aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2021_06_22_02_world_2018_02_16_02_world.sql8
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp114
2 files changed, 122 insertions, 0 deletions
diff --git a/sql/updates/world/master/2021_06_22_02_world_2018_02_16_02_world.sql b/sql/updates/world/master/2021_06_22_02_world_2018_02_16_02_world.sql
new file mode 100644
index 00000000000..ac6733d1059
--- /dev/null
+++ b/sql/updates/world/master/2021_06_22_02_world_2018_02_16_02_world.sql
@@ -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');
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 736ea803973..e6a36a36ed0 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -1143,6 +1143,118 @@ class spell_gen_dalaran_disguise : public SpellScriptLoader
}
};
+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,
@@ -3928,6 +4040,8 @@ void AddSC_generic_spell_scripts()
RegisterAuraScript(spell_gen_creature_permanent_feign_death);
new spell_gen_dalaran_disguise("spell_gen_sunreaver_disguise");
new spell_gen_dalaran_disguise("spell_gen_silver_covenant_disguise");
+ 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);