mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Quest API] Add apis to end shared tasks (#2521)
This required some minor shared task refactoring - Shared task expiration handling was moved to world. Previously this was handled by zone and had clients self remove when a shared task expired. This resulted in wrong messages when a task ended. - FailTask is now implemented for shared tasks which previously only made the client quit the shared task. It now fails the task for all members by ending the shared task. The `Client::EndSharedTask` api will end the client's current shared task (removing all members). This is similiar to the `FailTask` api except it doesn't require a `task_id` and the red task fail banner is optional (live doesn't use it for shared tasks). The global `end_dz_task` api was added for when a client context isn't available. This will end a shared task if the current zone is a dynamic zone for a shared task mission. Currently only shared tasks use dynamic zones but this api can be expanded if support is added for tasks/quests. The global `get_dz_task_id` was added to conveniently get the task id for the current dynamic zone if it's used for a mission. Note this is a database hit since that information is not available at zone level.
This commit is contained in:
@@ -2480,6 +2480,24 @@ std::string QuestManager::gettaskname(uint32 task_id) {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
int QuestManager::GetCurrentDzTaskID() {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && zone && task_manager) {
|
||||
return task_manager->GetCurrentDzTaskID();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void QuestManager::EndCurrentDzTask(bool send_fail) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && zone && task_manager) {
|
||||
task_manager->EndCurrentDzTask(send_fail);
|
||||
}
|
||||
}
|
||||
|
||||
void QuestManager::clearspawntimers() {
|
||||
if (!zone) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user