diff options
Diffstat (limited to 'src')
33 files changed, 74 insertions, 59 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index cdea190dfbc..f210f077fdd 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -493,7 +493,7 @@ void npc_escortAI::SetEscortPaused(bool on) bool npc_escortAI::SetNextWaypoint(uint32 pointId, float x, float y, float z, float orientation) { - me->SetPosition(x, y, z, orientation); + me->UpdatePosition(x, y, z, orientation); return SetNextWaypoint(pointId, false, true); } @@ -516,7 +516,7 @@ bool npc_escortAI::SetNextWaypoint(uint32 pointId, bool setPosition, bool resetW if (waypoint.id == pointId) { if (setPosition) - me->SetPosition(waypoint.x, waypoint.y, waypoint.z, me->GetOrientation()); + me->UpdatePosition(waypoint.x, waypoint.y, waypoint.z, me->GetOrientation()); CurrentWP = WaypointList.begin(); return true; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 5ac2fdcaca1..5682e0c0361 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2387,6 +2387,7 @@ const char* Creature::GetNameForLocaleIdx(LocaleConstant loc_idx) const return GetName(); } +//TODO: This may cause crash. Creature must be removed from the original grid and added to the new grid. void Creature::FarTeleportTo(Map* map, float X, float Y, float Z, float O) { InterruptNonMeleeSpells(true); @@ -2401,7 +2402,21 @@ void Creature::FarTeleportTo(Map* map, float X, float Y, float Z, float O) SetMap(map); AddToWorld(); - SetPosition(X, Y, Z, O, true); + UpdatePosition(X, Y, Z, O, true); +} + +void Creature::SetPosition(float x, float y, float z, float o) +{ + // prevent crash when a bad coord is sent by the client + if (!Trinity::IsValidMapCoord(x, y, z, o)) + { + sLog->outDebug(LOG_FILTER_UNITS, "Creature::SetPosition(%f, %f, %f) .. bad coordinates!", x, y, z); + return; + } + + GetMap()->CreatureRelocation(ToCreature(), x, y, z, o); + if (IsVehicle()) + GetVehicleKit()->RelocatePassengers(x, y, z, o); } bool Creature::IsDungeonBoss() const diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 6bca501f76b..1d25dd46992 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -664,6 +664,9 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature return m_charmInfo->GetCharmSpell(pos)->GetAction(); } + void SetPosition(float x, float y, float z, float o); + void SetPosition(const Position &pos) { SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); } + void SetHomePosition(float x, float y, float z, float o) { m_homePosition.Relocate(x, y, z, o); } void SetHomePosition(const Position &pos) { m_homePosition.Relocate(pos); } void GetHomePosition(float &x, float &y, float &z, float &ori) { m_homePosition.GetPosition(x, y, z, ori); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4a8e2c9de0d..deade7431a8 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6727,9 +6727,9 @@ ActionButton const* Player::GetActionButton(uint8 button) return &buttonItr->second; } -bool Player::SetPosition(float x, float y, float z, float orientation, bool teleport) +bool Player::UpdatePosition(float x, float y, float z, float orientation, bool teleport) { - if (!Unit::SetPosition(x, y, z, orientation, teleport)) + if (!Unit::UpdatePosition(x, y, z, orientation, teleport)) return false; //if (movementInfo.flags & MOVEMENTFLAG_MOVING) @@ -6743,7 +6743,7 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); // code block for underwater state update - // Unit::SetPosition() checks for validity and updates our coordinates + // Unit::UpdatePosition() checks for validity and updates our coordinates // so we re-fetch them instead of using "raw" coordinates from function params UpdateUnderwaterState(GetMap(), GetPositionX(), GetPositionY(), GetPositionZ()); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 862b271c464..05ef060add9 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1937,8 +1937,8 @@ class Player : public Unit, public GridObject<Player> void SendResetInstanceFailed(uint32 reason, uint32 MapId); void SendResetFailedNotify(uint32 mapid); - virtual bool SetPosition(float x, float y, float z, float orientation, bool teleport = false); - bool SetPosition(const Position &pos, bool teleport = false) { return SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } + virtual bool UpdatePosition(float x, float y, float z, float orientation, bool teleport = false); + bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } void UpdateUnderwaterState(Map* m, float x, float y, float z); void SendMessageToSet(WorldPacket* data, bool self) {SendMessageToSetInRange(data, GetVisibilityRange(), self); };// overwrite Object::SendMessageToSet diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6d02d943f63..ba801354457 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17151,16 +17151,16 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas { // FIXME: this interrupts spell visual DestroyForNearbyPlayers(); - SetPosition(x, y, z, orientation, true); + UpdatePosition(x, y, z, orientation, true); } } -bool Unit::SetPosition(float x, float y, float z, float orientation, bool teleport) +bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport) { // prevent crash when a bad coord is sent by the client if (!Trinity::IsValidMapCoord(x, y, z, orientation)) { - sLog->outDebug(LOG_FILTER_UNITS, "Unit::SetPosition(%f, %f, %f) .. bad coordinates!", x, y, z); + sLog->outDebug(LOG_FILTER_UNITS, "Unit::UpdatePosition(%f, %f, %f) .. bad coordinates!", x, y, z); return false; } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 8f052ab41ae..c683cbbe957 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1600,9 +1600,9 @@ class Unit : public WorldObject void SendSpellDamageImmune(Unit* target, uint32 spellId); void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false); - virtual bool SetPosition(float x, float y, float z, float ang, bool teleport = false); + virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false); // returns true if unit's position really changed - bool SetPosition(const Position &pos, bool teleport = false) { return SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } + bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } void KnockbackFrom(float x, float y, float speedXY, float speedZ); void JumpTo(float speedXY, float speedZ, bool forward = true); diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index effd43cd320..107e275d47b 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -445,7 +445,7 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang) float pz = z + passenger->m_movementInfo.t_pos.m_positionZ; float po = ang + passenger->m_movementInfo.t_pos.m_orientation; - passenger->SetPosition(px, py, pz, po); + passenger->UpdatePosition(px, py, pz, po); } } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 4ad2f0638d0..99deef200a6 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -266,7 +266,7 @@ void FlightPathMovementGenerator::Finalize(Player & player) float y = 0; float z = 0; i_destinationHolder.GetLocationNow(player.GetBaseMap(), x, y, z); - player.SetPosition(x, y, z, player.GetOrientation()); + player.UpdatePosition(x, y, z, player.GetOrientation()); } diff --git a/src/server/game/Movement/Traveller.h b/src/server/game/Movement/Traveller.h index 27700eb61c4..9cd6a6cda17 100755 --- a/src/server/game/Movement/Traveller.h +++ b/src/server/game/Movement/Traveller.h @@ -85,7 +85,7 @@ inline float Traveller<Creature>::Speed() template<> inline void Traveller<Creature>::Relocation(float x, float y, float z, float orientation) { - i_traveller.SetPosition(x, y, z, orientation); + i_traveller.UpdatePosition(x, y, z, orientation); } template<> @@ -136,7 +136,7 @@ inline float Traveller<Player>::GetMoveDestinationTo(float x, float y, float z) template<> inline void Traveller<Player>::Relocation(float x, float y, float z, float orientation) { - i_traveller.SetPosition(x, y, z, orientation); + i_traveller.UpdatePosition(x, y, z, orientation); } template<> diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index bf971cae32f..9f91e944e7a 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -215,7 +215,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) WorldLocation const& dest = plMover->GetTeleportDest(); - plMover->SetPosition(dest, true); + plMover->UpdatePosition(dest, true); uint32 newzone, newarea; plMover->GetZoneAndAreaId(newzone, newarea); @@ -355,7 +355,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) return; } - mover->SetPosition(movementInfo.pos); + mover->UpdatePosition(movementInfo.pos); if (plMover) // nothing is charmed, or player charmed { diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 926a2280d18..5594b66f22d 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3368,7 +3368,7 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/) if (unitTarget->GetTypeId() == TYPEID_PLAYER) { // For players just turn them - unitTarget->ToPlayer()->SetPosition(unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), angle, false); + unitTarget->ToPlayer()->UpdatePosition(unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), angle, false); unitTarget->ToPlayer()->SendTeleportAckPacket(); } else diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index cdb87fde354..63b5ff97afb 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -623,7 +623,7 @@ public: const_cast<CreatureData*>(data)->posZ = z; const_cast<CreatureData*>(data)->orientation = o; } - creature->GetMap()->CreatureRelocation(creature, x, y, z, o); + creature->SetPosition(x, y, z, o); creature->GetMotionMaster()->Initialize(); if (creature->isAlive()) // dead creature will reset movement generator at respawn { diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index ce4a2a10cac..c64fc6f2dab 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -206,7 +206,7 @@ public: { float x = KaelLocations[0][0]; float y = KaelLocations[0][1]; - me->GetMap()->CreatureRelocation(me, x, y, LOCATION_Z, 0.0f); + me->SetPosition(x, y, LOCATION_Z, 0.0f); //me->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues... std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp index e6610294071..a61b88a990d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp @@ -53,7 +53,7 @@ public: me->GetPosition(x, y, z); z += 4; x -= 3.5; y -= 5; me->GetMotionMaster()->Clear(false); - me->GetMap()->CreatureRelocation(me, x, y, z, 0.0f); + me->SetPosition(x, y, z, 0.0f); } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 667e1cd279e..9afbeaa0172 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -756,7 +756,7 @@ public: { float x, y, z; me->GetPosition(x, y, z); //this visual aura some under ground - me->GetMap()->CreatureRelocation(me, x, y, z + 0.35f, 0.0f); + me->SetPosition(x, y, z + 0.35f, 0.0f); Despawn(); Creature* debuff = DoSpawnCreature(HELPER, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 14500); if (debuff) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 2e4e92685ea..df3bb5d4525 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -661,7 +661,7 @@ public: void JustDied(Unit* /*killer*/) { DoScriptText(SAY_SATH_DEATH, me); - me->GetMap()->CreatureRelocation(me, me->GetPositionX(), me->GetPositionY(), DRAGON_REALM_Z, me->GetOrientation()); + me->SetPosition(me->GetPositionX(), me->GetPositionY(), DRAGON_REALM_Z, me->GetOrientation()); TeleportAllPlayersBack(); if (Creature* Kalecgos = Unit::GetCreature(*me, KalecgosGUID)) { diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index d4d4e7314b4..162c84f1fa7 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -335,7 +335,7 @@ class boss_hexlord_malacrass : public CreatureScript else { creature->AI()->EnterEvadeMode(); - creature->GetMap()->CreatureRelocation(me, Pos_X[i], POS_Y, POS_Z, ORIENT); + creature->SetPosition(Pos_X[i], POS_Y, POS_Z, ORIENT); creature->StopMoving(); } } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index b9ae61c122e..f6704a50e6f 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -185,7 +185,7 @@ class boss_marli : public CreatureScript if (target) { DoCast(target, SPELL_CHARGE); - //me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); + //me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); //me->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true, 1); AttackStart(target); } diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index 042c8f695c7..b8f2499c4e6 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -107,10 +107,10 @@ public: { if (summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY) { - if (Unit* target = Unit::GetUnit(*summoned, targetGUID)) + if (Creature* target = Unit::GetCreature(*summoned, targetGUID)) { target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0); - target->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f); + target->SetPosition(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f); summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); } @@ -187,7 +187,7 @@ public: { me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->SendMonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, 5000); - me->GetMap()->CreatureRelocation(me, me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation()); + me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation()); EventMove = false; } else EventMove_Timer -= diff; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index ef75307c625..748d0dfa071 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -1202,7 +1202,7 @@ public: me->GetPosition(x, y, z); z = me->GetMap()->GetHeight(x, y, z); me->GetMotionMaster()->MovePoint(0, x, y, z); - me->GetMap()->CreatureRelocation(me, x, y, z, 0); + me->SetPosition(x, y, z, 0); } void EnterCombat(Unit* /*who*/) {} @@ -1321,7 +1321,7 @@ public: me->GetPosition(x, y, z); z = me->GetMap()->GetHeight(x, y, z); me->GetMotionMaster()->MovePoint(0, x, y, z); - me->GetMap()->CreatureRelocation(me, x, y, z, 0); + me->SetPosition(x, y, z, 0); hyjal_trashAI::JustDied(victim); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index dd2531d5aad..4cc1069b838 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -1073,7 +1073,7 @@ public: if (!target->HasAura(SPELL_DIGESTIVE_ACID)) { - me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); + me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) { pPortal->SetReactState(REACT_PASSIVE); @@ -1185,7 +1185,7 @@ public: if (!target->HasAura(SPELL_DIGESTIVE_ACID)) { - me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); + me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); if (Creature* pPortal = me->SummonCreature(MOB_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) { pPortal->SetReactState(REACT_PASSIVE); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index b0033aa582a..0ba6bdb1154 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -157,15 +157,15 @@ public: switch (urand(0, 2)) { case 0: - me->GetMap()->CreatureRelocation(me, -8340.782227f, 2083.814453f, 125.648788f, 0.0f); + me->SetPosition(-8340.782227f, 2083.814453f, 125.648788f, 0.0f); DoResetThreat(); break; case 1: - me->GetMap()->CreatureRelocation(me, -8341.546875f, 2118.504639f, 133.058151f, 0.0f); + me->SetPosition(-8341.546875f, 2118.504639f, 133.058151f, 0.0f); DoResetThreat(); break; case 2: - me->GetMap()->CreatureRelocation(me, -8318.822266f, 2058.231201f, 133.058151f, 0.0f); + me->SetPosition(-8318.822266f, 2058.231201f, 133.058151f, 0.0f); DoResetThreat(); break; } @@ -252,7 +252,7 @@ public: me->RemoveAllAuras(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetVisible(false); - me->GetMap()->CreatureRelocation(me, bossc->x, bossc->y, bossc->z, bossc->r); + me->SetPosition(bossc->x, bossc->y, bossc->z, bossc->r); Invisible = true; DoResetThreat(); DoStopAttack(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index c501a060194..29b92957ace 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -216,15 +216,12 @@ struct boss_twinemperorsAI : public ScriptedAI if (pOtherBoss) { //me->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0); - float other_x = pOtherBoss->GetPositionX(); - float other_y = pOtherBoss->GetPositionY(); - float other_z = pOtherBoss->GetPositionZ(); - float other_o = pOtherBoss->GetOrientation(); - - Map* thismap = me->GetMap(); - thismap->CreatureRelocation(pOtherBoss, me->GetPositionX(), - me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - thismap->CreatureRelocation(me, other_x, other_y, other_z, other_o); + Position thisPos; + thisPos.Relocate(me); + Position otherPos; + otherPos.Relocate(pOtherBoss); + pOtherBoss->SetPosition(thisPos); + me->SetPosition(otherPos); SetAfterTeleport(); CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport(); diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 88e46e7fb26..6fbc424f3d4 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -357,7 +357,7 @@ public: Map* map = me->GetMap(); if (map) { - map->CreatureRelocation(me, 3706.39f, -3969.15f, 35.9118f, 0); + me->SetPosition(3706.39f, -3969.15f, 35.9118f, 0); me->AI_SendMoveToPacket(3706.39f, -3969.15f, 35.9118f, 0, 0, 0); } //begin swimming and summon depth charges diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index 1c7b538eb02..a8edd40d6b5 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -238,7 +238,7 @@ public: for (uint8 n = 0; n < 3; ++n) time[n] = 0; me->GetMotionMaster()->Clear(); - me->GetMap()->CreatureRelocation(me, CenterOfRoom.GetPositionX(), CenterOfRoom.GetPositionY(), CenterOfRoom.GetPositionZ(), CenterOfRoom.GetOrientation()); + me->SetPosition(CenterOfRoom.GetPositionX(), CenterOfRoom.GetPositionY(), CenterOfRoom.GetPositionZ(), CenterOfRoom.GetOrientation()); DoCast(me, SPELL_TELESTRA_BACK); me->SetVisible(true); if (Phase == 1) diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp index ec336d3402c..81450fe8b5f 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp @@ -757,7 +757,7 @@ class boss_flame_leviathan_safety_container : public CreatureScript me->GetPosition(x, y, z); z = me->GetMap()->GetHeight(x, y, z); me->GetMotionMaster()->MovePoint(0, x, y, z); - me->GetMap()->CreatureRelocation(me, x, y, z, 0); + me->SetPosition(x, y, z, 0); } void UpdateAI(uint32 const /*diff*/) diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp index 41d43a08f5d..41e80b1b777 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp @@ -260,7 +260,7 @@ class mob_frozen_orb_stalker : public CreatureScript { Position pos; me->GetNearPoint(toravon, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, 10.0f, 0.0f); - me->SetPosition(pos, true); + me->SetPosition(pos); DoCast(me, SPELL_FROZEN_ORB_SUMMON); } } diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp index 9b985d6d93e..6d3a5f181d4 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp @@ -291,7 +291,7 @@ public: if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) i_pl->TeleportTo(me->GetMapId(), VorpilPosition[0], VorpilPosition[1], VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); - me->GetMap()->CreatureRelocation(me, VorpilPosition[0], VorpilPosition[1], VorpilPosition[2], 0.0f); + me->SetPosition(VorpilPosition[0], VorpilPosition[1], VorpilPosition[2], 0.0f); DoCast(me, SPELL_DRAW_SHADOWS, true); DoCast(me, SPELL_RAIN_OF_FIRE); diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 60845ae6365..aec9ffcf5cc 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1967,7 +1967,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence() Summons.DespawnAll(); break; case 17: - if (GETUNIT(Akama, AkamaGUID)) + if (GETCRE(Akama, AkamaGUID)) { if (!me->IsWithinDistInMap(Akama, 15)) { @@ -1976,7 +1976,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence() x += 10; y += 10; Akama->GetMotionMaster()->Clear(false); //Akama->GetMotionMaster()->MoveIdle(); - Akama->GetMap()->CreatureRelocation(me, x, y, z, 0.0f); + Akama->SetPosition(x, y, z, 0.0f); Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0);//Illidan must not die until Akama arrives. Akama->GetMotionMaster()->MoveChase(me); } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 19280bd71f5..dcbc2832f27 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -291,7 +291,7 @@ class boss_alar : public CreatureScript if (me->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f)) dist = 5.0f; WaitTimer = 1000 + uint32(floor(dist / 80 * 1000.0f)); - me->GetMap()->CreatureRelocation(me, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f); + me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f); me->StopMoving(); WaitEvent = WE_LAND; } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index f079f68d943..6fac13aa8ad 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -278,7 +278,7 @@ class boss_high_astromancer_solarian : public CreatureScript Phase1_Timer = 50000; //After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind. me->GetMotionMaster()->Clear(); - me->GetMap()->CreatureRelocation(me, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O); + me->SetPosition(CENTER_X, CENTER_Y, CENTER_Z, CENTER_O); for (uint8 i=0; i <= 2; ++i) { if (!i) @@ -346,7 +346,7 @@ class boss_high_astromancer_solarian : public CreatureScript //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals. int i = rand()%3; me->GetMotionMaster()->Clear(); - me->GetMap()->CreatureRelocation(me, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O); + me->SetPosition(Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O); for (int j=0; j <= 2; j++) if (j != i) diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 52a23196ee0..d987601c5bd 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -819,7 +819,7 @@ class boss_kaelthas : public CreatureScript me->StopMoving(); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); - me->GetMap()->CreatureRelocation(me, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); + me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0); me->InterruptNonMeleeSpells(false); @@ -886,7 +886,7 @@ class boss_kaelthas : public CreatureScript me->StopMoving(); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); - me->GetMap()->CreatureRelocation(me, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); + me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0); // 1) Kael'thas will portal the whole raid right into his body |