diff options
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 104 | 
3 files changed, 106 insertions, 2 deletions
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index 5a0560293da..03427a4cfc2 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -124,9 +124,9 @@ class boss_rotface : public CreatureScript              void JustDied(Unit* /*killer*/)              { +                instance->DoRemoveAurasDueToSpellOnPlayers(MUTATED_INFECTION);                  _JustDied();                  Talk(SAY_DEATH); -                instance->DoRemoveAurasDueToSpellOnPlayers(MUTATED_INFECTION);                  if (Creature* professor = Unit::GetCreature(*me, instance->GetData64(DATA_PROFESSOR_PUTRICIDE)))                      professor->AI()->DoAction(ACTION_ROTFACE_DEATH);              } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index a2ee6c1c3a3..e445f68cfba 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -574,7 +574,7 @@ class spell_hun_misdirection : public SpellScriptLoader              void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)              {                  if (Unit* caster = GetCaster()) -                    if (!GetDuration()) +                    if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT)                          caster->SetReducedThreatPercent(0, 0);              } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 557cef24ee6..3570c9e8d75 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -24,6 +24,7 @@  #include "ScriptMgr.h"  #include "SpellScript.h"  #include "SpellAuraEffects.h" +#include "Group.h"  enum PaladinSpells @@ -47,6 +48,9 @@ enum PaladinSpells      SPELL_FORBEARANCE                            = 25771,      SPELL_AVENGING_WRATH_MARKER                  = 61987,      SPELL_IMMUNE_SHIELD_MARKER                   = 61988, + +    SPELL_HAND_OF_SACRIFICE                      = 6940, +    SPELL_DIVINE_SACRIFICE                       = 64205,  };  // 31850 - Ardent Defender @@ -566,6 +570,104 @@ class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader          }  }; +class spell_pal_hand_of_sacrifice : public SpellScriptLoader +{ +    public: +        spell_pal_hand_of_sacrifice() : SpellScriptLoader("spell_pal_hand_of_sacrifice") { } + +        class spell_pal_hand_of_sacrifice_AuraScript : public AuraScript +        { +            PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript); + +            int32 remainingAmount; + +            bool Load() +            { +                if (Unit* caster = GetCaster()) +                { +                    remainingAmount = caster->GetMaxHealth(); +                    return true; +                } +                return false; +            } + +            void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) +            { +                remainingAmount -= splitAmount; + +                if (remainingAmount <= 0) +                { +                    GetTarget()->RemoveAura(SPELL_HAND_OF_SACRIFICE); +                } +            } + +            void Register() +            { +                OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice_AuraScript::Split, EFFECT_0); +            } +        }; + +        AuraScript* GetAuraScript() const +        { +            return new spell_pal_hand_of_sacrifice_AuraScript(); +        } +}; + +class spell_pal_divine_sacrifice : public SpellScriptLoader +{ +    public: +        spell_pal_divine_sacrifice() : SpellScriptLoader("spell_pal_divine_sacrifice") { } + +        class spell_pal_divine_sacrifice_AuraScript : public AuraScript +        { +            PrepareAuraScript(spell_pal_divine_sacrifice_AuraScript); + +            uint32 groupSize, minHpPct; +            int32 remainingAmount; + +            bool Load() +            { +                 +                if (Unit* caster = GetCaster()) +                { +                    if (caster->GetTypeId() == TYPEID_PLAYER) +                    { +                        if (caster->ToPlayer()->GetGroup()) +                            groupSize = caster->ToPlayer()->GetGroup()->GetMembersCount(); +                        else +                            groupSize = 1; +                    } +                    else +                        return false; + +                    remainingAmount = (caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster)) * groupSize); +                    minHpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster); +                    return true; +                } +                return false; +            } + +            void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) +            { +                remainingAmount -= splitAmount; +                // break when absorbed everything it could, or if the casters hp drops below 20% +                if (Unit* caster = GetCaster()) +                    if (remainingAmount <= 0 || (caster->GetHealthPct() < minHpPct)) +                        caster->RemoveAura(SPELL_DIVINE_SACRIFICE); +            } + +            void Register() +            { +                OnEffectSplit += AuraEffectSplitFn(spell_pal_divine_sacrifice_AuraScript::Split, EFFECT_0); +            } +        }; + +        AuraScript* GetAuraScript() const +        { +            return new spell_pal_divine_sacrifice_AuraScript(); +        } +}; +  void AddSC_paladin_spell_scripts()  {      //new spell_pal_ardent_defender(); @@ -579,4 +681,6 @@ void AddSC_paladin_spell_scripts()      new spell_pal_lay_on_hands();      new spell_pal_righteous_defense();      new spell_pal_exorcism_and_holy_wrath_damage(); +    new spell_pal_hand_of_sacrifice(); +    new spell_pal_divine_sacrifice();  }  | 
