mirror of
https://github.com/araxiaonline/AzerothCore-wotlk-with-NPCBots.git
synced 2026-06-13 03:22:24 -04:00
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();
|
||||
}
|
||||
|
||||
bool CanMeleeHit()
|
||||
{
|
||||
return me->GetVictim() && (me->GetVictim()->GetPositionZ() < 53.0f || me->GetVictim()->GetDistance(me->GetHomePosition()) < 50.0f);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (Creature* midnight = instance->GetCreature(DATA_MIDNIGHT))
|
||||
@@ -215,18 +210,10 @@ struct boss_attumen : public BossAI
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (_phase != PHASE_NONE)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!CanMeleeHit())
|
||||
{
|
||||
BossAI::EnterEvadeMode(EvadeReason::EVADE_REASON_BOUNDARY);
|
||||
}
|
||||
scheduler.Update(diff, std::bind(&BossAI::DoMeleeAttackIfReady, this));
|
||||
if (_phase != PHASE_NONE && !UpdateVictim())
|
||||
return;
|
||||
|
||||
scheduler.Update(diff, [this] { DoMeleeAttackIfReady(); });
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "AreaBoundary.h"
|
||||
#include "Creature.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceMapScript.h"
|
||||
@@ -65,6 +66,12 @@ DoorData const doorData[] =
|
||||
{ 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
|
||||
{
|
||||
public:
|
||||
@@ -81,6 +88,7 @@ public:
|
||||
{
|
||||
SetHeaders(DataHeader);
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadBossBoundaries(boundaries);
|
||||
LoadObjectData(creatureData, gameObjectData);
|
||||
LoadDoorData(doorData);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user