aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorccrs <ccrs@users.noreply.github.com>2019-01-16 23:30:23 +0100
committerShauren <shauren.trinity@gmail.com>2021-11-21 20:02:01 +0100
commit22182970379bd09d66a1b5ecb00d216f1e36a5e7 (patch)
treedf1be653ef323b53a6850a4ea20a5516764c32bb
parentf2688f3abedc6435b15721d0b64258d650606956 (diff)
Scripts/ICC: npc_suppresser corrections
closes #22908 (cherry picked from commit c5423fa474273400982b277c82bb38385b2798e1)
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp32
1 files changed, 10 insertions, 22 deletions
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
index 7a98e95b134..e78eb35a680 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
@@ -867,38 +867,30 @@ class npc_suppresser : public CreatureScript
struct npc_suppresserAI : public ScriptedAI
{
- npc_suppresserAI(Creature* creature) : ScriptedAI(creature),
- _instance(creature->GetInstanceScript())
+ npc_suppresserAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
{
}
void Reset() override
{
_events.Reset();
- _events.ScheduleEvent(EVENT_SUPPRESSION, 10s, 15s);
- me->SetReactState(REACT_PASSIVE);
}
void IsSummonedBy(Unit* /*summoner*/) override
{
if (Creature* valithria = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER)))
{
- float x, y, z;
- valithria->GetContactPoint(me, x,y,z);
- me->GetMotionMaster()->MovePoint(POINT_VALITHRIA, x, y, z);
+ me->EngageWithTarget(valithria);
+ me->GetThreatManager().FixateTarget(valithria);
}
+ else
+ me->DespawnOrUnsummon();
}
- void MovementInform(uint32 /*type*/, uint32 id) override
+ void MovementInform(uint32 type, uint32 /*id*/) override
{
- if (id == POINT_VALITHRIA)
- {
- if (Creature* valithria = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER)))
- {
- AttackStart(valithria);
- DoCastAOE(SPELL_SUPPRESSION);
- }
- }
+ if (type == CHASE_MOTION_TYPE)
+ _events.RescheduleEvent(EVENT_SUPPRESSION, 1);
}
void UpdateAI(uint32 diff) override
@@ -911,24 +903,20 @@ class npc_suppresser : public CreatureScript
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
- // this code will never be reached while channeling
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SUPPRESSION:
DoCastAOE(SPELL_SUPPRESSION);
- _events.ScheduleEvent(EVENT_SUPPRESSION, 5s);
+ _events.Repeat(5s);
break;
default:
break;
}
}
- // this creature has REACT_PASSIVE so it does not always have victim here
- if (Unit* victim = me->GetVictim())
- if (victim->GetEntry() != NPC_VALITHRIA_DREAMWALKER)
- DoMeleeAttackIfReady();
+ DoMeleeAttackIfReady();
}
private: