Core/Spells: Fixed resist calculations for spells with multiple schools. Thx to Shauren for tips

Closes #3875
This commit is contained in:
tobmaps
2011-11-12 04:40:44 +07:00
parent c5e316164f
commit 3569f01adc
4 changed files with 17 additions and 5 deletions

View File

@@ -971,7 +971,7 @@ class spell_sindragosa_s_fury : public SpellScriptLoader
if (!GetHitUnit()->isAlive() || !_targetCount)
return;
float resistance = float(GetHitUnit()->GetResistance(GetFirstSchoolInMask(SpellSchoolMask(GetSpellInfo()->SchoolMask))));
float resistance = float(GetHitUnit()->GetResistance(SpellSchoolMask(GetSpellInfo()->SchoolMask)));
uint32 minResistFactor = uint32((resistance / (resistance + 510.0f))* 10.0f) * 2;
uint32 randomResist = urand(0, (9 - minResistFactor) * 100)/100 + minResistFactor;