aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-11-16 04:06:32 -0300
committerariel- <ariel-@users.noreply.github.com>2016-11-16 04:06:32 -0300
commit56beec8aaf151e10a50a4451ba3b04cd94411e25 (patch)
tree3e4e48d8058f6364435a4cb822b616a40f11e6e3 /src/server/scripts/Spells
parentb6a8045adcbccfba4fa4a48a3dfcc2ccf1972206 (diff)
Core/Spell: Fixed irregular handling of SPELLMOD_DOT
- Applied twice for some dots - Missing for Health Leech Periodic - Missing in a few scripts Closes #17463
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp2
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp23
2 files changed, 15 insertions, 10 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index e18dc838965..31a706f0b1e 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -225,7 +225,7 @@ class spell_hun_chimera_shot : public SpellScriptLoader
// first, calculate damage of basic tick (C&P from AuraEffect::HandlePeriodicDamageAurasTick)
basePoint = (aurEff->GetAmount() + aurEff->GetBonusAmount()) * aurEff->GetDonePct();
if (Player* modOwner = caster->GetSpellModOwner())
- modOwner->ApplySpellMod<SPELLMOD_DOT>(aurEff->GetSpellInfo()->Id, basePoint);
+ modOwner->ApplySpellMod<SPELLMOD_DOT>(aurEff->GetId(), basePoint);
basePoint = unitTarget->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount());
// then, multiply to get damage potential
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 16bf769a9ae..6d59e49e333 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -1091,17 +1091,22 @@ class spell_pri_renew : public SpellScriptLoader
void HandleApplyEffect(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
- if (Unit* caster = GetCaster())
+ Unit* caster = GetCaster();
+ if (!caster)
+ return;
+
+ // Empowered Renew
+ if (AuraEffect const* empoweredRenewAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT, EFFECT_1))
{
- // Empowered Renew
- if (AuraEffect const* empoweredRenewAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT, EFFECT_1))
- {
- uint32 heal = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), GetEffect(EFFECT_0)->GetAmount(), DOT);
- heal = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT);
+ int32 heal = (aurEff->GetAmount() + aurEff->GetBonusAmount()) * aurEff->GetDonePct();
+ if (Player* modOwner = caster->GetSpellModOwner())
+ modOwner->ApplySpellMod<SPELLMOD_DOT>(GetId(), heal);
+ heal = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT);
- int32 basepoints0 = empoweredRenewAurEff->GetAmount() * GetEffect(EFFECT_0)->GetTotalTicks() * int32(heal) / 100;
- caster->CastCustomSpell(GetTarget(), SPELL_PRIEST_EMPOWERED_RENEW, &basepoints0, NULL, NULL, true, NULL, aurEff);
- }
+ heal *= GetSpellInfo()->GetMaxTicks();
+
+ int32 basepoints0 = CalculatePct(heal, empoweredRenewAurEff->GetAmount());
+ caster->CastCustomSpell(SPELL_PRIEST_EMPOWERED_RENEW, SPELLVALUE_BASE_POINT0, basepoints0, GetTarget(), true, nullptr, aurEff);
}
}