diff --git a/src/naxx40Scripts/instance_naxxramas.cpp b/src/naxx40Scripts/instance_naxxramas.cpp index 0530feb..a7441a0 100644 --- a/src/naxx40Scripts/instance_naxxramas.cpp +++ b/src/naxx40Scripts/instance_naxxramas.cpp @@ -24,6 +24,9 @@ #include "PassiveAI.h" #include "Player.h" #include "naxxramas.h" +#include "ScriptMgr.h" +#include "Map.h" +#include "WorldSession.h" 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() { RegisterInstanceScript(instance_naxxramas, NaxxramasMapId); @@ -845,4 +889,5 @@ void AddSC_instance_naxxramas() RegisterNaxxramasCreatureAI(npc_living_poison); RegisterNaxxramasCreatureAI(npc_naxxramas_trigger); new at_naxxramas_hub_portal(); + new OnyNaxxLogoutTeleport(); }