From 31640406b57cb9380ad4d5f7010727a2b2f36ba1 Mon Sep 17 00:00:00 2001 From: Astellar Date: Sat, 21 Nov 2009 11:18:55 +0300 Subject: [PATCH] [8854] Implement heal back part of spell 48181. Signed-off-by: VladimirMangos I choice maybe less clear way store future heal amount, but with avoid use additional fields for auras. --- src/game/Spell.cpp | 7 +++++++ src/game/SpellAuras.cpp | 20 ++++++++++++++++++-- src/shared/revision_nr.h | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index be4e65aab49..a71d2592455 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -992,6 +992,13 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) if (m_canTrigger && missInfo != SPELL_MISS_REFLECT) caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo); + // Haunt (NOTE: for avoid use additional field damage stored in dummy value (replace unused 100%) + // apply before deal damage because aura can be removed at target kill + if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellIconID == 3172 && + (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0004000000000000))) + if(Aura* dummy = unitTarget->GetDummyAura(m_spellInfo->Id)) + dummy->GetModifier()->m_amount = damageInfo.damage; + caster->DealSpellDamage(&damageInfo, true); } // Passive spell hits/misses or active spells only misses (only triggers) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 3065fcd18dd..2ef6b4a983a 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2488,6 +2488,22 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } case SPELLFAMILY_MAGE: break; + case SPELLFAMILY_WARLOCK: + { + // Haunt + if (GetSpellProto()->SpellIconID == 3172 && (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0004000000000000))) + { + // NOTE: for avoid use additional field damage stored in dummy value (replace unused 100% + if (apply) + m_modifier.m_amount = 0; // use value as damage counter instead redundent 100% percent + else + { + int32 bp0 = m_modifier.m_amount; + caster->CastCustomSpell(caster,48210,&bp0,NULL,NULL,true); + } + } + break; + } case SPELLFAMILY_PRIEST: { // Pain and Suffering @@ -2510,8 +2526,6 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } break; } - case SPELLFAMILY_PALADIN: - break; case SPELLFAMILY_DRUID: { switch(GetId()) @@ -2642,6 +2656,8 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } case SPELLFAMILY_HUNTER: break; + case SPELLFAMILY_PALADIN: + break; case SPELLFAMILY_SHAMAN: { // Improved Weapon Totems diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 7eb5e59e172..04d6d321037 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8853" + #define REVISION_NR "8854" #endif // __REVISION_NR_H__