diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index abc6ea6f1..53948c756 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -1041,8 +1041,10 @@ enum Targets TARGET_TOTEM_FIRE = 44, TARGET_CHAIN_HEAL = 45, TARGET_SCRIPT_COORDINATES = 46, - TARGET_DYNAMIC_OBJECT = 47, + TARGET_DYNAMIC_OBJECT_FRONT = 47, TARGET_SUMMON = 48, + TARGET_DYNAMIC_OBJECT_LEFT_SIDE = 49, + TARGET_DYNAMIC_OBJECT_RIGHT_SIDE = 50, TARGET_AREAEFFECT_CUSTOM_2 = 52, TARGET_CURRENT_ENEMY_COORDINATES = 53, // set unit coordinates as dest, only 16 target B imlemented TARGET_ALL_RAID_AROUND_CASTER = 56, diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index f6785f229..33e9f7f7d 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1319,7 +1319,6 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap) case TARGET_TOTEM_FIRE: case TARGET_SELF: case TARGET_SELF2: - case TARGET_DYNAMIC_OBJECT: case TARGET_AREAEFFECT_CUSTOM: case TARGET_AREAEFFECT_CUSTOM_2: case TARGET_SUMMON: @@ -1986,6 +1985,28 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap) if(DynamicObject* dynObj = m_caster->GetDynObject(m_triggeredByAuraSpell ? m_triggeredByAuraSpell->Id : m_spellInfo->Id)) m_targets.setDestination(dynObj->GetPositionX(), dynObj->GetPositionY(), dynObj->GetPositionZ()); break; + + case TARGET_DYNAMIC_OBJECT_FRONT: + case TARGET_DYNAMIC_OBJECT_LEFT_SIDE: + case TARGET_DYNAMIC_OBJECT_RIGHT_SIDE: + if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)) + { + float angle = m_caster->GetOrientation(); + switch(targetMode) + { + case TARGET_DYNAMIC_OBJECT_FRONT: break; + case TARGET_DYNAMIC_OBJECT_LEFT_SIDE: angle -= 3*M_PI/4; break; + case TARGET_DYNAMIC_OBJECT_RIGHT_SIDE: angle += 3*M_PI/4; break; + } + + float x,y; + m_caster->GetNearPoint2D(x,y,radius,angle); + m_targets.setDestination(x,y,m_caster->GetPositionZ()); + } + + TagUnitMap.push_back(m_caster); + break; + case TARGET_POINT_AT_NORTH: case TARGET_POINT_AT_SOUTH: case TARGET_POINT_AT_EAST: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 495a7f004..5a35397de 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 "8527" + #define REVISION_NR "8528" #endif // __REVISION_NR_H__