diff --git a/common/ruletypes.h b/common/ruletypes.h index 0f8c3eb2c..b8ca75c33 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -715,6 +715,7 @@ RULE_BOOL(TaskSystem, ExpRewardsIgnoreLevelBasedEXPMods, false, "Rewarding Level RULE_INT(TaskSystem, SharedTasksWorldProcessRate, 6000, "Timer interval (milliseconds) that shared tasks are processed in world") RULE_INT(TaskSystem, SharedTasksTerminateTimerMS, 120000, "Delay (milliseconds) until a shared task is terminated if requirements are no longer met after member removal (default: 2 minutes)") RULE_BOOL(TaskSystem, UpdateOneElementPerTask, true, "If true (live-like) task updates only increment the first matching activity. If false all matching elements will be incremented.") +RULE_INT(TaskSystem, MaxUpdateMessages, 50, "Maximum update messages for non-GiveCash activity types in IncrementDoneCount") RULE_CATEGORY_END() RULE_CATEGORY(Range) diff --git a/zone/task_client_state.cpp b/zone/task_client_state.cpp index 31790135c..2b7f89ea9 100644 --- a/zone/task_client_state.cpp +++ b/zone/task_client_state.cpp @@ -869,7 +869,12 @@ int ClientTaskState::IncrementDoneCount( if (task_data->type != TaskType::Shared) { // live messages for each increment of non-shared tasks auto activity_type = task_data->activity_information[activity_id].activity_type; - int msg_count = activity_type == TaskActivityType::GiveCash ? 1 : count; + int msg_count = 1; + + if (activity_type != TaskActivityType::GiveCash) { + msg_count = std::min(count, RuleI(TaskSystem, MaxUpdateMessages)); + } + for (int i = 0; i < msg_count; ++i) { client->MessageString(Chat::DefaultText, TASK_UPDATED, task_data->title.c_str()); }