Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Chat.h"
- class utility_commandscript : public CommandScript
- {
- public:
- utility_commandscript() : CommandScript("utility_commandscript") { }
- ChatCommand* GetCommands() const
- {
- static ChatCommand utilityCommandTable[] =
- {
- { "changerace", SEC_PLAYER, false, &HandleChangeRaceCommand, "", NULL },
- { "changefaction", SEC_PLAYER, false, &HandleChangeFactionCommand, "", NULL },
- { "maxskills", SEC_PLAYER, false, &HandleMaxSkillsCommand, "", NULL },
- { "customize", SEC_PLAYER, false, &HandleCustomizeCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
- static ChatCommand commandTable[] =
- {
- { "utility", SEC_PLAYER, true, NULL, "", utilityCommandTable },
- { NULL, 0, false, NULL, "", NULL }
- };
- return commandTable;
- }
- static bool HandleChangeRaceCommand(ChatHandler* handler, const char* args)
- {
- handler->GetSession()->GetPlayer()->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
- handler->SendSysMessage("Relog to change race of your character.");
- return true;
- }
- static bool HandleChangeFactionCommand(ChatHandler* handler, const char* args)
- {
- handler->GetSession()->GetPlayer()->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
- handler->SendSysMessage("Relog to change faction of your character.");
- return true;
- }
- static bool HandleMaxSkillsCommand(ChatHandler* handler, const char* args)
- {
- handler->GetSession()->GetPlayer()->UpdateSkillsForLevel();
- handler->SendSysMessage("Your weapon skills are now maximized.");
- return true;
- }
- static bool HandleCustomizeCommand(ChatHandler* handler, const char* args)
- {
- handler->GetSession()->GetPlayer()->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
- handler->SendSysMessage("Relog to customize your character.");
- return true;
- }
- };
- void AddSC_utility_commandscript()
- {
- new utility_commandscript();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement