protected override void OnTarget(Mobile from, object targeted) { if (m_Bandage.Deleted) { return; } if (targeted is Mobile) { if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range)) { if (BandageContext.BeginHeal(from, (Mobile)targeted) != null) { m_Bandage.Consume(); } } else { from.SendLocalizedMessage(500295); // You are too far away to do that. } } else if (targeted is PlagueBeastInnard) { if (((PlagueBeastInnard)targeted).OnBandage(from)) { m_Bandage.Consume(); } } else { from.SendLocalizedMessage(500970); // Bandages can not be used on that. } }
public static void BandageRequest(NetState state, PacketReader pvSrc) { Mobile from = state.Mobile; if (from.AccessLevel >= AccessLevel.Counselor || Core.TickCount >= from.NextActionTime) { Serial use = pvSrc.ReadInt32(); Serial targ = pvSrc.ReadInt32(); Bandage bandage = World.FindItem(use) as Bandage; if (bandage != null && from.InRange(bandage.GetWorldLocation(), Core.AOS ? 2 : 1)) { from.RevealingAction(); Mobile to = World.FindMobile(targ); if (to != null) { if (from.InRange(bandage.GetWorldLocation(), Core.AOS ? 2 : 1)) { if (BandageContext.BeginHeal(from, to) != null) { bandage.Consume(); } } else { from.SendLocalizedMessage(500295); // You are too far away to do that. } } else { from.SendLocalizedMessage(500970); // Bandages can not be used on that. } from.NextActionTime = Core.TickCount + Mobile.ActionDelay; } } else { from.SendActionMessage(); } }
public static void BandageRequest(NetState state, PacketReader pvSrc) { Mobile from = state.Mobile; if (from.Alive) { if (from.AccessLevel >= AccessLevel.Counselor || DateTime.UtcNow >= from.NextActionTime) { Serial use = pvSrc.ReadInt32(); Serial targ = pvSrc.ReadInt32(); Bandage bandage = World.FindItem(use) as Bandage; if (bandage != null && !bandage.Deleted) { if (from.InRange(bandage.GetWorldLocation(), 2)) { //from.RevealingAction(); Mobile to = World.FindMobile(targ); if (to != null) { if (BandageContext.BeginHeal(from, to) != null) { bandage.Consume(); } } else { from.SendLocalizedMessage(500970); // Bandages can not be used on that. } } else { from.SendLocalizedMessage(500295); // You are too far away to do that. } from.NextActionTime = DateTime.UtcNow + Mobile.ServerWideObjectDelay; } } else { from.SendActionMessage(); } } else { from.SendLocalizedMessage(500949); // You can't do that when you're dead. } }