mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-24 07:32:40 +00:00
[Feature] Legacy Manaburn Rule (#3872)
* [Feature] Legacy Manaburn Rule Enabling this rule allows the legacy style Manaburn and LifeBurn early 2003 and earlier. * Requested Changes * Requested Change
This commit is contained in:
parent
51dc62dfb1
commit
d9cfc3a858
@ -470,6 +470,7 @@ RULE_REAL(Spells, DefensiveProcPenaltyLevelGapModifier, 10.0f, "Defensive Proc P
|
|||||||
RULE_BOOL(Spells, DOTBonusDamageSplitOverDuration, true, "Disable to have Damage Over Time total bonus damage added to each tick instead of divided across duration")
|
RULE_BOOL(Spells, DOTBonusDamageSplitOverDuration, true, "Disable to have Damage Over Time total bonus damage added to each tick instead of divided across duration")
|
||||||
RULE_BOOL(Spells, HOTBonusHealingSplitOverDuration, true, "Disable to have Heal Over Time total bonus healing added to each tick instead of divided across duration")
|
RULE_BOOL(Spells, HOTBonusHealingSplitOverDuration, true, "Disable to have Heal Over Time total bonus healing added to each tick instead of divided across duration")
|
||||||
RULE_BOOL(Spells, UseLegacyFizzleCode, false, "Enable will turn on the legacy fizzle code which is far stricter and more accurate to 2001/2002 testing.")
|
RULE_BOOL(Spells, UseLegacyFizzleCode, false, "Enable will turn on the legacy fizzle code which is far stricter and more accurate to 2001/2002 testing.")
|
||||||
|
RULE_BOOL(Spells, LegacyManaburn, false, "Enable to have the legacy manaburn system from 2003 and earlier.")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Combat)
|
RULE_CATEGORY(Combat)
|
||||||
|
|||||||
@ -326,32 +326,44 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
|||||||
|
|
||||||
// hack fix for client health not reflecting server value
|
// hack fix for client health not reflecting server value
|
||||||
last_hp = 0;
|
last_hp = 0;
|
||||||
|
|
||||||
int64 dmg = effect_value;
|
int64 dmg = effect_value;
|
||||||
|
|
||||||
//hardcoded for manaburn and life burn
|
//hardcoded for manaburn and life burn
|
||||||
if (spell_id == SPELL_MANA_BURN || spell_id == SPELL_LIFE_BURN)
|
if (spell_id == SPELL_MANA_BURN || spell_id == SPELL_LIFE_BURN) {
|
||||||
{
|
if (RuleB(Spells, LegacyManaburn)) {
|
||||||
if (spell_id == SPELL_MANA_BURN && caster) //Manaburn
|
if (spell_id == SPELL_MANA_BURN && caster) { //Manaburn
|
||||||
{
|
int manaburn_multiplier = zone->random.Int(150, 200); //Manaburn deals 150-200% of mana
|
||||||
dmg = caster->GetMana()*-3;
|
dmg = caster->GetMana() * manaburn_multiplier / 100;
|
||||||
caster->SetMana(0);
|
dmg *= -1; //Damage should be negative
|
||||||
}
|
dmg = caster->GetActSpellDamage(spell_id, dmg, this); // Spell can crit, so need this. Damage cap handled in this function.
|
||||||
else if (spell_id == SPELL_LIFE_BURN && caster) //Lifeburn
|
LogSpellsDetail("manaburn_multiplier [{}], Mana [{}], Damage [{}]", manaburn_multiplier, caster->GetMana(), dmg);
|
||||||
{
|
caster->SetMana(0);
|
||||||
dmg = caster->GetHP(); // just your current HP
|
} else if (spell_id == SPELL_LIFE_BURN && caster) { //Lifeburn
|
||||||
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?
|
dmg = caster->GetHP() * -1;
|
||||||
dmg = -dmg;
|
caster->SetHP(1);
|
||||||
}
|
if (caster->IsClient()) {
|
||||||
|
caster->CastToClient()->SetFeigned(true);
|
||||||
|
caster->SendAppearancePacket(AppearanceType::Die, Animation::Lying);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (spell_id == SPELL_MANA_BURN && caster) { //Manaburn
|
||||||
|
dmg = caster->GetMana() * -3;
|
||||||
|
caster->SetMana(0);
|
||||||
|
} 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?
|
||||||
|
dmg = -dmg;
|
||||||
|
}
|
||||||
|
|
||||||
if (dmg < 0) {
|
if (dmg < 0) {
|
||||||
dmg = -dmg;
|
dmg = -dmg;
|
||||||
Damage(caster, dmg, spell_id, spell.skill, false, buffslot, false);
|
Damage(caster, dmg, spell_id, spell.skill, false, buffslot, false);
|
||||||
|
} else {
|
||||||
|
HealDamage(dmg, caster);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
HealDamage(dmg, caster);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
//normal effects
|
//normal effects
|
||||||
else {
|
else {
|
||||||
|
|||||||
@ -4413,6 +4413,9 @@ bool Mob::SpellOnTarget(
|
|||||||
LogSpells("Spell [{}] could not apply its effects [{}] -> [{}]\n", spell_id, GetName(), spelltar->GetName());
|
LogSpells("Spell [{}] could not apply its effects [{}] -> [{}]\n", spell_id, GetName(), spelltar->GetName());
|
||||||
if (casting_spell_aa_id) {
|
if (casting_spell_aa_id) {
|
||||||
MessageString(Chat::SpellFailure, SPELL_NO_HOLD);
|
MessageString(Chat::SpellFailure, SPELL_NO_HOLD);
|
||||||
|
if (RuleB(Spells, LegacyManaburn) && IsClient() && casting_spell_aa_id == aaManaBurn) {
|
||||||
|
StopCasting();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
safe_delete(action_packet);
|
safe_delete(action_packet);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user