Scripts/BoT: scripted the mechanics of the bound elementals in the Sanctum of the Ascended

This commit is contained in:
Ovahlord committed 2021-04-26 13:35:22 +02:00
1 parent 63dbbc3309
commit bb2e5b8e1e
2 files changed
+134

No files matched your search

@@ -28,6 +28,7 @@
#include "MotionMaster.h"
#include "PassiveAI.h"
#include "Player.h"
#include "SpellMgr.h"
#include "VMapFactory.h"
#include "VMapManager2.h"
#include "bastion_of_twilight.h"
@@ -294,6 +295,75 @@ class spell_bot_twilight_rupture : public SpellScript
}
};
enum AscendantCouncilElementals
{
SPELL_RENDING_GALE = 93277,
SPELL_ENTOMB = 93327,
SPELL_BURNING_REPRISAL = 93352,
SPELL_COLD_TOUCHED = 93381,
SPELL_ICY_SHROUD = 93335
};
class spell_bot_cancel_aura : public SpellScript
{
public:
spell_bot_cancel_aura(uint32 spellId) : _spellId(spellId) { }
void HandleAuraCancel(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->RemoveAurasDueToSpell(sSpellMgr->GetSpellIdForDifficulty(_spellId, GetHitUnit()));
}
void Register() override
{
OnEffectHitTarget.Register(&spell_bot_cancel_aura::HandleAuraCancel, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
}
private:
uint32 _spellId;
};
class spell_bot_ward_of_combustion : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_BURNING_REPRISAL,
SPELL_COLD_TOUCHED
});
}
bool CheckProc(ProcEventInfo& eventInfo)
{
return (eventInfo.GetDamageInfo() && eventInfo.GetActor() && !eventInfo.GetActor()->HasAura(SPELL_COLD_TOUCHED));
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
GetTarget()->CastSpell(eventInfo.GetActor(), SPELL_BURNING_REPRISAL, CastSpellExtraArgs(aurEff).AddSpellBP0(eventInfo.GetDamageInfo()->GetDamage()));
}
void Register() override
{
DoCheckProc.Register(&spell_bot_ward_of_combustion::CheckProc);
OnEffectProc.Register(&spell_bot_ward_of_combustion::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
class spell_bot_flame_strike : public SpellScript
{
void HandleAuraCancel(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->RemoveAurasDueToSpell(SPELL_ICY_SHROUD);
}
void Register() override
{
OnEffectHitTarget.Register(&spell_bot_flame_strike::HandleAuraCancel, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
class at_bot_intro_events final : public OnlyOnceAreaTriggerScript
{
public:
@@ -316,6 +386,10 @@ void AddSC_bastion_of_twilight()
RegisterBastionOfTwilightCreatureAI(npc_bot_evolved_drakonaar);
RegisterSpellScript(spell_bot_wyvern_sting);
RegisterSpellScript(spell_bot_twilight_rupture);
RegisterSpellScriptWithArgs(spell_bot_cancel_aura, "spell_bot_rending_gale", SPELL_ENTOMB);
RegisterSpellScriptWithArgs(spell_bot_cancel_aura, "spell_bot_entomb", SPELL_RENDING_GALE);
RegisterSpellScript(spell_bot_ward_of_combustion);
RegisterSpellScript(spell_bot_flame_strike);
new at_bot_intro_events("at_halfus_wyrmbreaker_intro", DATA_AT_HALFUS_WYRMBREAKER_INTRO);
new at_bot_intro_events("at_theralion_and_valiona_intro", DATA_AT_THERALION_AND_VALIONA_INTRO);
new at_bot_intro_events("at_ascendant_council_intro_1", DATA_AT_ASCENDANT_COUNCIL_INTRO_1);