Naxx40 Logout Teleport (#654)

Naxx40 Logout Teleport
This commit is contained in:
Grimfeather
2025-08-18 12:51:31 +02:00
committed by GitHub
parent bcc46498d2
commit 49dce007b4

View File

@@ -24,6 +24,9 @@
#include "PassiveAI.h" #include "PassiveAI.h"
#include "Player.h" #include "Player.h"
#include "naxxramas.h" #include "naxxramas.h"
#include "ScriptMgr.h"
#include "Map.h"
#include "WorldSession.h"
struct LivingPoisonData struct LivingPoisonData
{ {
@@ -838,6 +841,47 @@ public:
} }
}; };
class OnyNaxxLogoutTeleport : public PlayerScript
{
public:
OnyNaxxLogoutTeleport() : PlayerScript("OnyNaxxLogoutTeleport") {}
void OnPlayerLogin(Player* player) override
{
TeleportIfNeeded(player);
}
void OnPlayerLogout(Player* player) override
{
TeleportIfNeeded(player);
}
void OnPlayerBeforeLogout(Player* player) override
{
TeleportIfNeeded(player);
}
private:
void TeleportIfNeeded(Player* player)
{
int mapId = player->GetMapId();
if (player->GetRaidDifficulty() != RAID_DIFFICULTY_10MAN_HEROIC)
return;
switch (mapId)
{
case 533:
player->TeleportTo(0, 3082.641602f, -3725.781250f, 132.418884f, 0.002488f);
break;
case 249:
player->TeleportTo(1, -4737.995f, -3745.33f, 53.68f, 0.002488f);
break;
default:
break;
}
}
};
void AddSC_instance_naxxramas() void AddSC_instance_naxxramas()
{ {
RegisterInstanceScript(instance_naxxramas, NaxxramasMapId); RegisterInstanceScript(instance_naxxramas, NaxxramasMapId);
@@ -845,4 +889,5 @@ void AddSC_instance_naxxramas()
RegisterNaxxramasCreatureAI(npc_living_poison); RegisterNaxxramasCreatureAI(npc_living_poison);
RegisterNaxxramasCreatureAI(npc_naxxramas_trigger); RegisterNaxxramasCreatureAI(npc_naxxramas_trigger);
new at_naxxramas_hub_portal(); new at_naxxramas_hub_portal();
new OnyNaxxLogoutTeleport();
} }