aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-13 09:46:46 -0500
committermegamage <none@none>2009-06-13 09:46:46 -0500
commit81ade11d78f91e8ffeff4ac848b5355d8179ac59 (patch)
tree806ea0ec3839d202d08dcae795306692f5b07a3d /src
parentd38da3dd05d79d59e2de614111da99feff93a29a (diff)
parent990de65ba2d9c0468767dbf83723cf2ed06fb9ee (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index d369426e1cb..a7fdab050e0 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -6731,6 +6731,42 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
CastCustomSpell(this,45470,&heal,NULL,NULL,true);
return true;
}
+ // Sudden Doom
+ if (dummySpell->SpellIconID == 1939 && GetTypeId() == TYPEID_PLAYER)
+ {
+ SpellChainNode const* chain = NULL;
+ // get highest rank of the Death Coil spell
+ const PlayerSpellMap& sp_list = ((Player*)this)->GetSpellMap();
+ for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
+ {
+ // check if shown in spell book
+ if(!itr->second->active || itr->second->disabled || itr->second->state == PLAYERSPELL_REMOVED)
+ continue;
+
+ SpellEntry const *spellProto = sSpellStore.LookupEntry(itr->first);
+ if (!spellProto)
+ continue;
+
+ if (spellProto->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT
+ && spellProto->SpellFamilyFlags[0] & 0x2000)
+ {
+ SpellChainNode const* newChain = spellmgr.GetSpellChainNode(itr->first);
+
+ // No chain entry or entry lower than found entry
+ if (!chain || !newChain || (chain->rank < newChain->rank))
+ {
+ triggered_spell_id = itr->first;
+ chain = newChain;
+ }
+ else
+ continue;
+ // Found spell is last in chain - do not need to look more
+ // Optimisation for most common case
+ if (chain && chain->last == itr->first)
+ break;
+ }
+ }
+ }
break;
}
case SPELLFAMILY_POTION: