Exemple #1
0
        public static void EquipReq(NetState state, CircularBufferReader reader, ref int packetLength)
        {
            var from = state.Mobile;
            var item = from.Holding;

            var valid = item != null && item.HeldBy == from && item.Map == Map.Internal;

            from.Holding = null;

            if (!valid)
            {
                return;
            }

            reader.Seek(5, SeekOrigin.Current);
            var to = World.FindMobile((Serial)reader.ReadUInt32()) ?? from;

            if (!to.AllowEquipFrom(from) || !to.EquipItem(item))
            {
                item.Bounce(from);
            }

            item.ClearBounce();
        }