diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 24563bc46..974594b49 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -1249,6 +1249,7 @@ enum Targets TARGET_DYNAMIC_OBJECT_BEHIND = 48, TARGET_DYNAMIC_OBJECT_LEFT_SIDE = 49, TARGET_DYNAMIC_OBJECT_RIGHT_SIDE = 50, + TARGET_AREAEFFECT_GO_AROUND_SOURCE = 51, TARGET_AREAEFFECT_GO_AROUND_DEST = 52, // gameobject around destination, select by spell_script_target TARGET_CURRENT_ENEMY_COORDINATES = 53, // set unit coordinates as dest, only 16 target B imlemented TARGET_LARGE_FRONTAL_CONE = 54, diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 76f372c94..bfc115dc1 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2177,8 +2177,28 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& } break; } + case TARGET_AREAEFFECT_GO_AROUND_SOURCE: case TARGET_AREAEFFECT_GO_AROUND_DEST: { + float x, y, z; + if (targetMode == TARGET_AREAEFFECT_GO_AROUND_SOURCE) + { + if (m_targets.m_targetMask & TARGET_FLAG_SOURCE_LOCATION) + { + x = m_targets.m_srcX; + y = m_targets.m_srcY; + z = m_targets.m_srcZ; + } + else + m_caster->GetPosition(x, y, z); + } + else + { + x = m_targets.m_destX; + y = m_targets.m_destY; + z = m_targets.m_destZ; + } + // It may be possible to fill targets for some spell effects // automatically (SPELL_EFFECT_WMO_REPAIR(88) for example) but // for some/most spells we clearly need/want to limit with spell_target_script @@ -2186,13 +2206,12 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& // Some spells untested, for affected GO type 33. May need further adjustments for spells related. SpellScriptTargetBounds bounds = sSpellMgr.GetSpellScriptTargetBounds(m_spellInfo->Id); - - for(SpellScriptTarget::const_iterator i_spellST = bounds.first; i_spellST != bounds.second; ++i_spellST) + for (SpellScriptTarget::const_iterator i_spellST = bounds.first; i_spellST != bounds.second; ++i_spellST) { if (i_spellST->second.type == SPELL_TARGET_TYPE_GAMEOBJECT) { // search all GO's with entry, within range of m_destN - MaNGOS::GameObjectEntryInPosRangeCheck go_check(*m_caster, i_spellST->second.targetEntry, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, radius); + MaNGOS::GameObjectEntryInPosRangeCheck go_check(*m_caster, i_spellST->second.targetEntry, x, y, z, radius); MaNGOS::GameObjectListSearcher checker(tempTargetGOList, go_check); Cell::VisitGridObjects(m_caster, checker, radius); } diff --git a/src/game/Spell.h b/src/game/Spell.h index 00708d9bc..af18c9cbc 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -659,7 +659,7 @@ enum ReplenishType namespace MaNGOS { - struct MANGOS_DLL_DECL SpellNotifierPlayer + struct MANGOS_DLL_DECL SpellNotifierPlayer // Currently unused. When put to use this one requires handling for source-location (smilar to below) { Spell::UnitList &i_data; Spell &i_spell; @@ -706,6 +706,7 @@ namespace MaNGOS bool i_playerControlled; float i_centerX; float i_centerY; + float i_centerZ; float GetCenterX() const { return i_centerX; } float GetCenterY() const { return i_centerY; } @@ -734,8 +735,18 @@ namespace MaNGOS } break; case PUSH_DEST_CENTER: - i_centerX = i_spell.m_targets.m_destX; - i_centerY = i_spell.m_targets.m_destY; + if (i_spell.m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) + { + i_centerX = i_spell.m_targets.m_destX; + i_centerY = i_spell.m_targets.m_destY; + i_centerZ = i_spell.m_targets.m_destZ; + } + else + { + i_centerX = i_spell.m_targets.m_srcX; + i_centerY = i_spell.m_targets.m_srcY; + i_centerZ = i_spell.m_targets.m_srcZ; + } break; case PUSH_TARGET_CENTER: if (Unit* target = i_spell.m_targets.getUnitTarget()) @@ -833,7 +844,7 @@ namespace MaNGOS i_data->push_back(itr->getSource()); break; case PUSH_DEST_CENTER: - if (itr->getSource()->IsWithinDist3d(i_spell.m_targets.m_destX, i_spell.m_targets.m_destY, i_spell.m_targets.m_destZ,i_radius)) + if (itr->getSource()->IsWithinDist3d(i_centerX, i_centerY, i_centerZ, i_radius)) i_data->push_back(itr->getSource()); break; case PUSH_TARGET_CENTER: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5557dfc49..ff48859ba 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 "11992" + #define REVISION_NR "11993" #endif // __REVISION_NR_H__