mirror of
https://github.com/mangosfour/server.git
synced 2025-12-28 13:37:13 +00:00
[12203] Improve EffectTeleUnitsFaceCaster and target-selection for position targets
* Let EffectTeleUnitsFaceCaster use a destination for teleporting if provided * Expect to add caster for TARGET_RANDOM_NEARBY_LOC, TARGET_RANDOM_CIRCUMFERENCE_POINT only for summon spells (or similar spells)
This commit is contained in:
parent
6ba3c19a22
commit
d2679caf85
3 changed files with 12 additions and 5 deletions
|
|
@ -5689,10 +5689,14 @@ void Spell::EffectTeleUnitsFaceCaster(SpellEffectEntry const* effect)
|
|||
if (unitTarget->IsTaxiFlying())
|
||||
return;
|
||||
|
||||
float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(effect->EffectRadiusIndex));
|
||||
|
||||
float fx, fy, fz;
|
||||
m_caster->GetClosePoint(fx, fy, fz, unitTarget->GetObjectBoundingRadius(), dis);
|
||||
if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
|
||||
m_targets.getDestination(fx, fy, fz);
|
||||
else
|
||||
{
|
||||
float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(effect->EffectRadiusIndex));
|
||||
m_caster->GetClosePoint(fx, fy, fz, unitTarget->GetObjectBoundingRadius(), dis);
|
||||
}
|
||||
|
||||
unitTarget->NearTeleportTo(fx, fy, fz, -m_caster->GetOrientation(), unitTarget == m_caster);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue