aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeader <keader.android@gmail.com>2019-03-06 16:15:03 +0100
committerShauren <shauren.trinity@gmail.com>2021-11-24 20:35:18 +0100
commitc72afc76be5a9be4041e9ee007cf176210055656 (patch)
tree659d40efc87f672604a028a3684dcf829f1f0068 /src
parentc0bcf98e0794c37b1bad8eff8aea6bd760884857 (diff)
Creature/Script: Daegarn
Remove the incorrect SAI and move it to cpp (cherry picked from commit 482e0dad30ccb88ae4d518fc205f1cd76202fed7)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/zone_howling_fjord.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp
index fef7eb2eaf2..41047aad08b 100644
--- a/src/server/scripts/Northrend/zone_howling_fjord.cpp
+++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp
@@ -355,6 +355,7 @@ enum Daegarnn
NPC_PRISONER_1 = 24253, // looks the same but has different abilities
NPC_PRISONER_2 = 24254,
NPC_PRISONER_3 = 24255,
+ SAY_TEXT = 0
};
static float afSummon[] = {838.81f, -4678.06f, -94.182f};
@@ -381,10 +382,19 @@ public:
bool bEventInProgress;
ObjectGuid uiPlayerGUID;
+ TaskScheduler _scheduler;
void Reset() override
{
Initialize();
+ _scheduler.Schedule(40s, [this](TaskContext sayContext)
+ {
+ if (!bEventInProgress)
+ {
+ Talk(SAY_TEXT);
+ sayContext.Repeat(40s);
+ }
+ });
}
void StartEvent(ObjectGuid uiGUID)
@@ -394,8 +404,18 @@ public:
uiPlayerGUID = uiGUID;
+ bEventInProgress = true;
SummonGladiator(NPC_FIRJUS);
}
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (bEventInProgress && !UpdateVictim())
+ return;
+
+ _scheduler.Update(diff);
+ DoMeleeAttackIfReady();
+ }
void JustSummoned(Creature* summon) override
{