File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5774,6 +5774,11 @@ enum Offsets {
57745774 // SPELL_ATTR_EX3_IGNORE_CASTER_MODIFIERS (verified via disassembly; the
57755775 // server enum agrees). NOT AttributesEx2's bit 29 (that's CANT_CRIT).
57765776 SPELL_ATTR_EX3_IGNORE_CASTER_MODIFIERS = 0x20000000 ,
5777+ // AttributesEx channel bits (CHANNELED_1 0x4 | CHANNELED_2 0x40) and the
5778+ // AttributesEx2 autorepeat flag (bit 5, Auto Shot / Shoot) — each shared
5779+ // by more than one module, so kept here rather than redefined locally.
5780+ SPELL_ATTR_EX_CHANNELED = 0x4 | 0x40 ,
5781+ SPELL_ATTR_EX2_AUTOREPEAT_FLAG = 0x20 ,
57775782 OFF_SPELL_RECORD_INTERRUPT_FLAGS = 0x54 , // u32 (column 21)
57785783
57795784 // Remaining Spell.dbc record fields — the single source of truth for the
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ namespace Spell::AutoAttack {
4242namespace {
4343
4444constexpr int SPELL_AUTO_ATTACK = 6603 ;
45- constexpr uint32_t SPELL_ATTR_EX2_AUTOREPEAT_FLAG = 0x00000020 ;
4645
4746bool IsMelee (int spellID) {
4847 return spellID == SPELL_AUTO_ATTACK ;
@@ -58,7 +57,7 @@ bool IsRanged(int spellID) {
5857 return false ;
5958 const uint32_t attrEx2 = *reinterpret_cast <const uint32_t *>(
6059 rec + Offsets::OFF_SPELL_RECORD_ATTRIBUTES_EX2 );
61- return (attrEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG ) != 0 ;
60+ return (attrEx2 & Offsets:: SPELL_ATTR_EX2_AUTOREPEAT_FLAG ) != 0 ;
6261}
6362
6463int ReadSpellID (void *L) {
Original file line number Diff line number Diff line change @@ -99,7 +99,6 @@ constexpr uint32_t SPELL_ATTR_TRADESPELL = 0x20;
9999// flat +500ms "aim time" to these (SpellEntry::GetCastTime). Auto-repeat
100100// shots (Auto Shot / Shoot, AttributesEx2 bit 0x20) are the one exclusion.
101101constexpr uint32_t SPELL_ATTR_RANGED = 0x2 ;
102- constexpr uint32_t SPELL_ATTR_EX2_AUTOREPEAT = 0x20 ;
103102
104103struct TrackedSpell {
105104 int spellID; // 0 = not casting / channeling
@@ -184,7 +183,7 @@ int CastTimeMs(int spellID) {
184183 *reinterpret_cast <const uint32_t *>(rec + Offsets::OFF_SPELL_RECORD_ATTRIBUTES );
185184 const uint32_t attrEx2 =
186185 *reinterpret_cast <const uint32_t *>(rec + Offsets::OFF_SPELL_RECORD_ATTRIBUTES_EX2 );
187- if ((attr & SPELL_ATTR_RANGED ) && !(attrEx2 & SPELL_ATTR_EX2_AUTOREPEAT ))
186+ if ((attr & SPELL_ATTR_RANGED ) && !(attrEx2 & Offsets:: SPELL_ATTR_EX2_AUTOREPEAT_FLAG ))
188187 ms += 500 ;
189188 }
190189 }
@@ -334,11 +333,9 @@ const Game::HookAutoRegister _castStartHook{
334333// thing at a time). Regular casts back `UnitCastingInfo`; channels add real
335334// times to `UnitChannelInfo` (validated against the live +0x228 field).
336335
337- constexpr uint32_t SPELL_ATTR_EX_CHANNELED = 0x4 | 0x40 ; // IS_CHANNELED | SELF
338-
339336bool IsChannelSpell (const uint8_t *rec) {
340337 return (*reinterpret_cast <const uint32_t *>(rec + Offsets::OFF_SPELL_RECORD_ATTRIBUTES_EX ) &
341- SPELL_ATTR_EX_CHANNELED ) != 0 ;
338+ Offsets:: SPELL_ATTR_EX_CHANNELED ) != 0 ;
342339}
343340
344341// Channel duration for a non-player caster — base (skipMod=1), since we
Original file line number Diff line number Diff line change @@ -254,14 +254,11 @@ int g_pendingChanSuccSpell = 0;
254254int g_pendingChanSuccTMs = 0 ;
255255constexpr int kChanSuccDeferMs = 500 ;
256256
257- // Spell.dbc AttributesEx channel bits — same test Spell::Cast uses.
258- constexpr uint32_t SPELL_ATTR_EX_CHANNELED = 0x4 | 0x40 ; // IS_CHANNELED | SELF
259-
260257bool IsChanneledSpell (int spellID) {
261258 const uint8_t *rec = Spell::Lookup::RecordForID (spellID);
262259 return rec != nullptr &&
263260 (*reinterpret_cast <const uint32_t *>(rec + Offsets::OFF_SPELL_RECORD_ATTRIBUTES_EX ) &
264- SPELL_ATTR_EX_CHANNELED ) != 0 ;
261+ Offsets:: SPELL_ATTR_EX_CHANNELED ) != 0 ;
265262}
266263
267264int NowMs () {
Original file line number Diff line number Diff line change 2222
2323namespace Spell ::Info {
2424
25- // Attributes (+0x18) bit 6 = SPELL_ATTR_PASSIVE — passive spell (no cast
26- // bar, applies its effect as soon as learned/equipped).
27- static constexpr uint32_t SPELL_ATTR_PASSIVE = 0x40 ;
2825// GetSpellInfo's isFunnel means a health-funnel spell — AttributesEx2 (+0x20)
2926// bit 11 = SPELL_ATTR_EX2_HEALTH_FUNNEL. Verified from Spell.dbc: Health
3027// Funnel (755) Ex2=0x808 and Hellfire (1949) Ex2=0x800 carry it, while
@@ -397,7 +394,7 @@ static int PushIsPassive(void *L, int spellID) {
397394 return 0 ;
398395 const uint32_t attr = *reinterpret_cast <const uint32_t *>(
399396 record + Offsets::OFF_SPELL_RECORD_ATTRIBUTES );
400- Game::Lua::PushBool (L, (attr & SPELL_ATTR_PASSIVE ) != 0 );
397+ Game::Lua::PushBool (L, (attr & Offsets:: SPELL_ATTR_PASSIVE ) != 0 );
401398 return 1 ;
402399}
403400
Original file line number Diff line number Diff line change @@ -130,7 +130,6 @@ bool SpellHiddenFromSpellbook(int spellID) {
130130// checks are NOT in the 1.12 client's Spell.dbc — server-only columns — so
131131// the spellLevel rule is the only client-readable target-level mechanism.)
132132
133- constexpr uint32_t SPELL_ATTR_PASSIVE = 0x40 ; // Attributes bit
134133constexpr uint32_t SPELL_EFFECT_APPLY_AURA = 6 ;
135134constexpr uint32_t SPELL_EFFECT_APPLY_AREA_AURA_PARTY = 35 ;
136135
@@ -184,7 +183,7 @@ int RequiredTargetLevel(const uint8_t *record) {
184183 return 0 ;
185184 const uint32_t attr =
186185 *reinterpret_cast <const uint32_t *>(record + Offsets::OFF_SPELL_RECORD_ATTRIBUTES );
187- if (attr & SPELL_ATTR_PASSIVE )
186+ if (attr & Offsets:: SPELL_ATTR_PASSIVE )
188187 return 0 ;
189188 if (!HasRankString (record)) // single-rank spell → not gated
190189 return 0 ;
You can’t perform that action at this time.
0 commit comments