Пример #1
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_Head == null || m_Head.Deleted )
					return;
					
				if ( m_Head.IsChildOf( from.Backpack ) )
				{
					BaseHouse house = BaseHouse.FindHouseAt( from );
					
					if ( house != null && house.IsOwner( from ) )
					{
						IPoint3D p = targeted as IPoint3D;
						Map map = from.Map;
						
						if ( p == null || map == null )
							return;
							
						Point3D p3d = new Point3D( p );
						ItemData id = TileData.ItemTable[ 0x10F5 ];
						
						house = BaseHouse.FindHouseAt( p3d, map, id.Height );
						
						if ( house != null && house.IsOwner( from ) )
						{
							if ( map.CanFit( p3d, id.Height ) )
							{
								bool north = BaseAddon.IsWall( p3d.X, p3d.Y - 1, p3d.Z, map );
								bool west = BaseAddon.IsWall( p3d.X - 1, p3d.Y, p3d.Z, map );

								FlamingHead head = null;
								
								if ( north && west )
									head = new FlamingHead( StoneFaceTrapType.NorthWestWall );
								else if ( north )
									head = new FlamingHead( StoneFaceTrapType.NorthWall );
								else if ( west )
									head = new FlamingHead( StoneFaceTrapType.WestWall );
								
								if ( north || west )
								{
									house.Addons.Add( head );	

									head.IsRewardItem = m_Head.IsRewardItem;
									head.MoveToWorld( p3d, map );

									m_Head.Delete();
								}
								else		
									from.SendLocalizedMessage( 1042266 ); // The head must be placed next to a wall.
							}
							else
								from.SendLocalizedMessage( 1042266 ); // The head must be placed next to a wall.
						}
						else
							from.SendLocalizedMessage( 1042036 ); // That location is not in your house.			
					}
					else
						from.SendLocalizedMessage( 502115 ); // You must be in your house to do this.
				}
				else
					from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.     
			}
Пример #2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Head == null || m_Head.Deleted)
                {
                    return;
                }

                if (m_Head.IsChildOf(from.Backpack))
                {
                    BaseHouse house = BaseHouse.FindHouseAt(from);

                    if (house != null && house.IsOwner(from))
                    {
                        IPoint3D p   = targeted as IPoint3D;
                        Map      map = from.Map;

                        if (p == null || map == null)
                        {
                            return;
                        }

                        Point3D  p3d = new Point3D(p);
                        ItemData id  = TileData.ItemTable[0x10F5];

                        house = BaseHouse.FindHouseAt(p3d, map, id.Height);

                        if (house != null && house.IsOwner(from))
                        {
                            if (map.CanFit(p3d, id.Height))
                            {
                                bool north = BaseAddon.IsWall(p3d.X, p3d.Y - 1, p3d.Z, map);
                                bool west  = BaseAddon.IsWall(p3d.X - 1, p3d.Y, p3d.Z, map);

                                FlamingHead head = null;

                                if (north && west)
                                {
                                    head = new FlamingHead(StoneFaceTrapType.NorthWestWall);
                                }
                                else if (north)
                                {
                                    head = new FlamingHead(StoneFaceTrapType.NorthWall);
                                }
                                else if (west)
                                {
                                    head = new FlamingHead(StoneFaceTrapType.WestWall);
                                }

                                if (north || west)
                                {
                                    house.Addons.Add(head);

                                    head.IsRewardItem = m_Head.IsRewardItem;
                                    head.MoveToWorld(p3d, map);

                                    m_Head.Delete();
                                }
                                else
                                {
                                    from.SendLocalizedMessage(1042266);                                       // The head must be placed next to a wall.
                                }
                            }
                            else
                            {
                                from.SendLocalizedMessage(1042266);                                   // The head must be placed next to a wall.
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(1042036);                               // That location is not in your house.
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(502115);                           // You must be in your house to do this.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042038);                       // You must have the object in your backpack to use it.
                }
            }
			protected override void OnTarget( Mobile from, object targeted )
			{
				IPoint3D p = targeted as IPoint3D;

				if ( p == null || m_Deed.Deleted )
					return;
				if ( m_Deed.IsChildOf( from.Backpack ) )
				{
					BaseHouse house = BaseHouse.FindHouseAt( from );

					if ( !( house == null || !house.IsOwner( from ) || !house.IsCoOwner( from ) ) )
					{
						Item flame = new FlamingHead();
						flame.Map = from.Map;
						flame.Location = new Point3D( p );
						m_Deed.Delete();
					}
					else
						from.SendLocalizedMessage( 500274 ); // You can only place this in a house that you own!
				}
				else
					from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}