Skip to content

Commit

Permalink
fix(Scripts/Oculus): Prevent boss Urom teleportation to nowhere on fa…
Browse files Browse the repository at this point in the history
…st kill (azerothcore#21305)

Co-authored-by: Hexadecimal <[email protected]>
  • Loading branch information
p-tkachuk and Hexadecimal authored Feb 3, 2025
1 parent 7b47cde commit 6753b44
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class boss_urom : public CreatureScript

InstanceScript* pInstance;
EventMap events;
bool lock;
bool lock, inCenter;
float x, y, z;
int32 releaseLockTimer;

Expand All @@ -134,6 +134,7 @@ class boss_urom : public CreatureScript
me->CastSpell(me, SPELL_EVOCATION, true);
events.Reset();
lock = false;
inCenter = false;
x = 0.0f;
y = 0.0f;
z = 0.0f;
Expand Down Expand Up @@ -222,9 +223,14 @@ class boss_urom : public CreatureScript
{
pInstance->SetData(DATA_UROM, DONE);
}
me->SetCanFly(false);
me->SetDisableGravity(false);
me->NearTeleportTo(x, y, z, 0.0f);

// Body teleportation required only when boss is flying in the center
if (inCenter)
{
me->SetCanFly(false);
me->SetDisableGravity(false);
me->NearTeleportTo(x, y, z, 0.0f);
}
}

void KilledUnit(Unit* /*victim*/) override
Expand Down Expand Up @@ -281,6 +287,7 @@ class boss_urom : public CreatureScript
me->SetCanFly(true);
me->SetDisableGravity(true);
me->NearTeleportTo(1103.69f, 1048.76f, 512.279f, 1.16f);
inCenter = true;

Talk(SAY_ARCANE_EXPLOSION);
Talk(EMOTE_ARCANE_EXPLOSION);
Expand Down Expand Up @@ -356,6 +363,7 @@ class boss_urom : public CreatureScript
me->SetControlled(false, UNIT_STATE_ROOT);
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->GetMotionMaster()->MoveChase(me->GetVictim());
inCenter = false;
break;
}
}
Expand All @@ -365,6 +373,7 @@ class boss_urom : public CreatureScript
me->SetCanFly(false);
me->SetDisableGravity(false);
me->SetControlled(false, UNIT_STATE_ROOT);
inCenter = false;
ScriptedAI::EnterEvadeMode(why);
}
};
Expand Down

0 comments on commit 6753b44

Please sign in to comment.