Beispiel #1
0
        public static void Write(this ByteArrayStreamWriter writer, Item item)
        {
            writer.Write(item.Metadata.TibiaId);

            StackableItem stackable = item as StackableItem;

            if (stackable != null)
            {
                writer.Write((byte)stackable.Count);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Known creature.
        /// </summary>
        public static void Write(this ByteArrayStreamWriter writer, Creature creature)
        {
            writer.Write((ushort)0x62);

            writer.Write(creature.Id);

            writer.Write((byte)Math.Ceiling(100.0 * creature.Health / creature.MaxHealth));

            writer.Write((byte)creature.Direction);

            writer.Write(creature.Outfit);

            writer.Write(creature.Light);

            writer.Write(creature.Speed);

            writer.Write((byte)creature.SkullIcon);

            writer.Write((byte)creature.PartyIcon);

            writer.Write(creature.Block);
        }
Beispiel #3
0
        public static void Write(this ByteArrayStreamWriter writer, Outfit outfit)
        {
            writer.Write(outfit.Id);

            if (outfit.Id == 0)
            {
                writer.Write(outfit.ItemId);
            }
            else
            {
                writer.Write(outfit.Head);

                writer.Write(outfit.Body);

                writer.Write(outfit.Legs);

                writer.Write(outfit.Feet);

                writer.Write((byte)outfit.Addon);
            }
        }
Beispiel #4
0
        public static void Write(this ByteArrayStreamWriter writer, Light light)
        {
            writer.Write(light.Level);

            writer.Write(light.Color);
        }
Beispiel #5
0
 public static void Write(this ByteArrayStreamWriter writer, IPAddress ipAddress)
 {
     writer.Write(ipAddress.GetAddressBytes());
 }