aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Redko <ovitnez@gmail.com>2022-12-23 16:08:58 +0200
committerGitHub <noreply@github.com>2022-12-23 15:08:58 +0100
commitdc221604d9971eabb95cdbaececa28765a6dfa9a (patch)
treef7eff42f8186be905d782f049b84404199a7f2e6
parentd91c4526e1630669a48ade376d46b78b7dfeac9e (diff)
Core/Scripts: Implemented Zort's Protective Elixir (#28372)
* Core/Scripts: Implemented Zort's Protective Elixir * Rename XXXX_XX_XX_XX_world.sql to 2022_12_23_00_world.sql Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
-rw-r--r--sql/updates/world/3.3.5/2022_12_23_00_world.sql3
-rw-r--r--src/server/scripts/Northrend/zone_dragonblight.cpp34
2 files changed, 37 insertions, 0 deletions
diff --git a/sql/updates/world/3.3.5/2022_12_23_00_world.sql b/sql/updates/world/3.3.5/2022_12_23_00_world.sql
new file mode 100644
index 00000000000..852260c1f51
--- /dev/null
+++ b/sql/updates/world/3.3.5/2022_12_23_00_world.sql
@@ -0,0 +1,3 @@
+--
+DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_dragonblight_corrosive_spit';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (47447, 'spell_dragonblight_corrosive_spit');
diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp
index a6675345ce5..18d74441370 100644
--- a/src/server/scripts/Northrend/zone_dragonblight.cpp
+++ b/src/server/scripts/Northrend/zone_dragonblight.cpp
@@ -25,6 +25,7 @@
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "SpellAuras.h"
+#include "SpellAuraEffects.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
@@ -941,6 +942,38 @@ class spell_dragonblight_fill_blood_unholy_frost_gem : public SpellScript
}
};
+// 47447 - Corrosive Spit
+class spell_dragonblight_corrosive_spit : public AuraScript
+{
+ PrepareAuraScript(spell_dragonblight_corrosive_spit);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
+ }
+
+ void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetTarget()->HasAura(aurEff->GetSpellInfo()->GetEffect(EFFECT_0).CalcValue()))
+ GetAura()->Remove();
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ if (GetTarget()->HasAura(aurEff->GetSpellInfo()->GetEffect(EFFECT_0).CalcValue()))
+ {
+ PreventDefaultAction();
+ GetAura()->Remove();
+ }
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_dragonblight_corrosive_spit::AfterApply, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_dragonblight_corrosive_spit::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
+ }
+};
+
void AddSC_dragonblight()
{
RegisterCreatureAI(npc_commander_eligor_dawnbringer);
@@ -958,4 +991,5 @@ void AddSC_dragonblight()
RegisterSpellScript(spell_dragonblight_bombard_the_ballistae_fx_master);
RegisterSpellScript(spell_dragonblight_surge_needle_teleporter);
RegisterSpellScript(spell_dragonblight_fill_blood_unholy_frost_gem);
+ RegisterSpellScript(spell_dragonblight_corrosive_spit);
}