Revision of SE_PercentHeal

Will now apply focus properly
Can now do damage if set to negative value
This commit is contained in:
KayenEQ 2014-04-12 21:15:13 -04:00
parent aedd70f5fa
commit 272bbdb4d2

View File

@ -284,20 +284,31 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
#ifdef SPELL_EFFECT_SPAM #ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Percental Heal: %+i (%d%% max)", spell.max[i], effect_value); snprintf(effect_desc, _EDLEN, "Percental Heal: %+i (%d%% max)", spell.max[i], effect_value);
#endif #endif
//im not 100% sure about this implementation. int32 val = GetMaxHP() * spell.base[i] / 100;
//the spell value forumula dosent work for these... at least spell 3232 anyways
int32 val = spell.max[i]; //This effect can also do damage by percent.
if (val < 0) {
if (-val > spell.max[i])
val = -spell.max[i];
if (caster)
val = caster->GetActSpellDamage(spell_id, val, this);
}
else
{
if (val > spell.max[i])
val = spell.max[i];
if(caster) if(caster)
val = caster->GetActSpellHealing(spell_id, val, this); val = caster->GetActSpellHealing(spell_id, val, this);
}
int32 mhp = GetMaxHP(); if (val < 0)
int32 cap = mhp * spell.base[i] / 100; Damage(caster, -val, spell_id, spell.skill, false, buffslot, false);
else
if(cap < val)
val = cap;
if(val > 0)
HealDamage(val, caster); HealDamage(val, caster);
break; break;