Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- <--------------------------------------------------------------------------->
- - Developer(s): Ghostcrawler336
- - Complete: 100%
- - ScriptName: 'Reward Command'
- - Comment: Untested
- - Shared for: Emudevs
- <--------------------------------------------------------------------------->
- */
- #include "ScriptMgr.h"
- #include "Chat.h"
- #include "Common.h"
- #include "Language.h"
- enum
- {
- Money_1 = 100000, // Define the amount of money you want here (100 gold)
- Money_2 = 750000, // Define the amount of money you want here (75 gold)
- Money_3 = 500000 // Define the amount of money you want here (50 gold)
- };
- class reward_command : public CommandScript
- {
- public:
- reward_command() : CommandScript("reward_command") { }
- ChatCommand* GetCommands() const
- {
- static ChatCommand rewardCommandTable[] =
- {
- { "first", 2, false, &HandleReward, "", NULL },
- { "second", 2, false, &HandleReward1, "", NULL },
- { "third", 2, false, &HandleReward2, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
- static ChatCommand commandTable[] =
- {
- { "reward", 2, true, NULL, "", rewardCommandTable},
- { NULL, 0, false, NULL, "", NULL }
- };
- return commandTable;
- }
- static bool HandleReward(ChatHandler* handler, const char* args) // Give player 100 gold
- {
- Player* pPlayer = handler->GetSession()->GetPlayer();
- Player* plTarget = pPlayer->GetSelectedPlayer();
- plTarget->ModifyMoney(Money_1);
- handler->PSendSysMessage("|cffB400B4Congratulations you have won yourself 100 gold!");
- return true;
- }
- static bool HandleReward1(ChatHandler * handler, const char * args) // Give player 75 gold
- { Player* pPlayer = handler->GetSession()->GetPlayer();
- Player* plTarget = pPlayer->GetSelectedPlayer();
- plTarget->ModifyMoney(Money_2);
- handler->PSendSysMessage("|cffB400B4Congratulations you have won yourself 75 gold!");
- return true;
- }
- static bool HandleReward2(ChatHandler* handler, const char* args) // Give player 50 gold
- {
- Player* pPlayer = handler->GetSession()->GetPlayer();
- Player* plTarget = pPlayer->GetSelectedPlayer();
- plTarget->ModifyMoney(Money_3);
- handler->PSendSysMessage("|cffB400B4Congratulations you have won yourself 50 gold!");
- return true;
- }
- };
- void AddSC_reward_command()
- {
- new reward_command();
- }
Add Comment
Please, Sign In to add comment