fix(Core/Scripts): Fix boss scripts resetting during death/defeat RP after threat system port (#25185)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: Treeston <treeston.mmoc@gmail.com>
This commit is contained in:
@@ -190,11 +190,10 @@ struct boss_felblood_kaelthas : public BossAI
|
||||
damage = me->GetHealth() - 1;
|
||||
if (me->isRegeneratingHealth())
|
||||
{
|
||||
me->CombatStop();
|
||||
me->CastStop();
|
||||
me->SetRegeneratingHealth(false);
|
||||
me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE);
|
||||
me->SetImmuneToAll(true);
|
||||
me->SetImmuneToAll(true, true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
LapseAction(ACTION_REMOVE_FLY);
|
||||
scheduler.CancelAll();
|
||||
|
||||
@@ -161,7 +161,6 @@ struct boss_kalecgos : public BossAI
|
||||
|
||||
me->m_Events.AddEventAtOffset([&] {
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->CombatStop();
|
||||
me->RemoveAllAuras();
|
||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
Talk(SAY_EVIL_ENRAGE);
|
||||
|
||||
@@ -95,7 +95,7 @@ struct boss_skeram : public BossAI
|
||||
creature->CastSpell(creature, SPELL_BIRTH, true);
|
||||
creature->SetControlled(true, UNIT_STATE_ROOT);
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
creature->SetImmuneToAll(true);
|
||||
creature->SetImmuneToAll(true, true);
|
||||
|
||||
_copiesGUIDs.push_back(creature->GetGUID());
|
||||
}
|
||||
@@ -211,7 +211,7 @@ struct boss_skeram : public BossAI
|
||||
_copiesGUIDs.clear();
|
||||
DoCast(me, SPELL_SUMMON_IMAGES, true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetImmuneToAll(true);
|
||||
me->SetImmuneToAll(true, true);
|
||||
me->SetControlled(true, UNIT_STATE_ROOT);
|
||||
Talk(SAY_SPLIT);
|
||||
_hpct -= 25.0f;
|
||||
|
||||
@@ -217,6 +217,14 @@ struct boss_hodir : public BossAI
|
||||
const Position ENTRANCE_DOOR{ 1999.160034f, -297.792999f, 431.960999f, 0 };
|
||||
const Position EXIT_DOOR{ 1999.709961f, -166.259003f, 432.822998f, 0 };
|
||||
|
||||
void JustExitedCombat() override
|
||||
{
|
||||
EngagementOver();
|
||||
if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
|
||||
@@ -399,6 +399,14 @@ struct boss_thorim : public BossAI
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
void JustExitedCombat() override
|
||||
{
|
||||
EngagementOver();
|
||||
if (_encounterFinished)
|
||||
return;
|
||||
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
DisableThorim(false);
|
||||
|
||||
@@ -1101,16 +1101,29 @@ struct npc_maiev_illidan : public ScriptedAI
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
bool _outroActive{ false };
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
if (_outroActive)
|
||||
return;
|
||||
scheduler.CancelAll();
|
||||
me->m_Events.KillAllEvents(false);
|
||||
}
|
||||
|
||||
void JustExitedCombat() override
|
||||
{
|
||||
EngagementOver();
|
||||
if (_outroActive)
|
||||
return;
|
||||
EnterEvadeMode(EVADE_REASON_NO_HOSTILES);
|
||||
}
|
||||
|
||||
void DoAction(int32 param) override
|
||||
{
|
||||
if (param == ACTION_MAIEV_ENDING)
|
||||
{
|
||||
_outroActive = true;
|
||||
scheduler.CancelAll();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
DoStopAttack();
|
||||
|
||||
Reference in New Issue
Block a user