Implemented SPA Duration Pct

Implemented new spell effects
SE_Duration_HP_Pct 			524
SE_Duration_Mana_Pct			525
SE_Duration_Endurance_Pct		526

Consumes 'base1' % of your maximum health/mana/endurance every 6 seconds. 'max' is maximum amount that can be consumed per tic.

Additional Functionality
Can be used as a heal/gain % by setting the base1 value to a positive.
This commit is contained in:
KayenEQ
2021-07-09 11:33:09 -04:00
parent a8e12c82a7
commit 0d3c7f7206
3 changed files with 59 additions and 3 deletions
+53
View File
@@ -3777,6 +3777,59 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
break;
}
case SE_Duration_HP_Pct: {
effect_value = spells[buff.spellid].base[i];
int32 amt = abs(GetMaxHP() * effect_value / 100);
if (amt > spells[buff.spellid].max[i])
amt = spells[buff.spellid].max[i];
if (effect_value < 0) {
Damage(this, amt, 0, EQ::skills::SkillEvocation, false);
}
else {
HealDamage(amt);
}
break;
}
case SE_Duration_Mana_Pct: {
effect_value = spells[buff.spellid].base[i];
int32 amt = abs(GetMaxHP() * effect_value / 100);
if (amt > spells[buff.spellid].max[i])
amt = spells[buff.spellid].max[i];
if (effect_value < 0) {
SetMana(GetMana() - amt);
}
else {
SetMana(GetMana() + amt);
}
break;
}
case SE_Duration_Endurance_Pct: {
effect_value = spells[buff.spellid].base[i];
int32 amt = abs(GetMaxHP() * effect_value / 100);
if (amt > spells[buff.spellid].max[i])
amt = spells[buff.spellid].max[i];
if (IsClient())
{
if (effect_value < 0) {
CastToClient()->SetEndurance(CastToClient()->GetEndurance() - amt);
}
else {
HealDamage(amt);
CastToClient()->SetEndurance(CastToClient()->GetEndurance() + amt);
}
}
break;
}
default: {
// do we need to do anyting here?
}