Core/Scripts: implemented Fungal Decay & Tail Sting

Refs #18542
This commit is contained in:
ariel-
2018-02-16 00:54:03 -03:00
parent ab1aa8e384
commit 7dc78d8e3f
2 changed files with 122 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
DELETE FROM `spell_proc` WHERE `SpellId` IN (32065, 36659);
INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
(32065, 0x0, 0, 0x00000000, 0x00000000, 0x00000000, 0x80000, 0x1, 0x0, 0x0, 0x0, 0, 0, 0, 0),
(36659, 0x0, 0, 0x00000000, 0x00000000, 0x00000000, 0x80000, 0x1, 0x0, 0x0, 0x0, 0, 0, 0, 0);
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_gen_decay_over_time_fungal_decay','spell_gen_decay_over_time_tail_sting');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(32065, 'spell_gen_decay_over_time_fungal_decay'),
(36659, 'spell_gen_decay_over_time_tail_sting');

View File

@@ -1238,6 +1238,118 @@ class spell_gen_damage_reduction_aura : public AuraScript
}
};
class spell_gen_decay_over_time : public SpellScriptLoader
{
public:
spell_gen_decay_over_time(char const* name) : SpellScriptLoader(name) { }
SpellScript* GetSpellScript() const override
{
return new spell_gen_decay_over_time_SpellScript();
}
private:
class spell_gen_decay_over_time_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_decay_over_time_SpellScript);
void ModAuraStack()
{
if (Aura* aur = GetHitAura())
aur->SetStackAmount(static_cast<uint8>(GetSpellInfo()->StackAmount));
}
void Register() override
{
AfterHit += SpellHitFn(spell_gen_decay_over_time_SpellScript::ModAuraStack);
}
};
protected:
class spell_gen_decay_over_time_AuraScript : public AuraScript
{
protected:
PrepareAuraScript(spell_gen_decay_over_time_AuraScript);
bool CheckProc(ProcEventInfo& eventInfo)
{
return (eventInfo.GetSpellInfo() == GetSpellInfo());
}
void Decay(ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
ModStackAmount(-1);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_gen_decay_over_time_AuraScript::CheckProc);
OnProc += AuraProcFn(spell_gen_decay_over_time_AuraScript::Decay);
}
~spell_gen_decay_over_time_AuraScript() = default;
};
~spell_gen_decay_over_time() = default;
};
enum FungalDecay
{
// found in sniffs, there is no duration entry we can possibly use
AURA_DURATION = 12600
};
// 32065 - Fungal Decay
class spell_gen_decay_over_time_fungal_decay : public spell_gen_decay_over_time
{
public:
spell_gen_decay_over_time_fungal_decay() : spell_gen_decay_over_time("spell_gen_decay_over_time_fungal_decay") { }
class spell_gen_decay_over_time_fungal_decay_AuraScript : public spell_gen_decay_over_time_AuraScript
{
PrepareAuraScript(spell_gen_decay_over_time_fungal_decay_AuraScript);
void ModDuration(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
// only on actual reapply, not on stack decay
if (GetDuration() == GetMaxDuration())
{
SetMaxDuration(AURA_DURATION);
SetDuration(AURA_DURATION);
}
}
void Register() override
{
spell_gen_decay_over_time_AuraScript::Register();
OnEffectApply += AuraEffectApplyFn(spell_gen_decay_over_time_fungal_decay_AuraScript::ModDuration, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_gen_decay_over_time_fungal_decay_AuraScript();
}
};
// 36659 - Tail Sting
class spell_gen_decay_over_time_tail_sting : public spell_gen_decay_over_time
{
public:
spell_gen_decay_over_time_tail_sting() : spell_gen_decay_over_time("spell_gen_decay_over_time_tail_sting") { }
class spell_gen_decay_over_time_tail_sting_AuraScript : public spell_gen_decay_over_time_AuraScript
{
PrepareAuraScript(spell_gen_decay_over_time_tail_sting_AuraScript);
};
AuraScript* GetAuraScript() const override
{
return new spell_gen_decay_over_time_tail_sting_AuraScript();
}
};
enum DefendVisuals
{
SPELL_VISUAL_SHIELD_1 = 63130,
@@ -3840,6 +3952,8 @@ void AddSC_generic_spell_scripts()
new spell_gen_dalaran_disguise("spell_gen_sunreaver_disguise");
new spell_gen_dalaran_disguise("spell_gen_silver_covenant_disguise");
RegisterAuraScript(spell_gen_damage_reduction_aura);
new spell_gen_decay_over_time_fungal_decay();
new spell_gen_decay_over_time_tail_sting();
RegisterAuraScript(spell_gen_defend);
RegisterSpellScript(spell_gen_despawn_self);
RegisterSpellScript(spell_gen_divine_storm_cd_reset);