mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[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:
+29
-43
@@ -1170,52 +1170,38 @@ void QuestManager::untraindiscs() {
|
||||
initiator->UntrainDiscAll();
|
||||
}
|
||||
|
||||
void QuestManager::givecash(int copper, int silver, int gold, int platinum) {
|
||||
void QuestManager::givecash(uint32 copper, uint32 silver, uint32 gold, uint32 platinum) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (initiator && initiator->IsClient() && ((copper + silver + gold + platinum) > 0))
|
||||
{
|
||||
initiator->AddMoneyToPP(copper, silver, gold, platinum, true);
|
||||
if (
|
||||
initiator &&
|
||||
initiator->IsClient() &&
|
||||
(
|
||||
copper ||
|
||||
silver ||
|
||||
gold ||
|
||||
platinum
|
||||
)
|
||||
) {
|
||||
initiator->AddMoneyToPP(
|
||||
copper,
|
||||
silver,
|
||||
gold,
|
||||
platinum,
|
||||
true
|
||||
);
|
||||
|
||||
std::string tmp;
|
||||
if (platinum > 0)
|
||||
{
|
||||
tmp = "You receive ";
|
||||
tmp += itoa(platinum);
|
||||
tmp += " platinum";
|
||||
if (initiator) {
|
||||
initiator->MessageString(
|
||||
Chat::MoneySplit,
|
||||
YOU_RECEIVE,
|
||||
ConvertMoneyToString(
|
||||
platinum,
|
||||
gold,
|
||||
silver,
|
||||
copper
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
if (gold > 0)
|
||||
{
|
||||
if (tmp.length() == 0)
|
||||
tmp = "You receive ";
|
||||
else
|
||||
tmp += ",";
|
||||
|
||||
tmp += itoa(gold);
|
||||
tmp += " gold";
|
||||
}
|
||||
if(silver > 0)
|
||||
{
|
||||
if (tmp.length() == 0)
|
||||
tmp = "You receive ";
|
||||
else
|
||||
tmp += ",";
|
||||
|
||||
tmp += itoa(silver);
|
||||
tmp += " silver";
|
||||
}
|
||||
if(copper > 0)
|
||||
{
|
||||
if (tmp.length() == 0)
|
||||
tmp = "You receive ";
|
||||
else
|
||||
tmp += ",";
|
||||
|
||||
tmp += itoa(copper);
|
||||
tmp += " copper";
|
||||
}
|
||||
tmp += " pieces.";
|
||||
if (initiator)
|
||||
initiator->Message(Chat::OOC, tmp.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user