fix(Scripts/Karazhan): Midnight no longer evades during Attumen fight (#25610)
This commit is contained in:
@@ -82,11 +82,6 @@ struct boss_attumen : public BossAI
|
|||||||
Initialize();
|
Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CanMeleeHit()
|
|
||||||
{
|
|
||||||
return me->GetVictim() && (me->GetVictim()->GetPositionZ() < 53.0f || me->GetVictim()->GetDistance(me->GetHomePosition()) < 50.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnterEvadeMode(EvadeReason why) override
|
void EnterEvadeMode(EvadeReason why) override
|
||||||
{
|
{
|
||||||
if (Creature* midnight = instance->GetCreature(DATA_MIDNIGHT))
|
if (Creature* midnight = instance->GetCreature(DATA_MIDNIGHT))
|
||||||
@@ -215,18 +210,10 @@ struct boss_attumen : public BossAI
|
|||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
{
|
{
|
||||||
if (_phase != PHASE_NONE)
|
if (_phase != PHASE_NONE && !UpdateVictim())
|
||||||
{
|
|
||||||
if (!UpdateVictim())
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
scheduler.Update(diff, [this] { DoMeleeAttackIfReady(); });
|
||||||
if (!CanMeleeHit())
|
|
||||||
{
|
|
||||||
BossAI::EnterEvadeMode(EvadeReason::EVADE_REASON_BOUNDARY);
|
|
||||||
}
|
|
||||||
scheduler.Update(diff, std::bind(&BossAI::DoMeleeAttackIfReady, this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
|
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "AreaBoundary.h"
|
||||||
#include "Creature.h"
|
#include "Creature.h"
|
||||||
#include "GameObject.h"
|
#include "GameObject.h"
|
||||||
#include "InstanceMapScript.h"
|
#include "InstanceMapScript.h"
|
||||||
@@ -65,6 +66,12 @@ DoorData const doorData[] =
|
|||||||
{ 0, 0, DOOR_TYPE_ROOM }
|
{ 0, 0, DOOR_TYPE_ROOM }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
BossBoundaryData const boundaries =
|
||||||
|
{
|
||||||
|
{ DATA_ATTUMEN, new CircleBoundary(Position(-11126.3f, -1929.11f), 50.0f) },
|
||||||
|
{ DATA_ATTUMEN, new ZRangeBoundary(49.0f, 55.0f) },
|
||||||
|
};
|
||||||
|
|
||||||
class instance_karazhan : public InstanceMapScript
|
class instance_karazhan : public InstanceMapScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -81,6 +88,7 @@ public:
|
|||||||
{
|
{
|
||||||
SetHeaders(DataHeader);
|
SetHeaders(DataHeader);
|
||||||
SetBossNumber(EncounterCount);
|
SetBossNumber(EncounterCount);
|
||||||
|
LoadBossBoundaries(boundaries);
|
||||||
LoadObjectData(creatureData, gameObjectData);
|
LoadObjectData(creatureData, gameObjectData);
|
||||||
LoadDoorData(doorData);
|
LoadDoorData(doorData);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user