Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "StdAfx.h"
- #include "Setup.h"
- #ifdef WIN32
- #pragma warning(disable:4305)
- #endif
- class SCRIPT_DECL BG_MASTER : public GossipScript
- {
- public:
- void GossipHello(Object * pObject, Player* Plr, bool AutoSend)
- {
- GossipMenu *Menu;
- uint32 Team = Plr->GetTeam();
- // Check if the player can be entered into the bg or not.
- if(Plr->getLevel() < 10)
- {
- uint32 FactMessages[2] = { 7599, 7688 };
- // Send "you cannot enter" message.
- objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), FactMessages[Team], Plr);
- }
- else
- {
- uint32 FactMessages[2] = { 7689, 7705 }; // need to find the second one
- // Send "you cannot enter" message.
- objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), FactMessages[Team], Plr);
- Menu->AddItem( 0, "I would like to enter the Warsong Battleground.", 1);
- Menu->AddItem(0, "I would like to go to Arathi Basin Battleground", 2);
- Menu->AddItem(0, "I Would like to Fight in EOTS!",3);
- Menu->AddItem(0, "Let me Que up for Alterac Valley!",4);
- }
- if(AutoSend)
- Menu->SendTo(Plr);
- }
- void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
- {
- if(!pObject->IsCreature())
- return;
- switch(IntId)
- {
- case 1:
- Plr->GetSession()->SendBattlegroundList((TO_CREATURE(pObject)),2);
- break;
- case 2:
- Plr->GetSession()->SendBattlegroundList((TO_CREATURE(pObject)),3);
- break;
- case 3:
- Plr->GetSession()->SendBattlegroundList((TO_CREATURE(pObject)),7);
- break;
- case 4:
- Plr->GetSession()->SendBattlegroundList((TO_CREATURE(pObject)),1);
- break;
- default:
- Plr->Gossip_Complete();
- break;
- }
- }
- void GossipEnd(Object * pObject, Player* Plr)
- {
- Plr->Gossip_Complete();
- }
- void Destroy()
- {
- delete this;
- }
- };
- void SetupBGM(ScriptMgr * mgr)
- {
- GossipScript * gs = new BG_MASTER;
- mgr->register_gossip_script(60012,gs);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement