[Spells] Update SPA 238 SE_IllusionPersistence allow illusions to persist through deaths at higher AA ranks. (#1884)

* start

* working
This commit is contained in:
KayenEQ
2021-12-13 18:49:33 -05:00
committed by GitHub
parent 91c958ae63
commit 7cf66a2daa
5 changed files with 22 additions and 9 deletions
+5 -3
View File
@@ -2929,9 +2929,10 @@ int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caste
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))
target->itembonuses.IllusionPersistence) &&
spell_id != SPELL_MINOR_ILLUSION && spell_id != SPELL_ILLUSION_TREE && IsEffectInSpell(spell_id, SE_Illusion)) {
res = 10000; // ~16h override
}
res = mod_buff_duration(res, caster, target, spell_id);
@@ -4373,7 +4374,8 @@ void Mob::BuffFadeNonPersistDeath()
auto current_spell_id = buffs[buff_slot].spellid;
if (
IsValidSpell(current_spell_id) &&
!IsPersistDeathSpell(current_spell_id)
!IsPersistDeathSpell(current_spell_id) &&
!HasPersistDeathIllusion(current_spell_id)
) {
BuffFadeBySlot(buff_slot, false);
recalc_bonus = true;