mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +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:
@@ -927,7 +927,7 @@ public:
|
||||
uint32 entry = (uint32)atoi(e);
|
||||
|
||||
float x, y, z, o = handler->GetSession()->GetPlayer()->GetOrientation();
|
||||
handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, handler->GetSession()->GetPlayer()->GetObjectSize());
|
||||
handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, handler->GetSession()->GetPlayer()->GetCombatReach());
|
||||
|
||||
if (!i)
|
||||
return handler->GetSession()->GetPlayer()->SummonCreature(entry, x, y, z, o) != nullptr;
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
|
||||
// before GM
|
||||
float x, y, z;
|
||||
gmPlayer->GetClosePoint(x, y, z, player->GetObjectSize());
|
||||
gmPlayer->GetClosePoint(x, y, z, player->GetCombatReach());
|
||||
player->TeleportTo(gmPlayer->GetMapId(), x, y, z, player->GetOrientation());
|
||||
}
|
||||
|
||||
|
||||
@@ -561,7 +561,7 @@ public:
|
||||
|
||||
// before GM
|
||||
float x, y, z;
|
||||
handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, target->GetObjectSize());
|
||||
handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, target->GetCombatReach());
|
||||
target->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation());
|
||||
target->SetPhaseMask(handler->GetSession()->GetPlayer()->GetPhaseMask(), true);
|
||||
}
|
||||
|
||||
@@ -1372,7 +1372,7 @@ public:
|
||||
|
||||
// place pet before player
|
||||
float x, y, z;
|
||||
player->GetClosePoint (x, y, z, creatureTarget->GetObjectSize(), CONTACT_DISTANCE);
|
||||
player->GetClosePoint (x, y, z, creatureTarget->GetCombatReach(), CONTACT_DISTANCE);
|
||||
pet->Relocate(x, y, z, float(M_PI) - player->GetOrientation());
|
||||
|
||||
// set pet to defensive mode by default (some classes can't control controlled pets in fact).
|
||||
|
||||
@@ -123,7 +123,7 @@ class boss_selin_fireheart : public CreatureScript
|
||||
Crystals.remove(CrystalChosen);
|
||||
|
||||
float x, y, z;
|
||||
CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE);
|
||||
CrystalChosen->GetClosePoint(x, y, z, me->GetCombatReach(), CONTACT_DISTANCE);
|
||||
|
||||
events.SetPhase(PHASE_DRAIN);
|
||||
me->SetWalk(false);
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
FlyBackTimer = 500;
|
||||
break;
|
||||
case 1:
|
||||
player->GetClosePoint(x, y, z, me->GetObjectSize());
|
||||
player->GetClosePoint(x, y, z, me->GetCombatReach());
|
||||
z += 2.5f;
|
||||
x -= 2.0f;
|
||||
y -= 1.5f;
|
||||
|
||||
@@ -144,7 +144,7 @@ class boss_king_dred : public CreatureScript
|
||||
|
||||
float x, y, z;
|
||||
|
||||
me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, 10.0f);
|
||||
me->GetClosePoint(x, y, z, me->GetCombatReach() / 3, 10.0f);
|
||||
me->SummonCreature(RAND(NPC_DRAKKARI_GUTRIPPER, NPC_DRAKKARI_SCYTHECLAW), x, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 1000);
|
||||
events.ScheduleEvent(EVENT_RAPTOR_CALL, urand(20000, 25000));
|
||||
break;
|
||||
|
||||
@@ -127,7 +127,7 @@ class boss_bronjahm : public CreatureScript
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
summon->GetMotionMaster()->MoveFollow(me, me->GetObjectSize(), 0.0f);
|
||||
summon->GetMotionMaster()->MoveFollow(me, me->GetCombatReach(), 0.0f);
|
||||
summon->CastSpell(summon, SPELL_PURPLE_BANISH_VISUAL, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,7 +788,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_DEATHBRINGER_SAURFANG)))
|
||||
{
|
||||
float x, y, z;
|
||||
deathbringer->GetClosePoint(x, y, z, deathbringer->GetObjectSize());
|
||||
deathbringer->GetClosePoint(x, y, z, deathbringer->GetCombatReach());
|
||||
me->SetWalk(true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_CORPSE, x, y, z);
|
||||
}
|
||||
|
||||
@@ -383,7 +383,7 @@ class npc_coldflame : public CreatureScript
|
||||
{
|
||||
float ang = Position::NormalizeOrientation(pos.GetAngle(me));
|
||||
me->SetOrientation(ang);
|
||||
owner->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 5.0f - owner->GetObjectSize(), ang);
|
||||
owner->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 5.0f - owner->GetCombatReach(), ang);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -396,7 +396,7 @@ class npc_coldflame : public CreatureScript
|
||||
|
||||
float ang = Position::NormalizeOrientation(pos.GetAngle(target));
|
||||
me->SetOrientation(ang);
|
||||
owner->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 15.0f - owner->GetObjectSize(), ang);
|
||||
owner->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 15.0f - owner->GetCombatReach(), ang);
|
||||
}
|
||||
|
||||
me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
@@ -514,7 +514,7 @@ class spell_marrowgar_coldflame : public SpellScriptLoader
|
||||
{
|
||||
targets.clear();
|
||||
// select any unit but not the tank (by owners threatlist)
|
||||
Unit* target = GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 1, -GetCaster()->GetObjectSize(), true, -SPELL_IMPALED);
|
||||
Unit* target = GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 1, -GetCaster()->GetCombatReach(), true, -SPELL_IMPALED);
|
||||
if (!target)
|
||||
target = GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true); // or the tank if its solo
|
||||
if (!target)
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
float x, y, z;
|
||||
me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, 0.1f);
|
||||
me->GetClosePoint(x, y, z, me->GetCombatReach() / 3, 0.1f);
|
||||
|
||||
if (Creature* summon = me->SummonCreature(NPC_RAGECLAW, x, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 1000))
|
||||
{
|
||||
@@ -180,7 +180,7 @@ public:
|
||||
void Reset() override
|
||||
{
|
||||
float x, y, z;
|
||||
me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, 25.0f);
|
||||
me->GetClosePoint(x, y, z, me->GetCombatReach() / 3, 25.0f);
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@@ -521,7 +521,7 @@ public:
|
||||
|
||||
Tapped = true;
|
||||
float x, y, z;
|
||||
caster->GetClosePoint(x, y, z, me->GetObjectSize());
|
||||
caster->GetClosePoint(x, y, z, me->GetCombatReach());
|
||||
|
||||
me->SetWalk(false);
|
||||
me->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
|
||||
@@ -356,7 +356,7 @@ public:
|
||||
uint32 BirdEntry = 0;
|
||||
|
||||
float fX, fY, fZ;
|
||||
go->GetClosePoint(fX, fY, fZ, go->GetObjectSize(), INTERACTION_DISTANCE);
|
||||
go->GetClosePoint(fX, fY, fZ, go->GetCombatReach(), INTERACTION_DISTANCE);
|
||||
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
|
||||
@@ -240,7 +240,7 @@ public:
|
||||
return true;
|
||||
|
||||
float x, y, z;
|
||||
go->GetClosePoint(x, y, z, go->GetObjectSize() / 3, 7.0f);
|
||||
go->GetClosePoint(x, y, z, go->GetCombatReach() / 3, 7.0f);
|
||||
go->SummonGameObject(GO_HIGH_QUALITY_FUR, *go, G3D::Quat(), 1);
|
||||
if (TempSummon* summon = player->SummonCreature(NPC_NESINGWARY_TRAPPER, x, y, z, go->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1000))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user