Пример #1
0
 public void forfeit(MapleCharacter c) {
   if (!c.getQuest(this).getStatus().equals(Status.STARTED)) {
     return;
   }
   if (timeLimit > 0) {
     c.announce(MaplePacketCreator.removeQuestTimeLimit(id));
   }
   MapleQuestStatus newStatus = new MapleQuestStatus(this, MapleQuestStatus.Status.NOT_STARTED);
   newStatus.setForfeited(c.getQuest(this).getForfeited() + 1);
   c.updateQuest(newStatus);
 }
Пример #2
0
 private boolean canStart(MapleCharacter c, int npcid) {
   if (c.getQuest(this).getStatus() != Status.NOT_STARTED
       && !(c.getQuest(this).getStatus() == Status.COMPLETED && repeatable)) {
     return false;
   }
   for (MapleQuestRequirement r : startReqs) {
     if (!r.check(c, npcid)) {
       return false;
     }
   }
   return true;
 }
Пример #3
0
 public void 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.announce(MaplePacketCreator.showSpecialEffect(9));
   c.getMap().broadcastMessage(c, MaplePacketCreator.showForeignEffect(c.getId(), 9), false);
   c.updateQuest(newStatus);
 }
Пример #4
0
  public void forceStart(MapleCharacter c, int npc) {
    MapleQuestStatus newStatus = new MapleQuestStatus(this, MapleQuestStatus.Status.STARTED, npc);
    newStatus.setForfeited(c.getQuest(this).getForfeited());

    if (timeLimit > 0) c.questTimeLimit(this, 30000); // timeLimit * 1000
    if (timeLimit2 > 0) { // =\
    }
    c.updateQuest(newStatus);
  }
Пример #5
0
 public boolean canComplete(MapleCharacter c, Integer npcid) {
   if (!c.getQuest(this).getStatus().equals(Status.STARTED)) {
     return false;
   }
   for (MapleQuestRequirement r : completeReqs) {
     if (!r.check(c, npcid)) {
       return false;
     }
   }
   return true;
 }