mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 03:12:09 +01:00
Core/Scripts: fix Tenacity Aurascript (target is null on UpdatePeriodic)
- also aura amount increases with stack so we lose spellid info, calculate it from basepoints directly - aura should be SPELL_AURA_MOD_HEALING_PCT instead of SPELL_AURA_MOD_HEALING_DONE_PERCENT (ie taken instead of done, confusing names)
This commit is contained in:
1
sql/updates/world/3.3.5/2018_02_12_03_world.sql
Normal file
1
sql/updates/world/3.3.5/2018_02_12_03_world.sql
Normal file
@@ -0,0 +1 @@
|
||||
UPDATE `spell_dbc` SET `EffectApplyAuraName1`=118 WHERE `Id`=47802;
|
||||
@@ -594,9 +594,11 @@ class spell_wintergrasp_tenacity_refresh : public AuraScript
|
||||
return !triggeredSpellId || ValidateSpellInfo({ triggeredSpellId });
|
||||
}
|
||||
|
||||
void Refresh(AuraEffect* aurEff)
|
||||
void Refresh(AuraEffect const* aurEff)
|
||||
{
|
||||
if (uint32 triggeredSpellId = aurEff->GetAmount())
|
||||
PreventDefaultAction();
|
||||
|
||||
if (uint32 triggeredSpellId = GetSpellInfo()->Effects[aurEff->GetEffIndex()].CalcValue())
|
||||
{
|
||||
int32 bp = 0;
|
||||
if (AuraEffect const* healEffect = GetEffect(EFFECT_0))
|
||||
@@ -614,13 +616,13 @@ class spell_wintergrasp_tenacity_refresh : public AuraScript
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (uint32 triggeredSpellId = aurEff->GetAmount())
|
||||
if (uint32 triggeredSpellId = GetSpellInfo()->Effects[aurEff->GetEffIndex()].CalcValue())
|
||||
GetTarget()->RemoveAurasDueToSpell(triggeredSpellId);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_wintergrasp_tenacity_refresh::Refresh, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user