fix(Scripts/Karazhan): Midnight no longer evades during Attumen fight (#25610)

This commit is contained in:
sogladev 2026-04-26 23:04:10 +02:00 committed by GitHub
parent cb0ffd34aa
commit cf62b76ae0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 17 deletions

View file

@ -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

View file

@ -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);