mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[8350] Implement (partly) 78-85 target modes.
Thanks to Astellar for original reseach related target modes.
This commit is contained in:
parent
cb29748467
commit
e01e1b4fb4
4 changed files with 50 additions and 1 deletions
|
|
@ -2110,6 +2110,39 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,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_POINT_AT_NORTH:
|
||||
case TARGET_POINT_AT_SOUTH:
|
||||
case TARGET_POINT_AT_EAST:
|
||||
case TARGET_POINT_AT_WEST:
|
||||
case TARGET_POINT_AT_NE:
|
||||
case TARGET_POINT_AT_NW:
|
||||
case TARGET_POINT_AT_SE:
|
||||
case TARGET_POINT_AT_SW:
|
||||
{
|
||||
|
||||
if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
|
||||
{
|
||||
Unit* currentTarget = m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster;
|
||||
float angle = currentTarget != m_caster ? currentTarget->GetAngle(m_caster) : m_caster->GetOrientation();
|
||||
|
||||
switch(cur)
|
||||
{
|
||||
case TARGET_POINT_AT_NORTH: break;
|
||||
case TARGET_POINT_AT_SOUTH: angle += M_PI; break;
|
||||
case TARGET_POINT_AT_EAST: angle -= M_PI/2; break;
|
||||
case TARGET_POINT_AT_WEST: angle += M_PI/2; break;
|
||||
case TARGET_POINT_AT_NE: angle -= M_PI/4; break;
|
||||
case TARGET_POINT_AT_NW: angle += M_PI/4; break;
|
||||
case TARGET_POINT_AT_SE: angle -= 3*M_PI/4; break;
|
||||
case TARGET_POINT_AT_SW: angle += 3*M_PI/4; break;
|
||||
}
|
||||
|
||||
float x,y;
|
||||
currentTarget->GetNearPoint2D(x,y,radius,angle);
|
||||
m_targets.setDestination(x,y,currentTarget->GetPositionZ());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TARGET_DIRECTLY_FORWARD:
|
||||
{
|
||||
if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue