Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IN the header file (.h)
- bool hasLogged = false;
- bool inZone = true;
- static Position sTeleOut[] =
- {
- { -4286.56f, 1330.970f, 161.21f, 0.019994f }
- };
- void DoSendCompleteMessage(string who)
- {
- stringstream ss;
- ss << who.c_str()
- << "has completed the Dire Maul Arena Event!"
- << "The event is now opened and ready for another victim!";
- sWorld->SendGlobalText(ss.str().c_str(), NULL);
- }
- IN THE .cpp FILE under Arena Commander's ScriptedAI:
- ADD THIS ABOVE YOUR Reset() function
- uint32 checkPlayer;
- UPDATE YOUR Reset() function and add:
- checkPlayer = 1000;
- if(checkPlayer <= diff)
- {
- if(m_PlayerGUID == 0)
- return;
- if(hasLogged || !inZone)
- {
- isBattleActive = false;
- summons.DespawnAll();
- events.Reset();
- isWaveBossDead = 0;
- checkIsDead = true;
- hasLogged = false;
- inZone = true;
- resetOnce = false;
- player = NULL;
- m_PlayerGUID = NULL;
- playerName = "";
- sWorld->SendGlobalText("A challenger has been scared off and left the Dire Maul Arena Challenge! Who's next?", NULL);
- }
- checkPlayer = 1000;
- }
- else
- checkPlayer -= diff;
- THIS IS WHEN THE PLAYER COMPLETES THE EVENT: (Under, EVENT_COMPLETED_WAVES)
- DoSendCompleteMessage(player->GetName());
- IN THE .cpp FILE UNDER THE PlayerScript:
- class remove_non_battle_player : public PlayerScript
- {
- public:
- remove_non_battle_player() : PlayerScript("remove_non_battle_player") { }
- void OnUpdateZone(Player * player, uint32 zone, uint32 area)
- {
- if(m_PlayerGUID == 0)
- return;
- if(player->GetZoneId() != DIRE_MAUL_ZONE && player->GetAreaId() != DIRE_MAUL_AREA && player->GetGUID() == m_PlayerGUID)
- {
- inZone = false;
- return;
- }
- if(player->GetAreaId() != DIRE_MAUL_AREA || player->GetSession()->GetSecurity() > 1)
- return;
- if(isBattleActive && player->GetGUID() != m_PlayerGUID)
- {
- player->TeleportTo(player->GetStartPosition().GetMapId(), player->GetStartPosition().GetPositionX(), player->GetStartPosition().GetPositionY(),
- player->GetStartPosition().GetPositionZ(), player->GetStartPosition().GetOrientation());
- ChatHandler(player).SendSysMessage("You cannot be in the Dire Maul Arena while the event is going on!");
- }
- }
- void OnLogout(Player * player)
- {
- if(m_PlayerGUID == 0)
- return;
- if(player->GetGUID() == m_PlayerGUID)
- hasLogged = true;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement