mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 02:31:03 +00:00
[Commands] Cleanup #corpse Command. (#1790)
- Cleanup message and logic. - Add ConvertMoneyToString(platinum, gold, silver, copper) helper method. - Cleanup NPC::QueryLoot() and Corpse::QueryLoot().
This commit is contained in:
@@ -1180,3 +1180,78 @@ std::string ConvertSecondsToTime(int duration, bool is_milliseconds)
|
||||
}
|
||||
return time_string;
|
||||
}
|
||||
|
||||
std::string ConvertMoneyToString(uint32 platinum, uint32 gold, uint32 silver, uint32 copper)
|
||||
{
|
||||
std::string money_string = "Unknown";
|
||||
if (copper && silver && gold && platinum) { // CSGP
|
||||
money_string = fmt::format(
|
||||
"{} Platinum, {} Gold, {} Silver, and {} Copper",
|
||||
platinum,
|
||||
gold,
|
||||
silver,
|
||||
copper
|
||||
);
|
||||
} else if (copper && silver && gold && !platinum) { // CSG
|
||||
money_string = fmt::format(
|
||||
"{} Gold, {} Silver, and {} Copper",
|
||||
gold,
|
||||
silver,
|
||||
copper
|
||||
);
|
||||
} else if (copper && silver && !gold && !platinum) { // CS
|
||||
money_string = fmt::format(
|
||||
"{} Silver and {} Copper",
|
||||
silver,
|
||||
copper
|
||||
);
|
||||
} else if (copper && !silver && !gold && !platinum) { // C
|
||||
money_string = fmt::format(
|
||||
"{} Copper",
|
||||
copper
|
||||
);
|
||||
} else if (!copper && silver && gold && platinum) { // SGP
|
||||
money_string = fmt::format(
|
||||
"{} Platinum, {} Gold, and {} Silver",
|
||||
platinum,
|
||||
gold,
|
||||
silver
|
||||
);
|
||||
} else if (!copper && silver && gold && !platinum) { // SG
|
||||
money_string = fmt::format(
|
||||
"{} Gold and {} Silver",
|
||||
gold,
|
||||
silver
|
||||
);
|
||||
} else if (!copper && silver && !gold && !platinum) { // S
|
||||
money_string = fmt::format(
|
||||
"{} Silver",
|
||||
silver
|
||||
);
|
||||
} else if (copper && !silver && gold && platinum) { // CGP
|
||||
money_string = fmt::format(
|
||||
"{} Platinum, {} Gold, and {} Copper",
|
||||
platinum,
|
||||
gold,
|
||||
copper
|
||||
);
|
||||
} else if (copper && !silver && gold && !platinum) { // CG
|
||||
money_string = fmt::format(
|
||||
"{} Gold and {} Copper",
|
||||
gold,
|
||||
copper
|
||||
);
|
||||
} else if (!copper && !silver && gold && platinum) { // GP
|
||||
money_string = fmt::format(
|
||||
"{} Platinum and {} Gold",
|
||||
platinum,
|
||||
gold
|
||||
);
|
||||
} else if (!copper && !silver && gold && !platinum) { // G
|
||||
money_string = fmt::format(
|
||||
"{} Gold",
|
||||
gold
|
||||
);
|
||||
}
|
||||
return money_string;
|
||||
}
|
||||
Reference in New Issue
Block a user