[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
2 changed files with 12 additions and 0 deletions
+11
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.
*/