Advertisement
Deathsoul

Vip_Commands

Jul 11th, 2013
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.41 KB | None | 0 0
  1. /* Made by: aaddss A.K.A Deathsoul
  2.    tested in combat
  3.    untested in arena
  4. */
  5.  
  6. #include "ScriptMgr.h"
  7. #include "Chat.h"
  8.  
  9.  
  10. uint32 auras[] = { 48074, 47440, 53307, 132, 48170, 23737, 48470, 43002, 26393, 48162 };
  11.  
  12. class Vip_commands : public CommandScript
  13. {
  14. public:
  15. Vip_commands() : CommandScript("Vip_commands") { }
  16.  
  17.         ChatCommand* GetCommands() const
  18. {
  19.  
  20.     static ChatCommand vipCommandTable[] =
  21.         {
  22.                 {"Buff",                      SEC_PLAYER,         true, &HandleBuffCommand,                          "",},
  23.                 {"Reset cooldowns",           SEC_PLAYER,         true, &HandleResetCooldownsCommand,                "",},
  24.                 {"Repair",                    SEC_PLAYER,         true, &HandleRepairCommand,                        "",},
  25.                 {"Heal",                      SEC_PLAYER,         true, &HandleHealCommand,                          "",},
  26.                 { NULL,                       0,                     false, NULL,                                       "", NULL }
  27.  
  28.         };
  29.  
  30.         static ChatCommand commandTable[] =
  31.         {
  32.                { "vip",            0,                  true, NULL,                                "",  vipCommandTable},
  33.                { NULL,             0,                  false, NULL,                               "", NULL }
  34.         };
  35.         return commandTable;
  36.     }
  37.  
  38.  
  39.         static bool HandleBuffCommand(ChatHandler * handler, const char * args)
  40.         {
  41.                 Player * player = handler->GetSession()->GetPlayer();
  42.                 if (player->InArena())
  43.                         {
  44.                                 player->GetSession()->SendNotification("You can't use this command in arena!");
  45.                                 return false;
  46.                         }
  47.                 if (player->IsInCombat())
  48.                         {
  49.                                 player->GetSession()->SendNotification("You can't use in combat!");
  50.                                 return false;
  51.                         }
  52.  
  53.                 for(int i = 0; i < 10; i++)
  54.                         player->AddAura(auras[i], player);
  55.                 handler->GetSession()->SendNotification("You have been buffed!");
  56.                 return true;
  57.         }
  58.  
  59.         static bool HandleResetCooldownsCommand(ChatHandler * handler, const char * args)
  60.         {
  61.                 Player * player = handler->GetSession()->GetPlayer();
  62.  
  63.                 player->RemoveAllSpellCooldown();
  64.                 handler->GetSession()->SendNotification("your cooldowns has been reseted!");
  65.                 return true;
  66.         }
  67.  
  68.                 static bool HandleRepairCommand(ChatHandler * handler, const char * args)
  69.         {
  70.                 Player * player = handler->GetSession()->GetPlayer();
  71.                                 if (player->InArena())
  72.                         {
  73.                                 player->GetSession()->SendNotification("You can't use this command in arena!");
  74.                                 return false;
  75.                         }
  76.                 if (player->IsInCombat())
  77.                         {
  78.                                 player->GetSession()->SendNotification("You can't use in combat!");
  79.                                 return false;
  80.                         }
  81.  
  82.                 player->DurabilityRepairAll(false, 0, false);
  83.                 handler->GetSession()->SendNotification("your items has been repaired");
  84.                 return true;
  85.         }
  86.  
  87.                 static bool HandleHealCommand(ChatHandler * handler, const char * args)
  88.         {
  89.                 Player * player = handler->GetSession()->GetPlayer();
  90.                                 if (player->InArena())
  91.                         {
  92.                                 player->GetSession()->SendNotification("You can't use this command in arena!");
  93.                                 return false;
  94.                         }
  95.                 if (player->IsInCombat())
  96.                         {
  97.                                 player->GetSession()->SendNotification("You can't use in combat!");
  98.                                 return false;
  99.                         }
  100.                
  101.                 player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA));
  102.                 player->SetHealth(player->GetMaxHealth());
  103.                 player->SendTalentsInfoData(false);
  104.                 handler->GetSession()->SendNotification("your health and mana get restored!");
  105.                 return true;
  106.         }
  107. };
  108.  
  109. void AddSC_Vip_commands()
  110. {
  111.         new Vip_commands();
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement