[Rules] Add Spells:IllusionsAlwaysPersist. (#2199)

- Allows illusions to always persist beyond death or zoning.
This commit is contained in:
Kinglykrab
2022-05-27 14:39:35 -04:00
committed by GitHub
parent 5bc4cff7a9
commit 0de90dc135
3 changed files with 36 additions and 8 deletions
+12 -3
View File
@@ -2800,9 +2800,18 @@ int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caste
castlevel = caster_level_override;
int res = CalcBuffDuration_formula(castlevel, formula, duration);
if (caster == target && (target->aabonuses.IllusionPersistence || target->spellbonuses.IllusionPersistence ||
target->itembonuses.IllusionPersistence) &&
spell_id != SPELL_MINOR_ILLUSION && spell_id != SPELL_ILLUSION_TREE && IsEffectInSpell(spell_id, SE_Illusion)) {
if (
caster == target &&
(
target->aabonuses.IllusionPersistence ||
target->spellbonuses.IllusionPersistence ||
target->itembonuses.IllusionPersistence ||
RuleB(Spells, IllusionsAlwaysPersist)
) &&
spell_id != SPELL_MINOR_ILLUSION &&
spell_id != SPELL_ILLUSION_TREE &&
IsEffectInSpell(spell_id, SE_Illusion)
) {
res = 10000; // ~16h override
}