From 00af2903c3814e9743edc035a24afa30938a8e24 Mon Sep 17 00:00:00 2001 From: catapultam-habeo <97849758+catapultam-habeo@users.noreply.github.com> Date: Mon, 28 Feb 2022 12:24:16 -0800 Subject: [PATCH] Rule to apply Spell Dmg and Heal Amount stats as a percentage instead of flat value. (#2017) * Apply Spell Dmg and Heal Amt stats as a percentage increase (1 SD\HA = 1% increase to spell effectiveness) instead of a flat addition. * Corrected logic to allow for coexistence of FlatItemExtraSpellAmt rule and this. * Adjusted rule name to be less ambiguous. --- common/ruletypes.h | 1 + zone/effects.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index f113834fa..400c5f30f 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -396,6 +396,7 @@ RULE_BOOL(Spells, UseAdditiveFocusFromWornSlot, false, "Allows an additive focus RULE_BOOL(Spells, AlwaysSendTargetsBuffs, false, "Ignore Leadership Alternate Abilities level if true") RULE_BOOL(Spells, FlatItemExtraSpellAmt, false, "Allow SpellDmg stat to affect all spells, regardless of cast time/cooldown/etc") RULE_BOOL(Spells, IgnoreSpellDmgLvlRestriction, false, "Ignore the 5 level spread on applying SpellDmg") +RULE_BOOL(Spells, ItemExtraSpellAmtCalcAsPercent, false, "Apply the Item stats Spell Dmg and Heal Amount as Percentage-based modifiers instead of flat additions") RULE_BOOL(Spells, AllowItemTGB, false, "Target group buff (/tgb) doesn't work with items on live, custom servers want it though") RULE_BOOL(Spells, NPCInnateProcOverride, true, "NPC innate procs override the target type to single target") RULE_BOOL(Spells, OldRainTargets, false, "Use old incorrectly implemented maximum targets for rains") diff --git a/zone/effects.cpp b/zone/effects.cpp index 86e2422ab..41b8ecd62 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -284,8 +284,12 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) { int32 Mob::GetExtraSpellAmt(uint16 spell_id, int32 extra_spell_amt, int32 base_spell_dmg) { - if (RuleB(Spells, FlatItemExtraSpellAmt)) - return extra_spell_amt; + if (RuleB(Spells, FlatItemExtraSpellAmt)) { + if (RuleB(Spells, ItemExtraSpellAmtCalcAsPercent)) + return abs(base_spell_dmg)*extra_spell_amt/100; + else + return extra_spell_amt; + } int total_cast_time = 0; @@ -306,6 +310,9 @@ int32 Mob::GetExtraSpellAmt(uint16 spell_id, int32 extra_spell_amt, int32 base_s extra_spell_amt = abs(base_spell_dmg) / 2; } + if (RuleB(Spells, ItemExtraSpellAmtCalcAsPercent)) + return abs(base_spell_dmg)*extra_spell_amt/100; + return extra_spell_amt; }