diff options
Diffstat (limited to 'src/game/SpellMgr.cpp')
-rw-r--r-- | src/game/SpellMgr.cpp | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index d433a9917c0..de06727be8b 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -28,6 +28,7 @@ #include "Spell.h" #include "BattleGroundMgr.h" #include "CreatureAI.h" +#include "MapManager.h" bool IsAreaEffectTarget[TOTAL_SPELL_TARGETS]; SpellEffectTargetTypes EffectTargetType[TOTAL_SPELL_EFFECTS]; @@ -1105,6 +1106,19 @@ void SpellMgr::LoadSpellTargetPositions() st.target_Z = fields[4].GetFloat(); st.target_Orientation = fields[5].GetFloat(); + MapEntry const* mapEntry = sMapStore.LookupEntry(st.target_mapId); + if (!mapEntry) + { + sLog.outErrorDb("Spell (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.",Spell_ID,st.target_mapId); + continue; + } + + if (st.target_X==0 && st.target_Y==0 && st.target_Z==0) + { + sLog.outErrorDb("Spell (ID:%u) target coordinates not provided.",Spell_ID); + continue; + } + SpellEntry const* spellInfo = sSpellStore.LookupEntry(Spell_ID); if (!spellInfo) { @@ -1117,6 +1131,17 @@ void SpellMgr::LoadSpellTargetPositions() { if (spellInfo->EffectImplicitTargetA[i] == TARGET_DST_DB || spellInfo->EffectImplicitTargetB[i] == TARGET_DST_DB) { + // additional requirements + if (spellInfo->Effect[i]==SPELL_EFFECT_BIND && spellInfo->EffectMiscValue[i]) + { + uint32 area_id = MapManager::Instance().GetAreaId(st.target_mapId, st.target_X, st.target_Y, st.target_Z); + if (area_id != spellInfo->EffectMiscValue[i]) + { + sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.",Spell_ID, spellInfo->EffectMiscValue[i], area_id); + break; + } + } + found = true; break; } @@ -1127,19 +1152,6 @@ void SpellMgr::LoadSpellTargetPositions() continue; } - MapEntry const* mapEntry = sMapStore.LookupEntry(st.target_mapId); - if (!mapEntry) - { - sLog.outErrorDb("Spell (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.",Spell_ID,st.target_mapId); - continue; - } - - if (st.target_X == 0 && st.target_Y == 0 && st.target_Z == 0) - { - sLog.outErrorDb("Spell (ID:%u) target coordinates not provided.",Spell_ID); - continue; - } - mSpellTargetPositions[Spell_ID] = st; ++count; @@ -3566,6 +3578,12 @@ void SpellMgr::LoadSpellCustomAttr() switch(i) { + // Bind + case 3286: + spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ENEMY; + spellInfo->EffectImplicitTargetA[1] = TARGET_UNIT_TARGET_ENEMY; + count++; + break; // Heroism case 32182: spellInfo->excludeCasterAuraSpell = 57723; // Exhaustion |