*Implement "Chaos Bolt cannot be resisted, and pierces through all absorption effects" + some cleanup.
--HG-- branch : trunk
This commit is contained in:
+11
-5
@@ -1247,8 +1247,16 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
|
|||||||
// Calculate absorb resist
|
// Calculate absorb resist
|
||||||
if (damage > 0)
|
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);
|
CalcAbsorbResist(pVictim, damageSchoolMask, SPELL_DIRECT_DAMAGE, damage, &damageInfo->absorb, &damageInfo->resist, spellInfo);
|
||||||
damage -= damageInfo->absorb + damageInfo->resist;
|
damage -= damageInfo->absorb + damageInfo->resist;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
damage = 0;
|
damage = 0;
|
||||||
@@ -1892,10 +1900,8 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
|
|||||||
{
|
{
|
||||||
if (!preventDeathSpell &&
|
if (!preventDeathSpell &&
|
||||||
pVictim->GetTypeId() == TYPEID_PLAYER && // Only players
|
pVictim->GetTypeId() == TYPEID_PLAYER && // Only players
|
||||||
!((Player*)pVictim)->HasSpellCooldown(31231) &&
|
!((Player*)pVictim)->HasSpellCooldown(31231) && // Only if no cooldown
|
||||||
// Only if no cooldown
|
roll_chance_i((*i)->GetAmount())) // Only if roll
|
||||||
roll_chance_i((*i)->GetAmount()))
|
|
||||||
// Only if roll
|
|
||||||
{
|
{
|
||||||
preventDeathSpell = (*i)->GetSpellProto();
|
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);
|
itr->source->CastCustomSpell(itr->spell, SPELLVALUE_BASE_POINT0, itr->amount, itr->target, true, NULL, itr->auraEff);
|
||||||
else if (itr->amount > 0)
|
else if (itr->amount > 0)
|
||||||
{
|
{
|
||||||
uint32 damage = (uint32)itr->amount;
|
uint32 damage = uint32(itr->amount);
|
||||||
itr->source->DealDamageMods(itr->target, damage, NULL);
|
itr->source->DealDamageMods(itr->target, damage, NULL);
|
||||||
itr->source->DealDamage(itr->target, damage, NULL, damagetype, schoolMask, 0, false);
|
itr->source->DealDamage(itr->target, damage, NULL, damagetype, schoolMask, 0, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user