Skip to content

Instantly share code, notes, and snippets.

@Rochet2
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Rochet2/9580836 to your computer and use it in GitHub Desktop.
Save Rochet2/9580836 to your computer and use it in GitHub Desktop.
/************************************
* Custom Commands *
* *
* RealityNetGaming *
*************************************
*/
#include "ScriptPCH.h"
#include "Chat.h"
uint32 buffs[] = {
15366, //Songflower Serenade
16609, // Warchief's Blessing
43223, // Greater Blessing of Kings
36880, // Arcane Intellect
33081, // Stamina
26035, // Celebrate Good Times!
66068, // Thorns
21562, // Power Word: Fortitude
0, // stop
};
class buff_commandscript : public CommandScript
{
public:
buff_commandscript() : CommandScript("buff_commandscript") {}
ChatCommand* GetCommands() const
{
static ChatCommand IngameCommandTable[] =
{
{"buff", rbac::RBAC_PERM_COMMAND_BUFF, false, &HandleBuffCommand, "", NULL},
{"mall", rbac::RBAC_PERM_COMMAND_MALL, false, &HandleMallCommand, "", NULL},
{"heal", rbac::RBAC_PERM_COMMAND_HEAL, false, &HandleHealCommand, "", NULL},
{"level", rbac::RBAC_PERM_COMMAND_LEVEL, false, &HandleLevelCommand, "", NULL},
{NULL, 0, false, NULL, "", NULL}
};
return IngameCommandTable;
}
static bool HandleBuffCommand(ChatHandler * handler, const char * args)
{
Player * me = handler->GetSession()->GetPlayer();
if (me->IsInCombat())
me->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, NULL, NULL);
else
{
me->RemoveAurasByType(SPELL_AURA_MOUNTED);
for (int i = 0; buffs[i]; ++i)
me->AddAura(buffs[i], me);
}
handler->PSendSysMessage("|cffff6060You are now buffed!"); // available for everyone!
return true;
}
static bool HandleMallCommand(ChatHandler * handler, const char * args) //MALL COMMAND
{
Player * me = handler->GetSession()->GetPlayer();
if (me->IsInCombat())
me->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, NULL, NULL);
else
{
me->TeleportTo(1, 7337.972168f, -1541.647705f, 161.172668f, 5.585654f); //if not in combat - teleport
handler->PSendSysMessage("|cff00E5EEYou have been teleported!"); //send message
}
return true;
}
static bool HandleHealCommand(ChatHandler * handler, const char * args) //HEAL COMMAND
{
Player * me = handler->GetSession()->GetPlayer();
if (me->IsInCombat())
me->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, NULL, NULL);
else if (me->HasItemCount(159787, 1, true)) //require the Healing Coin
{
me->DestroyItemCount(159787, 1, true, false); //Deleting the Healing Coin
me->SetHealth(me->GetMaxHealth());
handler->PSendSysMessage("|cffffcc00You've been healed!!");
}
else
handler->PSendSysMessage("|cffffcc00You must obtain our healing token!"); //missing coin - fail
return true;
}
static bool HandleLevelCommand(ChatHandler * handler, const char * args) //LEVEL COMMAND
{
Player * me = handler->GetSession()->GetPlayer();
if (me->IsInCombat())
me->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, NULL, NULL);
else if (me->HasItemCount(159786, 1, true)) //require the Leveling Coin
{
me->DestroyItemCount(159786, 1, true, false); //deleting the Leveling Coin
me->SetLevel(255);
handler->PSendSysMessage("|cffffcc00You have obtained your levels!");
}
else
handler->PSendSysMessage("|cffffcc00You must purchase our leveling token!"); //missing coin - fail
return true;
}
};
void AddSC_Ingame_commandscript()
{
new buff_commandscript();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment