Advertisement
Guest User

Untitled

a guest
May 29th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.63 KB | None | 0 0
  1. /*
  2.     Author: QQrofl
  3.     Core: Arcemu:
  4.     Credits: Arcemu, QQrofl
  5.     Format: C++
  6.     Info: You can buy experience!
  7. */
  8.  
  9. #include "Setup.h"
  10.  
  11. #ifdef WIN32
  12. #pragma warning(disable:4305)
  13. #endif
  14.  
  15. #define NpcId 68992
  16.  
  17. enum
  18. {
  19.  
  20.     XP1 = 5000000,
  21.     XPA = 10000,
  22.     XP2 = 10000000,
  23.     XPB = 20000,
  24. };
  25.  
  26. class BuyNpcExp : public GossipScript
  27. {
  28. public:
  29.   void GossipHello(Object * pObject, Player* Plr, bool AutoSend)
  30.   {
  31.      GossipMenu * Menu;
  32.      objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
  33.      Menu->AddItem(9, "10000[XP] [500g]", 1);
  34.      Menu->AddItem(9, "20000[XP] [1000g]", 2);
  35.      Menu->AddItem(9, "30000[XP] [1500g]", 3);
  36.      Menu->AddItem(9, "40000[XP] [2000g]", 4);
  37.      Menu->AddItem(9, "50000[XP] [2500g]", 5);
  38.      Menu->AddItem(9, "60000[XP] [3000g]", 6);
  39.      Menu->AddItem(9, "70000[XP] [4000g]", 7);
  40.      Menu->AddItem(9, "80000[XP] [4500g]", 8);
  41.      Menu->AddItem(9, "90000[XP] [5000g]", 9);
  42.      Menu->AddItem(9, "100000[XP] [5500g]", 10);
  43.      Menu->AddItem(9, "200000[XP] [7500g]", 11);
  44.      Menu->AddItem(9, "300000[XP] [8500g]", 12);
  45.      Menu->AddItem(3, ">> Next Page >>", 13);
  46.      if(AutoSend)
  47.      Menu->SendTo(Plr);
  48.   }
  49.  
  50. void GossipSelectOption(Object * pObject, Player * Plr, uint32 Id, uint32 IntId, const char * Code)
  51. {
  52.     if(pObject->GetTypeId()!=TYPEID_UNIT)
  53.      return;
  54.  
  55.     switch(IntId)
  56.     {
  57.        case 0:
  58.        GossipHello(pObject, Plr, true);
  59.        break;
  60.  
  61.        case 1:
  62.       {
  63.         if(Plr->GetUInt32Value(PLAYER_FIELD_COINAGE) < XP1)
  64.         {
  65.             Plr->SendAreaTriggerMessage("%sInsufficient Funds!", MSG_COLOR_RED);
  66.             Plr->Gossip_Complete();
  67.             return;
  68.         }else{
  69.             int32 GetGold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
  70.             int32 Rob = GetGold - XP1;
  71.             Plr->SetUInt32Value(PLAYER_FIELD_COINAGE, Rob);
  72.             Plr->GiveXP(XPA, Plr->GetGUID(), true);
  73.             Plr->BroadcastMessage("%s 10,000 XP was given.", MSG_COLOR_RED);
  74.             Plr->Gossip_Complete();
  75.         }break;
  76.  
  77.        case 2:
  78.       {
  79.           if(Plr->GetUInt32Value(PLAYER_FIELD_COINAGE) < XP2)
  80.           {
  81.               Plr->SendAreaTriggerMessage("%s Insufficient Funds!", MSG_COLOR_RED);
  82.               Plr->Gossip_Complete();
  83.               return;
  84.           }else{
  85.               int32
  86.           }
  87.          }break;
  88.       }
  89.     }
  90. }
  91.  
  92. void Destroy()
  93. {
  94.     delete this;
  95. }
  96. };
  97.  
  98. /*
  99.    Author: QQrofl
  100.    Core: Arcemu
  101.    Format: C++
  102.    Info: Simple Commands for fast actions
  103.    Credits: Arcemu, QQrofl
  104. */
  105. void SetupGossipBuyExp(ScriptMgr * mgr)
  106. {
  107.   GossipScript * gs = (GossipScript*) new BuyNpcExp();
  108.   mgr->register_gossip_script(NpcId, gs);
  109. }
  110.  
  111. static string buy = "#buy";
  112. static string exp = "#exp";
  113. static string ven = "#ven";
  114.  
  115. bool EventBuyCommands(Player * Plr, uint32 Type, uint32 Lang, const char * Cmd, const char * Misc)
  116. {
  117. }; // MEH!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement