protected override void OnTarget( Mobile from, object targeted ) { if ( targeted is BaseContainer ) { m_engtarg = (BaseContainer)targeted; if ( !from.InRange( m_Engraver.GetWorldLocation(), 2 ) || !from.InRange( m_engtarg.GetWorldLocation(), 2 ) ) from.SendLocalizedMessage( 500446 ); // That is too far away. else if ( m_engtarg.Parent == null ) { BaseHouse house = BaseHouse.FindHouseAt( m_engtarg ); if ( house == null || !house.IsSecure( m_engtarg ) ) from.SendMessage( "You must Secure your container before you can Engrave it." ); else if ( !house.IsCoOwner( from ) ) from.SendLocalizedMessage( 501023 ); // You must be the owner to use this item. else { from.Prompt = new RenameContPrompt( m_engtarg ); from.SendMessage( "What would you like to engrave on the container ?" ); m_Engraver.Charges = ( m_Engraver.Charges - 1 ); from.SendMessage( "You use your Engraver. You now have {0} uses left.", m_Engraver.Charges ); if ( m_Engraver.Charges == 0 ) { from.SendMessage( "You have ran out of uses, the Engraver has been removed." ); m_Engraver.Delete(); } } } } else { from.SendMessage( "You cannot engrave that." ); } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is BaseContainer) { m_engtarg = (BaseContainer)targeted; if (!from.InRange(m_Engraver.GetWorldLocation(), 2) || !from.InRange(m_engtarg.GetWorldLocation(), 2)) { from.SendLocalizedMessage(500446); // That is too far away. } else if (m_engtarg.Parent == null) { BaseHouse house = BaseHouse.FindHouseAt(m_engtarg); if (house == null || !house.IsLockedDown(m_engtarg)) { from.SendMessage("Containers must be locked down to engrave them."); } else if (!house.IsCoOwner(from)) { from.SendLocalizedMessage(501023); // You must be the owner to use this item. } else { from.Prompt = new RenameContPrompt(m_engtarg); from.SendMessage("What would you like to engrave on the container ?"); } } } else { from.SendMessage("You cannot engrave that."); } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is BaseContainer) { m_engtarg = (BaseContainer)targeted; if (!from.InRange(m_Engraver.GetWorldLocation(), 2) || !from.InRange(m_engtarg.GetWorldLocation(), 2)) { from.SendLocalizedMessage(500446); // That is too far away. } else if (m_engtarg.Parent == null) { BaseHouse house = BaseHouse.FindHouseAt(m_engtarg); if (house == null || !house.IsSecure(m_engtarg)) { from.SendMessage("You must Secure your container before you can Engrave it."); } else if (!house.IsCoOwner(from)) { from.SendLocalizedMessage(501023); // You must be the owner to use this item. } else { from.Prompt = new RenameContPrompt(m_engtarg); from.SendMessage("What would you like to engrave on the container ?"); m_Engraver.Charges = (m_Engraver.Charges - 1); from.SendMessage("You use your Engraver. You now have {0} uses left.", m_Engraver.Charges); if (m_Engraver.Charges == 0) { from.SendMessage("You have ran out of uses, the Engraver has been removed."); m_Engraver.Delete(); } } } } else { from.SendMessage("You cannot engrave that."); } }