fix: Converts ResurrectGump to Static/Dynamic Gumps (#1904)

This commit is contained in:
Guyute 2024-08-06 22:17:33 -04:00 • committed by GitHub
parent 808e721e3d
commit 9014f3d4dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 294 additions and 237 deletions

View file

@ -311,7 +311,7 @@ public class BandageContext : Timer
else
{
Patient.CloseGump<ResurrectGump>();
Patient.SendGump(new ResurrectGump(Patient, Healer));
Patient.SendGump(new ResurrectGump(Healer));
}
}
else if (Patient.Poisoned)

View file

@ -83,29 +83,31 @@ public partial class AnkhOfSacrificeComponent : AddonComponent
private class AnkhResurrectGump : ResurrectGump
{
public AnkhResurrectGump(Mobile owner, ResurrectMessage msg) : base(owner, owner, msg)
public AnkhResurrectGump(Mobile owner, ResurrectMessage msg) : base(owner, msg)
{
}
public override void OnResponse(NetState state, in RelayInfo info)
{
if (info.ButtonID is not 1 and not 2)
{
return;
}
var from = state.Mobile;
if (info.ButtonID is 1 or 2)
if (from.Map?.CanFit(from.Location, 16, false, false) != true)
{
if (from.Map?.CanFit(from.Location, 16, false, false) != true)
{
from.SendLocalizedMessage(502391); // Thou can not be resurrected there!
return;
}
if (from is PlayerMobile mobile)
{
mobile.AnkhNextUse = Core.Now + TimeSpan.FromHours(1);
}
base.OnResponse(state, info);
from.SendLocalizedMessage(502391); // Thou can not be resurrected there!
return;
}
if (from is PlayerMobile mobile)
{
mobile.AnkhNextUse = Core.Now + TimeSpan.FromHours(1);
}
base.OnResponse(state, info);
}
}
}