Advertisement
Guest User

Untitled

a guest
Dec 27th, 2010
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.12 KB | None | 0 0
  1. #include "StdAfx.h"
  2. #include "Setup.h"
  3. #ifdef WIN32
  4. #pragma warning(disable:4305)        
  5. #endif
  6.  
  7.  
  8. class SCRIPT_DECL BG_MASTER : public GossipScript
  9. {
  10.     public:
  11.     void GossipHello(Object * pObject, Player* Plr, bool AutoSend)
  12.     {
  13.  
  14.          GossipMenu *Menu;
  15.         uint32 Team = Plr->GetTeam();
  16.        
  17.         // Check if the player can be entered into the bg or not.
  18.         if(Plr->getLevel() < 10)
  19.         {
  20.             uint32 FactMessages[2] = { 7599, 7688 };
  21.  
  22.             // Send "you cannot enter" message.
  23.             objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), FactMessages[Team], Plr);
  24.         }
  25.         else
  26.         {
  27.             uint32 FactMessages[2] = { 7689, 7705 }; // need to find the second one
  28.  
  29.             // Send "you cannot enter" message.
  30.             objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), FactMessages[Team], Plr);
  31.             Menu->AddItem( 0, "I would like to enter the Warsong Battleground.", 1);
  32.             Menu->AddItem(0, "I would like to go to Arathi Basin Battleground", 2);
  33.             Menu->AddItem(0, "I Would like to Fight in EOTS!",3);
  34.             Menu->AddItem(0, "Let me Que up for Alterac Valley!",4);
  35.         }
  36.        
  37.         if(AutoSend)
  38.             Menu->SendTo(Plr);
  39.     }
  40.     void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
  41.     {
  42.         if(!pObject->IsCreature())
  43.             return;
  44.  
  45.        switch(IntId)
  46.        {
  47.  
  48.        case 1:
  49.            Plr->GetSession()->SendBattlegroundList((TO_CREATURE(pObject)),2);
  50.         break;
  51.  
  52.        case 2:
  53.            Plr->GetSession()->SendBattlegroundList((TO_CREATURE(pObject)),3);
  54.         break;
  55.  
  56.        case 3:
  57.            Plr->GetSession()->SendBattlegroundList((TO_CREATURE(pObject)),7);
  58.         break;
  59.  
  60.        case 4:
  61.            Plr->GetSession()->SendBattlegroundList((TO_CREATURE(pObject)),1);
  62.         break;
  63.  
  64.        default:
  65.            Plr->Gossip_Complete();
  66.         break;
  67.        }
  68.  
  69.     }
  70.     void GossipEnd(Object * pObject, Player* Plr)
  71.     {
  72.         Plr->Gossip_Complete();
  73.     }
  74.     void Destroy()
  75.     {
  76.         delete this;
  77.     }
  78.  
  79. };
  80.  
  81.  
  82. void SetupBGM(ScriptMgr * mgr)
  83. {
  84.     GossipScript * gs = new BG_MASTER;
  85.     mgr->register_gossip_script(60012,gs);
  86.  
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement