public boolean checkEnd(MapleCharacter c, Integer extSelection) {
        switch (this.type) {
            case item:
                Map props = new HashMap();

                for (QuestItem item : this.items) {
                    if ((item.prop > 0) && (canGetItem(item, c))) {
                        for (int i = 0; i < item.prop; i++) {
                            props.put(props.size(), item.itemid);
                        }
                    }
                }
                int selection = 0;
                int extNum = 0;
                if (props.size() > 0) {
                    selection = ((Integer) props.get(Randomizer.nextInt(props.size())));
                }
                byte eq = 0;
                byte use = 0;
                byte setup = 0;
                byte etc = 0;
                byte cash = 0;

                for (QuestItem item : this.items) {
                    if (canGetItem(item, c)) {
                        int id = item.itemid;
                        if ((item.prop == -2)
                                || (item.prop == -1
                                ? (extSelection == null) && (extSelection == extNum++)
                                : id == selection)) {
                            short count = (short) item.count;
                            if (count < 0) {
                                if (!c.haveItem(id, count, false, true)) {
                                    c.dropMessage(1, "You are short of some item to complete quest.");
                                    return false;
                                }
                            } else {
                                switch (GameConstants.getInventoryType(id)) {
                                    case EQUIP:
                                        eq = (byte) (eq + 1);
                                        break;
                                    case USE:
                                        use = (byte) (use + 1);
                                        break;
                                    case SETUP:
                                        setup = (byte) (setup + 1);
                                        break;
                                    case ETC:
                                        etc = (byte) (etc + 1);
                                        break;
                                    case CASH:
                                        cash = (byte) (cash + 1);
                                }
                            }
                        }
                    }
                }
                if (c.getInventory(MapleInventoryType.EQUIP).getNumFreeSlot() < eq) {
                    c.dropMessage(1, "Please make space for your Equip inventory.");
                    return false;
                }
                if (c.getInventory(MapleInventoryType.USE).getNumFreeSlot() < use) {
                    c.dropMessage(1, "Please make space for your Use inventory.");
                    return false;
                }
                if (c.getInventory(MapleInventoryType.SETUP).getNumFreeSlot() < setup) {
                    c.dropMessage(1, "Please make space for your Setup inventory.");
                    return false;
                }
                if (c.getInventory(MapleInventoryType.ETC).getNumFreeSlot() < etc) {
                    c.dropMessage(1, "Please make space for your Etc inventory.");
                    return false;
                }
                if (c.getInventory(MapleInventoryType.CASH).getNumFreeSlot() < cash) {
                    c.dropMessage(1, "Please make space for your Cash inventory.");
                    return false;
                }
                return true;
            case money:
                int meso = this.intStore;
                if (c.getMeso() + meso < 0L) {
                    c.dropMessage(1, "Meso exceed the max amount, 2147483647.");
                    return false;
                }
                if ((meso < 0) && (c.getMeso() < Math.abs(meso))) {
                    c.dropMessage(1, "Insufficient meso.");
                    return false;
                }
                return true;
        }

        return true;
    }