} // Where would you like to place this decoration? public void Placement_OnTarget(Mobile from, object targeted, object state) { if (!IsChildOf(from.Backpack)) { return; } IPoint3D p = targeted as IPoint3D; if (p == null) { return; } Point3D loc = new Point3D(p); if (!from.Map.CanFit(loc.X, loc.Y, loc.Z, 1)) // TODO: Height { return; } BaseHouse house = BaseHouse.FindHouseAt(loc, from.Map, 16); if (house != null && house.IsOwner(from)) { int itemID = (int)state; if (BaseAddon.IsWall(loc.X - 1, loc.Y - 1, loc.Z, from.Map) && ((itemID & 0x1) == 0x0 ? BaseAddon.IsWall(loc.X, loc.Y - 1, loc.Z, from.Map) : BaseAddon.IsWall(p.X - 1, p.Y, p.Z, from.Map))) { HangingShield shield = new HangingShield(itemID); shield.IsRewardItem = IsRewardItem; shield.MoveToWorld(loc, from.Map); house.Addons.Add(shield); Delete(); } else { from.SendLocalizedMessage(1062840); // The decoration must be placed next to a wall. } } else { from.SendLocalizedMessage(1042036); // That location is not in your house. } }
public int TargetLocalized { get { return 1049780; } } // Where would you like to place this decoration? public void Placement_OnTarget( Mobile from, object targeted, object state ) { if (!IsChildOf( from.Backpack )) return; IPoint3D p = targeted as IPoint3D; if (p == null) return; Point3D loc = new Point3D( p ); if (!from.Map.CanFit( loc.X, loc.Y, loc.Z, 1 )) // TODO: Height return; BaseHouse house = BaseHouse.FindHouseAt( loc, from.Map, 16 ); if (house != null && house.IsOwner( from )) { int itemID = (int)state; if (BaseAddon.IsWall( loc.X - 1, loc.Y - 1, loc.Z, from.Map ) && ((itemID & 0x1) == 0x0 ? BaseAddon.IsWall( loc.X, loc.Y - 1, loc.Z, from.Map ) : BaseAddon.IsWall( p.X - 1, p.Y, p.Z, from.Map ))) { HangingShield shield = new HangingShield( itemID ); shield.IsRewardItem = IsRewardItem; shield.MoveToWorld( loc, from.Map ); house.Addons.Add( shield ); Delete(); } else from.SendLocalizedMessage( 1062840 ); // The decoration must be placed next to a wall. } else { from.SendLocalizedMessage( 1042036 ); // That location is not in your house. } }