fix(Scripts/Oculus): Prevent boss Urom teleportation to nowhere on fast kill (#21305)

Co-authored-by: Hexadecimal <hd@hd.hd>
This commit is contained in:
p-tkachuk
2025-02-03 17:47:38 +01:00
committed by GitHub
parent 7b47cdebb9
commit 6753b44b16
@@ -107,7 +107,7 @@ public:
InstanceScript* pInstance; InstanceScript* pInstance;
EventMap events; EventMap events;
bool lock; bool lock, inCenter;
float x, y, z; float x, y, z;
int32 releaseLockTimer; int32 releaseLockTimer;
@@ -134,6 +134,7 @@ public:
me->CastSpell(me, SPELL_EVOCATION, true); me->CastSpell(me, SPELL_EVOCATION, true);
events.Reset(); events.Reset();
lock = false; lock = false;
inCenter = false;
x = 0.0f; x = 0.0f;
y = 0.0f; y = 0.0f;
z = 0.0f; z = 0.0f;
@@ -222,9 +223,14 @@ public:
{ {
pInstance->SetData(DATA_UROM, DONE); pInstance->SetData(DATA_UROM, DONE);
} }
me->SetCanFly(false);
me->SetDisableGravity(false); // Body teleportation required only when boss is flying in the center
me->NearTeleportTo(x, y, z, 0.0f); if (inCenter)
{
me->SetCanFly(false);
me->SetDisableGravity(false);
me->NearTeleportTo(x, y, z, 0.0f);
}
} }
void KilledUnit(Unit* /*victim*/) override void KilledUnit(Unit* /*victim*/) override
@@ -281,6 +287,7 @@ public:
me->SetCanFly(true); me->SetCanFly(true);
me->SetDisableGravity(true); me->SetDisableGravity(true);
me->NearTeleportTo(1103.69f, 1048.76f, 512.279f, 1.16f); me->NearTeleportTo(1103.69f, 1048.76f, 512.279f, 1.16f);
inCenter = true;
Talk(SAY_ARCANE_EXPLOSION); Talk(SAY_ARCANE_EXPLOSION);
Talk(EMOTE_ARCANE_EXPLOSION); Talk(EMOTE_ARCANE_EXPLOSION);
@@ -356,6 +363,7 @@ public:
me->SetControlled(false, UNIT_STATE_ROOT); me->SetControlled(false, UNIT_STATE_ROOT);
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE); me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->GetMotionMaster()->MoveChase(me->GetVictim()); me->GetMotionMaster()->MoveChase(me->GetVictim());
inCenter = false;
break; break;
} }
} }
@@ -365,6 +373,7 @@ public:
me->SetCanFly(false); me->SetCanFly(false);
me->SetDisableGravity(false); me->SetDisableGravity(false);
me->SetControlled(false, UNIT_STATE_ROOT); me->SetControlled(false, UNIT_STATE_ROOT);
inCenter = false;
ScriptedAI::EnterEvadeMode(why); ScriptedAI::EnterEvadeMode(why);
} }
}; };