use of client.MapleQuestStatus in project HeavenMS by ronancpl.
the class MapleQuest method forceStart.
public boolean forceStart(MapleCharacter c, int npc) {
MapleQuestStatus newStatus = new MapleQuestStatus(this, MapleQuestStatus.Status.STARTED, npc);
newStatus.setForfeited(c.getQuest(this).getForfeited());
if (timeLimit > 0) {
newStatus.setExpirationTime(System.currentTimeMillis() + (timeLimit * 1000));
c.questTimeLimit(this, timeLimit);
}
if (timeLimit2 > 0) {
newStatus.setExpirationTime(System.currentTimeMillis() + timeLimit2);
c.questTimeLimit2(this, newStatus.getExpirationTime());
}
c.updateQuest(newStatus);
return true;
}
use of client.MapleQuestStatus in project HeavenMS by ronancpl.
the class MapleQuest method forceComplete.
public boolean forceComplete(MapleCharacter c, int npc) {
MapleQuestStatus newStatus = new MapleQuestStatus(this, MapleQuestStatus.Status.COMPLETED, npc);
newStatus.setForfeited(c.getQuest(this).getForfeited());
newStatus.setCompletionTime(System.currentTimeMillis());
c.updateQuest(newStatus);
// Quest completion
c.getClient().getSession().write(MaplePacketCreator.showSpecialEffect(9));
// use 9 instead of 12 for both
c.getMap().broadcastMessage(c, MaplePacketCreator.showForeignEffect(c.getId(), 9), false);
return true;
}
use of client.MapleQuestStatus in project HeavenMS by ronancpl.
the class MapScriptMethods method touchTheSky.
public void touchTheSky() {
// 29004
MapleQuest quest = MapleQuest.getInstance(29004);
if (!isQuestStarted(29004)) {
if (!quest.forceStart(getPlayer(), 9000066)) {
return;
}
}
MapleQuestStatus q = getPlayer().getQuest(quest);
if (!q.addMedalMap(getPlayer().getMapId())) {
return;
}
String status = Integer.toString(q.getMedalProgress());
getPlayer().announce(MaplePacketCreator.updateQuest(q, true));
getPlayer().announce(MaplePacketCreator.earnTitleMessage(status + "/5 Completed"));
getPlayer().announce(MaplePacketCreator.earnTitleMessage("The One Who's Touched the Sky title in progress."));
if (Integer.toString(q.getMedalProgress()).equals(quest.getInfoEx())) {
showInfoText("The One Who's Touched the Sky" + rewardstring);
getPlayer().announce(MaplePacketCreator.getShowQuestCompletion(quest.getId()));
} else {
showInfoText("The One Who's Touched the Sky title in progress. " + status + "/5 Completed");
}
}
use of client.MapleQuestStatus in project HeavenMS by ronancpl.
the class NextQuestAction method run.
@Override
public void run(MapleCharacter chr, Integer extSelection) {
MapleQuestStatus status = chr.getQuest(MapleQuest.getInstance(questID));
chr.announce(MaplePacketCreator.updateQuestFinish((short) questID, status.getNpc(), (short) nextQuest));
}
use of client.MapleQuestStatus in project HeavenMS by ronancpl.
the class QuestAction method run.
@Override
public void run(MapleCharacter chr, Integer extSelection) {
for (Integer questID : quests.keySet()) {
int stat = quests.get(questID);
chr.updateQuest(new MapleQuestStatus(MapleQuest.getInstance(questID), MapleQuestStatus.Status.getById(stat)));
}
}
Aggregations