Scripts/Ulduar: restored boundary functionality for Assembly of Iron encounter

This commit is contained in:
Ovahlord
2020-10-01 20:45:51 +02:00
parent af164c8ace
commit 82a5ba527e
2 changed files with 10 additions and 4 deletions

View File

@@ -16,6 +16,7 @@
*/
#include "ScriptMgr.h"
#include "AreaBoundary.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
@@ -158,6 +159,9 @@ std::array<Position, 8> BrundirIntroWaypoints =
Position(1588.82f, 120.42f, 427.3189f)
};
CircleBoundary const AssemblyBoundary({ 1587.2f, 121.0f }, 90.0f);
CreatureBoundary const ArenaBoundaries = { &AssemblyBoundary };
namespace EncounterHelper
{
// Let's use cheap AI macros instead of having the SpellMgr go through storages
@@ -177,6 +181,7 @@ struct boss_steelbreaker : public ScriptedAI
{
// For dynamic linking compatability
_instance = me->GetInstanceScript();
SetBoundary(&ArenaBoundaries);
}
void JustEngagedWith(Unit* who) override
@@ -267,7 +272,7 @@ struct boss_steelbreaker : public ScriptedAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
if (!UpdateVictim() || !CheckInRoom())
return;
_events.Update(diff);
@@ -322,6 +327,7 @@ struct boss_runemaster_molgeim : public ScriptedAI
{
// For dynamic linking compatability
_instance = me->GetInstanceScript();
SetBoundary(&ArenaBoundaries);
}
void JustAppeared() override
@@ -416,7 +422,7 @@ struct boss_runemaster_molgeim : public ScriptedAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim() && !_events.IsInPhase(PHASE_INTRO))
if ((!UpdateVictim() || !CheckInRoom()) && !_events.IsInPhase(PHASE_INTRO))
return;
_events.Update(diff);
@@ -490,6 +496,7 @@ struct boss_stormcaller_brundir : public ScriptedAI
{
// For dynamic linking compatability
_instance = me->GetInstanceScript();
SetBoundary(&ArenaBoundaries);
}
void JustAppeared() override
@@ -625,7 +632,7 @@ struct boss_stormcaller_brundir : public ScriptedAI
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim() && !_events.IsInPhase(PHASE_INTRO))
if ((!UpdateVictim() || !CheckInRoom()) && !_events.IsInPhase(PHASE_INTRO))
return;
_events.Update(diff);

View File

@@ -37,7 +37,6 @@ static BossBoundaryData const boundaries =
{ DATA_IGNIS, new RectangleBoundary(495.0f, 680.0f, 90.0f, 400.0f) },
{ DATA_RAZORSCALE, new RectangleBoundary(370.0f, 810.0f, -542.0f, -55.0f) },
{ DATA_XT002, new RectangleBoundary(755.0f, 940.0f, -125.0f, 95.0f) },
{ DATA_ASSEMBLY_OF_IRON, new CircleBoundary(Position(1587.2f, 121.0f), 90.0) },
{ DATA_ALGALON, new CircleBoundary(Position(1632.668f, -307.7656f), 45.0) },
{ DATA_ALGALON, new ZRangeBoundary(410.0f, 470.0f) },
{ DATA_HODIR, new EllipseBoundary(Position(2001.5f, -240.0f), 50.0, 75.0) },