Esempio n. 1
0
            public override void Deserialize(GenericReader reader)
            {
                base.Deserialize(reader);
                int version = reader.ReadInt();

                m_SleeperUsed = (SleeperEWUsedAddon)reader.ReadItem();
            }
Esempio n. 2
0
            public override void Deserialize(GenericReader reader)
            {
                base.Deserialize(reader);
                int version = reader.ReadInt();
                m_SleeperUsed = (SleeperEWUsedAddon)reader.ReadItem();

            }
Esempio n. 3
0
 public SleeperEWUsedPiece(SleeperEWUsedAddon sleeperused, int itemid)
     : base(itemid)
 {
     m_SleeperUsed = sleeperused;
 }
Esempio n. 4
0
 public InternalTarget(SleeperEWUsedAddon addon)
     : base(2, false, TargetFlags.None)
 {
     m_SleeperEWUsedAddon = addon;
 }
Esempio n. 5
0
		public void DoubleClick( Mobile from ) 
		{ 
			Mobile m_Player = from as PlayerMobile;
			if(m_Player.CantWalk && !m_Sleeping)
			{
				m_Player.LocalOverheadMessage( MessageType.Regular, 0x33, true, "You are already sleeping somewhere!" );
			}
			else
			{
				if( !m_Sleeping ) 
				{	
					/*BaseHouse m_house = BaseHouse.FindHouseAt( from );
					BaseHouse this_house = BaseHouse.FindHouseAt ( this );
					if (m_house!= null && (m_house != this_house))
					{
						from.LocalOverheadMessage( MessageType.Regular, 0x33, true, "You cannot sleep in someone elses bed! Get a bed of your own." );
						return;
					}
					if ( m_house!= null && (m_house.IsOwner(from) || m_house.IsCoOwner(from) || m_house.IsFriend( from )))
					{*/
                    


						wtry=0;
						m_Owner = m_Player;
						m_Player.Hidden = true;
						m_Player.CantWalk = true;
						m_Sleeping = true;
						m_SleeperBedBody = new SleeperBedBody( m_Player, false, false );
						Point3D m_Location = new Point3D(this.Location.X+1, this.Location.Y, this.Location.Z+5);
						m_SleeperBedBody.Direction=Direction.East;
						m_SleeperBedBody.MoveToWorld( m_Location, this.Map );
					/*}
					else
					{
						from.LocalOverheadMessage( MessageType.Regular, 0x33, true, "You must be in the house and be the owner, co-owner or friend of the house this bed is in to sleep in it." );
						return;
					}
                    */
				}
				else 
				{
					if(m_Owner==m_Player)
					{
                        Point3D sleeploc = this.Location;
                        
                        SleeperEWUsedAddon bed = new SleeperEWUsedAddon();
                        bed.Location = sleeploc;
                        bed.MoveToWorld(sleeploc, from.Map);
                        bed.Hue = this.Hue;
                        this.Delete();

						m_Sleeping = false;
						m_Player.Hidden = false;
						m_Player.CantWalk = false;
						if( m_SleeperBedBody != null )
							m_SleeperBedBody.Delete();
						m_SleeperBedBody = null;
						switch( Utility.RandomMinMax( 1, 3 ) )
						{
						case 1:
							m_Player.LocalOverheadMessage( MessageType.Regular, 0x33, true, "You wake up and feel rested and strong." );
							break;
						case 2:
							m_Player.LocalOverheadMessage( MessageType.Regular, 0x33, true, "You spring out of bed, ready for another day!" );
							break;
						case 3:
							m_Player.LocalOverheadMessage( MessageType.Regular, 0x33, true, "You fall out of bed." );
							break;
						}
					}
					else
					{
						switch (wtry)
						{
						case 0:
							m_Player.LocalOverheadMessage( MessageType.Regular, 0x33, true, "Shhh, don't wake them up." );
							wtry=wtry+1;
							break;
						case 1: 
							m_Player.LocalOverheadMessage( MessageType.Regular, 0x33, true, "You really should NOT bother someone that is sleeping. Bad things might happen." );
							wtry=wtry+1;
							break;
						case 2:
							m_Player.LocalOverheadMessage( MessageType.Regular, 0x33, true, "You were warned!! Now leave them alone." );
							m_Player.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.Head );
							m_Player.PlaySound( 0x208 );
							m_Player.Hits=m_Player.Hits-40;
							break;
						}
					}
				}
			}
		}
