[Money Messages] Cleanup quest::givecash(), split, and task reward messages. (#2205)

* [Money Messages] Cleanup quest::givecash(), split, and task reward messages.
- Cleans up all the money messages using ConvertMoneyToString().
- Allows quest::givecash() to have optional parameters other than copper.

* Commification.

* Corpse messages.

* String IDs and cleanup.
This commit is contained in:
Kinglykrab
2022-05-29 14:33:18 -04:00
committed by GitHub
parent 9e9ef6809b
commit bcf7ccefcd
11 changed files with 243 additions and 271 deletions
+27 -9
View File
@@ -1019,8 +1019,27 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
loot_coin = (tmp[0] == 1 && tmp[1] == '\0');
if (loot_request_type == LootRequestType::GMPeek || loot_request_type == LootRequestType::GMAllowed) {
client->Message(Chat::Yellow, "This corpse contains %u platinum, %u gold, %u silver and %u copper.",
GetPlatinum(), GetGold(), GetSilver(), GetCopper());
if (
GetPlatinum() ||
GetGold() ||
GetSilver() ||
GetCopper()
) {
client->Message(
Chat::Yellow,
fmt::format(
"This corpse contains {}.",
ConvertMoneyToString(
GetPlatinum(),
GetGold(),
GetSilver(),
GetCopper()
)
).c_str()
);
} else {
client->Message(Chat::Yellow, "This corpse contains no money.");
}
auto outapp = new EQApplicationPacket(OP_MoneyOnCorpse, sizeof(moneyOnCorpseStruct));
moneyOnCorpseStruct* d = (moneyOnCorpseStruct*)outapp->pBuffer;
@@ -1505,13 +1524,12 @@ void Corpse::QueryLoot(Client* to) {
}
}
bool has_money = (
platinum > 0 ||
gold > 0 ||
silver > 0 ||
copper > 0
);
if (has_money) {
if (
platinum ||
gold ||
silver ||
copper
) {
to->Message(
Chat::White,
fmt::format(