mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 05:11:55 +01:00
Core/Spells: fix wrong distance calculations in AoE spells [Needs testing] (#16290)
Core/Spells: Fix wrong distance calculations in AoE spells. Pull request #16290 by chaodhib. God bless, finally.
This commit is contained in:
@@ -2565,7 +2565,7 @@ void Spell::EffectTeleUnitsFaceCaster(SpellEffIndex effIndex)
|
||||
float dis = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
|
||||
|
||||
float fx, fy, fz;
|
||||
m_caster->GetClosePoint(fx, fy, fz, unitTarget->GetObjectSize(), dis);
|
||||
m_caster->GetClosePoint(fx, fy, fz, unitTarget->GetCombatReach(), dis);
|
||||
|
||||
unitTarget->NearTeleportTo(fx, fy, fz, -m_caster->GetOrientation(), unitTarget == m_caster);
|
||||
}
|
||||
@@ -2990,7 +2990,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex)
|
||||
//OldSummon->GetMap()->Remove(OldSummon->ToCreature(), false);
|
||||
|
||||
float px, py, pz;
|
||||
owner->GetClosePoint(px, py, pz, OldSummon->GetObjectSize());
|
||||
owner->GetClosePoint(px, py, pz, OldSummon->GetCombatReach());
|
||||
|
||||
OldSummon->NearTeleportTo(px, py, pz, OldSummon->GetOrientation());
|
||||
//OldSummon->Relocate(px, py, pz, OldSummon->GetOrientation());
|
||||
@@ -3016,7 +3016,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex)
|
||||
}
|
||||
|
||||
float x, y, z;
|
||||
owner->GetClosePoint(x, y, z, owner->GetObjectSize());
|
||||
owner->GetClosePoint(x, y, z, owner->GetCombatReach());
|
||||
Pet* pet = owner->SummonPet(petentry, x, y, z, owner->GetOrientation(), SUMMON_PET, 0);
|
||||
if (!pet)
|
||||
return;
|
||||
@@ -3474,7 +3474,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
|
||||
if (m_targets.HasDst())
|
||||
destTarget->GetPosition(x, y, z);
|
||||
else
|
||||
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
|
||||
m_caster->GetClosePoint(x, y, z, DEFAULT_PLAYER_BOUNDING_RADIUS);
|
||||
|
||||
Map* map = target->GetMap();
|
||||
|
||||
@@ -4412,7 +4412,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex)
|
||||
destTarget->GetPosition(x, y, z);
|
||||
// Summon in random point all other units if location present
|
||||
else
|
||||
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE);
|
||||
m_caster->GetClosePoint(x, y, z, DEFAULT_PLAYER_BOUNDING_RADIUS);
|
||||
|
||||
Map* map = m_caster->GetMap();
|
||||
G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(m_caster->GetOrientation(), 0.f, 0.f);
|
||||
@@ -4669,7 +4669,7 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
||||
if (m_preGeneratedPath.GetPathType() == PATHFIND_BLANK)
|
||||
{
|
||||
//unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
Position pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetObjectSize(), unitTarget->GetRelativeAngle(m_caster));
|
||||
Position pos = unitTarget->GetFirstCollisionPosition(unitTarget->GetCombatReach(), unitTarget->GetRelativeAngle(m_caster));
|
||||
m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ, speed);
|
||||
}
|
||||
else
|
||||
@@ -4902,7 +4902,7 @@ void Spell::EffectResurrectPet(SpellEffIndex /*effIndex*/)
|
||||
// Reposition the pet's corpse before reviving so as not to grab aggro
|
||||
// We can use a different, more accurate version of GetClosePoint() since we have a pet
|
||||
float x, y, z; // Will be used later to reposition the pet if we have one
|
||||
player->GetClosePoint(x, y, z, pet->GetObjectSize(), PET_FOLLOW_DIST, pet->GetFollowAngle());
|
||||
player->GetClosePoint(x, y, z, pet->GetCombatReach(), PET_FOLLOW_DIST, pet->GetFollowAngle());
|
||||
pet->NearTeleportTo(x, y, z, player->GetOrientation());
|
||||
pet->Relocate(x, y, z, player->GetOrientation()); // This is needed so SaveStayPosition() will get the proper coords.
|
||||
}
|
||||
@@ -5051,7 +5051,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
||||
else if (m_spellInfo->Effects[effIndex].HasRadius() && m_spellInfo->Speed == 0)
|
||||
{
|
||||
float dis = m_spellInfo->Effects[effIndex].CalcRadius(m_originalCaster);
|
||||
m_caster->GetClosePoint(fx, fy, fz, DEFAULT_WORLD_OBJECT_SIZE, dis);
|
||||
m_caster->GetClosePoint(fx, fy, fz, DEFAULT_PLAYER_BOUNDING_RADIUS, dis);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5060,7 +5060,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
||||
float max_dis = m_spellInfo->GetMaxRange(true);
|
||||
float dis = (float)rand_norm() * (max_dis - min_dis) + min_dis;
|
||||
|
||||
m_caster->GetClosePoint(fx, fy, fz, DEFAULT_WORLD_OBJECT_SIZE, dis);
|
||||
m_caster->GetClosePoint(fx, fy, fz, DEFAULT_PLAYER_BOUNDING_RADIUS, dis);
|
||||
}
|
||||
|
||||
Map* cMap = m_caster->GetMap();
|
||||
|
||||
Reference in New Issue
Block a user