Esempio n. 6
0
 public SleeperEWUsedPiece(SleeperEWUsedAddon sleeperused, int itemid)
     : base(itemid)
 {
     m_SleeperUsed = sleeperused;
 }
Esempio n. 7
0
 public InternalTarget(SleeperEWUsedAddon addon)
     : base(2, false, TargetFlags.None)
 {
     m_SleeperEWUsedAddon = addon;
 }
Esempio n. 8
0
        public void DoubleClick(Mobile from)
        {
            Mobile m_Player = from as PlayerMobile;

            if (m_Player.CantWalk && !m_Sleeping)
            {
                m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You are already sleeping somewhere!");
            }
            else
            {
                if (!m_Sleeping)
                {
                    /*BaseHouse m_house = BaseHouse.FindHouseAt( from );
                     * BaseHouse this_house = BaseHouse.FindHouseAt ( this );
                     * if (m_house!= null && (m_house != this_house))
                     * {
                     *      from.LocalOverheadMessage( MessageType.Regular, 0x33, true, "You cannot sleep in someone elses bed! Get a bed of your own." );
                     *      return;
                     * }
                     * if ( m_house!= null && (m_house.IsOwner(from) || m_house.IsCoOwner(from) || m_house.IsFriend( from )))
                     * {*/



                    wtry              = 0;
                    m_Owner           = m_Player;
                    m_Player.Hidden   = true;
                    m_Player.CantWalk = true;
                    m_Sleeping        = true;
                    m_SleeperBedBody  = new SleeperBedBody(m_Player, false, false);
                    Point3D m_Location = new Point3D(this.Location.X + 1, this.Location.Y, this.Location.Z + 5);
                    m_SleeperBedBody.Direction = Direction.East;
                    m_SleeperBedBody.MoveToWorld(m_Location, this.Map);

                    /*}
                     * else
                     * {
                     *      from.LocalOverheadMessage( MessageType.Regular, 0x33, true, "You must be in the house and be the owner, co-owner or friend of the house this bed is in to sleep in it." );
                     *      return;
                     * }
                     */
                }
                else
                {
                    if (m_Owner == m_Player)
                    {
                        Point3D sleeploc = this.Location;

                        SleeperEWUsedAddon bed = new SleeperEWUsedAddon();
                        bed.Location = sleeploc;
                        bed.MoveToWorld(sleeploc, from.Map);
                        bed.Hue = this.Hue;
                        this.Delete();

                        m_Sleeping        = false;
                        m_Player.Hidden   = false;
                        m_Player.CantWalk = false;
                        if (m_SleeperBedBody != null)
                        {
                            m_SleeperBedBody.Delete();
                        }
                        m_SleeperBedBody = null;
                        switch (Utility.RandomMinMax(1, 3))
                        {
                        case 1:
                            m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You wake up and feel rested and strong.");
                            break;

                        case 2:
                            m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You spring out of bed, ready for another day!");
                            break;

                        case 3:
                            m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You fall out of bed.");
                            break;
                        }
                    }
                    else
                    {
                        switch (wtry)
                        {
                        case 0:
                            m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "Shhh, don't wake them up.");
                            wtry = wtry + 1;
                            break;

                        case 1:
                            m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You really should NOT bother someone that is sleeping. Bad things might happen.");
                            wtry = wtry + 1;
                            break;

                        case 2:
                            m_Player.LocalOverheadMessage(MessageType.Regular, 0x33, true, "You were warned!! Now leave them alone.");
                            m_Player.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.Head);
                            m_Player.PlaySound(0x208);
                            m_Player.Hits = m_Player.Hits - 40;
                            break;
                        }
                    }
                }
            }
        }