mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Scripts: made BossAI::CheckInRoom virtual
This commit is contained in:
@@ -370,7 +370,7 @@ class BossAI : public ScriptedAI
|
||||
void _JustDied();
|
||||
void _JustReachedHome() { me->setActive(false); }
|
||||
|
||||
bool CheckInRoom()
|
||||
virtual bool CheckInRoom()
|
||||
{
|
||||
if (CheckBoundary(me))
|
||||
return true;
|
||||
|
||||
@@ -262,9 +262,21 @@ struct generic_halionAI : public BossAI
|
||||
}
|
||||
}
|
||||
|
||||
bool CheckInRoom() override
|
||||
{
|
||||
// Rough radius, it is not an exactly perfect circle
|
||||
if (me->GetDistance2d(HalionControllerSpawnPos.GetPositionX(), HalionControllerSpawnPos.GetPositionY()) > 48.5f)
|
||||
{
|
||||
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HALION_CONTROLLER)))
|
||||
controller->AI()->EnterEvadeMode();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
|
||||
if (!UpdateVictim() || !CheckInRoom() || me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
@@ -394,13 +406,6 @@ class boss_halion : public CreatureScript
|
||||
if (events.IsInPhase(PHASE_TWO))
|
||||
return;
|
||||
|
||||
// Rough radius, it is not an exactly perfect circle
|
||||
if (me->GetDistance2d(HalionControllerSpawnPos.GetPositionX(), HalionControllerSpawnPos.GetPositionY()) > 48.5f)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
generic_halionAI::UpdateAI(diff);
|
||||
}
|
||||
|
||||
|
||||
@@ -510,7 +510,7 @@ class boss_prince_keleseth_icc : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
bool CheckRoom()
|
||||
bool CheckInRoom() override
|
||||
{
|
||||
if (!CheckBoundary(me))
|
||||
{
|
||||
@@ -529,7 +529,7 @@ class boss_prince_keleseth_icc : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim() || !CheckRoom())
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
@@ -729,7 +729,7 @@ class boss_prince_taldaram_icc : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
bool CheckRoom()
|
||||
bool CheckInRoom() override
|
||||
{
|
||||
if (!CheckBoundary(me))
|
||||
{
|
||||
@@ -748,7 +748,7 @@ class boss_prince_taldaram_icc : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim() || !CheckRoom())
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
@@ -968,7 +968,7 @@ class boss_prince_valanar_icc : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
bool CheckRoom()
|
||||
bool CheckInRoom() override
|
||||
{
|
||||
if (!CheckBoundary(me))
|
||||
{
|
||||
@@ -987,7 +987,7 @@ class boss_prince_valanar_icc : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim() || !CheckRoom())
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
Reference in New Issue
Block a user