mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 11:48:37 +00:00
[Tasks] Implement alternate currency rewards (#2827)
* Reward currency on task completion * Handle reward window * Tweaks
This commit is contained in:
@@ -1072,6 +1072,16 @@ void ClientTaskState::RewardTask(Client *c, const TaskInformation *ti, ClientTas
|
||||
c->AddCrystals(ti->reward_points, 0);
|
||||
} else if (ti->reward_point_type == static_cast<int32_t>(zone->GetCurrencyID(EBON_CRYSTAL))) {
|
||||
c->AddCrystals(0, ti->reward_points);
|
||||
} else {
|
||||
for (const auto& ac : zone->AlternateCurrencies) {
|
||||
if (ti->reward_point_type == ac.id) {
|
||||
const EQ::ItemData *item = database.GetItem(ac.item_id);
|
||||
if (item) {
|
||||
c->AddAlternateCurrencyValue(ti->reward_point_type, ti->reward_points);
|
||||
c->Message(Chat::Yellow, fmt::format("You have received ({}) {}!", ti->reward_points, item->Name).c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user