Example #1
0
                public override void OnResponse(GameClient sender, RelayInfo info)
                {
                    if (m_Skeleton == null || m_Skeleton.Deleted || m_House == null)
                    {
                        return;
                    }

                    HangingSkeleton banner = null;

                    if (info.ButtonID == (int)Buttons.East)
                    {
                        banner = new HangingSkeleton(GetWestItemID(m_ItemID));
                    }
                    if (info.ButtonID == (int)Buttons.South)
                    {
                        banner = new HangingSkeleton(m_ItemID);
                    }

                    if (banner != null)
                    {
                        m_House.Addons.Add(banner);

                        banner.IsRewardItem = m_Skeleton.IsRewardItem;
                        banner.MoveToWorld(m_Location, sender.Mobile.Map);

                        m_Skeleton.Delete();
                    }
                }
                public override void OnResponse(NetState sender, RelayInfo info)
                {
                    if (this.m_Skeleton == null || this.m_Skeleton.Deleted || this.m_House == null)
                    {
                        return;
                    }

                    HangingSkeleton banner = null;

                    if (info.ButtonID == (int)Buttons.East)
                    {
                        banner = new HangingSkeleton(GetWestItemID(this.m_ItemID));
                    }
                    if (info.ButtonID == (int)Buttons.South)
                    {
                        banner = new HangingSkeleton(this.m_ItemID);
                    }

                    if (banner != null)
                    {
                        m_House.Addons[banner] = sender.Mobile;

                        banner.IsRewardItem = this.m_Skeleton.IsRewardItem;
                        banner.MoveToWorld(this.m_Location, sender.Mobile.Map);

                        this.m_Skeleton.Delete();
                    }
                }
Example #3
0
				public override void OnResponse( NetState sender, RelayInfo info )
				{
					if ( m_Skeleton == null || m_Skeleton.Deleted || m_House == null )
						return;		
					
					HangingSkeleton banner = null;	
				
					if ( info.ButtonID == (int) Buttons.East )
						banner = new HangingSkeleton( GetWestItemID( m_ItemID ) );
					if ( info.ButtonID == (int) Buttons.South )
						banner = new HangingSkeleton( m_ItemID );
						
					if ( banner != null )
					{
						m_House.Addons.Add( banner );

						banner.IsRewardItem = m_Skeleton.IsRewardItem;
						banner.MoveToWorld( m_Location, sender.Mobile.Map );

						m_Skeleton.Delete();
					}
				}
Example #4
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_Skeleton == null || m_Skeleton.Deleted )
					return;
					
				if ( m_Skeleton.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[ m_ItemID & 0x3FFF ];
						
						if ( map.CanFit( p3d, id.Height ) )
						{
							house = BaseHouse.FindHouseAt( p3d, map, id.Height );
							
							if ( house != null && house.IsOwner( from ) )
							{
								bool north = BaseAddon.IsWall( p3d.X, p3d.Y - 1, p3d.Z, map );
								bool west = BaseAddon.IsWall( p3d.X - 1, p3d.Y, p3d.Z, map );
															
								if ( north && west )
								{
									from.CloseGump( typeof( FacingGump ) );
									from.SendGump( new FacingGump( m_Skeleton, m_ItemID, p3d, house ) );
								}
								else if ( north || west )
								{
									HangingSkeleton banner = null;
									
									if ( north )
										banner = new HangingSkeleton( m_ItemID );
									else if ( west )
										banner = new HangingSkeleton( GetWestItemID( m_ItemID ) );
										
									house.Addons.Add( banner );

									banner.IsRewardItem = m_Skeleton.IsRewardItem;
									banner.MoveToWorld( p3d, map );

									m_Skeleton.Delete();
								}
								else
									from.SendLocalizedMessage( 1042039 ); // The banner must be placed next to a wall.								
							}
							else
								from.SendLocalizedMessage( 1042036 ); // That location is not in your house.
						}
						else
							from.SendLocalizedMessage( 500269 ); // You cannot build that there.		
					}
					else
						from.SendLocalizedMessage( 502092 ); // You must be in your house to do this.
				}
				else
					from.SendLocalizedMessage( 1042038 ); // You must have the object in your backpack to use it.       
			}
Example #5
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Skeleton == null || m_Skeleton.Deleted)
                {
                    return;
                }

                if (m_Skeleton.IsChildOf(from.Backpack))
                {
                    var house = HousingHelper.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[m_ItemID & TileData.MaxItemValue];

                        if (map.CanFit(p3d, id.Height))
                        {
                            house = HousingHelper.FindHouseAt(p3d, map, id.Height);

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

                                if (north && west)
                                {
                                    from.CloseGump(typeof(FacingGump));
                                    from.SendGump(new FacingGump(m_Skeleton, m_ItemID, p3d, house));
                                }
                                else if (north || west)
                                {
                                    HangingSkeleton banner = null;

                                    if (north)
                                    {
                                        banner = new HangingSkeleton(m_ItemID);
                                    }
                                    else if (west)
                                    {
                                        banner = new HangingSkeleton(GetWestItemID(m_ItemID));
                                    }

                                    house.Addons.Add(banner);

                                    banner.IsRewardItem = m_Skeleton.IsRewardItem;
                                    banner.MoveToWorld(p3d, map);

                                    m_Skeleton.Delete();
                                }
                                else
                                {
                                    from.SendLocalizedMessage(1042039);                                       // The banner must be placed next to a wall.
                                }
                            }
                            else
                            {
                                from.SendLocalizedMessage(1042036);                                   // That location is not in your house.
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(500269);                               // You cannot build that there.
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(502092);                           // You must be in your house to do this.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042038);                       // You must have the object in your backpack to use it.
                }
            }