feat(animation): 452 named constants, 30-phase character animation state machine

Add animation_ids.hpp/cpp with all 452 WoW animation ID constants (anim::STAND,
anim::RUN, anim::FIRE_BOW, ... anim::FLY_BACKWARDS, etc.), nameFromId() O(1)
lookup, and flyVariant() compact 218-element ground→FLY_* resolver.

Expand AnimationController into a full state machine with 20+ named states:
spell cast (directed→omni→cast fallback chain, instant one-shot release),
hit reactions (WOUND/CRIT/DODGE/BLOCK/SHIELD_BLOCK), stun, wounded idle,
stealth animation substitution, loot, fishing channel, sit/sleep/kneel
down→loop→up transitions, sheathe/unsheathe combat enter/exit, ranged weapons
(BOW/GUN/CROSSBOW/THROWN with reload states), game object OPEN/CLOSE/DESTROY,
vehicle enter/exit, mount flight directionals (FLY_LEFT/RIGHT/UP/DOWN/BACKWARDS),
emote state variants, off-hand/pierce/dual-wield alternation, NPC
birth/spawn/drown/rise, sprint aura override, totem idle, NPC greeting/farewell.

Add spell_defines.hpp with SpellEffect (~45 constants) and SpellMissInfo
(12 constants) namespaces; replace all magic numbers in spell_handler.cpp.

Add GAMEOBJECT_BYTES_1 to update field table (all 4 expansion JSONs) and wire
GameObjectStateCallback. Add DBC cross-validation on world entry.

Expand tools/_ANIM_NAMES from ~35 to 452 entries in m2_viewer.py and
asset_pipeline_gui.py. Add tests/test_animation_ids.cpp.

Bug fixes included:
- Stand state 1 was animating READY_2H(27) — fixed to SITTING(97)
- Spell casts ended freeze-frame — add one-shot release animation
- NPC 2H swing probe chain missing ATTACK_2H_LOOSE (polearm/staff)
- Chair sits (states 2/4/5/6) incorrectly played floor-sit transition
- STOP(3) used for all spell casts — replaced with model-aware chain
This commit is contained in:
Paul 2026-04-04 23:02:53 +03:00
parent d54e262048
commit e58f9b4b40
59 changed files with 3903 additions and 483 deletions

View file

@ -300,5 +300,76 @@ inline const char* getSpellCastResultString(uint8_t result, int powerType = -1)
}
}
// ── SpellEffect — SMSG_SPELLLOGEXECUTE effectType field (3.3.5a) ──────────
// Full WoW enum has 164 entries; only values used in the codebase or commonly
// relevant are defined here. Values match SharedDefines.h SpellEffects enum.
namespace SpellEffect {
constexpr uint8_t NONE = 0;
constexpr uint8_t INSTAKILL = 1;
constexpr uint8_t SCHOOL_DAMAGE = 2;
constexpr uint8_t DUMMY = 3;
constexpr uint8_t TELEPORT_UNITS = 5;
constexpr uint8_t APPLY_AURA = 6;
constexpr uint8_t ENVIRONMENTAL_DAMAGE = 7;
constexpr uint8_t POWER_DRAIN = 10;
constexpr uint8_t HEALTH_LEECH = 11;
constexpr uint8_t HEAL = 12;
constexpr uint8_t WEAPON_DAMAGE_NOSCHOOL = 16;
constexpr uint8_t RESURRECT = 18;
constexpr uint8_t EXTRA_ATTACKS = 19;
constexpr uint8_t CREATE_ITEM = 24;
constexpr uint8_t WEAPON_DAMAGE = 25;
constexpr uint8_t INTERRUPT_CAST = 26;
constexpr uint8_t OPEN_LOCK = 27;
constexpr uint8_t APPLY_AREA_AURA_PARTY = 35;
constexpr uint8_t LEARN_SPELL = 36;
constexpr uint8_t DISPEL = 38;
constexpr uint8_t SUMMON = 40;
constexpr uint8_t ENERGIZE = 43;
constexpr uint8_t WEAPON_PERCENT_DAMAGE = 44;
constexpr uint8_t TRIGGER_SPELL = 45;
constexpr uint8_t FEED_PET = 49;
constexpr uint8_t DISMISS_PET = 50;
constexpr uint8_t ENCHANT_ITEM_PERM = 53;
constexpr uint8_t ENCHANT_ITEM_TEMP = 54;
constexpr uint8_t SUMMON_PET = 56;
constexpr uint8_t LEARN_PET_SPELL = 57;
constexpr uint8_t WEAPON_DAMAGE_PLUS = 58;
constexpr uint8_t CREATE_HOUSE = 60;
constexpr uint8_t DUEL = 62;
constexpr uint8_t QUEST_COMPLETE = 63;
constexpr uint8_t NORMALIZED_WEAPON_DMG = 75;
constexpr uint8_t OPEN_LOCK_ITEM = 79;
constexpr uint8_t APPLY_AREA_AURA_RAID = 81;
constexpr uint8_t ACTIVATE_RUNE = 92;
constexpr uint8_t KNOCK_BACK = 99;
constexpr uint8_t PULL = 100;
constexpr uint8_t DISPEL_MECHANIC = 108;
constexpr uint8_t RESURRECT_NEW = 113;
constexpr uint8_t CREATE_ITEM2 = 114;
constexpr uint8_t MILLING = 115;
constexpr uint8_t PROSPECTING = 118;
constexpr uint8_t CHARGE = 126;
constexpr uint8_t TITAN_GRIP = 155;
constexpr uint8_t TOTAL_SPELL_EFFECTS = 164;
} // namespace SpellEffect
// ── SpellMissInfo — SMSG_SPELLLOGMISS / SMSG_SPELL_GO miss type (3.3.5a) ─
namespace SpellMissInfo {
constexpr uint8_t NONE = 0; // Miss
constexpr uint8_t MISS = 0;
constexpr uint8_t DODGE = 1;
constexpr uint8_t PARRY = 2;
constexpr uint8_t BLOCK = 3;
constexpr uint8_t EVADE = 4;
constexpr uint8_t IMMUNE = 5;
constexpr uint8_t DEFLECT = 6;
constexpr uint8_t ABSORB = 7;
constexpr uint8_t RESIST = 8;
constexpr uint8_t IMMUNE2 = 9; // Second immunity flag
constexpr uint8_t IMMUNE3 = 10; // Third immunity flag
constexpr uint8_t REFLECT = 11;
} // namespace SpellMissInfo
} // namespace game
} // namespace wowee