mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
fix(Core): Boss encounter disengage improvement (#4954)
This commit is contained in:
@@ -216,6 +216,10 @@ public:
|
||||
bool bAchievCoolestFriends{ true };
|
||||
uint16 addSpawnTimer{ 0 };
|
||||
|
||||
// Used to make Hodir disengage whenever he leaves his room
|
||||
const Position ENTRANCE_DOOR{ 1999.160034f, -297.792999f, 431.960999f, 0 };
|
||||
const Position EXIT_DOOR{ 1999.709961f, -166.259003f, 432.822998f, 0 };
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
events.Reset();
|
||||
@@ -369,22 +373,12 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bool IsInRoom()
|
||||
{
|
||||
// Calculate the distance between his home position to the gate
|
||||
if (me->GetExactDist(me->GetHomePosition().GetPositionX(),
|
||||
me->GetHomePosition().GetPositionY(),
|
||||
me->GetHomePosition().GetPositionZ()) > 80.0f)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!IsInRoom()) { return; }
|
||||
if (!IsInRoom(&ENTRANCE_DOOR, Axis::AXIS_Y, false) || !IsInRoom(&EXIT_DOOR, Axis::AXIS_Y, true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
@@ -398,9 +392,6 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if( !berserk && (me->GetPositionX() < 1940.0f || me->GetPositionX() > 2070.0f || me->GetPositionY() < -300.0f || me->GetPositionY() > -155.0f) )
|
||||
events.RescheduleEvent(EVENT_BERSERK, 1);
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
|
||||
Reference in New Issue
Block a user