fix: Fixes buffs don't start/stop properly. Streamlines constructor and Add/Remove buffs. (#2082)

This commit is contained in:
mark1145 2025-01-25 13:20:23 +11:00 • committed by GitHub
parent c8f13b2933
commit d5160bd6db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 651 additions and 616 deletions

View file

@ -1,5 +1,6 @@
using System.Collections.Generic;
using ModernUO.CodeGeneratedEvents;
using Server.Engines.BuffIcons;
using Server.Mobiles;
namespace Server.Spells.Fifth
@ -70,7 +71,7 @@ namespace Server.Spells.Fifth
Caster.RemoveResistanceMod(mods[i]);
}
BuffInfo.RemoveBuff(Caster, BuffIcon.MagicReflection);
(Caster as PlayerMobile)?.RemoveBuff(BuffIcon.MagicReflection);
}
else
{
@ -98,7 +99,9 @@ namespace Server.Spells.Fifth
var buffFormat = $"{physiMod}\t+{otherMod}\t+{otherMod}\t+{otherMod}\t+{otherMod}";
BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.MagicReflection, 1075817, buffFormat, true));
(Caster as PlayerMobile)?.AddBuff(
new BuffInfo(BuffIcon.MagicReflection, 1075817, args: buffFormat, retainThroughDeath: true)
);
}
}
}
@ -147,7 +150,7 @@ namespace Server.Spells.Fifth
m.RemoveResistanceMod(mods[i]);
}
BuffInfo.RemoveBuff(m, BuffIcon.MagicReflection);
(m as PlayerMobile)?.RemoveBuff(BuffIcon.MagicReflection);
}
}
}