aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-09-05 15:58:30 +0200
committerShauren <shauren.trinity@gmail.com>2021-09-05 15:58:30 +0200
commit7e09deea3a6784c7abd44cb2893ae19dbf95f9f1 (patch)
tree4c81f8c55bcb4aac06fc57942b3a07c6933f2c5b
parentc07b9188dfc6f76bd909eea7cb8f5a8263b0e83e (diff)
Scripts/Spells: Fixed mage ice block to not heal without aura 320913
-rw-r--r--sql/updates/world/master/2021_09_05_04_world_mage_ice_block.sql3
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp36
2 files changed, 37 insertions, 2 deletions
diff --git a/sql/updates/world/master/2021_09_05_04_world_mage_ice_block.sql b/sql/updates/world/master/2021_09_05_04_world_mage_ice_block.sql
new file mode 100644
index 00000000000..58603627674
--- /dev/null
+++ b/sql/updates/world/master/2021_09_05_04_world_mage_ice_block.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_mage_ice_block';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(45438,'spell_mage_ice_block');
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index 0a1c5614853..aa94a1b95a7 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -49,6 +49,7 @@ enum MageSpells
SPELL_MAGE_CONJURE_REFRESHMENT = 116136,
SPELL_MAGE_CONJURE_REFRESHMENT_TABLE = 167145,
SPELL_MAGE_DRAGONHAWK_FORM = 32818,
+ SPELL_MAGE_EVERWARM_SOCKS = 320913,
SPELL_MAGE_FINGERS_OF_FROST = 44544,
SPELL_MAGE_FROST_NOVA = 122,
SPELL_MAGE_GIRAFFE_FORM = 32816,
@@ -550,6 +551,36 @@ class spell_mage_ice_barrier : public AuraScript
}
};
+// 45438 - Ice Block
+class spell_mage_ice_block : public SpellScript
+{
+ PrepareSpellScript(spell_mage_ice_block);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ SPELL_MAGE_EVERWARM_SOCKS });
+ }
+
+ void PreventStunWithEverwarmSocks(WorldObject*& target)
+ {
+ if (GetCaster()->HasAura(SPELL_MAGE_EVERWARM_SOCKS))
+ target = nullptr;
+ }
+
+ void PreventEverwarmSocks(WorldObject*& target)
+ {
+ if (!GetCaster()->HasAura(SPELL_MAGE_EVERWARM_SOCKS))
+ target = nullptr;
+ }
+
+ void Register() override
+ {
+ OnObjectTargetSelect += SpellObjectTargetSelectFn(spell_mage_ice_block::PreventStunWithEverwarmSocks, EFFECT_0, TARGET_UNIT_CASTER);
+ OnObjectTargetSelect += SpellObjectTargetSelectFn(spell_mage_ice_block::PreventEverwarmSocks, EFFECT_5, TARGET_UNIT_CASTER);
+ OnObjectTargetSelect += SpellObjectTargetSelectFn(spell_mage_ice_block::PreventEverwarmSocks, EFFECT_6, TARGET_UNIT_CASTER);
+ }
+};
+
// Ice Lance - 30455
class spell_mage_ice_lance : public SpellScript
{
@@ -836,7 +867,7 @@ class spell_mage_ring_of_frost : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_RING_OF_FROST_SUMMON, SPELL_MAGE_RING_OF_FROST_FREEZE })
- && !sSpellMgr->AssertSpellInfo(SPELL_MAGE_RING_OF_FROST_SUMMON, GetCastDifficulty())->GetEffects().empty();
+ && !sSpellMgr->AssertSpellInfo(SPELL_MAGE_RING_OF_FROST_SUMMON, DIFFICULTY_NONE)->GetEffects().empty();
}
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
@@ -893,7 +924,7 @@ class spell_mage_ring_of_frost_freeze : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_RING_OF_FROST_SUMMON, SPELL_MAGE_RING_OF_FROST_FREEZE })
- && !sSpellMgr->AssertSpellInfo(SPELL_MAGE_RING_OF_FROST_SUMMON, GetCastDifficulty())->GetEffects().empty();
+ && !sSpellMgr->AssertSpellInfo(SPELL_MAGE_RING_OF_FROST_SUMMON, DIFFICULTY_NONE)->GetEffects().empty();
}
void FilterTargets(std::list<WorldObject*>& targets)
@@ -1082,6 +1113,7 @@ void AddSC_mage_spell_scripts()
RegisterSpellScript(spell_mage_conjure_refreshment);
RegisterAuraScript(spell_mage_fingers_of_frost);
RegisterAuraScript(spell_mage_ice_barrier);
+ RegisterSpellScript(spell_mage_ice_block);
RegisterSpellScript(spell_mage_ice_lance);
RegisterSpellScript(spell_mage_ice_lance_damage);
RegisterAuraScript(spell_mage_ignite);