protected override void OnTarget(Mobile from, object targeted) { IPoint3D p = targeted as IPoint3D; Map map = from.Map; if (p == null || map == null || m_Deed.Deleted) { return; } StablePost post = new StablePost(m_Deed.East); BaseHouse house = BaseHouse.FindHouseAt(from.Location, from.Map, 20); if (m_Deed.IsChildOf(from.Backpack)) { Server.Spells.SpellHelper.GetSurfaceTop(ref p); if (house != null && house.IsInside(from) && house.IsOwner(from)) { post.MoveToWorld(new Point3D(p), map); house.AddSecure(from, (Item)post); m_Deed.Delete(); } else if (house != null && house.IsInside(from) && !house.IsOwner(from)) { from.SendLocalizedMessage(500274); // You can only place this in a house that you own! post.Delete(); } else if (house == null) { from.SendLocalizedMessage(500269); // You cannot build that there. post.Delete(); } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } }
protected override void OnTarget( Mobile from, object targeted ) { IPoint3D p = targeted as IPoint3D; Map map = from.Map; if ( p == null || map == null || m_Deed.Deleted ) return; StablePost post = new StablePost( m_Deed.East ); BaseHouse house = BaseHouse.FindHouseAt( from.Location, from.Map, 20 ); if ( m_Deed.IsChildOf( from.Backpack ) ) { Server.Spells.SpellHelper.GetSurfaceTop( ref p ); if ( house != null && house.IsInside( from ) && house.IsOwner( from ) ) { post.MoveToWorld( new Point3D( p ), map ); m_Deed.Delete(); } else if ( house != null && house.IsInside( from ) && !house.IsOwner( from ) ) { from.SendLocalizedMessage( 500274 ); // You can only place this in a house that you own! post.Delete(); } else if ( house == null ) { from.SendLocalizedMessage( 500269 ); // You cannot build that there. post.Delete(); } } else { from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } }
public StablePostTarget( StablePost p ) : base(10, false, TargetFlags.None) { m_Post = p; }
// uses "Configure" entry public MenuEntry( Mobile from, Item item ) : base(2132) { m_Item = item as StablePost; m_Mobile = from; }
public HitchGump(StablePost post) : base(0, 0) { m_Post = post; Dragable = true; if (m_Post != null && m_Post.Controlled != null)//<< Safety Catch shouldn't need it. { temp = m_Post.HomeRange; AddPage(0); AddBackground(0, 0, 248, 122, 9270); AddLabel(105, 75, 1071, Convert.ToString(temp)); AddLabel(20, 20, 1071, @"Owner:"); AddLabel(75, 20, 1071, m_Post.Owner.Name); AddLabel(20, 45, 1071, @"Pet:"); AddLabel(75, 45, 1071, m_Post.PetName); AddLabel(20, 75, 1071, @"HomeRange:"); AddButton(150, 80, 2223, 2223, 1, GumpButtonType.Reply, 0); AddButton(170, 80, 2224, 2224, 2, GumpButtonType.Reply, 0); AddButton(200, 75, 1154, 1155, 3, GumpButtonType.Reply, 0); } else { m_Post.Say("ERROR: Something went Fatally Wrong with the GUMP!"); m_Post.Say("ERROR: Either the Post doesn't exist OR there is not Mobile Controlled!"); } }
public MenuEntry(Mobile from, Item item) : base(2132) // uses "Configure" entry { m_Item = item as StablePost; m_Mobile = from; }
public StablePostTarget(StablePost p) : base(10, false, TargetFlags.None) { m_Post = p; }