diff options
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 172 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_priest.cpp | 11 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 14 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 2 | 
4 files changed, 105 insertions, 94 deletions
| diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index c7b6d326ce3..478473bf89e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -73,6 +73,46 @@ class spell_item_trigger_spell : public SpellScriptLoader          }  }; +enum AegisOfPreservation +{ +    SPELL_AEGIS_HEAL   = 23781 +}; + +// 23780 - Aegis of Preservation +class spell_item_aegis_of_preservation : public SpellScriptLoader +{ +    public: +        spell_item_aegis_of_preservation() : SpellScriptLoader("spell_item_aegis_of_preservation") { } + +        class spell_item_aegis_of_preservation_AuraScript : public AuraScript +        { +            PrepareAuraScript(spell_item_aegis_of_preservation_AuraScript); + +            bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE +            { +                if (!sSpellMgr->GetSpellInfo(SPELL_AEGIS_HEAL)) +                    return false; +                return true; +            } + +            void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) +            { +                PreventDefaultAction(); +                GetTarget()->CastSpell(GetTarget(), SPELL_AEGIS_HEAL, true, NULL, aurEff); +            } + +            void Register() OVERRIDE +            { +                OnEffectProc += AuraEffectProcFn(spell_item_aegis_of_preservation_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); +            } +        }; + +        AuraScript* GetAuraScript() const OVERRIDE +        { +            return new spell_item_aegis_of_preservation_AuraScript(); +        } +}; +  // 26400 - Arcane Shroud  class spell_item_arcane_shroud : public SpellScriptLoader  { @@ -217,6 +257,46 @@ class spell_item_defibrillate : public SpellScriptLoader          uint32 _failSpell;  }; +enum DesperateDefense +{ +    SPELL_DESPERATE_RAGE    = 33898 +}; + +// 33896 - Desperate Defense +class spell_item_desperate_defense : public SpellScriptLoader +{ +    public: +        spell_item_desperate_defense() : SpellScriptLoader("spell_item_desperate_defense") { } + +        class spell_item_desperate_defense_AuraScript : public AuraScript +        { +            PrepareAuraScript(spell_item_desperate_defense_AuraScript); + +            bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE +            { +                if (!sSpellMgr->GetSpellInfo(SPELL_DESPERATE_RAGE)) +                    return false; +                return true; +            } + +            void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) +            { +                PreventDefaultAction(); +                GetTarget()->CastSpell(GetTarget(), SPELL_DESPERATE_RAGE, true, NULL, aurEff); +            } + +            void Register() OVERRIDE +            { +                OnEffectProc += AuraEffectProcFn(spell_item_desperate_defense_AuraScript::HandleProc, EFFECT_2, SPELL_AURA_PROC_TRIGGER_SPELL); +            } +        }; + +        AuraScript* GetAuraScript() const OVERRIDE +        { +            return new spell_item_desperate_defense_AuraScript(); +        } +}; +  // http://www.wowhead.com/item=6522 Deviate Fish  // 8063 Deviate Fish  enum DeviateFishSpells @@ -523,15 +603,21 @@ class spell_item_necrotic_touch : public SpellScriptLoader                  return true;              } +            bool CheckProc(ProcEventInfo& eventInfo) +            { +                return eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->IsAlive(); +            } +              void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)              {                  PreventDefaultAction();                  int32 bp = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); -                GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff); +                GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, NULL, aurEff);              }              void Register() OVERRIDE              { +                DoCheckProc += AuraCheckProcFn(spell_item_necrotic_touch_AuraScript::CheckProc);                  OnEffectProc += AuraEffectProcFn(spell_item_necrotic_touch_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);              }          }; @@ -2421,86 +2507,6 @@ public:      }  }; -enum AegisOfPreservation -{ -    SPELL_AEGIS_HEAL   = 23781 -}; - -// 23780 - Blazing Speed -class spell_item_aegis_of_preservation : public SpellScriptLoader -{ -    public: -        spell_item_aegis_of_preservation() : SpellScriptLoader("spell_item_aegis_of_preservation") { } - -        class spell_item_aegis_of_preservation_AuraScript : public AuraScript -        { -            PrepareAuraScript(spell_item_aegis_of_preservation_AuraScript); - -            bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE -            { -                if (!sSpellMgr->GetSpellInfo(SPELL_AEGIS_HEAL)) -                    return false; -                return true; -            } - -            void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) -            { -                PreventDefaultAction(); -                GetTarget()->CastSpell(GetTarget(), SPELL_AEGIS_HEAL, true, NULL, aurEff); -            } - -            void Register() OVERRIDE -            { -                OnEffectProc += AuraEffectProcFn(spell_item_aegis_of_preservation_AuraScript::OnProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); -            } -        }; - -        AuraScript* GetAuraScript() const OVERRIDE -        { -            return new spell_item_aegis_of_preservation_AuraScript(); -        } -}; - -enum DesperateDefense -{ -    SPELL_DESPERATE_RAGE    = 33898 -}; - -// 33896 - Desperate Defense -class spell_item_desperate_defense : public SpellScriptLoader -{ -    public: -        spell_item_desperate_defense() : SpellScriptLoader("spell_item_desperate_defense") { } - -        class spell_item_desperate_defense_AuraScript : public AuraScript -        { -            PrepareAuraScript(spell_item_desperate_defense_AuraScript); - -            bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE -            { -                if (!sSpellMgr->GetSpellInfo(SPELL_DESPERATE_RAGE)) -                    return false; -                return true; -            } - -            void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) -            { -                PreventDefaultAction(); -                GetTarget()->CastSpell(GetTarget(), SPELL_DESPERATE_RAGE, true, NULL, aurEff); -            } - -            void Register() OVERRIDE -            { -                OnEffectProc += AuraEffectProcFn(spell_item_desperate_defense_AuraScript::OnProc, EFFECT_2, SPELL_AURA_PROC_TRIGGER_SPELL); -            } -        }; - -        AuraScript* GetAuraScript() const OVERRIDE -        { -            return new spell_item_desperate_defense_AuraScript(); -        } -}; -  void AddSC_item_spell_scripts()  {      // 23074 Arcanite Dragonling @@ -2512,11 +2518,13 @@ void AddSC_item_spell_scripts()      // 23075 Mithril Mechanical Dragonling      new spell_item_trigger_spell("spell_item_mithril_mechanical_dragonling", SPELL_MITHRIL_MECHANICAL_DRAGONLING); +    new spell_item_aegis_of_preservation();      new spell_item_arcane_shroud();      new spell_item_blessing_of_ancient_kings();      new spell_item_defibrillate("spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL);      new spell_item_defibrillate("spell_item_goblin_jumper_cables_xl", 50, SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL);      new spell_item_defibrillate("spell_item_gnomish_army_knife", 33); +    new spell_item_desperate_defense();      new spell_item_deviate_fish();      new spell_item_flask_of_the_north();      new spell_item_gnomish_death_ray(); @@ -2564,6 +2572,4 @@ void AddSC_item_spell_scripts()      new spell_item_chicken_cover();      new spell_item_muisek_vessel();      new spell_item_greatmothers_soulcatcher(); -    new spell_item_aegis_of_preservation(); -    new spell_item_desperate_defense();  } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 3d754275c20..4d85f1ed818 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -769,12 +769,11 @@ class spell_pri_power_word_shield : public SpellScriptLoader                  if (dmgInfo.GetAttacker() == target)                      return; -                if (Unit* caster = GetCaster()) -                    if (AuraEffect* talentAurEff = caster->GetAuraEffectOfRankedSpell(SPELL_PRIEST_REFLECTIVE_SHIELD_R1, EFFECT_0)) -                    { -                        int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); -                        target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); -                    } +                if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_PRIEST_REFLECTIVE_SHIELD_R1, EFFECT_0)) +                { +                    int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); +                    target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); +                }              }              void Register() OVERRIDE diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 3b67fca94cf..af652192d59 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -279,17 +279,22 @@ class spell_sha_earth_shield : public SpellScriptLoader                  }              } -            void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) +            bool CheckProc(ProcEventInfo& /*eventInfo*/)              { -                PreventDefaultAction(); -                  //! HACK due to currenct proc system implementation                  if (Player* player = GetTarget()->ToPlayer())                      if (player->HasSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL)) -                        return; +                        return false; +                return true; +            } + +            void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) +            { +                PreventDefaultAction();                  GetTarget()->CastCustomSpell(SPELL_SHAMAN_EARTH_SHIELD_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff, GetCasterGUID()); +                /// @hack: due to currenct proc system implementation                  if (Player* player = GetTarget()->ToPlayer())                      player->AddSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL, 0, time(NULL) + 3);              } @@ -297,6 +302,7 @@ class spell_sha_earth_shield : public SpellScriptLoader              void Register() OVERRIDE              {                  DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_earth_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_DUMMY); +                DoCheckProc += AuraCheckProcFn(spell_sha_earth_shield_AuraScript::CheckProc);                  OnEffectProc += AuraEffectProcFn(spell_sha_earth_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);              }          }; diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 6485b4da7fd..af136235fd6 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -70,7 +70,7 @@ enum MiscSpells  enum WarriorSpellIcons  { -    WARRIOR_ICON_ID_SUDDEN_DEATH                    = 1989, +    WARRIOR_ICON_ID_SUDDEN_DEATH                    = 1989  };  /// Updated 4.3.4 | 
