mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 03:42:37 +01:00
Scripts/VioletHold: corrections to violet_hold_trashAI to prevent trash npcs being stuck in place forever if SPELL_DESTROY_DOOR_SEAL is no longer being casted for w/e reason
This commit is contained in:
@@ -831,7 +831,8 @@ struct violet_hold_trashAI : public EscortAI
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_scheduler.CancelAll();
|
||||
if (!me->HasReactState(REACT_DEFENSIVE))
|
||||
_scheduler.CancelAll();
|
||||
}
|
||||
|
||||
template <size_t N>
|
||||
@@ -894,11 +895,23 @@ struct violet_hold_trashAI : public EscortAI
|
||||
void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override
|
||||
{
|
||||
if (waypointId == _lastWaypointId)
|
||||
CreatureStartAttackDoor();
|
||||
{
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
DoCastAOE(SPELL_DESTROY_DOOR_SEAL);
|
||||
_scheduler.Schedule(Seconds(2), [this](TaskContext destroyDoorCheck)
|
||||
{
|
||||
if (!me->HasAura(SPELL_DESTROY_DOOR_SEAL))
|
||||
DoCastAOE(SPELL_DESTROY_DOOR_SEAL);
|
||||
destroyDoorCheck.Repeat();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
if (me->HasReactState(REACT_DEFENSIVE))
|
||||
return;
|
||||
|
||||
EscortAI::JustEngagedWith(who);
|
||||
ScheduledTasks();
|
||||
}
|
||||
@@ -917,12 +930,6 @@ struct violet_hold_trashAI : public EscortAI
|
||||
|
||||
virtual void ScheduledTasks() { }
|
||||
|
||||
void CreatureStartAttackDoor()
|
||||
{
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
DoCastAOE(SPELL_DESTROY_DOOR_SEAL);
|
||||
}
|
||||
|
||||
protected:
|
||||
InstanceScript* _instance;
|
||||
TaskScheduler _scheduler;
|
||||
|
||||
Reference in New Issue
Block a user