mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[8068] Fixed crash from 33201 and ranks, remove outdated rank case.
Signed-off-by: SeT <can15@ngs.ru> (cherry picked from commit e52f1f4e530a435edb156de5083e39b2ef23bbb5) Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
634fda8475
commit
d4017afadd
2 changed files with 7 additions and 5 deletions
|
|
@ -1637,6 +1637,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
|
||||||
// Reflect damage spells (not cast any damage spell in aura lookup)
|
// Reflect damage spells (not cast any damage spell in aura lookup)
|
||||||
uint32 reflectSpell = 0;
|
uint32 reflectSpell = 0;
|
||||||
int32 reflectDamage = 0;
|
int32 reflectDamage = 0;
|
||||||
|
Aura* reflectTriggeredBy = NULL; // expected as not expired at reflect as in current cases
|
||||||
// Death Prevention Aura
|
// Death Prevention Aura
|
||||||
SpellEntry const* preventDeathSpell = NULL;
|
SpellEntry const* preventDeathSpell = NULL;
|
||||||
int32 preventDeathAmount = 0;
|
int32 preventDeathAmount = 0;
|
||||||
|
|
@ -1700,6 +1701,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
|
||||||
else
|
else
|
||||||
reflectDamage = currentAbsorb / 2;
|
reflectDamage = currentAbsorb / 2;
|
||||||
reflectSpell = 33619;
|
reflectSpell = 33619;
|
||||||
|
reflectTriggeredBy = *i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (spellProto->Id == 39228 || // Argussian Compass
|
if (spellProto->Id == 39228 || // Argussian Compass
|
||||||
|
|
@ -1762,15 +1764,15 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
|
||||||
{
|
{
|
||||||
switch((*k)->GetModifier()->m_miscvalue)
|
switch((*k)->GetModifier()->m_miscvalue)
|
||||||
{
|
{
|
||||||
case 5065: // Rank 1
|
case 5065: // Rank 1
|
||||||
case 5064: // Rank 2
|
case 5064: // Rank 2
|
||||||
case 5063: // Rank 3
|
|
||||||
{
|
{
|
||||||
if(RemainingDamage >= currentAbsorb)
|
if(RemainingDamage >= currentAbsorb)
|
||||||
reflectDamage = (*k)->GetModifier()->m_amount * currentAbsorb/100;
|
reflectDamage = (*k)->GetModifier()->m_amount * currentAbsorb/100;
|
||||||
else
|
else
|
||||||
reflectDamage = (*k)->GetModifier()->m_amount * RemainingDamage/100;
|
reflectDamage = (*k)->GetModifier()->m_amount * RemainingDamage/100;
|
||||||
reflectSpell = 33619;
|
reflectSpell = 33619;
|
||||||
|
reflectTriggeredBy = *i;
|
||||||
} break;
|
} break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
@ -1871,7 +1873,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
|
||||||
|
|
||||||
// Cast back reflect damage spell
|
// Cast back reflect damage spell
|
||||||
if (reflectSpell)
|
if (reflectSpell)
|
||||||
pVictim->CastCustomSpell(this, reflectSpell, &reflectDamage, NULL, NULL, true);
|
pVictim->CastCustomSpell(this, reflectSpell, &reflectDamage, NULL, NULL, true, NULL, reflectTriggeredBy);
|
||||||
|
|
||||||
// absorb by mana cost
|
// absorb by mana cost
|
||||||
AuraList const& vManaShield = pVictim->GetAurasByType(SPELL_AURA_MANA_SHIELD);
|
AuraList const& vManaShield = pVictim->GetAurasByType(SPELL_AURA_MANA_SHIELD);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8067"
|
#define REVISION_NR "8068"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue