[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
+25 -25
View File
@@ -1192,75 +1192,75 @@ std::string ConvertMoneyToString(uint32 platinum, uint32 gold, uint32 silver, ui
if (copper && silver && gold && platinum) { // CSGP
money_string = fmt::format(
"{} Platinum, {} Gold, {} Silver, and {} Copper",
platinum,
gold,
silver,
copper
commify(std::to_string(platinum)),
commify(std::to_string(gold)),
commify(std::to_string(silver)),
commify(std::to_string(copper))
);
} else if (copper && silver && gold && !platinum) { // CSG
money_string = fmt::format(
"{} Gold, {} Silver, and {} Copper",
gold,
silver,
copper
commify(std::to_string(gold)),
commify(std::to_string(silver)),
commify(std::to_string(copper))
);
} else if (copper && silver && !gold && !platinum) { // CS
money_string = fmt::format(
"{} Silver and {} Copper",
silver,
copper
commify(std::to_string(silver)),
commify(std::to_string(copper))
);
} else if (!copper && silver && gold && platinum) { // SGP
money_string = fmt::format(
"{} Platinum, {} Gold, and {} Silver",
platinum,
gold,
silver
commify(std::to_string(platinum)),
commify(std::to_string(gold)),
commify(std::to_string(silver))
);
} else if (!copper && silver && gold && !platinum) { // SG
money_string = fmt::format(
"{} Gold and {} Silver",
gold,
silver
commify(std::to_string(gold)),
commify(std::to_string(silver))
);
} else if (copper && !silver && gold && platinum) { // CGP
money_string = fmt::format(
"{} Platinum, {} Gold, and {} Copper",
platinum,
gold,
copper
commify(std::to_string(platinum)),
commify(std::to_string(gold)),
commify(std::to_string(copper))
);
} else if (copper && !silver && gold && !platinum) { // CG
money_string = fmt::format(
"{} Gold and {} Copper",
gold,
copper
commify(std::to_string(gold)),
commify(std::to_string(copper))
);
} else if (!copper && !silver && gold && platinum) { // GP
money_string = fmt::format(
"{} Platinum and {} Gold",
platinum,
gold
commify(std::to_string(platinum)),
commify(std::to_string(gold))
);
} else if (!copper && !silver && !gold && platinum) { // P
money_string = fmt::format(
"{} Platinum",
platinum
commify(std::to_string(platinum))
);
} else if (!copper && !silver && gold && !platinum) { // G
money_string = fmt::format(
"{} Gold",
gold
commify(std::to_string(gold))
);
} else if (!copper && silver && !gold && !platinum) { // S
money_string = fmt::format(
"{} Silver",
silver
commify(std::to_string(silver))
);
} else if (copper && !silver && !gold && !platinum) { // C
money_string = fmt::format(
"{} Copper",
copper
commify(std::to_string(copper))
);
}
return money_string;