public static void buySilentCrusade(final LittleEndianAccessor slea, final MapleClient c) {
        //ui window is 0x49
        //slea: [00 00] [4F 46 11 00] [01 00]
        short slot = slea.readShort(); //slot of item in the silent crusade window
        int itemId = slea.readInt();
        short quantity = slea.readShort();
        int tokenPrice = 0, potentialGrade = 0;
        final MapleDataProvider prov = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Etc.wz"));
        MapleData data = prov.getData("CrossHunterChapter.img");
        int currItemId = 0;
        for (final MapleData wzdata : data.getChildren()) {
            if (wzdata.getName().equals("Shop")) {
                for (final MapleData wzdata2 : wzdata.getChildren()) {
                    for (MapleData wzdata3 : wzdata2.getChildren()) {
                        switch (wzdata3.getName()) {
                            case "itemId":
                                currItemId = MapleDataTool.getInt(wzdata3);
                                break;
                            case "tokenPrice":
                                if (currItemId == itemId) {
                                    tokenPrice = MapleDataTool.getInt(wzdata3);
                                }
                                break;
                            case "potentialGrade":
                                if (currItemId == itemId) {
                                    potentialGrade = MapleDataTool.getInt(wzdata3);
                                }
                                break;
                        }
                    }
                }
            }
        }
        if (tokenPrice == 0) {
            System.out.println("[Silent Crusade] " + c.getPlayer().getName() + " has tried to exploit silent crusade shop.");
            c.getSession().write(CWvsContext.getSilentCrusadeMsg((byte) 3));
            c.getSession().write(CWvsContext.enableActions());
            return;
        }
        if (c.getPlayer().getInventory(GameConstants.getInventoryType(itemId)).getNumFreeSlot() >= quantity) {
            if (c.getPlayer().itemQuantity(4310029) < tokenPrice) {
                c.getSession().write(CWvsContext.getSilentCrusadeMsg((byte) 1));
                c.getSession().write(CWvsContext.enableActions());
                return;
            }
            if (MapleInventoryManipulator.checkSpace(c, itemId, quantity, "")) {
                MapleInventoryManipulator.removeById(c, MapleInventoryType.ETC, 4310029, tokenPrice, false, false);
                if (itemId < 2000000 && potentialGrade > 0) {
                    Equip equip = (Equip) MapleItemInformationProvider.getInstance().getEquipById(itemId);
                    equip.setQuantity((short) 1);
                    equip.setGMLog("BUY_SILENT_CRUSADE");
                    equip.setPotential1(-potentialGrade);
                    if (!MapleInventoryManipulator.addbyItem(c, equip)) {
                        c.getSession().write(CWvsContext.getSilentCrusadeMsg((byte) 2));
                        c.getSession().write(CWvsContext.enableActions());
                        return;
                    }
                } else {
                    if (!MapleInventoryManipulator.addById(c, itemId, quantity, "BUY_SILENT_CRUSADE")) {
                        c.getSession().write(CWvsContext.getSilentCrusadeMsg((byte) 2));
                        c.getSession().write(CWvsContext.enableActions());
                        return;
                    }
                }
                c.getSession().write(CWvsContext.getSilentCrusadeMsg((byte) 0));
                c.getSession().write(CWvsContext.enableActions());
            } else {
                c.getSession().write(CWvsContext.getSilentCrusadeMsg((byte) 2));
                c.getSession().write(CWvsContext.enableActions());
            }
        } else {
            c.getSession().write(CWvsContext.getSilentCrusadeMsg((byte) 2));
            c.getSession().write(CWvsContext.enableActions());
        }
    }