diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2018-02-12 18:34:22 -0300 | 
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2018-02-12 18:35:06 -0300 | 
| commit | 404240fb6820ab997b65740b234305c4c654c543 (patch) | |
| tree | 6317d3cca5c14b08134289207185e3de16517ec9 /src | |
| parent | 57553ed96a0a191d12ea30eaefffedd37fa51ca1 (diff) | |
Core/Scripts: remove Tenacity hack, implemented with proper aura
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/zone_wintergrasp.cpp | 31 | 
2 files changed, 29 insertions, 6 deletions
| diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index aa21f7d633c..af1c4f0e04b 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7904,10 +7904,6 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u      if (maxval)          AddPct(TakenTotalMod, maxval); -    // Tenacity increase healing % taken -    if (AuraEffect const* Tenacity = GetAuraEffect(58549, 0)) -        AddPct(TakenTotalMod, Tenacity->GetAmount()); -      // Nourish cast      if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->SpellFamilyFlags[1] & 0x2000000)      { diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index 045fe331275..fbbfd750aad 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -29,6 +29,7 @@  #include "ScriptedGossip.h"  #include "ScriptSystem.h"  #include "SpellAuras.h" +#include "SpellAuraEffects.h"  #include "SpellScript.h"  #include "Vehicle.h"  #include "WorldSession.h" @@ -587,14 +588,40 @@ class spell_wintergrasp_tenacity_refresh : public AuraScript  {      PrepareAuraScript(spell_wintergrasp_tenacity_refresh); -    void Refresh(AuraEffect* /*aurEff*/) +    bool Validate(SpellInfo const* spellInfo) override      { -        GetAura()->RefreshDuration(); +        uint32 triggeredSpellId = spellInfo->Effects[EFFECT_2].CalcValue(); +        return !triggeredSpellId || ValidateSpellInfo({ triggeredSpellId }); +    } + +    void Refresh(AuraEffect* aurEff) +    { +        if (uint32 triggeredSpellId = aurEff->GetAmount()) +        { +            int32 bp = 0; +            if (AuraEffect const* healEffect = GetEffect(EFFECT_0)) +                bp = healEffect->GetAmount(); + +            CastSpellExtraArgs args(aurEff); +            args +                .AddSpellMod(SPELLVALUE_BASE_POINT0, bp) +                .AddSpellMod(SPELLVALUE_BASE_POINT1, bp); +            GetTarget()->CastSpell(nullptr, triggeredSpellId, args); +        } + +        RefreshDuration(); +    } + +    void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) +    { +        if (uint32 triggeredSpellId = aurEff->GetAmount()) +            GetTarget()->RemoveAurasDueToSpell(triggeredSpellId);      }      void Register() override      {          OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_wintergrasp_tenacity_refresh::Refresh, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY); +        AfterEffectRemove += AuraEffectRemoveFn(spell_wintergrasp_tenacity_refresh::OnRemove, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);      }  }; | 
