diff options
author | QAston <none@none> | 2009-06-15 01:10:09 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-06-15 01:10:09 +0200 |
commit | e81175ec11124e885d349b1dca257d0cf97bdd85 (patch) | |
tree | 7a6affc1c09b5f3693bed827e329956461368991 /src/game/Unit.cpp | |
parent | 4c2986c6b16fac13554d8eb290caa28e863c8361 (diff) |
*Fix Hungering Cold.
--HG--
branch : trunk
rename : sql/updates/3997_world_spell_proc_event.sql => sql/updates/4000_world_spell_proc_event.sql
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 944a92ae755..3b1889d03f2 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7035,6 +7035,32 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 damage, AuraEff return true; } +// Used in case when access to whole aura is needed +// All procs should be handled like this... +bool Unit::HandleAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled) +{ + SpellEntry const *dummySpell = triggeredByAura->GetSpellProto(); + + switch(dummySpell->SpellFamilyName) + { + case SPELLFAMILY_DEATHKNIGHT: + { + switch(dummySpell->Id) + { + // Hungering Cold aura drop + case 51209: + *handled = true; + // Drop only in disease case + if (procSpell && procSpell->Dispel == DISPEL_DISEASE) + return false; + return true; + } + break; + } + } + return false; +} + bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlags, uint32 procEx, uint32 cooldown) { // Get triggered aura spell info @@ -12498,8 +12524,16 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag if (GetTypeId() == TYPEID_PLAYER && i->spellProcEvent && i->spellProcEvent->cooldown) cooldown = i->spellProcEvent->cooldown; - uint32 procDebug = 0; + // This bool is needed till separate aura effect procs are still here + bool handled = false; + if (HandleAuraProc(pTarget, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) + { + sLog.outDebug("ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), Id); + takeCharges = true; + } + uint32 procDebug = 0; + if (!handled) for (uint8 effIndex = 0; effIndex<MAX_SPELL_EFFECTS;++effIndex) { if (!(i->effMask & (1<<effIndex))) |