[10669] Fixed mana amount for overheal case for talent 31785 and ranks.

Also thanks to Wojta for patch code improvements.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Ceris 2010-11-01 07:51:39 +03:00 committed by VladimirMangos
parent 97ff7e6006
commit ee1b18cd20
2 changed files with 9 additions and 3 deletions

View file

@ -1873,8 +1873,14 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
if (this == pVictim)
return SPELL_AURA_PROC_FAILED;
// heal amount
basepoints[0] = triggerAmount*damage/100;
// dont count overhealing
uint32 diff = GetMaxHealth()-GetHealth();
if (!diff)
return SPELL_AURA_PROC_FAILED;
if (damage > diff)
basepoints[0] = triggerAmount*diff/100;
else
basepoints[0] = triggerAmount*damage/100;
target = this;
triggered_spell_id = 31786;
break;