Implemented SE_HealthTransfer 509

Implemented
SE_Health_Transfer			509
'life burn'
Consume base2 % of Hit Points to Damage for base % of Hit Points

Can be used for heal
Act of Valor
This commit is contained in:
KayenEQ
2021-07-10 09:45:39 -04:00
parent d286a34fb6
commit 37758b2afa
8 changed files with 68 additions and 11 deletions
+17 -2
View File
@@ -275,11 +275,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#endif
int32 dmg = effect_value;
if (spell_id == 2751 && caster) //Manaburn
if (spell_id == SPELL_MANA_BURN && caster) //Manaburn
{
dmg = caster->GetMana()*-3;
caster->SetMana(0);
} else if (spell_id == 2755 && caster) //Lifeburn
} else if (spell_id == SPELL_LIFE_BURN && caster) //Lifeburn
{
dmg = caster->GetHP(); // just your current HP
caster->SetHP(dmg / 4); // 2003 patch notes say ~ 1/4 HP. Should this be 1/4 your current HP or do 3/4 max HP dmg? Can it kill you?
@@ -303,6 +303,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
break;
}
case SE_PercentalHeal:
{
#ifdef SPELL_EFFECT_SPAM
@@ -2860,6 +2861,19 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
}
break;
}
/*Calc for base1 is found in TryOnSpellFinished() due to needing to account for AOE functionality
since effect can potentially kill caster*/
case SE_Health_Transfer: {
effect_value = spells[spell_id].base2[i];
int32 amt = abs(caster->GetMaxHP() * effect_value / 1000);
if (effect_value < 0)
Damage(caster, amt, spell_id, spell.skill, false, buffslot, false);
else
HealDamage(amt, caster);
break;
}
case SE_PersistentEffect:
MakeAura(spell_id);
@@ -3107,6 +3121,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_Duration_HP_Pct:
case SE_Duration_Mana_Pct:
case SE_Duration_Endurance_Pct:
case SE_Endurance_Absorb_Pct_Damage:
{
break;
}