mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-04 03:13:52 +00:00
[Tasks] Tweak task update messages (#2406)
Excludes GiveCash since it uses copper amount for increments
This commit is contained in:
parent
7cf96ca2d8
commit
ce12481021
@ -867,6 +867,15 @@ int ClientTaskState::IncrementDoneCount(
|
||||
parse->EventPlayer(EVENT_TASK_UPDATE, client, export_string, 0);
|
||||
}
|
||||
|
||||
if (task_information->type != TaskType::Shared) {
|
||||
// live messages for each increment of non-shared tasks
|
||||
auto activity_type = task_information->activity_information[activity_id].activity_type;
|
||||
int msg_count = activity_type == TaskActivityType::GiveCash ? 1 : count;
|
||||
for (int i = 0; i < msg_count; ++i) {
|
||||
client->MessageString(Chat::DefaultText, TASK_UPDATED, task_information->title.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
info->activity[activity_id].updated = true;
|
||||
// Have we reached the goal count for this activity_information ?
|
||||
if (info->activity[activity_id].done_count >= task_information->activity_information[activity_id].goal_count) {
|
||||
@ -881,12 +890,14 @@ int ClientTaskState::IncrementDoneCount(
|
||||
// Unlock subsequent activities for this task
|
||||
bool task_complete = UnlockActivities(client, *info);
|
||||
LogTasks("[IncrementDoneCount] task_complete is [{}]", task_complete);
|
||||
// shared tasks only send update messages on activity completion
|
||||
if (task_information->type == TaskType::Shared) {
|
||||
client->MessageString(Chat::DefaultText, TASK_UPDATED, task_information->title.c_str());
|
||||
}
|
||||
// and by the 'Task Stage Completed' message
|
||||
client->SendTaskActivityComplete(info->task_id, activity_id, task_index, task_information->type);
|
||||
// Send the updated task/activity_information list to the client
|
||||
task_manager->SendSingleActiveTaskToClient(client, *info, task_complete, false);
|
||||
// Inform the client the task has been updated, both by a chat message
|
||||
client->MessageString(Chat::DefaultText, TASK_UPDATED, task_information->title.c_str());
|
||||
|
||||
if (!ignore_quest_update) {
|
||||
std::string export_string = fmt::format(
|
||||
@ -946,10 +957,6 @@ int ClientTaskState::IncrementDoneCount(
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (task_information->type != TaskType::Shared) {
|
||||
client->MessageString(Chat::DefaultText, TASK_UPDATED, task_information->title.c_str());
|
||||
}
|
||||
|
||||
// Send an updated packet for this single activity_information
|
||||
task_manager->SendTaskActivityLong(
|
||||
client,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user