[11831] Implement player gear score calculation

Signed-off-by: Laise <fenrisse@gmail.com>
This commit is contained in:
C:/Program Files (x86)/git/dev/rsa 2011-10-17 16:13:06 +02:00 committed by Laise
parent fdc68c580d
commit 70a8a350d7
11 changed files with 246 additions and 4 deletions

View file

@ -7074,3 +7074,31 @@ bool ChatHandler::HandleModifyGenderCommand(char *args)
return true;
}
bool ChatHandler::HandleShowGearScoreCommand(char *args)
{
Player *player = getSelectedPlayer();
if (!player)
{
PSendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
return false;
}
uint32 withBags, withBank;
if (!ExtractOptUInt32(&args, withBags, 1))
return false;
if (!ExtractOptUInt32(&args, withBank, 0))
return false;
// always recalculate gear score for display
player->ResetCachedGearScore();
uint32 gearScore = player->GetEquipGearScore(withBags != 0, withBank != 0);
PSendSysMessage(LANG_GEARSCORE, GetNameLink(player).c_str(), gearScore);
return true;
}