From 94ba32e7099318a0d62010d825abdf16782af1ed Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Sat, 2 Nov 2024 11:13:30 +0100 Subject: [PATCH] fix(Scripts/Kalimdor): Cavern of Time custodian escort quest group completion (#20355) * cast quest credit on group members * refactor group event * Revert "refactor group event" This reverts commit 36dff97740ac1e63c8f323a4dbea5bd92a73031d. --- src/server/scripts/Kalimdor/zone_tanaris.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 419fe473f59206..fcdbaa6aa2438c 100644 --- a/src/server/scripts/Kalimdor/zone_tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -242,16 +242,28 @@ class npc_custodian_of_time : public CreatureScript break; case 24: Talk(WHISPER_CUSTODIAN_14, player); - DoCast(player, 34883); - // below here is temporary workaround, to be removed when spell works properly - player->AreaExploredOrEventHappens(10277); + if (Group* group = player->GetGroup()) + { + for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next()) + { + Player* player = itr->GetSource(); + + // for any leave or dead (with not released body) group member at appropriate distance + if (player && player->IsAtGroupRewardDistance(me) && !player->GetCorpse()) + DoCast(player, 34883); // QID 10277 + + } + } + else + { + DoCast(player, 34883); // QID 10277 + } break; } } } void MoveInLineOfSight(Unit* who) override - { if (HasEscortState(STATE_ESCORT_ESCORTING)) return;