aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2021_12_14_08_world_2019_07_08_00_world.sql4
-rw-r--r--src/server/game/Spells/SpellEffects.cpp8
-rw-r--r--src/server/scripts/Spells/spell_item.cpp54
3 files changed, 58 insertions, 8 deletions
diff --git a/sql/updates/world/master/2021_12_14_08_world_2019_07_08_00_world.sql b/sql/updates/world/master/2021_12_14_08_world_2019_07_08_00_world.sql
new file mode 100644
index 00000000000..e1df8449bd6
--- /dev/null
+++ b/sql/updates/world/master/2021_12_14_08_world_2019_07_08_00_world.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_item_brittle_armor','spell_item_mercurial_shield');
+INSERT INTO `spell_script_names` VALUES
+(24590,'spell_item_brittle_armor'),
+(26465,'spell_item_mercurial_shield');
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 6a77c858e89..14b719332b9 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2983,14 +2983,6 @@ void Spell::EffectScriptEffect()
{
switch (m_spellInfo->Id)
{
- // Brittle Armor - need remove one 24575 Brittle Armor aura
- case 24590:
- unitTarget->RemoveAuraFromStack(24575);
- return;
- // Mercurial Shield - need remove one 26464 Mercurial Shield aura
- case 26465:
- unitTarget->RemoveAuraFromStack(26464);
- return;
// Shadow Flame (All script effects, not just end ones to prevent player from dodging the last triggered spell)
case 22539:
case 22972:
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 8d1f9e37fdf..10afd8b97c1 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -405,6 +405,32 @@ class spell_item_dementia : public AuraScript
}
};
+// 24590 - Brittle Armor
+enum BrittleArmor
+{
+ SPELL_BRITTLE_ARMOR = 24575
+};
+
+class spell_item_brittle_armor : public SpellScript
+{
+ PrepareSpellScript(spell_item_brittle_armor);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_BRITTLE_ARMOR });
+ }
+
+ void HandleScript(SpellEffIndex /* effIndex */)
+ {
+ GetHitUnit()->RemoveAuraFromStack(SPELL_BRITTLE_ARMOR);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_brittle_armor::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
// 64411 - Blessing of Ancient Kings (Val'anyr, Hammer of Ancient Kings)
enum BlessingOfAncientKings
{
@@ -1263,6 +1289,32 @@ class spell_item_mark_of_conquest : public AuraScript
}
};
+// 26465 - Mercurial Shield
+enum MercurialShield
+{
+ SPELL_MERCURIAL_SHIELD = 26464
+};
+
+class spell_item_mercurial_shield : public SpellScript
+{
+ PrepareSpellScript(spell_item_mercurial_shield);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_MERCURIAL_SHIELD });
+ }
+
+ void HandleScript(SpellEffIndex /* effIndex */)
+ {
+ GetHitUnit()->RemoveAuraFromStack(SPELL_MERCURIAL_SHIELD);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_mercurial_shield::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
// http://www.wowhead.com/item=32686 Mingo's Fortune Giblets
// 40802 Mingo's Fortune Generator
class spell_item_mingos_fortune_generator : public SpellScript
@@ -4385,6 +4437,7 @@ void AddSC_item_spell_scripts()
RegisterAuraScript(spell_item_arcane_shroud);
RegisterAuraScript(spell_item_aura_of_madness);
RegisterAuraScript(spell_item_dementia);
+ RegisterSpellScript(spell_item_brittle_armor);
RegisterAuraScript(spell_item_blessing_of_ancient_kings);
RegisterAuraScript(spell_item_valanyr_hammer_of_ancient_kings);
RegisterAuraScript(spell_item_deadly_precision);
@@ -4411,6 +4464,7 @@ void AddSC_item_spell_scripts()
RegisterAuraScript(spell_item_crystal_spire_of_karabor);
RegisterSpellScript(spell_item_make_a_wish);
RegisterAuraScript(spell_item_mark_of_conquest);
+ RegisterSpellScript(spell_item_mercurial_shield);
RegisterSpellScript(spell_item_mingos_fortune_generator);
RegisterAuraScript(spell_item_necrotic_touch);
RegisterSpellScript(spell_item_net_o_matic);