fix(Scripts/Hyjal): Air Burst should not be cast on MT (#18933)

* fix movement of doomfire

* fix air burst

* conditions

* movechase random target

* Update boss_archimonde.cpp

* update movement

* Update boss_archimonde.cpp

* Update boss_archimonde.cpp
This commit is contained in:
Dan
2024-05-21 03:05:56 +02:00
committed by GitHub
parent a8b69edeee
commit f78820e9d5
2 changed files with 26 additions and 81 deletions

View File

@@ -144,79 +144,10 @@ struct npc_ancient_wisp : public ScriptedAI
return;
}
private:
InstanceScript* _instance;
};
//TODO: move to db?
struct npc_doomfire : public ScriptedAI
{
npc_doomfire(Creature* creature) : ScriptedAI(creature), _summons(me) { }
void Reset() override
{
_summons.DespawnAll();
}
void MoveInLineOfSight(Unit* /*who*/) override { }
void JustEngagedWith(Unit* /*who*/) override { }
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
damage = 0;
}
void JustSummoned(Creature* summoned) override
{
_summons.Summon(summoned);
if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT)
{
me->GetMotionMaster()->MoveFollow(summoned, 0.0f, 0.0f);
}
}
private:
SummonList _summons;
};
struct npc_doomfire_targetting : public ScriptedAI
{
npc_doomfire_targetting(Creature* creature) : ScriptedAI(creature) { }
void Reset() override
{
_chaseTarget = nullptr;
ScheduleTimedEvent(5s, [&]
{
if (_chaseTarget)
{
me->GetMotionMaster()->MoveFollow(_chaseTarget, 0.0f, 0.0f);
}
else
{
Position randomPosition = me->GetRandomNearPosition(40.0f);
me->GetMotionMaster()->MovePoint(0, randomPosition);
}
}, 5s);
}
void MoveInLineOfSight(Unit* who) override
{
if (who->IsPlayer())
{
_chaseTarget = who;
}
}
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
damage = 0;
}
private:
Unit* _chaseTarget;
};
struct boss_archimonde : public BossAI
{
boss_archimonde(Creature* creature) : BossAI(creature, DATA_ARCHIMONDE)
@@ -327,11 +258,11 @@ struct boss_archimonde : public BossAI
ScheduleTimedEvent(25s, 35s, [&]
{
Talk(SAY_AIR_BURST);
DoCastRandomTarget(SPELL_AIR_BURST);
DoCastRandomTarget(SPELL_AIR_BURST, 0, 0.0f, true, false, false);
}, 25s, 40s);
ScheduleTimedEvent(25s, 35s, [&]
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, false))
{
DoCastDoomFire(target);
}
@@ -442,18 +373,22 @@ struct boss_archimonde : public BossAI
{
summoned->AI()->AttackStart(me);
}
else if (summoned->GetEntry() == CREATURE_DOOMFIRE)
{
summoned->CastSpell(summoned, SPELL_DOOMFIRE_SPAWN);
summoned->CastSpell(summoned, SPELL_DOOMFIRE, true, 0, 0, me->GetGUID());
}
else if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT)
{
Position randomPosition = summoned->GetRandomNearPosition(40.0f);
summoned->GetMotionMaster()->MovePoint(0, randomPosition);
}
else
{
summoned->SetFaction(me->GetFaction()); //remove?
summoned->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
summoned->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
}
if (summoned->GetEntry() == CREATURE_DOOMFIRE)
{
summoned->CastSpell(summoned, SPELL_DOOMFIRE_SPAWN);
summoned->CastSpell(summoned, SPELL_DOOMFIRE, true, 0, 0, me->GetGUID());
}
}
void DoCastDoomFire(Unit* target)
@@ -462,12 +397,16 @@ struct boss_archimonde : public BossAI
Talk(SAY_DOOMFIRE);
Position spiritPosition = { target->GetPositionX() + DOOMFIRE_OFFSET, target->GetPositionY() + DOOMFIRE_OFFSET, target->GetPositionZ(), 0.0f };
Position doomfirePosition = { target->GetPositionX() - DOOMFIRE_OFFSET, target->GetPositionY() - DOOMFIRE_OFFSET, target->GetPositionZ(), 0.0f };
if (Unit* doomfireSpirit = me->SummonCreature(CREATURE_DOOMFIRE_SPIRIT, spiritPosition, TEMPSUMMON_TIMED_DESPAWN, 27000))
if (Creature* doomfireSpirit = me->SummonCreature(CREATURE_DOOMFIRE_SPIRIT, spiritPosition, TEMPSUMMON_TIMED_DESPAWN, 27000))
{
if (Unit* doomfire = me->SummonCreature(CREATURE_DOOMFIRE, doomfirePosition, TEMPSUMMON_TIMED_DESPAWN, 27000))
if (Creature* doomfire = me->SummonCreature(CREATURE_DOOMFIRE, doomfirePosition, TEMPSUMMON_TIMED_DESPAWN, 27000))
{
doomfireSpirit->SetVisible(false);
doomfire->SetVisible(false);
doomfireSpirit->SetWalk(false);
doomfireSpirit->SetReactState(REACT_PASSIVE);
doomfire->SetReactState(REACT_PASSIVE);
doomfire->GetMotionMaster()->MoveFollow(doomfireSpirit, 0.0f, 0.0f);
}
}
}
@@ -568,8 +507,6 @@ void AddSC_boss_archimonde()
RegisterSpellScript(spell_hand_of_death);
RegisterSpellScript(spell_finger_of_death);
RegisterHyjalAI(boss_archimonde);
RegisterHyjalAI(npc_doomfire);
RegisterHyjalAI(npc_doomfire_targetting);
RegisterHyjalAI(npc_ancient_wisp);
}