diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index dc8f64486..257a6e6d1 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -407,6 +407,5 @@ enum SpellEffectIndex }; #define MAX_EFFECT_INDEX 3 -#define MAX_REAGENTS 8 #endif diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 4f098eebd..73f4c936a 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1358,6 +1358,10 @@ struct SoundEntriesEntry // 29 new in 3.1 }; +#define MAX_SPELL_REAGENTS 8 +#define MAX_SPELL_TOTEMS 2 +#define MAX_SPELL_TOTEM_CATEGORIES 2 + struct SpellEntry { uint32 Id; // 0 m_ID @@ -1410,9 +1414,9 @@ struct SpellEntry float speed; // 47 m_speed //uint32 modalNextSpell; // 48 m_modalNextSpell not used uint32 StackAmount; // 49 m_cumulativeAura - uint32 Totem[2]; // 50-51 m_totem - int32 Reagent[MAX_REAGENTS]; // 52-59 m_reagent - uint32 ReagentCount[MAX_REAGENTS]; // 60-67 m_reagentCount + uint32 Totem[MAX_SPELL_TOTEMS]; // 50-51 m_totem + int32 Reagent[MAX_SPELL_REAGENTS]; // 52-59 m_reagent + uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 60-67 m_reagentCount int32 EquippedItemClass; // 68 m_equippedItemClass (value) int32 EquippedItemSubClassMask; // 69 m_equippedItemSubclass (mask) int32 EquippedItemInventoryTypeMask; // 70 m_equippedItemInvTypes (mask) @@ -1463,7 +1467,7 @@ struct SpellEntry //uint32 MinFactionId; // 219 m_minFactionID not used //uint32 MinReputation; // 220 m_minReputation not used //uint32 RequiredAuraVision; // 221 m_requiredAuraVision not used - uint32 TotemCategory[2]; // 222-223 m_requiredTotemCategoryID + uint32 TotemCategory[MAX_SPELL_TOTEM_CATEGORIES]; // 222-223 m_requiredTotemCategoryID int32 AreaGroupId; // 224 m_requiredAreaGroupId uint32 SchoolMask; // 225 m_schoolMask uint32 runeCostID; // 226 m_runeCostID diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 3358f9360..8ce6c018e 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -17435,7 +17435,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent) if(spellInfo) { - for(uint32 i = 0; i < MAX_REAGENTS; ++i) + for(uint32 i = 0; i < MAX_SPELL_REAGENTS; ++i) { if(spellInfo->Reagent[i] > 0) { diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 82ee63a3e..2f217b615 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3261,16 +3261,14 @@ void Spell::SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 ca } break; case SPELL_FAILED_TOTEMS: - if(spellInfo->Totem[0]) - data << uint32(spellInfo->Totem[0]); - if(spellInfo->Totem[1]) - data << uint32(spellInfo->Totem[1]); + for(int i = 0; i < MAX_SPELL_TOTEMS; ++i) + if(spellInfo->Totem[i]) + data << uint32(spellInfo->Totem[i]); break; case SPELL_FAILED_TOTEM_CATEGORY: - if(spellInfo->TotemCategory[0]) - data << uint32(spellInfo->TotemCategory[0]); - if(spellInfo->TotemCategory[1]) - data << uint32(spellInfo->TotemCategory[1]); + for(int i = 0; i < MAX_SPELL_TOTEM_CATEGORIES; ++i) + if(spellInfo->TotemCategory[i]) + data << uint32(spellInfo->TotemCategory[i]); break; case SPELL_FAILED_EQUIPPED_ITEM_CLASS: data << uint32(spellInfo->EquippedItemClass); @@ -3958,7 +3956,7 @@ void Spell::TakeReagents() if (p_caster->CanNoReagentCast(m_spellInfo) ) return; - for(uint32 x = 0; x < MAX_REAGENTS; ++x) + for(uint32 x = 0; x < MAX_SPELL_REAGENTS; ++x) { if(m_spellInfo->Reagent[x] <= 0) continue; @@ -5643,7 +5641,7 @@ SpellCastResult Spell::CheckItems() { if (!p_caster->CanNoReagentCast(m_spellInfo)) { - for(uint32 i = 0; i < MAX_REAGENTS; ++i) + for(uint32 i = 0; i < MAX_SPELL_REAGENTS; ++i) { if(m_spellInfo->Reagent[i] <= 0) continue; @@ -5675,8 +5673,8 @@ SpellCastResult Spell::CheckItems() } // check totem-item requirements (items presence in inventory) - uint32 totems = 2; - for(int i = 0; i < 2 ; ++i) + uint32 totems = MAX_SPELL_TOTEMS; + for(int i = 0; i < MAX_SPELL_TOTEMS ; ++i) { if (m_spellInfo->Totem[i] != 0) { @@ -5694,8 +5692,8 @@ SpellCastResult Spell::CheckItems() return SPELL_FAILED_TOTEMS; // Check items for TotemCategory (items presence in inventory) - uint32 TotemCategory = 2; - for(int i= 0; i < 2; ++i) + uint32 TotemCategory = MAX_SPELL_TOTEM_CATEGORIES; + for(int i= 0; i < MAX_SPELL_TOTEM_CATEGORIES; ++i) { if (m_spellInfo->TotemCategory[i] != 0) { diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index a0d727b3c..d8aa6bebf 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2709,7 +2709,7 @@ bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg) if(need_check_reagents) { - for(int j = 0; j < MAX_REAGENTS; ++j) + for(int j = 0; j < MAX_SPELL_REAGENTS; ++j) { if(spellInfo->Reagent[j] > 0 && !ObjectMgr::GetItemPrototype( spellInfo->Reagent[j] )) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index fe2c28bcb..86946743a 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 "9861" + #define REVISION_NR "9862" #endif // __REVISION_NR_H__