*Implement "Chaos Bolt cannot be resisted, and pierces through all absorption effects" + some cleanup.

--HG--
branch : trunk
This commit is contained in:
maximius
2009-11-20 20:25:12 -08:00
parent 37974cc362
commit 75e37c7599
2 changed files with 25 additions and 19 deletions
+11 -5
View File
@@ -1247,8 +1247,16 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
// Calculate absorb resist
if (damage > 0)
{
switch (spellInfo->SpellIconID)
{
// Chaos Bolt - "Chaos Bolt cannot be resisted, and pierces through all absorption effects."
case 3178:
break;
default:
CalcAbsorbResist(pVictim, damageSchoolMask, SPELL_DIRECT_DAMAGE, damage, &damageInfo->absorb, &damageInfo->resist, spellInfo);
damage -= damageInfo->absorb + damageInfo->resist;
break;
}
}
else
damage = 0;
@@ -1892,10 +1900,8 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
{
if (!preventDeathSpell &&
pVictim->GetTypeId() == TYPEID_PLAYER && // Only players
!((Player*)pVictim)->HasSpellCooldown(31231) &&
// Only if no cooldown
roll_chance_i((*i)->GetAmount()))
// Only if roll
!((Player*)pVictim)->HasSpellCooldown(31231) && // Only if no cooldown
roll_chance_i((*i)->GetAmount())) // Only if roll
{
preventDeathSpell = (*i)->GetSpellProto();
}
@@ -2020,7 +2026,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
itr->source->CastCustomSpell(itr->spell, SPELLVALUE_BASE_POINT0, itr->amount, itr->target, true, NULL, itr->auraEff);
else if (itr->amount > 0)
{
uint32 damage = (uint32)itr->amount;
uint32 damage = uint32(itr->amount);
itr->source->DealDamageMods(itr->target, damage, NULL);
itr->source->DealDamage(itr->target, damage, NULL, damagetype, schoolMask, 0, false);
}