diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Pet.cpp | 1 | ||||
-rw-r--r-- | src/game/Spell.cpp | 12 | ||||
-rw-r--r-- | src/game/Spell.h | 1 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 3 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 2 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 6 |
6 files changed, 16 insertions, 9 deletions
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 86f0ec58db5..d1345b7079d 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -571,7 +571,6 @@ void Pet::Update(uint32 diff) default: break; } - uint32 guidlow = GetGUIDLow(); Creature::Update(diff); } diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 0095933a01d..33f4d05ea0e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -380,6 +380,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi m_glyphIndex = 0; m_preCastSpell = 0; m_triggeredByAuraSpell = NULL; + m_spellAura = NULL; //Auto Shot & Shoot (wand) m_autoRepeat = IsAutoRepeatRangedSpell(m_spellInfo); @@ -938,6 +939,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) uint32 procAttacker = m_procAttacker; uint32 procVictim = m_procVictim; uint32 procEx = PROC_EX_NONE; + m_spellAura = NULL; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied if (missInfo==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target DoSpellHitOnUnit(unit, mask); @@ -981,6 +983,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) if (m_canTrigger && missInfo != SPELL_MISS_REFLECT) caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo); + if (m_spellAura) + m_spellAura->SetProcDamage(addhealth); + int32 gain = unitTarget->ModifyHealth( int32(addhealth) ); unitTarget->getHostilRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo); @@ -1007,6 +1012,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) if (m_canTrigger && missInfo != SPELL_MISS_REFLECT) caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo); + if (m_spellAura) + m_spellAura->SetProcDamage(damageInfo.damage); + caster->DealSpellDamage(&damageInfo, true); // Judgement of Blood @@ -1186,7 +1194,9 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags[1] & 0x000020)) m_caster->CastSpell(unit, 41637, true, NULL, NULL, m_originalCasterGUID); } - unit->AddAura(Aur); + // Set aura only when successfully applied + if (unit->AddAura(Aur)) + m_spellAura = Aur; } t_effmask = effectMask& ~t_effmask; for(uint32 effectNumber=0;effectNumber<3;effectNumber++) diff --git a/src/game/Spell.h b/src/game/Spell.h index 45a3a123bae..5a85590fe78 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -517,6 +517,7 @@ class Spell Item* itemTarget; GameObject* gameObjTarget; int32 damage; + Aura * m_spellAura; // only used in DoAllEffectOnTarget // this is set in Spell Hit, but used in Apply Aura handler DiminishingLevels m_diminishLevel; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 975e1310c1c..fb7d2c83f1c 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2434,8 +2434,9 @@ void AuraEffect::HandleAuraDummy(bool apply, bool Real) // Haunt if(m_spellProto->SpellFamilyFlags[1] & 0x40000) { + int32 bp0 = GetParentAura()->GetProcDamage() * m_amount / 100; if(caster) - caster->CastCustomSpell(caster, 48210, &m_currentBasePoints, 0, 0, true); + caster->CastCustomSpell(caster, 48210, &bp0, 0, 0, true, NULL, this); return; } break; diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index fb8120a01e6..eacd7f9e20b 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -74,6 +74,8 @@ class TRINITY_DLL_SPEC Aura uint8 GetAuraCharges() const { return m_procCharges; } void SetAuraCharges(uint8 charges); bool DropAuraCharge(); + void SetProcDamage(uint32 val) { m_procDamage = val; } + uint32 GetProcDamage() const { return m_procDamage; } int8 GetStackAmount() const {return m_stackAmount;} void SetStackAmount(uint8 num); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 021fd24fd71..fee53a2aafe 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -448,12 +448,6 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE, m_spellInfo, m_caster)) damage += int32(damage*0.25f); } - // Haunt - else if (m_spellInfo->SpellFamilyFlags[1] & 0x40000) - { - m_currentBasePoints[1] = int32(damage * m_currentBasePoints[1] / 100); - } - // Conflagrate - consumes immolate if (m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE) { |