Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: QQrofl
- Core: Arcemu:
- Credits: Arcemu, QQrofl
- Format: C++
- Info: You can buy experience!
- */
- #include "Setup.h"
- #ifdef WIN32
- #pragma warning(disable:4305)
- #endif
- #define NpcId 68992
- enum
- {
- XP1 = 5000000,
- XPA = 10000,
- XP2 = 10000000,
- XPB = 20000,
- };
- class BuyNpcExp : public GossipScript
- {
- public:
- void GossipHello(Object * pObject, Player* Plr, bool AutoSend)
- {
- GossipMenu * Menu;
- objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
- Menu->AddItem(9, "10000[XP] [500g]", 1);
- Menu->AddItem(9, "20000[XP] [1000g]", 2);
- Menu->AddItem(9, "30000[XP] [1500g]", 3);
- Menu->AddItem(9, "40000[XP] [2000g]", 4);
- Menu->AddItem(9, "50000[XP] [2500g]", 5);
- Menu->AddItem(9, "60000[XP] [3000g]", 6);
- Menu->AddItem(9, "70000[XP] [4000g]", 7);
- Menu->AddItem(9, "80000[XP] [4500g]", 8);
- Menu->AddItem(9, "90000[XP] [5000g]", 9);
- Menu->AddItem(9, "100000[XP] [5500g]", 10);
- Menu->AddItem(9, "200000[XP] [7500g]", 11);
- Menu->AddItem(9, "300000[XP] [8500g]", 12);
- Menu->AddItem(3, ">> Next Page >>", 13);
- if(AutoSend)
- Menu->SendTo(Plr);
- }
- void GossipSelectOption(Object * pObject, Player * Plr, uint32 Id, uint32 IntId, const char * Code)
- {
- if(pObject->GetTypeId()!=TYPEID_UNIT)
- return;
- switch(IntId)
- {
- case 0:
- GossipHello(pObject, Plr, true);
- break;
- case 1:
- {
- if(Plr->GetUInt32Value(PLAYER_FIELD_COINAGE) < XP1)
- {
- Plr->SendAreaTriggerMessage("%sInsufficient Funds!", MSG_COLOR_RED);
- Plr->Gossip_Complete();
- return;
- }else{
- int32 GetGold = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
- int32 Rob = GetGold - XP1;
- Plr->SetUInt32Value(PLAYER_FIELD_COINAGE, Rob);
- Plr->GiveXP(XPA, Plr->GetGUID(), true);
- Plr->BroadcastMessage("%s 10,000 XP was given.", MSG_COLOR_RED);
- Plr->Gossip_Complete();
- }break;
- case 2:
- {
- if(Plr->GetUInt32Value(PLAYER_FIELD_COINAGE) < XP2)
- {
- Plr->SendAreaTriggerMessage("%s Insufficient Funds!", MSG_COLOR_RED);
- Plr->Gossip_Complete();
- return;
- }else{
- int32
- }
- }break;
- }
- }
- }
- void Destroy()
- {
- delete this;
- }
- };
- /*
- Author: QQrofl
- Core: Arcemu
- Format: C++
- Info: Simple Commands for fast actions
- Credits: Arcemu, QQrofl
- */
- void SetupGossipBuyExp(ScriptMgr * mgr)
- {
- GossipScript * gs = (GossipScript*) new BuyNpcExp();
- mgr->register_gossip_script(NpcId, gs);
- }
- static string buy = "#buy";
- static string exp = "#exp";
- static string ven = "#ven";
- bool EventBuyCommands(Player * Plr, uint32 Type, uint32 Lang, const char * Cmd, const char * Misc)
- {
- }; // MEH!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement