From f64add02e8d65f3f75f4bd35918a7a13ff35fbe8 Mon Sep 17 00:00:00 2001 From: untaught Date: Mon, 7 Jul 2014 16:27:09 +0200 Subject: Core/Spells: fixed Fate Rune of Unsurpassed Vigor --- src/server/scripts/Spells/spell_item.cpp | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index a17d7dce2ea..30f9e914037 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -383,6 +383,45 @@ class spell_item_echoes_of_light : public SpellScriptLoader } }; +// 7434 - Fate Rune of Unsurpassed Vigor +enum FateRuneOfUnsurpassedVigor +{ + SPELL_UNSURPASSED_VIGOR = 25733 +}; + +class spell_item_fate_rune_of_unsurpassed_vigor : public SpellScriptLoader +{ + public: + spell_item_fate_rune_of_unsurpassed_vigor() : SpellScriptLoader("spell_item_fate_rune_of_unsurpassed_vigor") { } + + class spell_item_fate_rune_of_unsurpassed_vigor_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_fate_rune_of_unsurpassed_vigor_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_UNSURPASSED_VIGOR)) + return false; + return true; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + GetTarget()->CastSpell(GetTarget(), SPELL_UNSURPASSED_VIGOR, true); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_fate_rune_of_unsurpassed_vigor_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_fate_rune_of_unsurpassed_vigor_AuraScript(); + } +}; + // http://www.wowhead.com/item=47499 Flask of the North // 67019 Flask of the North enum FlaskOfTheNorthSpells @@ -2607,6 +2646,7 @@ void AddSC_item_spell_scripts() new spell_item_desperate_defense(); new spell_item_deviate_fish(); new spell_item_echoes_of_light(); + new spell_item_fate_rune_of_unsurpassed_vigor(); new spell_item_flask_of_the_north(); new spell_item_gnomish_death_ray(); new spell_item_make_a_wish(); -- cgit v1.2.3 From ba2563da5a7451274de40357b1476d847fe8e69f Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 7 Jul 2014 21:50:18 +0200 Subject: Core/Spells: Convert "Shaman T10 Elemental 2P Bonus" in spell script --- .../world/2014_07_07_03_world_spell_misc.sql | 7 ++++ src/server/game/Entities/Unit/Unit.cpp | 25 -------------- src/server/scripts/Spells/spell_shaman.cpp | 38 ++++++++++++++++++++++ 3 files changed, 45 insertions(+), 25 deletions(-) create mode 100644 sql/updates/world/2014_07_07_03_world_spell_misc.sql (limited to 'src/server/scripts/Spells') diff --git a/sql/updates/world/2014_07_07_03_world_spell_misc.sql b/sql/updates/world/2014_07_07_03_world_spell_misc.sql new file mode 100644 index 00000000000..8e200267797 --- /dev/null +++ b/sql/updates/world/2014_07_07_03_world_spell_misc.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=70811; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(70811,'spell_sha_item_t10_elemental_2p_bonus'); + +DELETE FROM `spell_proc_event` WHERE `entry`=70811; +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(70811, 0, 11, 3, 0, 0, 0, 0, 0, 0, 0); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 72c1a071487..902d99d888b 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6889,31 +6889,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } - // Item - Shaman T10 Elemental 2P Bonus - case 70811: - { - // Lightning Bolt & Chain Lightning - if (procSpell->SpellFamilyFlags[0] & 0x3) - { - if (ToPlayer()->HasSpellCooldown(16166)) - { - uint32 newCooldownDelay = ToPlayer()->GetSpellCooldownDelay(16166); - if (newCooldownDelay < 3) - newCooldownDelay = 0; - else - newCooldownDelay -= 2; - ToPlayer()->AddSpellCooldown(16166, 0, uint32(time(NULL) + newCooldownDelay)); - - WorldPacket data(SMSG_MODIFY_COOLDOWN, 4+8+4); - data << uint32(16166); // Spell ID - data << uint64(GetGUID()); // Player GUID - data << int32(-2000); // Cooldown mod in milliseconds - ToPlayer()->GetSession()->SendPacket(&data); - return true; - } - } - return false; - } // Item - Shaman T10 Elemental 4P Bonus case 70817: { diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 61ff79c505e..a1c2d0e1d1c 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -34,6 +34,7 @@ enum ShamanSpells SPELL_SHAMAN_BIND_SIGHT = 6277, SPELL_SHAMAN_CLEANSING_TOTEM_EFFECT = 52025, SPELL_SHAMAN_EARTH_SHIELD_HEAL = 379, + SPELL_SHAMAN_ELEMENTAL_MASTERY = 16166, SPELL_SHAMAN_EXHAUSTION = 57723, SPELL_SHAMAN_FIRE_NOVA_R1 = 1535, SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1 = 8349, @@ -767,6 +768,42 @@ class spell_sha_item_mana_surge : public SpellScriptLoader } }; +// 70811 - Item - Shaman T10 Elemental 2P Bonus +class spell_sha_item_t10_elemental_2p_bonus : public SpellScriptLoader +{ + public: + spell_sha_item_t10_elemental_2p_bonus() : SpellScriptLoader("spell_sha_item_t10_elemental_2p_bonus") { } + + class spell_sha_item_t10_elemental_2p_bonus_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_item_t10_elemental_2p_bonus_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ELEMENTAL_MASTERY)) + return false; + return true; + } + + void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + if (Player* target = GetTarget()->ToPlayer()) + target->ModifySpellCooldown(SPELL_SHAMAN_ELEMENTAL_MASTERY, -aurEff->GetAmount()); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_sha_item_t10_elemental_2p_bonus_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_sha_item_t10_elemental_2p_bonus_AuraScript(); + } +}; + // 60103 - Lava Lash class spell_sha_lava_lash : public SpellScriptLoader { @@ -989,6 +1026,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_item_lightning_shield(); new spell_sha_item_lightning_shield_trigger(); new spell_sha_item_mana_surge(); + new spell_sha_item_t10_elemental_2p_bonus(); new spell_sha_lava_lash(); new spell_sha_mana_spring_totem(); new spell_sha_mana_tide_totem(); -- cgit v1.2.3