mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-23 08:28:21 +00:00
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:
+3
-3
@@ -864,9 +864,9 @@ typedef enum {
|
|||||||
//#define SE_Endurance_Absorb_Pct_Damage 521 //
|
//#define SE_Endurance_Absorb_Pct_Damage 521 //
|
||||||
//#define SE_Instant_Mana_Pct 522 //
|
//#define SE_Instant_Mana_Pct 522 //
|
||||||
//#define SE_Instant_Endurance_Pct 523 //
|
//#define SE_Instant_Endurance_Pct 523 //
|
||||||
//#define SE_Duration_HP_Pct 524 //
|
#define SE_Duration_HP_Pct 524 //
|
||||||
//#define SE_Duration_Mana_Pct 525 //
|
#define SE_Duration_Mana_Pct 525 //
|
||||||
//#define SE_Duration_Endurance_Pct 526 //
|
#define SE_Duration_Endurance_Pct 526 //
|
||||||
|
|
||||||
|
|
||||||
// LAST
|
// LAST
|
||||||
|
|||||||
@@ -1487,6 +1487,8 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// to do
|
// to do
|
||||||
case SE_PetDiscipline:
|
case SE_PetDiscipline:
|
||||||
break;
|
break;
|
||||||
@@ -3250,6 +3252,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
if (new_bonus->trap_slots < effect_value)
|
if (new_bonus->trap_slots < effect_value)
|
||||||
new_bonus->trap_slots = effect_value;
|
new_bonus->trap_slots = effect_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
|
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
|
||||||
if (IsAISpellEffect) {
|
if (IsAISpellEffect) {
|
||||||
|
|||||||
@@ -3777,6 +3777,59 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
|
|||||||
break;
|
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: {
|
default: {
|
||||||
// do we need to do anyting here?
|
// do we need to do anyting here?
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user