diff options
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 46 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 57 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 159 | 
3 files changed, 171 insertions, 91 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 017013e46f8..263b2d9d66d 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -4459,6 +4459,17 @@ void SpellMgr::LoadSpellInfoCorrections()      });      // ENDOF ISLE OF CONQUEST SPELLS +    // Aura of Fear +    ApplySpellFix({ 40453 }, [](SpellInfo* spellInfo) +    { +        // Bad DBC data? Copying 25820 here due to spell description +        // either is a periodic with chance on tick, or a proc + +        spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PROC_TRIGGER_SPELL; +        spellInfo->Effects[EFFECT_0].Amplitude = 0; +        spellInfo->ProcChance = 10; +    }); +      ApplySpellFix({          41485, // Deadly Poison - Black Temple          41487  // Envenom - Black Temple @@ -4477,11 +4488,13 @@ void SpellMgr::LoadSpellInfoCorrections()          5707,  // Lifestone Regeneration          5760,  // Mind-numbing Poison          6727,  // Poison Mushroom +        6940,  // Hand of Sacrifice (handled remove in split hook)          6984,  // Frost Shot (Rank 2)          7164,  // Defensive Stance          7288,  // Immolate Cumulative (TEST) (Rank 1)          7291,  // Food (TEST)          7331,  // Healing Aura (TEST) (Rank 1) +        7366,  // Berserker Stance          7824,  // Blacksmithing Skill +10          12551, // Frost Shot          13218, // Wound Poison (Rank 1) @@ -4491,6 +4504,7 @@ void SpellMgr::LoadSpellInfoCorrections()          14795, // Venomhide Poison          16610, // Razorhide          18099, // Chill Nova +        18499, // Berserker Rage (extra rage implemented in Unit::RewardRage)          18802, // Frost Shot          20000, // Alexander's Test Periodic Aura          21163, // Polished Armor (Rank 1) @@ -4500,6 +4514,7 @@ void SpellMgr::LoadSpellInfoCorrections()          23335, // Silverwing Flag          25160, // Sand Storm          27189, // Wound Poison V (Rank 5) +        28313, // Aura of Fear          28726, // Nightmare Seed          28754, // Fury of the Ashbringer          30802, // Unleashed Rage (Rank 1) @@ -4509,6 +4524,7 @@ void SpellMgr::LoadSpellInfoCorrections()          32447, // Travel Form          33370, // Spell Haste          33807, // Abacus of Violent Odds +        33891, // Tree of Life (Shapeshift)          34132, // Gladiator's Totem of the Third Wind          34135, // Libram of Justice          34666, // Tamed Pet Passive 08 (DND) @@ -4517,6 +4533,7 @@ void SpellMgr::LoadSpellInfoCorrections()          34889, // Fire Breath (Rank 1)          34976, // Netherstorm Flag          35131, // Bladestorm +        35244, // Choking Vines          35323, // Fire Breath (Rank 2)          35336, // Energizing Spores          36148, // Chill Nova @@ -4533,6 +4550,8 @@ void SpellMgr::LoadSpellInfoCorrections()          40396, // Fel Infusion          40603, // Taunt Gurtogg          40803, // Ron's Test Buff +        40879, // Prismatic Shield (no longer used since patch 2.2/adaptive prismatic shield) +        41341, // Balance of Power (implemented by hooking absorb)          41435, // The Twin Blades of Azzinoth          42369, // Merciless Libram of Justice          42371, // Merciless Gladiator's Totem of the Third Wind @@ -4541,16 +4560,29 @@ void SpellMgr::LoadSpellInfoCorrections()          43729, // Vengeful Gladiator's Totem of the Third Wind          43817, // Focused Assault          44305, // You're a ...! (Effects2) +        44586, // Prayer of Mending (unknown, unused aura type)          45384, // Birmingham Tools Test 4          45433, // Birmingham Tools Test 5          46093, // Brutal Libram of Justice          46099, // Brutal Gladiator's Totem of the Third Wind          46705, // Honorless Target +        49145, // Spell Deflection (Rank 1) (implemented by hooking absorb)          49883, // Flames          50365, // Improved Blood Presence (Rank 1)          50371, // Improved Blood Presence (Rank 2) +        50462, // Anti-Magic Zone (implemented by hooking absorb) + +        50498, // Savage Rend (Rank 1) - proc from Savage Rend moved from attack itself to autolearn aura 50871 +        53578, // Savage Rend (Rank 2) +        53579, // Savage Rend (Rank 3) +        53580, // Savage Rend (Rank 4) +        53581, // Savage Rend (Rank 5) +        53582, // Savage Rend (Rank 6) +          50655, // Frost Cut          50995, // Empowered Blood Presence (Rank 1) +        51809, // First Aid +        53032, // Flurry of Claws          55482, // Fire Breath (Rank 3)          55483, // Fire Breath (Rank 4)          55484, // Fire Breath (Rank 5) @@ -4561,12 +4593,26 @@ void SpellMgr::LoadSpellInfoCorrections()          60302, // Meteorite Whetstone          60437, // Grim Toll          60492, // Embrace of the Spider +        62142, // Improved Chains of Ice (Rank 3)          63024, // Gravity Bomb +        64205, // Divine Sacrifice (handled remove in split hook)          64772, // Comet's Trail          65004, // Alacrity of the Elements          65019, // Mjolnir Runestone          65024, // Implosion + +        66334, // Mistress' Kiss - currently not used in script, need implement? +        67905, // Mistress' Kiss +        67906, // Mistress' Kiss +        67907, // Mistress' Kiss +          71003, // Vegard's Touch + +        72151, // Frenzied Bloodthirst - currently not used in script, need implement? +        72648, // Frenzied Bloodthirst +        72649, // Frenzied Bloodthirst +        72650, // Frenzied Bloodthirst +          72559, // Birmingham Tools Test 3          72560, // Birmingham Tools Test 3          72561, // Birmingham Tools Test 5 diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 9cf3e6bdadf..67fc8576bd4 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -321,6 +321,31 @@ class spell_gen_aura_of_anger : public AuraScript      }  }; +// 28313 - Aura of Fear +class spell_gen_aura_of_fear : public AuraScript +{ +    PrepareAuraScript(spell_gen_aura_of_fear); + +    bool Validate(SpellInfo const* spellInfo) override +    { +        return ValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell }); +    } + +    void PeriodicTick(AuraEffect const* aurEff) +    { +        PreventDefaultAction(); +        if (!roll_chance_i(GetSpellInfo()->ProcChance)) +            return; + +        GetTarget()->CastSpell(nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true); +    } + +    void Register() override +    { +        OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_aura_of_fear::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); +    } +}; +  enum ServiceUniform  {      // Spells @@ -795,6 +820,36 @@ class spell_gen_chaos_blast : public SpellScript      }  }; +enum ChokingVines +{ +    SPELL_CHOKING_WOUND = 35247 +}; + +// 35244 - Choking Vines +class spell_gen_choking_vines : public AuraScript +{ +    PrepareAuraScript(spell_gen_choking_vines); + +    bool Validate(SpellInfo const* /*spellInfo*/) override +    { +        return ValidateSpellInfo({ SPELL_CHOKING_WOUND }); +    } + +    void HandleChoke(AuraEffect const* /*aurEff*/) +    { +        if (GetStackAmount() != GetSpellInfo()->StackAmount) +            return; + +        GetTarget()->CastSpell(nullptr, SPELL_CHOKING_WOUND, true); +        Remove(); +    } + +    void Register() override +    { +        OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_choking_vines::HandleChoke, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE); +    } +}; +  class spell_gen_clone : public SpellScript  {      PrepareSpellScript(spell_gen_clone); @@ -3745,6 +3800,7 @@ void AddSC_generic_spell_scripts()      RegisterAuraScript(spell_gen_animal_blood);      RegisterAuraScript(spell_gen_arena_drink);      RegisterAuraScript(spell_gen_aura_of_anger); +    RegisterAuraScript(spell_gen_aura_of_fear);      RegisterAuraScript(spell_gen_aura_service_uniform);      RegisterAuraScript(spell_gen_av_drekthar_presence);      RegisterSpellScript(spell_gen_bandage); @@ -3758,6 +3814,7 @@ void AddSC_generic_spell_scripts()      RegisterSpellScript(spell_gen_cannibalize);      RegisterAuraScript(spell_gen_chains_of_ice);      RegisterSpellScript(spell_gen_chaos_blast); +    RegisterAuraScript(spell_gen_choking_vines);      RegisterSpellScript(spell_gen_clone);      RegisterSpellScript(spell_gen_clone_weapon);      RegisterAuraScript(spell_gen_clone_weapon_aura); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 29398c5dc35..811778eacc5 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -63,9 +63,6 @@ enum PaladinSpells      SPELL_PALADIN_AVENGING_WRATH_MARKER          = 61987,      SPELL_PALADIN_IMMUNE_SHIELD_MARKER           = 61988, -    SPELL_PALADIN_HAND_OF_SACRIFICE              = 6940, -    SPELL_PALADIN_DIVINE_SACRIFICE               = 64205, -      SPELL_PALADIN_ITEM_HEALING_TRANCE            = 37706,      SPELL_PALADIN_JUDGEMENT_DAMAGE               = 54158, @@ -510,58 +507,55 @@ class spell_pal_divine_purpose : public SpellScriptLoader  };  // 64205 - Divine Sacrifice -class spell_pal_divine_sacrifice : public SpellScriptLoader +class spell_pal_divine_sacrifice : public AuraScript  { -    public: -        spell_pal_divine_sacrifice() : SpellScriptLoader("spell_pal_divine_sacrifice") { } +    PrepareAuraScript(spell_pal_divine_sacrifice); -        class spell_pal_divine_sacrifice_AuraScript : public AuraScript -        { -            PrepareAuraScript(spell_pal_divine_sacrifice_AuraScript); +    uint32 groupSize = 0, minHpPct = 0; +    uint32 remainingAmount = 0; -            uint32 groupSize, minHpPct; -            int32 remainingAmount; - -            bool Load() override -            { -                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) +    bool Load() override +    { +        if (Unit* caster = GetCaster()) +        { +            if (caster->GetTypeId() == TYPEID_PLAYER)              { -                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_PALADIN_DIVINE_SACRIFICE); +                if (caster->ToPlayer()->GetGroup()) +                    groupSize = caster->ToPlayer()->GetGroup()->GetMembersCount(); +                else +                    groupSize = 1;              } +            else +                return false; -            void Register() override -            { -                OnEffectSplit += AuraEffectSplitFn(spell_pal_divine_sacrifice_AuraScript::Split, EFFECT_0); -            } -        }; +            remainingAmount = (caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster)) * groupSize); +            minHpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster); +            return true; +        } +        return false; +    } -        AuraScript* GetAuraScript() const override -        { -            return new spell_pal_divine_sacrifice_AuraScript(); +    void Split(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& splitAmount) +    { +        // break when splitted everything it could, or if the casters hp drops below 20% +        if (remainingAmount >= splitAmount) +            remainingAmount -= splitAmount; +        else +        { +            splitAmount = remainingAmount; +            Remove(); +            return;          } + +        if (Unit* caster = GetCaster()) +            if (caster->HealthBelowPct(minHpPct)) +                Remove(); +    } + +    void Register() override +    { +        OnEffectSplit += AuraEffectSplitFn(spell_pal_divine_sacrifice::Split, EFFECT_0); +    }  };  // 53385 - Divine Storm @@ -876,54 +870,37 @@ class spell_pal_guarded_by_the_light : public SpellScriptLoader  };  // 6940 - Hand of Sacrifice -class spell_pal_hand_of_sacrifice : public SpellScriptLoader +class spell_pal_hand_of_sacrifice : public AuraScript  { -    public: -        spell_pal_hand_of_sacrifice() : SpellScriptLoader("spell_pal_hand_of_sacrifice") { } +    PrepareAuraScript(spell_pal_hand_of_sacrifice); -        class spell_pal_hand_of_sacrifice_AuraScript : public AuraScript -        { -            PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript); - -        public: -            spell_pal_hand_of_sacrifice_AuraScript() -            { -                remainingAmount = 0; -            } - -        private: -            int32 remainingAmount; - -            bool Load() override -            { -                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_PALADIN_HAND_OF_SACRIFICE); -                } -            } +    uint32 remainingAmount = 0; -            void Register() override -            { -                OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice_AuraScript::Split, EFFECT_0); -            } -        }; +    bool Load() override +    { +        if (Unit* caster = GetCaster()) +        { +            remainingAmount = caster->GetMaxHealth(); +            return true; +        } +        return false; +    } -        AuraScript* GetAuraScript() const override +    void Split(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& splitAmount) +    { +        if (remainingAmount >= splitAmount) +            remainingAmount -= splitAmount; +        else          { -            return new spell_pal_hand_of_sacrifice_AuraScript(); +            splitAmount = remainingAmount; +            Remove();          } +    } + +    void Register() override +    { +        OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice::Split, EFFECT_0); +    }  };  // 1038 - Hand of Salvation @@ -2397,7 +2374,7 @@ void AddSC_paladin_spell_scripts()      new spell_pal_blessing_of_faith();      new spell_pal_blessing_of_sanctuary();      new spell_pal_divine_purpose(); -    new spell_pal_divine_sacrifice(); +    RegisterAuraScript(spell_pal_divine_sacrifice);      new spell_pal_divine_storm();      new spell_pal_divine_storm_dummy();      new spell_pal_exorcism_and_holy_wrath_damage(); @@ -2406,7 +2383,7 @@ void AddSC_paladin_spell_scripts()      new spell_pal_glyph_of_holy_light();      new spell_pal_glyph_of_holy_light_dummy();      new spell_pal_guarded_by_the_light(); -    new spell_pal_hand_of_sacrifice(); +    RegisterAuraScript(spell_pal_hand_of_sacrifice);      new spell_pal_hand_of_salvation();      new spell_pal_heart_of_the_crusader();      new spell_pal_holy_shock();  | 
