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 (((Mobile)targeted).Frozen) { if (FireAidsContext.BeginHeal(from, (Mobile)targeted) != null) { m_Bandage.Consume(); } } else { from.SendMessage("That is not frozen"); } } else { from.SendLocalizedMessage(500295); // You are too far away to do that. } } else { from.SendLocalizedMessage(500970); // Bandages can not be used on that. } }
public static FireAidsContext GetContext(Mobile healer) { FireAidsContext bc = null; m_Table.TryGetValue(healer, out bc); return(bc); }
public static FireAidsContext BeginHeal(Mobile healer, Mobile patient) { if (patient == null || healer == null || healer == patient || healer.Frozen || !healer.Alive || !patient.Alive || !patient.Frozen) { return(null); } FireAidsContext context = GetContext(healer); if (context != null) { context.StopHeal(); } context = new FireAidsContext(healer, patient, TimeSpan.FromSeconds(5.0)); m_Table[healer] = context; patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you. healer.SendMessage("You begin thawing them"); return(context); }
public InternalTimer(FireAidsContext context, int ticks) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1)) { m_Context = context; Priority = TimerPriority.FiftyMS; this.ticks = ticks; }
public InternalTimer( FireAidsContext context, int ticks ) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1)) { m_Context = context; Priority = TimerPriority.FiftyMS; this.ticks = ticks; }
public static FireAidsContext BeginHeal( Mobile healer, Mobile patient ) { if(patient == null || healer == null || healer == patient || healer.Frozen || !healer.Alive || !patient.Alive || !patient.Frozen) return null; FireAidsContext context = GetContext( healer ); if ( context != null ) context.StopHeal(); context = new FireAidsContext( healer, patient, TimeSpan.FromSeconds( 5.0 ) ); m_Table[healer] = context; patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you. healer.SendMessage( "You begin thawing them" ); return context; }