*Merge. Do not forget to apply TC1 sql!

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-05-25 12:25:35 -05:00
commit 981ecfdc41
5 files changed
+36 -27

No files matched your search

+19 -13
View File
@@ -6863,19 +6863,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
basepoints0 = triggerAmount;
Item* castItem = triggeredByAura->GetParentAura()->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL;
// TODO: we need better rules here. Enrage should not overwrite death wish, but it should overwrite Wrecking Crew
// AuraMap::iterator i,next;
// for (i = m_Auras.begin(); i != m_Auras.end(); i = next)
// {
// next = i;
// ++next;
// if (!(*i).second) continue;
//if ( (*i).second->GetSpellProto()->Id == trigger_spell_id) continue;
// if (spellmgr.IsNoStackSpellDueToSpell(trigger_spell_id, (*i).second->GetSpellProto()->Id, (pVictim == this)))
// return false;
// }
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL;
// Try handle unknown trigger spells
if (sSpellStore.LookupEntry(trigger_spell_id)==NULL)
@@ -7377,6 +7365,24 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
return false;
}
// check if triggering spell can stack with current target's auras (if not - don't proc)
// don't check if
// aura is passive (talent's aura)
// trigger_spell_id's aura is already active (allow to refresh triggered auras)
// trigger_spell_id's triggeredByAura is already active (for example shaman's shields)
AuraMap::iterator i,next;
uint32 aura_id = 0;
for (i = m_Auras.begin(); i != m_Auras.end(); i = next)
{
next = i;
++next;
if (!(*i).second) continue;
aura_id = (*i).second->GetSpellProto()->Id;
if ( IsPassiveSpell(aura_id) || aura_id == trigger_spell_id || aura_id == triggeredByAura->GetSpellProto()->Id ) continue;
if (spellmgr.IsNoStackSpellDueToSpell(trigger_spell_id, (*i).second->GetSpellProto()->Id, ((*i).second->GetCasterGUID() == GetGUID())))
return false;
}
// not allow proc extra attack spell at extra attack
if( m_extraAttacks && IsSpellHaveEffect(triggerEntry, SPELL_EFFECT_ADD_EXTRA_ATTACKS) )
return false;