public void runEnd(MapleCharacter c, Integer extSelection) {
        int selection;
        int extNum;
        switch (type) {
            case exp:
                c.gainExp(this.intStore * GameConstants.getExpRate_Quest(c.getLevel()) * c.getStat().questBonus * (c.getTrait(MapleTrait.MapleTraitType.sense).getLevel() * 3 / 10 + 100) / 100, true, true, true);
                break;
            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);
                        }
                    }
                }
                selection = 0;
                extNum = 0;
                if (props.size() > 0) {
                    selection = ((Integer) props.get(Randomizer.nextInt(props.size())));
                }
                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) {
                                MapleInventoryManipulator.removeById(c.getClient(), GameConstants.getInventoryType(id), id, count * -1, true, false);
                                c.getClient().getSession().write(CWvsContext.InfoPacket.getShowItemGain(id, count, true));
                            } else {
                                int period = item.period / 1440;
                                String name = MapleItemInformationProvider.getInstance().getName(id);
                                if ((id / 10000 == 114) && (name != null) && (name.length() > 0)) {
                                    String msg = "You have attained title <" + name + ">";
                                    c.dropMessage(-1, msg);
                                    c.dropMessage(5, msg);
                                }
                                MapleInventoryManipulator.addById(c.getClient(), id, count, "", null, period + " on " + FileoutputUtil.CurrentReadable_Date());
                                c.getClient().getSession().write(CWvsContext.InfoPacket.getShowItemGain(id, count, true));
                            }
                        }
                    }
                }
                break;
            case nextQuest:
                c.getClient().getSession().write(CField.updateQuestFinish(this.quest.getId(), c.getQuest(this.quest).getNpc(), this.intStore));
                break;
            case money:
                c.gainMeso(this.intStore, true, true);
                break;
            case quest:
                for (Pair<Integer, Integer> q : this.state) {
                    c.updateQuest(new MapleQuestStatus(MapleQuest.getInstance((q.left)), (q.right)));
                }
                break;
            case skill:
                Map sa = new HashMap();
                for (Triple skills : this.skill) {
                    int skillid = ((Integer) skills.left);
                    int skillLevel = ((Integer) skills.mid);
                    int masterLevel = ((Integer) skills.right);
                    Skill skillObject = SkillFactory.getSkill(skillid);
                    boolean found = false;
                    for (Iterator i$ = this.applicableJobs.iterator(); i$.hasNext();) {
                        int applicableJob = ((Integer) i$.next());
                        if (c.getJob() == applicableJob) {
                            found = true;
                            break;
                        }
                    }
                    if ((skillObject.isBeginnerSkill()) || (found)) {
                        sa.put(skillObject, new SkillEntry((byte) Math.max(skillLevel, c.getSkillLevel(skillObject)), (byte) Math.max(masterLevel, c.getMasterLevel(skillObject)), SkillFactory.getDefaultSExpiry(skillObject)));
                    }
                }
                c.changeSkillsLevel(sa);
                break;
            case pop:
                int fameGain = this.intStore;
                c.addFame(fameGain);
                c.updateSingleStat(MapleStat.FAME, c.getFame());
                c.getClient().getSession().write(CWvsContext.InfoPacket.getShowFameGain(fameGain));
                break;
            case buffItemID:
                int tobuff = this.intStore;
                if (tobuff > 0) {
                    MapleItemInformationProvider.getInstance().getItemEffect(tobuff).applyTo(c);
                }
                break;
            case infoNumber:
                break;
            case sp:
                int sp_val = this.intStore;
                if (this.applicableJobs.size() > 0) {
                    int finalJob = 0;
                    for (Iterator i$ = this.applicableJobs.iterator(); i$.hasNext();) {
                        int job_val = ((Integer) i$.next());
                        if ((c.getJob() >= job_val) && (job_val > finalJob)) {
                            finalJob = job_val;
                        }
                    }
                    if (finalJob == 0) {
                        c.gainSP(sp_val);
                    } else {
                        c.gainSP(sp_val, GameConstants.getSkillBook(finalJob, 0));
                    }
                } else {
                    c.gainSP(sp_val);
                }
                break;
            case charmEXP:
            case charismaEXP:
            case craftEXP:
            case insightEXP:
            case senseEXP:
            case willEXP:
                c.getTrait(MapleTrait.MapleTraitType.getByQuestName(this.type.name())).addExp(this.intStore, c);
                break;
        }
    }