Ejemplo n.º 1
0
		public SleepingBodyContent( Mobile beholder, SleepingBody beheld ) : base( 0x3C )
		{
			ArrayList items = beheld.EquipItems;
			int count = items.Count;

			EnsureCapacity( 5 + (count * 19) );

			long pos = m_Stream.Position;

			int written = 0;

			m_Stream.Write( (ushort) 0 );

			for ( int i = 0; i < count; ++i )
			{
				Item child = (Item)items[i];

				if ( !child.Deleted && child.Parent == beheld && beholder.CanSee( child ) )
				{
					m_Stream.Write( (int) child.Serial );
					m_Stream.Write( (ushort) child.ItemID );
					m_Stream.Write( (byte) 0 ); // signed, itemID offset
					m_Stream.Write( (ushort) child.Amount );
					m_Stream.Write( (short) child.X );
					m_Stream.Write( (short) child.Y );
					m_Stream.Write( (int) beheld.Serial );
					m_Stream.Write( (ushort) child.Hue );

					++written;
				}
			}

			m_Stream.Seek( pos, SeekOrigin.Begin );
			m_Stream.Write( (ushort) written );
		}
Ejemplo n.º 2
0
		public SleepingBodyEquip( Mobile beholder, SleepingBody beheld ) : base( 0x89 )
		{
			ArrayList list = beheld.EquipItems;

			EnsureCapacity( 8 + (list.Count * 5) );

			m_Stream.Write( (int) beheld.Serial );

			for ( int i = 0; i < list.Count; ++i )
			{
				Item item = (Item)list[i];

				if ( !item.Deleted && beholder.CanSee( item ) && item.Parent == beheld )
				{
					m_Stream.Write( (byte) (item.Layer + 1) );
					m_Stream.Write( (int) item.Serial );
				}
			}

			m_Stream.Write( (byte) Layer.Invalid );
		}
 public void Sleeping()
 {
     for (int i = Soldiers.Count - 1; i >= 0; i--)
     {
         BaseCreature soldier = (BaseCreature)Soldiers[i];
         if (!(soldier.Alive))
         {
             return;
         }
         else
         {
             soldier.Direction = Direction.North;
             m_SleepingBody    = new SleepingBody(soldier, false, false);
             m_SleepingBody.MoveToWorld(((BaseSoldier)soldier).HouseLocation, ((BaseSoldier)soldier).HouseMap);
             this.sleeping.Add(soldier);
             this.sleepingbod.Add(m_SleepingBody);
             soldier.Map = Map.Internal;
         }
     }
     return;
 }
Ejemplo n.º 4
0
			public BodyTimer( Mobile m, TimeSpan duration, SleepingBody body ) : base( duration )
			{
				m_Mobile = m;
				m_Body=body;
			}
Ejemplo n.º 5
0
			public void ApplySleepTo( Mobile m )
			{
				m.Hidden = true;
				m.Frozen=true;
				m.Squelched=true;
			
				SleepingBody body = new SleepingBody(m, m.Blessed);
			
				body.Map=m.Map;
				body.Location=m.Location;
				m_Body=body;
						m.Z-=100;
				
			
				m.SendMessage("You fall asleep");

				RemoveTimer( m );

				TimeSpan duration = TimeSpan.FromSeconds( m_Caster.Skills[SkillName.Magery].Value * 1.2 ); // 120% of magery

				Timer t = new BodyTimer( m, duration, m_Body );

				m_Table[m] = t;

				t.Start();
			}