Beispiel #1
0
        public static void Encode(this ItemSlotPet i, OutPacket p)
        {
            p.Encode <byte>(3);

            (i as ItemSlot).Encode(p);

            p.EncodeFixedString(i.PetName, 13);
            p.Encode <byte>(i.Level);
            p.Encode <short>(i.Tameness);
            p.Encode <byte>(i.Repleteness);

            if (i.DateDead == null)
            {
                p.Encode <long>(0);
            }
            else
            {
                p.Encode <DateTime>(i.DateDead.Value);
            }

            p.Encode <short>(i.PetAttribute);
            p.Encode <short>(i.PetSkill);
            p.Encode <int>(i.RemainLife);
            p.Encode <short>(i.Attribute);
        }
Beispiel #2
0
        public static void EncodeStats(this Character c, OutPacket p)
        {
            p.Encode <int>(c.ID);
            p.EncodeFixedString(c.Name, 13);

            p.Encode <byte>(c.Gender);
            p.Encode <byte>(c.Skin);
            p.Encode <int>(c.Face);
            p.Encode <int>(c.Hair);

            for (var i = 0; i < 3; i++)
            {
                p.Encode <long>(0); // Pet stuff.
            }
            p.Encode <byte>(c.Level);
            p.Encode(c.Job);
            p.Encode <short>(c.STR);
            p.Encode <short>(c.DEX);
            p.Encode <short>(c.INT);
            p.Encode <short>(c.LUK);
            p.Encode <int>(c.HP);
            p.Encode <int>(c.MaxHP);
            p.Encode <int>(c.MP);
            p.Encode <int>(c.MaxMP);

            p.Encode <short>(c.AP);
            if ((int)c.Job / 1000 != 3 && (int)c.Job / 100 != 22 && (int)c.Job != 2001)
            {
                p.Encode <short>(c.SP);
            }
            else
            {
                p.Encode <byte>(0); // TODO: extendedSP
            }
            p.Encode <int>(c.EXP);
            p.Encode <short>(c.POP);

            p.Encode <int>(c.TempEXP);
            p.Encode <int>(c.FieldID);
            p.Encode <byte>(c.FieldPortal);
            p.Encode <int>(c.PlayTime);
            p.Encode <short>(c.SubJob);
        }