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;
}
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());
}
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);
}
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));
}
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);
}
Aggregations