[Feature] Additive Spell Focus from Worn slot with Limit Checks (#4208)

* [Feature] Additive Spell Focus from Worn slot with limits

New rule (UseAdditiveFocusFromWornSlotWithLimits) allows you place to focus effects in worn slots which will apply the focus additively and perform normal limit checks on those focus. This differs from regular focus behavior that only takes highest value.

This is a new version of an old rule "UseAdditiveFocusFromWornSlot"
which allowed similar behavior but ignored focus limits. Thus hindering its full potential for itemization.

* Update spell_effects.cpp

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
KayenEQ
2024-03-30 13:23:02 -04:00
committed by GitHub
parent e19f72f021
commit cd89926435
4 changed files with 54 additions and 5 deletions
+4 -1
View File
@@ -2090,7 +2090,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
if (focus)
{
if (WornType){
if (RuleB(Spells, UseAdditiveFocusFromWornSlot)) {
if (RuleB(Spells, UseAdditiveFocusFromWornSlotWithLimits)) {
new_bonus->FocusEffectsWornWithLimits[focus] = spells[spell_id].effect_id[i];
}
else if (RuleB(Spells, UseAdditiveFocusFromWornSlot)) {
new_bonus->FocusEffectsWorn[focus] += spells[spell_id].base_value[i];
}
}