Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- #include "Chat.h"
- class buffcommand : public CommandScript
- {
- public:
- buffcommand() : CommandScript("buffcommand") { }
- ChatCommand* GetCommands() const
- {
- static ChatCommand IngameCommandTable[] =
- {
- { "buff", rbac::RBAC_PERM_COMMAND_BUFF, true, &HandleBuffCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
- return IngameCommandTable;
- }
- static bool HandleBuffCommand(ChatHandler * handler, const char * args)
- {
- uint32 spellId = handler->extractSpellIdFromLink((char*)args);
- if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId))
- {
- SessionMap::const_iterator itr;
- for (itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr)
- {
- if (itr->second &&
- itr->second->GetPlayer() &&
- itr->second->GetPlayer()->IsInWorld() &&
- {
- if (Player* player = itr->second->GetPlayer())
- {
- Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, player, player, spellInfo->spellPower);)
- }
- }
- }
- }
- handler->SetSentErrorMessage(true);
- return true;
- }
- };
- void AddSC_buffcommand()
- {
- new buffcommand();
- }
Add Comment
Please, Sign In to add comment