diff --git a/sql/updates/3997_world_spell_proc_event.sql b/sql/updates/4000_world_spell_proc_event.sql similarity index 100% rename from sql/updates/3997_world_spell_proc_event.sql rename to sql/updates/4000_world_spell_proc_event.sql diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql index 8a0f67e593..4881152ba2 100644 --- a/sql/world_spell_full.sql +++ b/sql/world_spell_full.sql @@ -80,6 +80,7 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comm ( 50720, 59665, 0, 'Vigilance (redirect threat)'), ( 52610, 62071, 0, 'Savage Roar'), ( -52610, -62071, 0, 'Savage Roar'), +(51209, 55095, 2, 'Hungering cold - frost fever'), -- Creature ( 36574, 36650, 0, 'Apply Phase Slip Vulnerability'), @@ -1404,7 +1405,7 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell ( 55380, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Skyflare Swiftness ( 55381, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 15), -- Mana Restore ( 55440, 0x00, 11, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Healing Wave -( 55610, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Icy Talons +( 55610, 0x00, 15, 0x00000000, 0x04000000, 0x00000000, 0x00001000, 0x00000000, 0, 0, 0), -- Improved Icy Talons ( 55620, 0x00, 15, 0x00000001, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Night of the Dead (Rank 1) ( 55623, 0x00, 15, 0x00000001, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Night of the Dead (Rank 2) ( 55640, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Lightweave Embroidery diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 2f641c43c3..87be2d381c 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2280,46 +2280,56 @@ void Spell::SetTargetMap(uint32 i, uint32 cur) } else { - if(m_spellInfo->Id == 27285) // Seed of Corruption proc spell - unitList.remove(m_targets.getUnitTarget()); - else if (m_spellInfo->Id==57699) //Replenishment (special target selection) 10 targets with lowest mana + switch (m_spellInfo->Id) { - typedef std::priority_queue, PrioritizeMana> TopMana; - TopMana manaUsers; - for (std::list::iterator itr = unitList.begin() ; itr != unitList.end();++itr) + case 27285: // Seed of Corruption proc spell + unitList.remove(m_targets.getUnitTarget()); + break; + case 55789: // Improved Icy Talons + case 59725: // Improved Spell Reflection - aoe aura + unitList.remove(m_caster); + break; + case 57699: //Replenishment (special target selection) 10 targets with lowest mana { - if ((*itr)->getPowerType() == POWER_MANA) + typedef std::priority_queue, PrioritizeMana> TopMana; + TopMana manaUsers; + for (std::list::iterator itr = unitList.begin() ; itr != unitList.end();++itr) { - PrioritizeManaWraper WTarget(*itr); - manaUsers.push(WTarget); + if ((*itr)->getPowerType() == POWER_MANA) + { + PrioritizeManaWraper WTarget(*itr); + manaUsers.push(WTarget); + } } - } - unitList.clear(); - while(!manaUsers.empty() && unitList.size()<10) + unitList.clear(); + while(!manaUsers.empty() && unitList.size()<10) + { + unitList.push_back(manaUsers.top().getUnit()); + manaUsers.pop(); + } + break; + } + case 52759: // Ancestral Awakening { - unitList.push_back(manaUsers.top().getUnit()); - manaUsers.pop(); + typedef std::priority_queue, PrioritizeHealth> TopHealth; + TopHealth healedMembers; + for (std::list::iterator itr = unitList.begin() ; itr != unitList.end();++itr) + { + PrioritizeHealthWraper WTarget(*itr); + healedMembers.push(WTarget); + } + + unitList.clear(); + while(!healedMembers.empty() && unitList.size()<1) + { + unitList.push_back(healedMembers.top().getUnit()); + healedMembers.pop(); + } + break; } } - else if (m_spellInfo->Id==52759)// Ancestral Awakening - { - typedef std::priority_queue, PrioritizeHealth> TopHealth; - TopHealth healedMembers; - for (std::list::iterator itr = unitList.begin() ; itr != unitList.end();++itr) - { - PrioritizeHealthWraper WTarget(*itr); - healedMembers.push(WTarget); - } - - unitList.clear(); - while(!healedMembers.empty() && unitList.size()<1) - { - unitList.push_back(healedMembers.top().getUnit()); - healedMembers.pop(); - } - } - else if (m_spellInfo->EffectImplicitTargetA[i] == TARGET_DEST_TARGET_ANY + if (m_spellInfo->EffectImplicitTargetA[i] == TARGET_DEST_TARGET_ANY && m_spellInfo->EffectImplicitTargetB[i] == TARGET_UNIT_AREA_ALLY_DST)// Wild Growth, Circle of Healing, Glyph of holy light target special selection { typedef std::priority_queue, PrioritizeHealth> TopHealth; diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 14f7033cfc..cc9dcfb14e 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -3351,10 +3351,8 @@ void SpellMgr::LoadSpellCustomAttr() // Target entry seems to be wrong for this spell :/ spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_PARTY_CASTER; spellInfo->EffectRadiusIndex[0] = 45; - //mSpellCustomAttr[i] |= SPELL_ATTR_CU_EXCLUDE_SELF; - //break; + break; case 27820: // Mana Detonation - case 55789: // Improved Icy Talons //case 28062: case 39090: // Positive/Negative Charge //case 28085: case 39093: mSpellCustomAttr[i] |= SPELL_ATTR_CU_EXCLUDE_SELF; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 944a92ae75..3b1889d03f 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; effIndexeffMask & (1<