fix(Scripts/SSC): make Fathomlord use his Spitfire Totem ability (#17674)

* initial

* new spell/aurascript format

* leftover
This commit is contained in:
Dan
2023-11-11 19:45:21 +01:00
committed by GitHub
parent 203536526c
commit 32ff556a99
2 changed files with 38 additions and 21 deletions

View File

@@ -113,6 +113,11 @@ struct boss_fathomlord_karathress : public BossAI
summon->SetWalk(true);
summon->GetMotionMaster()->MovePoint(0, advisorsPosition[MAX_ADVISORS - 1], false);
}
else
{
summon->Attack(me->GetVictim(), false);
summon->SetInCombatWithZone();
}
}
void SummonedCreatureDies(Creature* summon, Unit*) override
@@ -541,31 +546,38 @@ private:
InstanceScript* _instance;
};
class spell_karathress_power_of_caribdis : public SpellScriptLoader
class spell_karathress_power_of_tidalvess : public AuraScript
{
public:
spell_karathress_power_of_caribdis() : SpellScriptLoader("spell_karathress_power_of_caribdis") { }
PrepareAuraScript(spell_karathress_power_of_tidalvess);
class spell_karathress_power_of_caribdis_AuraScript : public AuraScript
void OnPeriodic(AuraEffect const* aurEff)
{
PrepareAuraScript(spell_karathress_power_of_caribdis_AuraScript);
PreventDefaultAction();
GetUnitOwner()->CastSpell(GetUnitOwner(), GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
}
void OnPeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
if (Unit* victim = GetUnitOwner()->GetVictim())
GetUnitOwner()->CastSpell(victim, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_karathress_power_of_caribdis_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_karathress_power_of_caribdis_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_karathress_power_of_tidalvess::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_karathress_power_of_caribdis : public AuraScript
{
PrepareAuraScript(spell_karathress_power_of_caribdis);
void OnPeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
if (Unit* victim = GetUnitOwner()->GetVictim())
{
GetUnitOwner()->CastSpell(victim, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_karathress_power_of_caribdis::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
@@ -575,5 +587,6 @@ void AddSC_boss_fathomlord_karathress()
RegisterSerpentShrineAI(boss_fathomguard_sharkkis);
RegisterSerpentShrineAI(boss_fathomguard_tidalvess);
RegisterSerpentShrineAI(boss_fathomguard_caribdis);
new spell_karathress_power_of_caribdis();
RegisterSpellScript(spell_karathress_power_of_tidalvess);
RegisterSpellScript(spell_karathress_power_of_caribdis);
}