[Feature] Add a rule for spells to bypass stacking rules (#4716)

* define rule that allows for spells which always stack

* Update spells.cpp

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
catapultam-habeo 2025-02-28 14:49:20 -08:00 committed by GitHub
parent 805757ba87
commit 1598d2e17b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -529,6 +529,7 @@ RULE_INT(Spells, TargetedAOEMaxTargets, 4, "Max number of targets a Targeted AOE
RULE_INT(Spells, PointBlankAOEMaxTargets, 0, "Max number of targets a Point-Blank AOE spell can cast on. Set to 0 for no limit.")
RULE_INT(Spells, DefaultAOEMaxTargets, 0, "Max number of targets that an AOE spell which does not meet other descriptions can cast on. Set to 0 for no limit.")
RULE_BOOL(Spells, AllowFocusOnSkillDamageSpells, false, "Allow focus effects 185, 459, and 482 to enhance SkillAttack spell effect 193")
RULE_STRING(Spells, AlwaysStackSpells, "", "Comma-Seperated list of spell IDs to always stack with every other spell, except themselves.")
RULE_CATEGORY_END()
RULE_CATEGORY(Combat)

View File

@ -3135,6 +3135,17 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2,
}
}
const std::string& always_stack_spells = RuleS(Spells, AlwaysStackSpells);
if (spellid1 != spellid2 && !always_stack_spells.empty()) {
const auto& v = Strings::Split(always_stack_spells, ",");
if (Strings::Contains(v, std::to_string(spellid1))) {
return 0;
}
if (Strings::Contains(v, std::to_string(spellid2))) {
return 0;
}
}
/*
One of these is a bard song and one isn't and they're both beneficial so they should stack.
*/