*Fix dead-loop crash.

*Fix damage shield.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-16 23:15:38 +01:00
parent 0213ad8a1f
commit 94fe962982
3 changed files with 11 additions and 5 deletions
+4 -1
View File
@@ -997,9 +997,12 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
procEx = createProcExtendMask(&damageInfo, missInfo);
procVictim |= PROC_FLAG_TAKEN_ANY_DAMAGE;
// Send blocked amount to spell_proc event if proc can be only from block (Damage Shield)
uint32 ProcAmount = procEx == PROC_EX_BLOCK ? damageInfo.blocked : damageInfo.damage;
// Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo);
caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, ProcAmount, m_attackType, m_spellInfo);
caster->DealSpellDamage(&damageInfo, true);
+2 -2
View File
@@ -574,7 +574,7 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep)
case SPELL_AURA_ADD_TARGET_TRIGGER:
return true;
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
if(spellId != spellproto->EffectTriggerSpell[effIndex])
if(!deep)
{
uint32 spellTriggeredId = spellproto->EffectTriggerSpell[effIndex];
SpellEntry const *spellTriggeredProto = sSpellStore.LookupEntry(spellTriggeredId);
@@ -586,7 +586,7 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep)
{
// if non-positive trigger cast targeted to positive target this main cast is non-positive
// this will place this spell auras as debuffs
if(IsPositiveTarget(spellTriggeredProto->EffectImplicitTargetA[effIndex],spellTriggeredProto->EffectImplicitTargetB[effIndex]) && !IsPositiveEffect(spellTriggeredId,i))
if(IsPositiveTarget(spellTriggeredProto->EffectImplicitTargetA[effIndex],spellTriggeredProto->EffectImplicitTargetB[effIndex]) && !IsPositiveEffect(spellTriggeredId,i, true))
return false;
}
}
+5 -2
View File
@@ -2376,7 +2376,9 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex
CalculateMeleeDamage(pVictim, 0, &damageInfo, attType);
// Send log damage message to client
SendAttackStateUpdate(&damageInfo);
ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, damageInfo.attackType);
// Send blocked amount to spell_proc event if proc can be only from block (Damage Shield)
uint32 ProcAmount = damageInfo.procEx == PROC_EX_BLOCK ? damageInfo.blocked_amount : damageInfo.damage;
ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, ProcAmount, damageInfo.attackType);
DealMeleeDamage(&damageInfo,true);
if (GetTypeId() == TYPEID_PLAYER)
@@ -5550,7 +5552,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellIconID == 3214)
{
triggered_spell_id = 59653;
basepoints0 = GetShieldBlockValue() * triggerAmount / 100;
// % of amount blocked
basepoints0 = damage * triggerAmount / 100;
break;
}
break;