mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +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
|
|
@ -1946,7 +1946,10 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
|
|||
m_caster->GetClosePoint(dest_x, dest_y, dest_z, 0.0f, radius, angle);
|
||||
m_targets.setDestination(dest_x, dest_y, dest_z);
|
||||
|
||||
targetUnitMap.push_back(m_caster);
|
||||
// This targetMode is often used as 'last' implicitTarget for positive spells, that just require coordinates
|
||||
// and no unitTarget (e.g. summon effects). As MaNGOS always needs a unitTarget we add just the caster here.
|
||||
if (IsPositiveSpell(m_spellInfo))
|
||||
targetUnitMap.push_back(m_caster);
|
||||
break;
|
||||
}
|
||||
case TARGET_91:
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "12202"
|
||||
#define REVISION_NR "12203"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue