*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)
|
if(!Real)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if(m_target->getLevel() > m_amount)
|
||||||
|
return;
|
||||||
|
|
||||||
Unit* caster = GetCaster();
|
Unit* caster = GetCaster();
|
||||||
if(caster && caster->GetTypeId() == TYPEID_UNIT)
|
if(caster && caster->GetTypeId() == TYPEID_UNIT)
|
||||||
{
|
{
|
||||||
@@ -7235,12 +7238,7 @@ void AuraEffect::HandleModPossess(bool apply, bool Real, bool /*changeAmount*/)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(apply)
|
if(apply)
|
||||||
{
|
|
||||||
if(m_target->getLevel() > m_amount)
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
|
m_target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
m_target->RemoveCharmedBy(caster);
|
m_target->RemoveCharmedBy(caster);
|
||||||
}
|
}
|
||||||
@@ -7253,14 +7251,11 @@ void AuraEffect::HandleModPossessPet(bool apply, bool Real, bool /*changeAmount*
|
|||||||
Unit* caster = GetCaster();
|
Unit* caster = GetCaster();
|
||||||
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
|
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
|
||||||
return;
|
return;
|
||||||
|
if(caster->GetGuardianPet() != m_target)
|
||||||
|
return;
|
||||||
|
|
||||||
if(apply)
|
if(apply)
|
||||||
{
|
|
||||||
if(caster->GetGuardianPet() != m_target)
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
|
m_target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_target->RemoveCharmedBy(caster);
|
m_target->RemoveCharmedBy(caster);
|
||||||
@@ -7282,13 +7277,11 @@ void AuraEffect::HandleModCharm(bool apply, bool Real, bool /*changeAmount*/)
|
|||||||
|
|
||||||
Unit* caster = GetCaster();
|
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);
|
m_target->SetCharmedBy(caster, CHARM_TYPE_CHARM);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
m_target->RemoveCharmedBy(caster);
|
m_target->RemoveCharmedBy(caster);
|
||||||
}
|
}
|
||||||
@@ -7298,15 +7291,13 @@ void AuraEffect::HandleCharmConvert(bool apply, bool Real, bool /*changeAmount*/
|
|||||||
if(!Real)
|
if(!Real)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if(m_amount && int32(m_target->getLevel()) > m_amount)
|
||||||
|
return;
|
||||||
|
|
||||||
Unit* caster = GetCaster();
|
Unit* caster = GetCaster();
|
||||||
|
|
||||||
if(apply)
|
if(apply)
|
||||||
{
|
|
||||||
if(m_amount && int32(m_target->getLevel()) > m_amount)
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_target->SetCharmedBy(caster, CHARM_TYPE_CONVERT);
|
m_target->SetCharmedBy(caster, CHARM_TYPE_CONVERT);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
m_target->RemoveCharmedBy(caster);
|
m_target->RemoveCharmedBy(caster);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1272,6 +1272,17 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr
|
|||||||
// No extra req need
|
// No extra req need
|
||||||
uint32 procEvent_procEx = PROC_EX_NONE;
|
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
|
// check prockFlags for condition
|
||||||
if((procFlags & EventProcFlag) == 0)
|
if((procFlags & EventProcFlag) == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+1
-1
@@ -7894,7 +7894,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
|||||||
|
|
||||||
// try detect target manually if not set
|
// try detect target manually if not set
|
||||||
if ( target == NULL )
|
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
|
// default case
|
||||||
if(!target || target!=this && !target->isAlive())
|
if(!target || target!=this && !target->isAlive())
|
||||||
|
|||||||
Reference in New Issue
Block a user