Exemple #1
0
        public void SendEquiped(Player Plr, UInt16[] Itms)
        {
            int Invalide = Itms.ToList().Count(slot => !IsEquipedSlot(slot));
            if (Invalide >= Itms.Length)
                return;

            PacketOut Out = new PacketOut((byte)Opcodes.F_PLAYER_INVENTORY);
            Out.WriteUInt16(Obj.Oid);
            Out.WriteUInt16((UInt16)(Itms.Length - Invalide)); // Count
            foreach (UInt16 Slot in Itms)
            {
                if (!IsEquipedSlot(Slot))
                    continue;

                Out.WriteByte(0); // Effect
                Out.WriteByte((byte)Slot);
                Out.WriteUInt16((UInt16)(Items[Slot] != null ? Items[Slot].ModelId : 0));
            }
            Out.WriteByte(0);

            if (Plr != null)
                Plr.SendPacket(Out);
            else
                Obj.DispatchPacket(Out, false);
        }