diff --git a/common/ruletypes.h b/common/ruletypes.h index 9b944b2ec..ae0f0a272 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -382,6 +382,8 @@ RULE_BOOL(Spells, AllowDoubleInvis, false, "Allows you to cast invisibility spel RULE_BOOL(Spells, AllowSpellMemorizeFromItem, false, "Allows players to memorize spells by right-clicking spell scrolls") RULE_BOOL(Spells, InvisRequiresGroup, false, "Invis requires the the target to be in group.") RULE_INT(Spells, ClericInnateHealFocus, 5, "Clerics on live get a 5 pct innate heal focus") +RULE_BOOL(Spells, DOTsScaleWithSpellDmg, false, "Allow SpellDmg stat to affect DoT spells") +RULE_BOOL(Spells, HOTsScaleWithHealAmt, false, "Allow HealAmt stat to affect HoT spells") RULE_CATEGORY_END() RULE_CATEGORY(Combat) diff --git a/zone/effects.cpp b/zone/effects.cpp index 67efa4fe1..849038ab1 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -196,7 +196,7 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) { if (target == nullptr) return value; - + if (IsNPC()) { value += value * CastToNPC()->GetSpellFocusDMG() / 100; } @@ -226,9 +226,18 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) { GetFocusEffect(focusFcDamageAmt, spell_id) + GetFocusEffect(focusFcDamageAmt2, spell_id) + GetFocusEffect(focusFcAmplifyAmt, spell_id); + + if (RuleB(Spells, DOTsScaleWithSpellDmg)) { + if (RuleB(Spells, IgnoreSpellDmgLvlRestriction) && !spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg) { + extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value)*ratio/100; + } + else if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) { + extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value)*ratio/100; + } + } if (extra_dmg) { - int duration = CalcBuffDuration(this, this, spell_id); + int duration = CalcBuffDuration(this, target, spell_id); if (duration > 0) extra_dmg /= duration; } @@ -248,9 +257,18 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) { GetFocusEffect(focusFcDamageAmt, spell_id) + GetFocusEffect(focusFcDamageAmt2, spell_id) + GetFocusEffect(focusFcAmplifyAmt, spell_id); + + if (RuleB(Spells, DOTsScaleWithSpellDmg)) { + if (RuleB(Spells, IgnoreSpellDmgLvlRestriction) && !spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg) { + extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value); + } + else if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) { + extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value); + } + } if (extra_dmg) { - int duration = CalcBuffDuration(this, this, spell_id); + int duration = CalcBuffDuration(this, target, spell_id); if (duration > 0) extra_dmg /= duration; } @@ -383,6 +401,25 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { //Heal over time spells. [Heal Rate and Additional Healing effects do not increase this value] else { + //Using IgnoreSpellDmgLvlRestriction to also allow healing to scale + int32 extra_heal = 0; + if (RuleB(Spells, HOTsScaleWithHealAmt)) { + if (RuleB(Spells, IgnoreSpellDmgLvlRestriction) && !spells[spell_id].no_heal_damage_item_mod && itembonuses.HealAmt) { + extra_heal += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, base_value); + } + else if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.HealAmt && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) { + extra_heal += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, base_value); + } + } + + if (extra_heal) { + int duration = CalcBuffDuration(this, target, spell_id); + if (duration > 0) { + extra_heal /= duration; + value += extra_heal; + } + } + if (critical_chance && zone->random.Roll(critical_chance)) value *= critical_modifier; }