*Prevent some possible crashes with charm auras.
*Allow non-dmg spells to proc dmg requiring effects if spellfamily specified in spell_proc_event table. --HG-- branch : trunk
This commit is contained in:
+11
-20
@@ -7227,6 +7227,9 @@ void AuraEffect::HandleModPossess(bool apply, bool Real, bool /*changeAmount*/)
|
||||
if(!Real)
|
||||
return;
|
||||
|
||||
if(m_target->getLevel() > m_amount)
|
||||
return;
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
if(caster && caster->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
@@ -7235,12 +7238,7 @@ void AuraEffect::HandleModPossess(bool apply, bool Real, bool /*changeAmount*/)
|
||||
}
|
||||
|
||||
if(apply)
|
||||
{
|
||||
if(m_target->getLevel() > m_amount)
|
||||
return;
|
||||
|
||||
m_target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
|
||||
}
|
||||
else
|
||||
m_target->RemoveCharmedBy(caster);
|
||||
}
|
||||
@@ -7253,14 +7251,11 @@ void AuraEffect::HandleModPossessPet(bool apply, bool Real, bool /*changeAmount*
|
||||
Unit* caster = GetCaster();
|
||||
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
if(caster->GetGuardianPet() != m_target)
|
||||
return;
|
||||
|
||||
if(apply)
|
||||
{
|
||||
if(caster->GetGuardianPet() != m_target)
|
||||
return;
|
||||
|
||||
m_target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_target->RemoveCharmedBy(caster);
|
||||
@@ -7282,13 +7277,11 @@ void AuraEffect::HandleModCharm(bool apply, bool Real, bool /*changeAmount*/)
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if(apply)
|
||||
{
|
||||
if(m_amount && int32(m_target->getLevel()) > m_amount)
|
||||
return;
|
||||
if(m_amount && int32(m_target->getLevel()) > m_amount)
|
||||
return;
|
||||
|
||||
if(apply)
|
||||
m_target->SetCharmedBy(caster, CHARM_TYPE_CHARM);
|
||||
}
|
||||
else
|
||||
m_target->RemoveCharmedBy(caster);
|
||||
}
|
||||
@@ -7298,15 +7291,13 @@ void AuraEffect::HandleCharmConvert(bool apply, bool Real, bool /*changeAmount*/
|
||||
if(!Real)
|
||||
return;
|
||||
|
||||
if(m_amount && int32(m_target->getLevel()) > m_amount)
|
||||
return;
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if(apply)
|
||||
{
|
||||
if(m_amount && int32(m_target->getLevel()) > m_amount)
|
||||
return;
|
||||
|
||||
m_target->SetCharmedBy(caster, CHARM_TYPE_CONVERT);
|
||||
}
|
||||
else
|
||||
m_target->RemoveCharmedBy(caster);
|
||||
}
|
||||
|
||||
@@ -1272,6 +1272,17 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr
|
||||
// No extra req need
|
||||
uint32 procEvent_procEx = PROC_EX_NONE;
|
||||
|
||||
// Some of not damaging spells have on damage procflags
|
||||
// And all of them are specified by spellfamilymask in proc entry
|
||||
// so, lets allow non dmg spells to proc on dmg auras if they have correct spellfamily
|
||||
if (spellProcEvent && spellProcEvent->spellFamilyMask)
|
||||
{
|
||||
if (EventProcFlag & PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT && procFlags & PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT)
|
||||
procFlags |= PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT;
|
||||
if (EventProcFlag & PROC_FLAG_SUCCESSFUL_HEALING_SPELL && procFlags & PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL)
|
||||
procFlags |= PROC_FLAG_SUCCESSFUL_HEALING_SPELL;
|
||||
}
|
||||
|
||||
// check prockFlags for condition
|
||||
if((procFlags & EventProcFlag) == 0)
|
||||
return false;
|
||||
|
||||
+1
-1
@@ -7894,7 +7894,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
|
||||
// try detect target manually if not set
|
||||
if ( target == NULL )
|
||||
target = !(procFlags & PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL | PROC_FLAG_SUCCESSFUL_HEALING_SPELL) && IsPositiveSpell(trigger_spell_id) ? this : pVictim;
|
||||
target = !(procFlags & (PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL | PROC_FLAG_SUCCESSFUL_HEALING_SPELL)) && IsPositiveSpell(trigger_spell_id) ? this : pVictim;
|
||||
|
||||
// default case
|
||||
if(!target || target!=this && !target->isAlive())
|
||||
|
||||
Reference in New Issue
Block a user