From 380c236479c418ee6cf220c1de23e4328b1d283e Mon Sep 17 00:00:00 2001 From: Stoabrogga <38475780+Stoabrogga@users.noreply.github.com> Date: Sat, 22 Dec 2018 17:01:35 +0100 Subject: [PATCH] Scripts/Quest: fix 12733 Death's Challenge (#886) --- .../EasternKingdoms/ScarletEnclave/chapter1.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 0c33043ea..122fda05a 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -217,6 +217,7 @@ public: uint64 _duelGUID; EventMap events; std::set playerGUIDs; + uint32 timer = 0; uint32 GetData(uint32 data) const { @@ -244,6 +245,9 @@ public: _duelGUID = caster->GetGUID(); _duelInProgress = true; + timer = 600000; // clear playerGUIDs after 10 minutes if no one initiates a duel + me->GetMotionMaster()->MoveFollow(caster, 2.0f, 0.0f); + events.ScheduleEvent(EVENT_SPEAK, 3000); events.ScheduleEvent(EVENT_SPEAK+1, 7000); events.ScheduleEvent(EVENT_SPEAK+2, 8000); @@ -279,6 +283,19 @@ public: void UpdateAI(uint32 diff) { + if (timer != 0) + { + if (timer <= diff) + { + timer = 0; + playerGUIDs.clear(); + } + else + { + timer -= diff; + } + } + events.Update(diff); switch (events.ExecuteEvent()) {