interdev

buff all

Feb 10th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.33 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2. #include "Chat.h"
  3.  
  4. class buffcommand : public CommandScript
  5. {
  6. public:
  7.     buffcommand() : CommandScript("buffcommand") { }
  8.  
  9.         ChatCommand* GetCommands() const
  10.     {
  11.         static ChatCommand IngameCommandTable[] =
  12.         {
  13.         { "buff",           rbac::RBAC_PERM_COMMAND_BUFF,         true,  &HandleBuffCommand,                "", NULL },
  14.         { NULL,             0,                  false, NULL,                              "", NULL }
  15.         };
  16.                  return IngameCommandTable;
  17.     }
  18.  
  19.         static bool HandleBuffCommand(ChatHandler * handler, const char * args)
  20.     {
  21.         uint32 spellId = handler->extractSpellIdFromLink((char*)args);
  22.         if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId))
  23.         {
  24.             SessionMap::const_iterator itr;
  25.             for (itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
  26.             {
  27.                 if (itr->second &&
  28.                     itr->second->GetPlayer() &&
  29.                     itr->second->GetPlayer()->IsInWorld() &&
  30.                 {
  31.                     if (Player* player = itr->second->GetPlayer())
  32.                     {
  33.                         Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, player, player, spellInfo->spellPower);)
  34.                     }
  35.                 }
  36.             }
  37.         }
  38.        
  39.         handler->SetSentErrorMessage(true);
  40.         return true;
  41.     }
  42. };
  43.  
  44. void AddSC_buffcommand()
  45. {
  46.     new buffcommand();
  47. }
Add Comment
Please, Sign In to add comment