Search in sources :

Example 6 with MapleQuestStatus

use of client.MapleQuestStatus in project HeavenMS by ronancpl.

the class MobRequirement method check.

@Override
public boolean check(MapleCharacter chr, Integer npcid) {
    MapleQuestStatus status = chr.getQuest(MapleQuest.getInstance(questID));
    for (Integer mobID : mobs.keySet()) {
        int countReq = mobs.get(mobID);
        int progress;
        try {
            progress = Integer.parseInt(status.getProgress(mobID));
        } catch (NumberFormatException ex) {
            FilePrinter.printError(FilePrinter.EXCEPTION_CAUGHT, ex, "Mob: " + mobID + " Quest: " + questID + "CID: " + chr.getId() + " Progress: " + status.getProgress(mobID));
            return false;
        }
        if (progress < countReq)
            return false;
    }
    return true;
}
Also used : MapleQuestStatus(client.MapleQuestStatus)

Example 7 with MapleQuestStatus

use of client.MapleQuestStatus in project HeavenMS by ronancpl.

the class MapScriptMethods method explorerQuest.

public void explorerQuest(short questid, String questName) {
    MapleQuest quest = MapleQuest.getInstance(questid);
    if (!isQuestStarted(questid)) {
        if (!quest.forceStart(getPlayer(), 9000066)) {
            return;
        }
    }
    MapleQuestStatus q = getPlayer().getQuest(quest);
    if (!q.addMedalMap(getPlayer().getMapId())) {
        return;
    }
    String status = Integer.toString(q.getMedalProgress());
    String infoex = quest.getInfoEx();
    getPlayer().announce(MaplePacketCreator.updateQuest(q, true));
    StringBuilder smp = new StringBuilder();
    StringBuilder etm = new StringBuilder();
    if (status.equals(infoex)) {
        etm.append("Earned the ").append(questName).append(" title!");
        smp.append("You have earned the <").append(questName).append(">").append(rewardstring);
        getPlayer().announce(MaplePacketCreator.getShowQuestCompletion(quest.getId()));
    } else {
        getPlayer().announce(MaplePacketCreator.earnTitleMessage(status + "/" + infoex + " regions explored."));
        etm.append("Trying for the ").append(questName).append(" title.");
        smp.append("You made progress on the ").append(questName).append(" title. ").append(status).append("/").append(infoex);
    }
    getPlayer().announce(MaplePacketCreator.earnTitleMessage(etm.toString()));
    showInfoText(smp.toString());
}
Also used : MapleQuest(server.quest.MapleQuest) MapleQuestStatus(client.MapleQuestStatus)

Example 8 with MapleQuestStatus

use of client.MapleQuestStatus in project HeavenMS by ronancpl.

the class AbstractPlayerInteraction method updateQuest.

public void updateQuest(int questid, String data) {
    MapleQuestStatus status = c.getPlayer().getQuest(MapleQuest.getInstance(questid));
    updateQuest(questid, status.getAnyProgressKey(), data);
}
Also used : MapleQuestStatus(client.MapleQuestStatus)

Example 9 with MapleQuestStatus

use of client.MapleQuestStatus in project HeavenMS by ronancpl.

the class AbstractPlayerInteraction method setQuestProgress.

public void setQuestProgress(int qid, int pid, int progress) {
    MapleQuestStatus status = c.getPlayer().getQuest(MapleQuest.getInstance(qid));
    status.setProgress(pid, String.valueOf(progress));
}
Also used : MapleQuestStatus(client.MapleQuestStatus)

Example 10 with MapleQuestStatus

use of client.MapleQuestStatus in project HeavenMS by ronancpl.

the class AbstractPlayerInteraction method updateQuest.

public void updateQuest(int questid, int data) {
    MapleQuestStatus status = c.getPlayer().getQuest(MapleQuest.getInstance(questid));
    updateQuest(questid, status.getAnyProgressKey(), data);
}
Also used : MapleQuestStatus(client.MapleQuestStatus)

Aggregations

MapleQuestStatus (client.MapleQuestStatus)16 MapleQuest (server.quest.MapleQuest)2 Item (client.inventory.Item)1 MaplePet (client.inventory.MaplePet)1 Point (java.awt.Point)1 ArrayList (java.util.ArrayList)1 MapleAlliance (net.server.guild.MapleAlliance)1 MapleGuild (net.server.guild.MapleGuild)1 CashItem (server.CashShop.CashItem)1 SpecialCashItem (server.CashShop.SpecialCashItem)1 MapleShopItem (server.MapleShopItem)1 MapleMapItem (server.maps.MapleMapItem)1 MaplePlayerShopItem (server.maps.MaplePlayerShopItem)1 MaplePacketLittleEndianWriter (tools.data.output.MaplePacketLittleEndianWriter)1