[8068] Fixed crash from 33201 and ranks, remove outdated rank case. Author: SeT.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-06-23 14:25:08 +02:00
parent 09a4fdc1c7
commit cc986dbdf3

View File

@@ -1903,6 +1903,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
// Reflect damage spells (not cast any damage spell in aura lookup)
uint32 reflectSpell = 0;
int32 reflectDamage = 0;
AuraEffect* reflectTriggeredBy = NULL; // expected as not expired at reflect as in current cases
uint32 healSpell = 0;
int32 healAmount = 0;
Unit * healCaster = NULL;
@@ -1968,6 +1969,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
else
reflectDamage = currentAbsorb / 2;
reflectSpell = 33619;
reflectTriggeredBy = *i;
break;
}
if (spellProto->Id == 39228 || // Argussian Compass
@@ -2037,13 +2039,13 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
{
case 5065: // Rank 1
case 5064: // Rank 2
case 5063: // Rank 3
{
if(RemainingDamage >= currentAbsorb)
reflectDamage = (*k)->GetAmount() * currentAbsorb/100;
else
reflectDamage = (*k)->GetAmount() * RemainingDamage/100;
reflectSpell = 33619;
reflectTriggeredBy = *i;
} break;
}
}
@@ -2146,7 +2148,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
// Cast back reflect damage spell
if (reflectSpell)
pVictim->CastCustomSpell(this, reflectSpell, &reflectDamage, NULL, NULL, true);
pVictim->CastCustomSpell(this, reflectSpell, &reflectDamage, NULL, NULL, true, NULL, reflectTriggeredBy);
// absorb by mana cost
AuraEffectList const& vManaShield = pVictim->GetAurasByType(SPELL_AURA_MANA_SHIELD);