aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Battlegrounds/StrandOfTheAncients/battleground_strand_of_the_ancients.cpp12
-rw-r--r--src/server/scripts/ExilesReach/zone_exiles_reach.cpp5
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp38
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp4
4 files changed, 20 insertions, 39 deletions
diff --git a/src/server/scripts/Battlegrounds/StrandOfTheAncients/battleground_strand_of_the_ancients.cpp b/src/server/scripts/Battlegrounds/StrandOfTheAncients/battleground_strand_of_the_ancients.cpp
index feb9c4334d1..9cefe03b553 100644
--- a/src/server/scripts/Battlegrounds/StrandOfTheAncients/battleground_strand_of_the_ancients.cpp
+++ b/src/server/scripts/Battlegrounds/StrandOfTheAncients/battleground_strand_of_the_ancients.cpp
@@ -554,16 +554,12 @@ struct battleground_strand_of_the_ancients : BattlegroundScript
{
if (TransportBase* transport = boat->ToTransportBase())
{
- player->Relocate(spawnPositionOnTransport[_attackers]);
- transport->AddPassenger(player);
- player->m_movementInfo.transport.pos.Relocate(spawnPositionOnTransport[_attackers]);
- float x, y, z, o;
- spawnPositionOnTransport[_attackers].GetPosition(x, y, z, o);
- transport->CalculatePassengerPosition(x, y, z, &o);
- player->Relocate(x, y, z, o);
+ transport->AddPassenger(player, spawnPositionOnTransport[_attackers]);
+ Position position = transport->GetPositionWithOffset(player->m_movementInfo.transport.pos);
+ player->Relocate(position);
if (player->IsInWorld())
- player->NearTeleportTo({ x, y, z, o });
+ player->NearTeleportTo(position);
}
}
}
diff --git a/src/server/scripts/ExilesReach/zone_exiles_reach.cpp b/src/server/scripts/ExilesReach/zone_exiles_reach.cpp
index 14518d79a32..df91066a55c 100644
--- a/src/server/scripts/ExilesReach/zone_exiles_reach.cpp
+++ b/src/server/scripts/ExilesReach/zone_exiles_reach.cpp
@@ -632,10 +632,7 @@ public:
if (!transport || !creature)
return;
- float x, y, z, o;
- position.GetPosition(x, y, z, o);
- transport->CalculatePassengerPosition(x, y, z, &o);
- creature->SummonPersonalClone({ x, y, z, o }, TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
+ creature->SummonPersonalClone(transport->GetPositionWithOffset(position), TEMPSUMMON_MANUAL_DESPAWN, 0s, 0, 0, player);
}
};
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
index 6790b95f7e4..bb32cd14c0d 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
@@ -567,18 +567,13 @@ struct gunship_npc_AI : public ScriptedAI
me->SetReactState(REACT_PASSIVE);
- float x, y, z, o;
- Slot->TargetPosition.GetPosition(x, y, z, o);
-
me->SetTransportHomePosition(Slot->TargetPosition);
- float hx = x, hy = y, hz = z, ho = o;
- me->GetTransport()->CalculatePassengerPosition(hx, hy, hz, &ho);
- me->SetHomePosition(hx, hy, hz, ho);
+ me->SetHomePosition(me->GetTransport()->GetPositionWithOffset(Slot->TargetPosition));
- std::function<void(Movement::MoveSplineInit&)> initializer = [=](Movement::MoveSplineInit& init)
+ std::function<void(Movement::MoveSplineInit&)> initializer = [pos = Slot->TargetPosition](Movement::MoveSplineInit& init)
{
init.DisableTransportPathTransformations();
- init.MoveTo(x, y, z, false);
+ init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), false);
};
me->GetMotionMaster()->LaunchMoveSpline(std::move(initializer), EVENT_CHARGE_PREPATH, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
}
@@ -1417,23 +1412,21 @@ struct npc_gunship_boarding_addAI : public gunship_npc_AI
if (pointId == EVENT_CHARGE_PREPATH && Slot)
{
Position const& otherTransportPos = Instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE ? OrgrimsHammerTeleportExit : SkybreakerTeleportExit;
- float x, y, z, o;
- otherTransportPos.GetPosition(x, y, z, o);
-
- TransportBase* myTransport = me->GetTransport();
+ TransportBase const* myTransport = me->GetTransport();
if (!myTransport)
return;
- if (Transport* destTransport = ObjectAccessor::GetTransport(*me, Instance->GetGuidData(DATA_ICECROWN_GUNSHIP_BATTLE)))
- destTransport->CalculatePassengerPosition(x, y, z, &o);
+ if (Transport const* destTransport = ObjectAccessor::GetTransport(*me, Instance->GetGuidData(DATA_ICECROWN_GUNSHIP_BATTLE)))
+ {
+ Position globalPosition = destTransport->GetPositionWithOffset(otherTransportPos);
- float angle = frand(0, float(M_PI) * 2.0f);
- x += 2.0f * std::cos(angle);
- y += 2.0f * std::sin(angle);
+ float angle = frand(0, float(M_PI) * 2.0f);
+ globalPosition.m_positionX += 2.0f * std::cos(angle);
+ globalPosition.m_positionY += 2.0f * std::sin(angle);
- me->SetHomePosition(x, y, z, o);
- myTransport->CalculatePassengerOffset(x, y, z, &o);
- me->SetTransportHomePosition(x, y, z, o);
+ me->SetHomePosition(globalPosition);
+ me->SetTransportHomePosition(myTransport->GetPositionOffsetTo(globalPosition));
+ }
me->m_Events.AddEvent(new BattleExperienceEvent(me), me->m_Events.CalculateTime(BattleExperienceEvent::ExperiencedTimes[0]));
DoCast(me, SPELL_BATTLE_EXPERIENCE, true);
@@ -1974,10 +1967,7 @@ class spell_igb_teleport_to_enemy_ship : public SpellScript
if (!dest || !target || !target->GetTransport())
return;
- float x, y, z, o;
- dest->GetPosition(x, y, z, o);
- target->GetTransport()->CalculatePassengerOffset(x, y, z, &o);
- target->m_movementInfo.transport.pos.Relocate(x, y, z, o);
+ target->m_movementInfo.transport.pos.Relocate(target->GetTransport()->GetPositionOffsetTo(*dest));
}
void Register() override
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
index 37794e1ae26..182f71a0163 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
@@ -504,9 +504,7 @@ struct boss_malygos : public BossAI
break;
case ACTION_HANDLE_RESPAWN:
// Teleport to spawn position, we can't use normal relocate
- float x, y, z, o;
- me->GetRespawnPosition(x, y, z, &o);
- me->NearTeleportTo(x, y, z, o);
+ me->NearTeleportTo(me->GetRespawnPosition());
// Respawn Iris
instance->SetData(DATA_RESPAWN_IRIS, 0);
_despawned = false;