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,6 +1,7 @@
using System;
using System.Collections.Generic;
using ModernUO.CodeGeneratedEvents;
using Server.Engines.BuffIcons;
using Server.Mobiles;
namespace Server.Spells.Second
@ -72,7 +73,7 @@ namespace Server.Spells.Second
target.RemoveResistanceMod(mods.Item1);
target.RemoveSkillMod(mods.Item2);
BuffInfo.RemoveBuff(target, BuffIcon.Protection);
(target as PlayerMobile)?.RemoveBuff(BuffIcon.Protection);
}
else
{
@ -91,7 +92,7 @@ namespace Server.Spells.Second
target.AddSkillMod(resistMod);
var args = $"{physLoss}\t{resistLoss}";
BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args));
(target as PlayerMobile)?.AddBuff(new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args: args));
}
}
@ -108,7 +109,7 @@ namespace Server.Spells.Second
m.RemoveResistanceMod(mods.Item1);
m.RemoveSkillMod(mods.Item2);
BuffInfo.RemoveBuff(m, BuffIcon.Protection);
(m as PlayerMobile)?.RemoveBuff(BuffIcon.Protection);
}
public override void OnCast()