Scripts/Quest: fix 12733 Death's Challenge (#886)
This commit is contained in:
committed by
Francesco Borzì
parent
9a9f44549d
commit
380c236479
@@ -217,6 +217,7 @@ public:
|
|||||||
uint64 _duelGUID;
|
uint64 _duelGUID;
|
||||||
EventMap events;
|
EventMap events;
|
||||||
std::set<uint32> playerGUIDs;
|
std::set<uint32> playerGUIDs;
|
||||||
|
uint32 timer = 0;
|
||||||
|
|
||||||
uint32 GetData(uint32 data) const
|
uint32 GetData(uint32 data) const
|
||||||
{
|
{
|
||||||
@@ -244,6 +245,9 @@ public:
|
|||||||
_duelGUID = caster->GetGUID();
|
_duelGUID = caster->GetGUID();
|
||||||
_duelInProgress = true;
|
_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, 3000);
|
||||||
events.ScheduleEvent(EVENT_SPEAK+1, 7000);
|
events.ScheduleEvent(EVENT_SPEAK+1, 7000);
|
||||||
events.ScheduleEvent(EVENT_SPEAK+2, 8000);
|
events.ScheduleEvent(EVENT_SPEAK+2, 8000);
|
||||||
@@ -279,6 +283,19 @@ public:
|
|||||||
|
|
||||||
void UpdateAI(uint32 diff)
|
void UpdateAI(uint32 diff)
|
||||||
{
|
{
|
||||||
|
if (timer != 0)
|
||||||
|
{
|
||||||
|
if (timer <= diff)
|
||||||
|
{
|
||||||
|
timer = 0;
|
||||||
|
playerGUIDs.clear();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
timer -= diff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
events.Update(diff);
|
events.Update(diff);
|
||||||
switch (events.ExecuteEvent())
|
switch (events.ExecuteEvent())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user