Scripts/Quest: fix 12733 Death's Challenge (#886)

This commit is contained in:
Stoabrogga
2018-12-22 17:01:35 +01:00
committed by Francesco Borzì
parent 9a9f44549d
commit 380c236479

View File

@@ -217,6 +217,7 @@ public:
uint64 _duelGUID;
EventMap events;
std::set<uint32> 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())
{