public static void magicWheel(LittleEndianAccessor slea, MapleClient c) {
        final byte mode = slea.readByte(); // 0 = open 2 = start 4 = receive reward
        if (mode == 2) {
            slea.readInt(); //4
            final short toUseSlot = slea.readShort();
            slea.readShort();
            final int tokenId = slea.readInt();
            if (c.getPlayer().getInventory(MapleInventoryType.ETC).getItem(toUseSlot).getItemId() != tokenId) {
                c.getSession().write(CWvsContext.enableActions());
                return;
            }
            for (byte inv = 1; inv <= 5; inv++) {
                if (c.getPlayer().getInventory(MapleInventoryType.getByType(inv)).getNumFreeSlot() < 2) {
                    c.getSession().write(CWvsContext.magicWheel((byte) 7, null, null, 0));
                    c.getSession().write(CWvsContext.enableActions());
                    return;
                }
            }
            List<Integer> items = new LinkedList();
            GameConstants.loadWheelRewards(items, tokenId);
            int end = Randomizer.nextInt(10);
            String data = "Magic Wheel";
            c.getPlayer().setWheelItem(items.get(end));
            if (!MapleInventoryManipulator.removeFromSlot_Lock(c, GameConstants.getInventoryType(tokenId), toUseSlot, (short) 1, false, false)) {
                c.getSession().write(CWvsContext.magicWheel((byte) 9, null, null, 0));
                c.getSession().write(CWvsContext.enableActions());
                return;
            }
            c.getSession().write(CWvsContext.magicWheel((byte) 3, items, data, end));
        } else if (mode == 4) {
            final String data = slea.readMapleAsciiString();
            int item;
            //try {
            //item = Integer.parseInt(data) / 2;
            item = c.getPlayer().getWheelItem();
            if (item == 0 || !MapleInventoryManipulator.addById(c, item, (short) 1, null)) {
                c.getSession().write(CWvsContext.magicWheel((byte) 0xA, null, null, 0));
                c.getSession().write(CWvsContext.enableActions());
                return;
            }
            //} catch (Exception ex) {
            //    c.getSession().write(CWvsContext.magicWheel((byte) 0xA, null, null, 0));
            //    c.getSession().write(CWvsContext.enableActions());
            //    return;
            //}
            c.getPlayer().setWheelItem(0);
            c.getSession().write(CWvsContext.magicWheel((byte) 5, null, null, 0));
        }
    }