public WreathAddonGump(Mobile from, WreathAddon addon) : base(150, 50) { m_From = from; m_Addon = addon; AddPage(0); AddBackground(0, 0, 220, 170, 0x13BE); AddBackground(10, 10, 200, 150, 0xBB8); AddHtmlLocalized(20, 30, 180, 60, 1062839, false, false); // Do you wish to re-deed this decoration? AddHtmlLocalized(55, 100, 160, 25, 1011011, false, false); // CONTINUE AddButton(20, 100, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(55, 125, 160, 25, 1011012, false, false); // CANCEL AddButton(20, 125, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0); }
private void PlaceAddon(Mobile from, Point3D loc, bool northWall, bool westWall) { if (Deleted) { return; } BaseHouse house = BaseHouse.FindHouseAt(loc, from.Map, 16); if (house == null || !house.IsCoOwner(from)) { from.SendAsciiMessage("That location is not in your house."); return; } int itemID = 0; if (northWall) { itemID = 0x232C; } else if (westWall) { itemID = 0x232D; } else { from.SendAsciiMessage("The decoration must be placed next to a wall."); } if (itemID > 0) { Item addon = new WreathAddon(this.Hue); addon.ItemID = itemID; addon.MoveToWorld(loc, from.Map); house.Addons.Add(addon); Delete(); } }
private void PlaceAddon(Mobile from, Point3D loc, bool northWall, bool westWall) { if (Deleted) { return; } var house = BaseHouse.FindHouseAt(loc, from.Map, 16); if (house?.IsCoOwner(from) != true) { from.SendLocalizedMessage(1042036); // That location is not in your house. return; } var itemID = 0; if (northWall) { itemID = 0x232C; } else if (westWall) { itemID = 0x232D; } else { from.SendLocalizedMessage(1062840); // The decoration must be placed next to a wall. } if (itemID > 0) { Item addon = new WreathAddon(Hue); addon.ItemID = itemID; addon.MoveToWorld(loc, from.Map); house.Addons.Add(addon); Delete(); } }
private void PlaceAddon(Mobile from, Point3D loc, bool northWall, bool westWall) { if (this.Deleted) return; BaseHouse house = BaseHouse.FindHouseAt(loc, from.Map, 16); if (house == null || !house.IsCoOwner(from)) { from.SendLocalizedMessage(1042036); // That location is not in your house. return; } int itemID = 0; if (northWall) itemID = 0x232C; else if (westWall) itemID = 0x232D; else from.SendLocalizedMessage(1062840); // The decoration must be placed next to a wall. if (itemID > 0) { Item addon = new WreathAddon(this.Hue); addon.ItemID = itemID; addon.MoveToWorld(loc, from.Map); house.Addons.Add(addon); this.Delete(); } }
public WreathAddonGump(Mobile from, WreathAddon addon) : base(150, 50) { this.m_From = from; this.m_Addon = addon; this.AddPage(0); this.AddBackground(0, 0, 220, 170, 0x13BE); this.AddBackground(10, 10, 200, 150, 0xBB8); this.AddHtmlLocalized(20, 30, 180, 60, 1062839, false, false); // Do you wish to re-deed this decoration? this.AddHtmlLocalized(55, 100, 160, 25, 1011011, false, false); // CONTINUE this.AddButton(20, 100, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0); this.AddHtmlLocalized(55, 125, 160, 25, 1011012, false, false); // CANCEL this.AddButton(20, 125, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0); }
public override void OnDoubleClick( Mobile from ) { if ( IsChildOf( from.Backpack ) ) { BaseHouse house = BaseHouse.FindHouseAt( from ); if ( house != null && house.IsCoOwner( from ) ) { bool northWall = IsWall( from.X, from.Y - 1, from.Z, from.Map ); bool westWall = IsWall( from.X - 1, from.Y, from.Z, from.Map ); if ( northWall && westWall ) { switch ( from.Direction & Direction.Mask ) { case Direction.North: case Direction.South: northWall = true; westWall = false; break; case Direction.East: case Direction.West: northWall = false; westWall = true; break; default: from.SendMessage( "Turn to face the wall on which to hang this decoration." ); return; } } int itemID = 0; if ( northWall ) itemID = 0x232C; else if ( westWall ) itemID = 0x232D; else from.SendLocalizedMessage( 1062840 ); // The decoration must be placed next to a wall. if ( itemID > 0 ) { Item addon = new WreathAddon( this.Hue ); addon.ItemID = itemID; addon.MoveToWorld( from.Location, from.Map ); house.Addons.Add( addon ); Delete(); } } else { from.SendLocalizedMessage( 502092 ); // You must be in your house to do this. } } else { from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } }