public override void OnMovement(Mobile m, Point3D oldLocation) { if (0 < DateTime.Compare(DateTime.Now, m_NextSpeakTime) && m.InRange(this, 3)) { PlayerMobile player = m as PlayerMobile; if (null != player) { if (player.AccessLevel < JailConfig.JailImmuneLevel) { m_NextSpeakTime = DateTime.Now + (TimeSpan.FromSeconds(10)); Move(GetDirectionTo(m.Location)); Say(m_Phrases[Utility.Random(m_Phrases.Length)]); if (null == (player.FindItemOnLayer(Layer.OneHanded) as JailHammer) && InLOS(player)) { Say("Don't just stand around {0}, make yourself useful!", player.Name); Jail.JailThem(player, Jail.JailOption.None); } } } } }
public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is JailRock) { PlayerMobile player = from as PlayerMobile; if (null != player) { JailHammer hammer = player.FindItemOnLayer(Layer.OneHanded) as JailHammer; if (null == hammer) { Say("How nice of you to volunteer {0}; get busy mining {1}!", player.Name, JailConfig.JailRockName); Jail.JailThem(player, Jail.JailOption.None); } else { if ((hammer.UsesRemaining -= dropped.Amount) <= 0) { Jail.FreeThem(player); } else { this.Say(hammer.UsesRemaining + " to go, Keep working scoundrel!"); } } } return(true); } else { Say("I dont want that junk! Get me some {0}!", JailConfig.JailRockName); } return(false); }