mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Implement implicit target types 64, 66, 67
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
fff2cae4b4
commit
41fec59cf9
2 changed files with 18 additions and 1 deletions
|
|
@ -1054,7 +1054,10 @@ enum Targets
|
|||
TARGET_NARROW_FRONTAL_CONE = 60,
|
||||
TARGET_AREAEFFECT_PARTY_AND_CLASS = 61,
|
||||
TARGET_DUELVSPLAYER_COORDINATES = 63,
|
||||
TARGET_INFRONT_OF_VICTIM = 64,
|
||||
TARGET_BEHIND_VICTIM = 65, // used in teleport behind spells, caster/target dependent from spell effect
|
||||
TARGET_RIGHT_FROM_VICTIM = 66,
|
||||
TARGET_LEFT_FROM_VICTIM = 67,
|
||||
TARGET_RANDOM_NEARBY_LOC = 72, // used in teleport onto nearby locations
|
||||
TARGET_RANDOM_CIRCUMFERENCE_POINT = 73,
|
||||
TARGET_DYNAMIC_OBJECT_COORDINATES = 76,
|
||||
|
|
|
|||
|
|
@ -2022,7 +2022,10 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
|
|||
sLog.outError( "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id );
|
||||
break;
|
||||
}
|
||||
case TARGET_INFRONT_OF_VICTIM:
|
||||
case TARGET_BEHIND_VICTIM:
|
||||
case TARGET_RIGHT_FROM_VICTIM:
|
||||
case TARGET_LEFT_FROM_VICTIM:
|
||||
{
|
||||
Unit *pTarget = NULL;
|
||||
|
||||
|
|
@ -2037,8 +2040,19 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
|
|||
|
||||
if(pTarget)
|
||||
{
|
||||
float angle = 0.0f;
|
||||
float dist = (radius && targetMode != TARGET_BEHIND_VICTIM) ? radius : CONTACT_DISTANCE;
|
||||
|
||||
switch(targetMode)
|
||||
{
|
||||
case TARGET_INFRONT_OF_VICTIM: break;
|
||||
case TARGET_BEHIND_VICTIM: angle = M_PI; break;
|
||||
case TARGET_RIGHT_FROM_VICTIM: angle = -M_PI/2; break;
|
||||
case TARGET_LEFT_FROM_VICTIM: angle = M_PI/2; break;
|
||||
}
|
||||
|
||||
float _target_x, _target_y, _target_z;
|
||||
pTarget->GetClosePoint(_target_x, _target_y, _target_z, m_caster->GetObjectSize(), CONTACT_DISTANCE, M_PI);
|
||||
pTarget->GetClosePoint(_target_x, _target_y, _target_z, pTarget->GetObjectSize(), dist, angle);
|
||||
if(pTarget->IsWithinLOS(_target_x, _target_y, _target_z))
|
||||
{
|
||||
TagUnitMap.push_back(m_caster);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue