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
+3 -3
View File
@@ -864,9 +864,9 @@ typedef enum {
//#define SE_Endurance_Absorb_Pct_Damage 521 //
//#define SE_Instant_Mana_Pct 522 //
//#define SE_Instant_Endurance_Pct 523 //
//#define SE_Duration_HP_Pct 524 //
//#define SE_Duration_Mana_Pct 525 //
//#define SE_Duration_Endurance_Pct 526 //
#define SE_Duration_HP_Pct 524 //
#define SE_Duration_Mana_Pct 525 //
#define SE_Duration_Endurance_Pct 526 //
// LAST
+3
View File
@@ -1487,6 +1487,8 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
}
break;
// to do
case SE_PetDiscipline:
break;
@@ -3250,6 +3252,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
if (new_bonus->trap_slots < effect_value)
new_bonus->trap_slots = effect_value;
break;
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
if (IsAISpellEffect) {
+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?
}