mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[11831] Implement player gear score calculation
Signed-off-by: Laise <fenrisse@gmail.com>
This commit is contained in:
parent
fdc68c580d
commit
70a8a350d7
11 changed files with 246 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue