Guest User

Ingame Command Script - Edited

a guest
Feb 12th, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.48 KB | None | 0 0
  1. //THIS SCRIPT IS NOT MINE, I'VE ONLY EDITED IT!!!
  2. //FULL CREDIT FOR MAKING THIS GOES TO: http://www.ac-web.org/forums/showthread.php?143075-trintity-c-commands-buff-mall-heal
  3.  
  4. #include "ScriptPCH.h"
  5. #include "Chat.h"
  6.  
  7.  
  8. uint32 auras[] = { 15366, 16609, 48162, 48074, 48170, 43223, 36880, 467, 69994, 33081, 24705, 26035, 48469 };
  9.  
  10. class buff_commandscript : public CommandScript
  11. {
  12. public:
  13.     buff_commandscript() : CommandScript("buff_commandscript") { }
  14.  
  15.     ChatCommand* GetCommands() const
  16.     {
  17.         static ChatCommand IngameCommandTable[] =
  18.         {
  19.             { "buff",            SEC_PLAYER,  false, &HandleBuffCommand,             "", NULL },
  20.             { "mall",            SEC_PLAYER,  false, &HandleMallCommand,             "", NULL },
  21.             { "vip",            SEC_VIP,  false, &HandleVipCommand,             "", NULL },
  22.             { "heal",            SEC_PLAYER,  false, &HandleHealCommand,             "", NULL },
  23.             { "cd",            SEC_PLAYER,  false, &HandleCooldownCommand,             "", NULL },
  24.             { "lvl",            SEC_PLAYER,  false, &HandleLevelCommand,             "", NULL },
  25.             { NULL,             0,                  false, NULL,                              "", NULL }
  26.         };
  27.          return IngameCommandTable;
  28.     }
  29.  
  30.     static bool HandleBuffCommand(ChatHandler * handler, const char * args)
  31.     {
  32.         Player * me = handler->GetSession()->GetPlayer();
  33.    
  34.         me->RemoveAurasByType(SPELL_AURA_MOUNTED);
  35.         for(int i = 0; i < 11; i++)
  36.             me->AddAura(auras[i], me);
  37.         handler->PSendSysMessage("|cffff6060You're buffed now! Use it well to kill others!"); // available for everyone!
  38.         return true;
  39.     }
  40.    
  41.     static bool HandleMallCommand(ChatHandler * handler, const char * args) //MALL COMMAND
  42.     {
  43.         Player * me = handler->GetSession()->GetPlayer();
  44.        
  45.          if(me->IsInCombat())
  46.             handler->PSendSysMessage("|cff00ff00You're in combat. When it's gone you can use this command.");
  47.         else
  48.             me-> TeleportTo(1, 7337.972168f, -1541.647705f, 161.172668f, 5.585654f), //if not in combat - teleport
  49.          me->SetHealth(18000), //set health when reaching the location
  50.          handler->PSendSysMessage("|cff00E5EEYou have been teleported to the mall and your health has been set to 18000!!"); //send message
  51.        
  52.         return true;
  53.     }
  54.  
  55.             static bool HandleVipCommand(ChatHandler * handler, const char * args) //VIP COMMAND
  56.     {
  57.         Player * me = handler->GetSession()->GetPlayer();
  58.    
  59.         if(me->IsInCombat())
  60.             handler->PSendSysMessage("|cff00ff00You're in combat. When it's gone you can use this command.");
  61.         else
  62.             me-> TeleportTo(0, -7370.899414f, 1062.117920f, 131.407379f, 4.726033f), //teleport
  63.          me->SetHealth(18000), //set hp to 18k
  64.          handler->PSendSysMessage("|cff00ff00You have been teleported to the VIP mall!");
  65.  
  66.         return true;
  67.     }
  68.  
  69.             static bool HandleHealCommand(ChatHandler * handler, const char * args) //HEAL COMMAND
  70.     {
  71.         Player * me = handler->GetSession()->GetPlayer();
  72.    
  73.          if(me->HasItemCount(159787,1,true)) //require the Healing Coin
  74.              me->DestroyItemCount(159787,1,true,false), //Deleting the Healing Coin
  75.         me-> SetHealth(me->GetMaxHealth()), handler->PSendSysMessage("|cffffcc00You've been healed!!");
  76.          else
  77.              handler->PSendSysMessage("|cffffcc00You need the Healing Coin first!"); //missing coin - fail
  78.         return true;
  79.     }
  80.  
  81.             static bool HandleCooldownCommand(ChatHandler * handler, const char * args) //CD COMMAND
  82.     {
  83.         Player * me = handler->GetSession()->GetPlayer();
  84.    
  85.         if(me->HasItemCount(159788,1,true)) //check if the player has the item
  86.             me->DestroyItemCount(159788,1,true,false), //delete the item
  87.             me-> RemoveAllSpellCooldown(),  //remove CDs
  88.             handler->PSendSysMessage("|cffFF4500Your cooldowns are now clear!!"); //remove item Cooldown Coin - for all
  89.         else
  90.             handler->PSendSysMessage("|cffFF4500You need the Cooldown Coin first!"); //if he doesn't have the Cooldown Coin - fail
  91.         return true;
  92.     }
  93.  
  94.             static bool HandleLevelCommand(ChatHandler * handler, const char * args) //LEVEL COMMAND
  95.     {
  96.         Player * me = handler->GetSession()->GetPlayer();
  97.    
  98.          if(me->HasItemCount(159786,1,true)) //require the Leveling Coin
  99.              me->DestroyItemCount(159786,1,true,false), //deleting the Leveling Coin
  100.              me->SetLevel(80), handler->PSendSysMessage("|cffffcc00You've been leveled!!!"); //level 80
  101.          else
  102.              handler->PSendSysMessage("|cffffcc00You need the Leveling Coin first!"); //missing coin - fail
  103.         return true;
  104.     }
  105.  
  106. };
  107.  
  108. void AddSC_Ingame_commandscript()
  109. {
  110.     new buff_commandscript();
  111. }
Advertisement
Add Comment
Please, Sign In to add comment