diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index f99fcbedc..8c2e64ae1 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1849,8 +1849,8 @@ struct MANGOS_DLL_SPEC SpellEntry uint32 AttributesEx6; // 7 m_attributesExF uint32 AttributesEx7; // 8 m_attributesExG (0x20 - totems, 0x4 - paladin auras, etc...) uint32 AttributesEx8; // 9 m_attributesExH - // uint32 unk_400_1; // 10 4.0.0 - // uint32 unk_420; // 11 4.0.0 + uint32 AttributesEx9; // 10 m_attributesExI + uint32 AttributesEx10; // 11 m_attributesExJ uint32 CastingTimeIndex; // 12 m_castingTimeIndex uint32 DurationIndex; // 13 m_durationIndex uint32 powerType; // 14 m_powerType @@ -1983,6 +1983,8 @@ struct MANGOS_DLL_SPEC SpellEntry inline bool HasAttribute(SpellAttributesEx6 attribute) const { return AttributesEx6 & attribute; } inline bool HasAttribute(SpellAttributesEx7 attribute) const { return AttributesEx7 & attribute; } inline bool HasAttribute(SpellAttributesEx8 attribute) const { return AttributesEx8 & attribute; } + inline bool HasAttribute(SpellAttributesEx9 attribute) const { return AttributesEx9 & attribute; } + inline bool HasAttribute(SpellAttributesEx10 attribute) const { return AttributesEx10 & attribute; } private: // prevent creating custom entries (copy data from original in fact) @@ -1997,8 +1999,8 @@ struct SpellCastTimesEntry { uint32 ID; // 0 m_ID int32 CastTime; // 1 m_base - //float CastTimePerLevel; // 2 m_perLevel - //int32 MinCastTime; // 3 m_minimum + float CastTimePerLevel; // 2 m_perLevel + int32 MinCastTime; // 3 m_minimum }; struct SpellFocusObjectEntry diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index ded1fcf3d..88c966d69 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -98,7 +98,7 @@ const char SkillLinefmt[]="nisxixi"; const char SkillLineAbilityfmt[]="niiiixxiiiiixx"; const char SkillRaceClassInfofmt[]="diiiiixxx"; const char SoundEntriesfmt[]="nissssssssssssssssssssssxxxxxxxxxxx"; -const char SpellCastTimefmt[]="nixx"; +const char SpellCastTimefmt[]="niii"; const char SpellDurationfmt[]="niii"; const char SpellDifficultyfmt[]="niiii"; const char SpellEntryfmt[]="niiiiiiiiixxiiiifiiiissxxiixxixiiiiiiixiiiiiiiix"; diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index d8816c20b..8cb657aa9 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -564,6 +564,78 @@ enum SpellAttributesEx8 SPELL_ATTR_EX8_UNK31 = 0x80000000,// 31 }; +enum SpellAttributesEx9 +{ + SPELL_ATTR_EX9_UNK0 = 0x00000001,// 0 + SPELL_ATTR_EX9_UNK1 = 0x00000002,// 1 + SPELL_ATTR_EX9_UNK2 = 0x00000004,// 2 some sort of invisibility + SPELL_ATTR_EX9_UNK3 = 0x00000008,// 3 + SPELL_ATTR_EX9_UNK4 = 0x00000010,// 4 + SPELL_ATTR_EX9_UNK5 = 0x00000020,// 5 some totem spells + SPELL_ATTR_EX9_UNK6 = 0x00000040,// 6 + SPELL_ATTR_EX9_UNK7 = 0x00000080,// 7 + SPELL_ATTR_EX9_UNK8 = 0x00000100,// 8 Aimed Shot (19434) and Aimed Shot! (82928) + SPELL_ATTR_EX9_UNK9 = 0x00000200,// 9 + SPELL_ATTR_EX9_UNK10 = 0x00000400,// 10 Ice Storm 88239 + SPELL_ATTR_EX9_UNK11 = 0x00000800,// 11 + SPELL_ATTR_EX9_UNK12 = 0x00001000,// 12 Feral Charge 49376 + SPELL_ATTR_EX9_UNK13 = 0x00002000,// 13 Slam 1464, used in cast time calculation + SPELL_ATTR_EX9_UNK14 = 0x00004000,// 14 + SPELL_ATTR_EX9_UNK15 = 0x00008000,// 15 not used + SPELL_ATTR_EX9_UNK16 = 0x00010000,// 16 Aimed Shot 19434, Steady Shot 56641, Cobra Shot 77767 + SPELL_ATTR_EX9_UNK17 = 0x00020000,// 17 not used + SPELL_ATTR_EX9_UNK18 = 0x00040000,// 18 + SPELL_ATTR_EX9_UNK19 = 0x00080000,// 19 + SPELL_ATTR_EX9_UNK20 = 0x00100000,// 20 + SPELL_ATTR_EX9_UNK21 = 0x00200000,// 21 + SPELL_ATTR_EX9_UNK22 = 0x00400000,// 22 + SPELL_ATTR_EX9_UNK23 = 0x00800000,// 23 Asira Dismount 103720 + SPELL_ATTR_EX9_UNK24 = 0x01000000,// 24 not used + SPELL_ATTR_EX9_UNK25 = 0x02000000,// 25 not used + SPELL_ATTR_EX9_UNK26 = 0x04000000,// 26 Item - Mage T12 4P Bonus 99064 + SPELL_ATTR_EX9_UNK27 = 0x08000000,// 27 20707 Soulstone Resurrection, Quest Invis 9 102370 + SPELL_ATTR_EX9_UNK28 = 0x10000000,// 28 Decimate, Unholy Frenzy, Spirit Link: all aoe reduce health + SPELL_ATTR_EX9_UNK29 = 0x20000000,// 29 passive raid-wide auras + SPELL_ATTR_EX9_UNK30 = 0x40000000,// 30 + SPELL_ATTR_EX9_UNK31 = 0x80000000,// 31 In Chains 88791 +}; + +enum SpellAttributesEx10 +{ + SPELL_ATTR_EX10_UNK0 = 0x00000001,// 0 Deep Wounds, Ignite, Blood Plague, Frost Fever, Ebon Plague, Scarlet Fever, Brittle Bones, Asira Dismount + SPELL_ATTR_EX10_UNK1 = 0x00000002,// 1 Combustion, Hemorrhage + SPELL_ATTR_EX10_UNK2 = 0x00000004,// 2 Throw Spear, Unholy Shot, Crack Shot!, Throw Knife, Ice Arrow + SPELL_ATTR_EX10_UNK3 = 0x00000008,// 3 Spirit Bond, Fel Armor + SPELL_ATTR_EX10_UNK4 = 0x00000010,// 4 Water Spout 58873 + SPELL_ATTR_EX10_UNK5 = 0x00000020,// 5 Immolate, Concussive Stomp + SPELL_ATTR_EX10_UNK6 = 0x00000040,// 6 Teleport Player, Teleport Player to NEXUS LEGENDARY + SPELL_ATTR_EX10_UNK7 = 0x00000080,// 7 + SPELL_ATTR_EX10_UNK8 = 0x00000100,// 8 Shadowflame, Furious Swipe + SPELL_ATTR_EX10_UNK9 = 0x00000200,// 9 relocation spells + SPELL_ATTR_EX10_UNK10 = 0x00000400,// 10 Omar's Seal of Approval, Spellweaving + SPELL_ATTR_EX10_UNK11 = 0x00000800,// 11 Herb Gathering, Mining + SPELL_ATTR_EX10_UNK12 = 0x00001000,// 12 not used + SPELL_ATTR_EX10_UNK13 = 0x00002000,// 13 not used + SPELL_ATTR_EX10_UNK14 = 0x00004000,// 14 not used + SPELL_ATTR_EX10_UNK15 = 0x00008000,// 15 not used + SPELL_ATTR_EX10_UNK16 = 0x00010000,// 16 not used + SPELL_ATTR_EX10_UNK17 = 0x00020000,// 17 not used + SPELL_ATTR_EX10_UNK18 = 0x00040000,// 18 not used + SPELL_ATTR_EX10_UNK19 = 0x00080000,// 19 not used + SPELL_ATTR_EX10_UNK20 = 0x00100000,// 20 not used + SPELL_ATTR_EX10_UNK21 = 0x00200000,// 21 not used + SPELL_ATTR_EX10_UNK22 = 0x00400000,// 22 not used + SPELL_ATTR_EX10_UNK23 = 0x00800000,// 23 not used + SPELL_ATTR_EX10_UNK24 = 0x01000000,// 24 not used + SPELL_ATTR_EX10_UNK25 = 0x02000000,// 25 not used + SPELL_ATTR_EX10_UNK26 = 0x04000000,// 26 not used + SPELL_ATTR_EX10_UNK27 = 0x08000000,// 27 not used + SPELL_ATTR_EX10_UNK28 = 0x10000000,// 28 not used + SPELL_ATTR_EX10_UNK29 = 0x20000000,// 29 not used + SPELL_ATTR_EX10_UNK30 = 0x40000000,// 30 not used + SPELL_ATTR_EX10_UNK31 = 0x80000000,// 31 not used +}; + #define MAX_TALENT_SPEC_COUNT 2 #define MAX_GLYPH_SLOT_INDEX 6 diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 4bab522df..cf4e43e3d 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -128,7 +128,27 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell) castTime = int32(spellScalingEntry->castTimeMax); } else if (SpellCastTimesEntry const* spellCastTimeEntry = sSpellCastTimesStore.LookupEntry(spellInfo->CastingTimeIndex)) - castTime = spellCastTimeEntry->CastTime; + { + if (spell) + { + uint32 level = spell->GetCaster()->getLevel(); + if (SpellLevelsEntry const* levelsEntry = spellInfo->GetSpellLevels()) + { + if (levelsEntry->maxLevel) + level = std::min(level, levelsEntry->maxLevel); + if (levelsEntry->baseLevel) + level = std::max(level, levelsEntry->baseLevel) - levelsEntry->baseLevel; + } + + // currently only profession spells have CastTimePerLevel data filled, always negative + castTime = spellCastTimeEntry->CastTime + spellCastTimeEntry->CastTimePerLevel * level; + } + else + castTime = spellCastTimeEntry->CastTime; + + if (castTime < spellCastTimeEntry->MinCastTime) + castTime = spellCastTimeEntry->MinCastTime; + } else // not all spells have cast time index and this is all is pasiive abilities return 0; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d23f38d4a..8ed19845c 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0108" + #define REVISION_NR "0109" #endif // __REVISION_NR_H__