[6960] Implement ".modify runnicpower" command.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Arthorius 2008-12-28 03:15:12 +03:00 committed by VladimirMangos
parent 70c7dda068
commit 41cbc67dfc
9 changed files with 59 additions and 3 deletions

View file

@ -827,6 +827,40 @@ bool ChatHandler::HandleModifyRageCommand(const char* args)
return true;
}
// Edit Player Runic Power
bool ChatHandler::HandleModifyRunicPowerCommand(const char* args)
{
if(!*args)
return false;
int32 rune = atoi((char*)args)*10;
int32 runem = atoi((char*)args)*10;
if (rune <= 0 || runem <= 0 || runem < rune)
{
SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true);
return false;
}
Player *chr = getSelectedPlayer();
if (chr == NULL)
{
SendSysMessage(LANG_NO_CHAR_SELECTED);
SetSentErrorMessage(true);
return false;
}
PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, chr->GetName(), rune/10, runem/10);
if (needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, GetName(), rune/10, runem/10);
chr->SetMaxPower(POWER_RUNIC_POWER,runem );
chr->SetPower(POWER_RUNIC_POWER, rune );
return true;
}
//Edit Player Faction
bool ChatHandler::HandleModifyFactionCommand(const char* args)
{