fix(spells): Fixes interruption of spells (#702)
This commit is contained in:
parent
50dd7a1146
commit
e6de7a5898
6 changed files with 64 additions and 55 deletions
|
|
@ -84,10 +84,13 @@ namespace Server.Spells
|
|||
public virtual void OnCasterHurt()
|
||||
{
|
||||
// Confirm: Monsters and pets cannot be disturbed.
|
||||
if (Caster.Player && IsCasting && ProtectionSpell.Registry.TryGetValue(Caster, out var d) &&
|
||||
d <= Utility.RandomDouble() * 100.0)
|
||||
if (Caster.Player && IsCasting)
|
||||
{
|
||||
Disturb(DisturbType.Hurt, false, true);
|
||||
var hasProtection = ProtectionSpell.Registry.TryGetValue(Caster, out var d);
|
||||
if (!hasProtection || d < 1000 && d < Utility.Random(1000))
|
||||
{
|
||||
Disturb(DisturbType.Hurt, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -704,7 +707,7 @@ namespace Server.Spells
|
|||
{
|
||||
DoFizzle();
|
||||
}
|
||||
else if (Scroll != null && !(Scroll is Runebook) &&
|
||||
else if (Scroll != null && Scroll is not Runebook &&
|
||||
(Scroll.Amount <= 0 || Scroll.Deleted || Scroll.RootParent != Caster || Scroll is BaseWand baseWand &&
|
||||
(baseWand.Charges <= 0 || baseWand.Parent != Caster)))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue