mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Feature] New SPAs pass 1 (#1454)
* 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. * Implemented SPA Instant Mana/End pct Fixes for SPA 524-526 Implemented SE_Instant_Mana_Pct 522 SE_Instant_Endurance_Pct 523 Extracts 'base1' percent of your maximum mana/endurance, or 'max', whichever is lower. * Implemented: SPA 521 EndAbsorbPctDmg Implemented SE_Endurance_Absorb_Pct_Damage 521 Absorb Damage using Endurance: base1 % (base2 End per 1 HP) Note: Both base1 and base2 need to be divided by 100 for actually value * 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 * Implemented SPA 515,516,518,496 Implemented SE_AC_Avoidance_Max_Percent 515 SE_AC_Mitigation_Max_Percent 516 SE_Attack_Accuracy_Max_Percent 518 Above are stackable defense and offensive mods SE_Critical_Melee_Damage_Mod_Max 496 - This is a non stackable melee critical modifier * Implemented SPA 503 , 505 SE_Melee_Damage_Position_Mod 503 define SE_Damage_Taken_Position_Mod 505 SPA 503 increase/decreases melee damage by percent base1 based on your position base2 0=back 1=front SPA 504 increase/decreases melee damage taken by percent base1 based on your position base2 0=back 1=front * Implemented 467,468 Implemented SE_DS_Mitigation_Amount 467 SE_DS_Mitigation_Percentage 468 Reduce incoming DS by amt or percentage. base1 is value, if a reduction is desired it should be set to negative for both. * Fixes Formula fixes * Update spdat.h Added spa descriptions. * Fixes for PR removed debug shouts fixed description issue
This commit is contained in:
+111
-2
@@ -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
|
||||
@@ -2828,6 +2829,52 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case SE_Instant_Mana_Pct: {
|
||||
effect_value = spells[spell_id].base[i];
|
||||
int32 amt = abs(GetMaxMana() * effect_value / 10000);
|
||||
if (spells[spell_id].max[i] && amt > spells[spell_id].max[i])
|
||||
amt = spells[spell_id].max[i];
|
||||
|
||||
if (effect_value < 0) {
|
||||
SetMana(GetMana() - amt);
|
||||
}
|
||||
else {
|
||||
SetMana(GetMana() + amt);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SE_Instant_Endurance_Pct: {
|
||||
effect_value = spells[spell_id].base[i];
|
||||
if (IsClient()) {
|
||||
int32 amt = abs(CastToClient()->GetMaxEndurance() * effect_value / 10000);
|
||||
if (spells[spell_id].max[i] && amt > spells[spell_id].max[i])
|
||||
amt = spells[spell_id].max[i];
|
||||
|
||||
if (effect_value < 0) {
|
||||
CastToClient()->SetEndurance(CastToClient()->GetEndurance() - amt);
|
||||
}
|
||||
else {
|
||||
CastToClient()->SetEndurance(CastToClient()->GetEndurance() + amt);
|
||||
}
|
||||
}
|
||||
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);
|
||||
break;
|
||||
@@ -3071,6 +3118,19 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
case SE_SkillProc:
|
||||
case SE_SkillProcSuccess:
|
||||
case SE_SpellResistReduction:
|
||||
case SE_Duration_HP_Pct:
|
||||
case SE_Duration_Mana_Pct:
|
||||
case SE_Duration_Endurance_Pct:
|
||||
case SE_Endurance_Absorb_Pct_Damage:
|
||||
case SE_AC_Mitigation_Max_Percent:
|
||||
case SE_AC_Avoidance_Max_Percent:
|
||||
case SE_Attack_Accuracy_Max_Percent:
|
||||
case SE_Critical_Melee_Damage_Mod_Max:
|
||||
case SE_Melee_Damage_Position_Mod:
|
||||
case SE_Damage_Taken_Position_Mod:
|
||||
case SE_DS_Mitigation_Amount:
|
||||
case SE_DS_Mitigation_Percentage:
|
||||
case SE_Double_Backstab_Front:
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -3777,6 +3837,55 @@ 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 (spells[buff.spellid].max[i] && 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(GetMaxMana() * effect_value / 100);
|
||||
if (spells[buff.spellid].max[i] && 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];
|
||||
|
||||
if (IsClient()) {
|
||||
int32 amt = abs(CastToClient()->GetMaxEndurance() * effect_value / 100);
|
||||
if (spells[buff.spellid].max[i] && amt > spells[buff.spellid].max[i])
|
||||
amt = spells[buff.spellid].max[i];
|
||||
|
||||
if (effect_value < 0) {
|
||||
CastToClient()->SetEndurance(CastToClient()->GetEndurance() - amt);
|
||||
}
|
||||
else {
|
||||
CastToClient()->SetEndurance(CastToClient()->GetEndurance() + amt);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
// do we need to do anyting here?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user