diff options
| author | Subv <subv2112@gmail.com> | 2014-07-13 16:52:38 -0500 |
|---|---|---|
| committer | Subv <subv2112@gmail.com> | 2014-07-13 16:52:38 -0500 |
| commit | dfdc19f3bc57757965d1d3b760a27622e411eb05 (patch) | |
| tree | 08025cfd4bbdef881149291e926eaf1d4676f441 /src/server/scripts/Spells | |
| parent | f14399d7887b221eb61378863c9c314adbcdebc1 (diff) | |
Merge branch `master` into `boost`
Conflicts:
BattlegroundMgr.h
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 42 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 38 |
5 files changed, 90 insertions, 12 deletions
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index e466c15d417..5f432bb8b61 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -578,11 +578,11 @@ class spell_dru_rip : public SpellScriptLoader uint8 cp = caster->ToPlayer()->GetComboPoints(); // Idol of Feral Shadows. Can't be handled as SpellMod due its dependency from CPs - if (AuraEffect const* idol = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_FERAL_SHADOWS, EFFECT_0)) - amount += cp * idol->GetAmount(); + if (AuraEffect const* auraEffIdolOfFeralShadows = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_FERAL_SHADOWS, EFFECT_0)) + amount += cp * auraEffIdolOfFeralShadows->GetAmount(); // Idol of Worship. Can't be handled as SpellMod due its dependency from CPs - else if (AuraEffect const* idol = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_WORSHIP, EFFECT_0)) - amount += cp * idol->GetAmount(); + else if (AuraEffect const* auraEffIdolOfWorship = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_WORSHIP, EFFECT_0)) + amount += cp * auraEffIdolOfWorship->GetAmount(); amount += int32(CalculatePct(caster->GetTotalAttackPowerValue(BASE_ATTACK), cp)); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 4c72d790059..a8a73310592 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -449,9 +449,9 @@ class spell_gen_bonked : public SpellScriptLoader target->CastSpell(target, SPELL_FOAM_SWORD_DEFEAT, true); target->RemoveAurasDueToSpell(SPELL_BONKED); - if (Aura const* aura = target->GetAura(SPELL_ON_GUARD)) + if (Aura const* auraOnGuard = target->GetAura(SPELL_ON_GUARD)) { - if (Item* item = target->GetItemByGuid(aura->GetCastItemGUID())) + if (Item* item = target->GetItemByGuid(auraOnGuard->GetCastItemGUID())) target->DestroyItemCount(item->GetEntry(), 1, true); } } @@ -2912,7 +2912,7 @@ class spell_gen_profession_research : public SpellScriptLoader // learn random explicit discovery recipe (if any) if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster)) - caster->learnSpell(discoveredSpellId, false); + caster->LearnSpell(discoveredSpellId, false); caster->UpdateCraftSkill(spellId); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index a17d7dce2ea..7139c9ecfba 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 @@ -1413,7 +1452,7 @@ class spell_item_book_of_glyph_mastery : public SpellScriptLoader // learn random explicit discovery recipe (if any) if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster)) - caster->learnSpell(discoveredSpellId, false); + caster->LearnSpell(discoveredSpellId, false); } void Register() override @@ -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(); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 447cb645e76..53af04c2e98 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -1211,11 +1211,11 @@ class spell_pal_sacred_shield : public SpellScriptLoader amount += int32(bonus); // Arena - Dampening - if (AuraEffect const* dampening = caster->GetAuraEffect(SPELL_GENERIC_ARENA_DAMPENING, EFFECT_0)) - AddPct(amount, dampening->GetAmount()); + if (AuraEffect const* auraEffArenaDampening = caster->GetAuraEffect(SPELL_GENERIC_ARENA_DAMPENING, EFFECT_0)) + AddPct(amount, auraEffArenaDampening->GetAmount()); // Battleground - Dampening - else if (AuraEffect const* dampening = caster->GetAuraEffect(SPELL_GENERIC_BATTLEGROUND_DAMPENING, EFFECT_0)) - AddPct(amount, dampening->GetAmount()); + else if (AuraEffect const* auraEffBattlegroudDampening = caster->GetAuraEffect(SPELL_GENERIC_BATTLEGROUND_DAMPENING, EFFECT_0)) + AddPct(amount, auraEffBattlegroudDampening->GetAmount()); } } 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(); |
