diff --git a/common/spdat.h b/common/spdat.h index 837f10f78..42e2d0d4c 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -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 diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index e6c99f154..0c25c5b92 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -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) { diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 4fdb926b4..0229afddc 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -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? }