fix(Scripts/SunwellPlateau): Fix Felmyst death event (#21425)

This commit is contained in:
Andrew
2025-02-13 07:38:47 -03:00
committed by GitHub
parent 75388c7538
commit 98a8a1306a
5 changed files with 53 additions and 42 deletions

View File

@@ -79,7 +79,10 @@ public:
scheduler.Schedule(1min, 1min, DATA_KALECGOS,[this](TaskContext)
{
if (Creature* kalecgos = instance->SummonCreature(NPC_KALECGOS, KalecgosSpawnPos))
{
kalecgos->GetMotionMaster()->MovePath(PATH_KALECGOS_FLIGHT, false);
kalecgos->AI()->Talk(SAY_KALECGOS_SPAWN);
}
});
}
}

View File

@@ -69,6 +69,11 @@ enum MovementData
PATH_KALECGOS_FLIGHT = 248440
};
enum CreatureTexts
{
SAY_KALECGOS_SPAWN = 0
};
template <class AI, class T>
inline AI* GetMagistersTerraceAI(T* obj)
{

View File

@@ -73,10 +73,13 @@ enum Misc
POINT_AIR_BREATH_END2 = 6,
POINT_MISC = 7,
POINT_KALECGOS = 1,
GROUP_START_INTRO = 0,
GROUP_BREATH = 1,
NPC_FOG_TRIGGER = 23472
NPC_FOG_TRIGGER = 23472,
NPC_KALECGOS_FELMYST = 24844 // Same as Magister's Terrace
};
class CorruptTriggers : public BasicEvent
@@ -159,7 +162,8 @@ struct boss_felmyst : public BossAI
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_FOG_OF_CORRUPTION_CHARM);
// Summon Kalecgos (human form of kalecgos fight)
me->SummonCreature(NPC_KALEC, 1526.28f, 700.10f, 60.0f, 4.33f);
if (Creature* kalec = me->SummonCreature(NPC_KALECGOS_FELMYST, 1573.1461f, 755.20245f, 99.524956f, 3.595378f))
kalec->GetMotionMaster()->MovePoint(POINT_KALECGOS, 1474.2347f, 624.0703f, 29.32589f, false, true);
}
void MovementInform(uint32 type, uint32 point) override
@@ -472,14 +476,26 @@ class spell_felmyst_open_brutallus_back_doors : public SpellScript
{
PrepareSpellScript(spell_felmyst_open_brutallus_back_doors);
bool Load() override
{
return GetCaster()->GetInstanceScript();
}
void FilterTargets(std::list<WorldObject*>& unitList)
{
unitList.remove_if(DoorsGuidCheck());
}
void HandleAfterCast()
{
GetCaster()->GetInstanceScript()->SetBossState(DATA_FELMYST_DOORS, NOT_STARTED);
GetCaster()->GetInstanceScript()->SetBossState(DATA_FELMYST_DOORS, DONE);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_felmyst_open_brutallus_back_doors::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
AfterCast += SpellCastFn(spell_felmyst_open_brutallus_back_doors::HandleAfterCast);
}
};

View File

@@ -246,7 +246,9 @@ struct boss_kalecgos : public BossAI
scheduler.Schedule(16s, [this](TaskContext)
{
me->SummonCreature(NPC_KALEC, 1702.21f, 931.7f, -74.56f, 5.07f, TEMPSUMMON_MANUAL_DESPAWN);
if (Creature* kalec = me->SummonCreature(NPC_KALEC, 1702.21f, 931.7f, -74.56f, 5.07f, TEMPSUMMON_MANUAL_DESPAWN))
kalec->CastSpell(kalec, SPELL_SPECTRAL_INVISIBILITY, true);
me->SummonCreature(NPC_SATHROVARR, 1704.62f, 927.78f, -73.9f, 2.0f, TEMPSUMMON_MANUAL_DESPAWN);
});
@@ -264,49 +266,10 @@ struct boss_kalecgos : public BossAI
bool _sathBanished;
};
enum Kalec
{
SPELL_OPEN_BRUTALLUS_BACK_DOOR = 46650,
MODEL_KALECGOS_DRAGON = 23487,
EVENT_KALEC_SCENE_1 = 101,
EVENT_KALEC_SCENE_2 = 102,
EVENT_KALEC_SCENE_3 = 103
};
struct boss_kalec : public ScriptedAI
{
boss_kalec(Creature* creature) : ScriptedAI(creature) { }
void Reset() override
{
if (me->GetPositionY() < 750.0f)
{
me->SetSpeed(MOVE_RUN, 2.4f);
me->SetDisplayId(MODEL_KALECGOS_DRAGON);
me->SetDisableGravity(true);
me->GetMotionMaster()->MovePoint(0, 1483.30f, 657.99f, 28.0f, false, true);
me->m_Events.AddEventAtOffset([&] {
Talk(SAY_GOOD_MADRIGOSA);
me->GetMotionMaster()->MovePoint(0, 1509.0f, 560.0f, 30.0f, false, true);
}, 9s);
me->m_Events.AddEventAtOffset([&] {
DoCastAOE(SPELL_OPEN_BRUTALLUS_BACK_DOOR, true);
me->GetInstanceScript()->SetBossState(DATA_FELMYST_DOORS, NOT_STARTED);
me->GetInstanceScript()->SetBossState(DATA_FELMYST_DOORS, DONE);
}, 16s);
me->m_Events.AddEventAtOffset([&] {
me->GetMotionMaster()->MovePoint(0, 1400.0f, 630.0f, 90.0f, false, true);
me->DespawnOrUnsummon(6000);
}, 22s);
}
else
DoCastSelf(SPELL_SPECTRAL_INVISIBILITY, true);
}
void JustEngagedWith(Unit*) override
{
ScheduleTimedEvent(5s, [&] {