コード例 #1
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;

    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();
    if (targetId != 204301) return false;
    if (qs.getStatus() == QuestStatus.START) {
      if (env.getDialogId() == 25) {
        qs.setQuestVar(1);
        qs.setStatus(QuestStatus.REWARD);
        updateQuestStatus(player, qs);
        return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
      } else return defaultQuestStartDialog(env);
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (env.getDialogId() == 17) {
        int[] ids = {2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042};
        for (int id : ids) {
          QuestService.startQuest(
              new QuestEnv(env.getVisibleObject(), env.getPlayer(), id, env.getDialogId()),
              QuestStatus.LOCKED);
        }
      }
      return defaultQuestEndDialog(env);
    }
    return false;
  }
コード例 #2
0
 @Override
 public boolean onKillInWorldEvent(QuestEnv env) {
   Player player = env.getPlayer();
   if (env.getVisibleObject() instanceof Player
       && player != null
       && player.isInsideZone(ZoneName.get("SLEEPING_ELDERS_PLATEAU_600060000"))) {
     if ((env.getPlayer().getLevel() >= (((Player) env.getVisibleObject()).getLevel() - 5))
         && (env.getPlayer().getLevel() <= (((Player) env.getVisibleObject()).getLevel() + 9))) {
       return defaultOnKillRankedEvent(env, 0, 1, true); // reward
     }
   }
   return false;
 }
コード例 #3
0
 private void removeStigma(QuestEnv env) {
   Player player = env.getPlayer();
   for (Item item : player.getEquipment().getEquippedItemsByItemId(getStoneId(player))) {
     player.getEquipment().unEquipItem(item.getObjectId(), 0);
   }
   removeQuestItem(env, getStoneId(player), 1);
 }
コード例 #4
0
 @Override
 public boolean onEnterWorldEvent(QuestEnv env) {
   Player player = env.getPlayer();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (qs != null && qs.getStatus() == QuestStatus.START) {
     int var = qs.getQuestVars().getQuestVars();
     if (player.getWorldId() != 320070000) {
       if (var >= 95 && var <= 99) {
         removeStigma(env);
         qs.setQuestVar(4);
         updateQuestStatus(env);
         PacketSendUtility.sendPacket(
             player,
             new SM_SYSTEM_MESSAGE(
                 SystemMessageId.QUEST_FAILED_$1,
                 DataManager.QUEST_DATA.getQuestById(questId).getName()));
         return true;
       } else if (var == 9) {
         removeStigma(env);
         return true;
       }
     }
   }
   return false;
 }
コード例 #5
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    DialogAction dialog = env.getDialog();
    int targetId = env.getTargetId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 0) {
        if (dialog == DialogAction.QUEST_ACCEPT_1) {
          QuestService.startQuest(env);
          return closeDialogWindow(env);
        }
      } else if (targetId == 700009) {
        return giveQuestItem(env, 182200559, 1);
      }
    } else if (qs.getStatus() == QuestStatus.START) {
      if (targetId == 203098) {
        if (dialog == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 2375);
        } else if (dialog == DialogAction.SELECT_QUEST_REWARD) {
          removeQuestItem(env, 182213168, 1);
          return defaultCloseDialog(env, 0, 1, true, true);
        }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 203098) {
        return sendQuestEndDialog(env);
      }
    }
    return false;
  }
コード例 #6
0
  public boolean onKillEvent(QuestEnv env) {
    /** Checks * */
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;

    int var = qs.getQuestVarById(0);
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();

    if (qs.getStatus() != QuestStatus.START) return false;

    switch (targetId) {
      case 210715: // Brute
        if (var > 0 && var < 4) // En tuer 4
        {
          qs.setQuestVarById(0, var + 1);
          updateQuestStatus(player, qs);
          return true;
        } else if (var == 4) // Au 4eme REWARD
        {
          qs.setStatus(QuestStatus.REWARD);
          updateQuestStatus(player, qs);
          return true;
        }
    }
    return false;
  }
コード例 #7
0
 @Override
 public boolean onEnterWorldEvent(QuestEnv env) {
   Player player = env.getPlayer();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (qs != null && qs.getStatus() == QuestStatus.START) {
     int var = qs.getQuestVars().getQuestVars();
     if (var == 12) {
       if (player.getWorldId() == 300160000) {
         qs.setQuestVar(13);
         updateQuestStatus(env);
         return true;
       } else {
         if (player.getInventory().getItemCountByItemId(182206613) == 0) {
           return giveQuestItem(env, 182206613, 1);
         }
       }
     } else if (var >= 13 && var < 16) {
       if (player.getWorldId() != 300160000) {
         changeQuestStep(env, var, 12, false);
         if (player.getInventory().getItemCountByItemId(182206613) == 0) {
           giveQuestItem(env, 182206613, 1);
         }
         return true;
       }
     }
   }
   return false;
 }
コード例 #8
0
  @Override
  public HandlerResult onItemUseEvent(final QuestEnv env, Item item) {
    final Player player = env.getPlayer();
    final int id = item.getItemTemplate().getTemplateId();
    final int itemObjId = item.getObjectId();

    if (id != 182204123) {
      return HandlerResult.UNKNOWN;
    }
    PacketSendUtility.broadcastPacket(
        player, new SM_ITEM_USAGE_ANIMATION(player.getObjectId(), itemObjId, id, 3000, 0, 0), true);
    ThreadPoolManager.getInstance()
        .schedule(
            new Runnable() {
              @Override
              public void run() {
                PacketSendUtility.broadcastPacket(
                    player,
                    new SM_ITEM_USAGE_ANIMATION(player.getObjectId(), itemObjId, id, 0, 1, 0),
                    true);
                sendQuestDialog(env, 4);
              }
            },
            3000);
    return HandlerResult.SUCCESS;
  }
コード例 #9
0
 @Override
 public boolean onDialogEvent(QuestEnv env) {
   final Player player = env.getPlayer();
   int targetId = 0;
   if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (targetId == 203607) {
     if (qs == null) {
       if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 1011);
       else return sendQuestStartDialog(env);
     }
   } else if (targetId == 203609) {
     if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 0) {
       if (env.getDialog() == DialogAction.QUEST_SELECT) return sendQuestDialog(env, 1352);
       else if (env.getDialog() == DialogAction.SETPRO1) {
         return defaultCloseDialog(env, 0, 1); // 1
       } else return sendQuestStartDialog(env);
     }
   } else if (targetId == 203631) {
     if (qs != null) {
       if (env.getDialog() == DialogAction.QUEST_SELECT && qs.getStatus() == QuestStatus.START)
         return sendQuestDialog(env, 2375);
       else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id()
           && qs.getStatus() != QuestStatus.COMPLETE
           && qs.getStatus() != QuestStatus.NONE) {
         qs.setQuestVar(2);
         qs.setStatus(QuestStatus.REWARD);
         updateQuestStatus(env);
         return sendQuestEndDialog(env);
       } else return sendQuestEndDialog(env);
     }
   }
   return false;
 }
コード例 #10
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    DialogAction dialog = env.getDialog();
    int targetId = env.getTargetId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 0) {
        if (dialog == DialogAction.QUEST_ACCEPT_1) {
          removeQuestItem(env, 182206844, 1);
          QuestService.startQuest(env);
          return closeDialogWindow(env);
        }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 799049) {
        if (dialog == DialogAction.USE_OBJECT) {
          return sendQuestDialog(env, 10002);
        } else if (dialog == DialogAction.SELECT_ACTION_2034) {
          return sendQuestDialog(env, 2034);
        } else if (dialog == DialogAction.SELECT_QUEST_REWARD) {
          if (player.getInventory().getKinah() >= 20000000) {
            player.getInventory().decreaseKinah(20000000);
            return sendQuestDialog(env, 5);
          } else return sendQuestDialog(env, 3739);
        } else return sendQuestEndDialog(env);
      }
    }
    return false;
  }
  @Override
  public HandlerResult onItemUseEvent(final QuestEnv env, Item item) {
    final Player player = env.getPlayer();
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    final int id = item.getItemTemplate().getTemplateId();
    final int itemObjId = item.getObjectId();

    if (id != 182206726) {
      return HandlerResult.UNKNOWN;
    }
    PacketSendUtility.broadcastPacket(
        player, new SM_ITEM_USAGE_ANIMATION(player.getObjectId(), itemObjId, id, 1000, 0, 0), true);
    ThreadPoolManager.getInstance()
        .schedule(
            new Runnable() {
              @Override
              public void run() {
                PacketSendUtility.broadcastPacket(
                    player,
                    new SM_ITEM_USAGE_ANIMATION(player.getObjectId(), itemObjId, id, 0, 1, 0),
                    true);
                removeQuestItem(env, 182206726, 1);
                qs.setStatus(QuestStatus.REWARD);
                updateQuestStatus(env);
              }
            },
            1000);
    return HandlerResult.SUCCESS;
  }
コード例 #12
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();
    if (targetId == 0) {
      if (env.getDialogId() == 1002) {
        QuestService.startQuest(env, QuestStatus.START);
        PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(0, 0));
        return true;
      }
    } else if (targetId == 203075) {
      if (qs != null) {
        if (env.getDialogId() == 25 && qs.getStatus() == QuestStatus.START) {
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
        } else if (env.getDialogId() == 1009) {
          player.getInventory().removeFromBagByItemId(182200501, 1);
          qs.setQuestVar(1);
          qs.setStatus(QuestStatus.REWARD);
          updateQuestStatus(player, qs);
          return defaultQuestEndDialog(env);
        } else return defaultQuestEndDialog(env);
      }
    }
    return false;
  }
コード例 #13
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    DialogAction dialog = env.getDialog();
    int targetId = env.getTargetId();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 799336) { // Tataka
        if (player.getInventory().getItemCountByItemId(102000690)
            >= 1) { // Noble Siel's Supreme Mace
          if (dialog == DialogAction.QUEST_SELECT) {
            return sendQuestDialog(env, 4762);
          } else {
            return sendQuestStartDialog(env);
          }
        }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 799336) { // Tataka
        if (dialog == DialogAction.USE_OBJECT) {
          if (player.getInventory().getItemCountByItemId(182213290) > 0) {
            return sendQuestDialog(env, 10002);
          }
        } else {
          removeQuestItem(env, 182213290, 1);
          return sendQuestEndDialog(env);
        }
      }
    }
    return false;
  }
コード例 #14
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    int targetId = env.getTargetId();
    DialogAction dialog = env.getDialog();

    if (qs == null || qs.getStatus() == QuestStatus.NONE) {
      if (targetId == 801022) {
        switch (dialog) {
          case QUEST_SELECT:
            {
              return sendQuestDialog(env, 1011);
            }
          case QUEST_ACCEPT_SIMPLE:
            {
              return sendQuestStartDialog(env, 182213313, 1);
            }
        }
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 801022) {
        if (dialog == DialogAction.USE_OBJECT) {
          return sendQuestDialog(env, 2375);
        } else {
          return sendQuestEndDialog(env);
        }
      }
    }
    return false;
  }
コード例 #15
0
  @Override
  public HandlerResult onItemUseEvent(final QuestEnv env, Item item) {
    final Player player = env.getPlayer();
    final int itemObjId = item.getObjectId();
    final int id = item.getItemTemplate().getTemplateId();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    if (id != 182201765) {
      return HandlerResult.UNKNOWN;
    }

    if (qs != null) {
      if (qs.getStatus() == QuestStatus.COMPLETE) {
        removeQuestItem(env, 182201765, 1);
        return HandlerResult.FAILED;
      }
    }

    PacketSendUtility.broadcastPacket(
        player, new SM_ITEM_USAGE_ANIMATION(player.getObjectId(), itemObjId, id, 3000, 0, 0), true);
    ThreadPoolManager.getInstance()
        .schedule(
            new Runnable() {
              @Override
              public void run() {
                PacketSendUtility.broadcastPacket(
                    player,
                    new SM_ITEM_USAGE_ANIMATION(player.getObjectId(), itemObjId, id, 0, 1, 0),
                    true);
                sendQuestDialog(env, 4);
              }
            },
            3000);
    return HandlerResult.SUCCESS;
  }
コード例 #16
0
  private void destroy(final int var, final QuestEnv env) {
    final int targetObjectId = env.getVisibleObject().getObjectId();

    final Player player = env.getPlayer();
    PacketSendUtility.sendPacket(
        player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 1));
    PacketSendUtility.broadcastPacket(
        player, new SM_EMOTION(player, EmotionType.NEUTRALMODE2, 0, targetObjectId), true);
    ThreadPoolManager.getInstance()
        .schedule(
            new Runnable() {

              @Override
              public void run() {
                if (player.getTarget() == null
                    || player.getTarget().getObjectId() != targetObjectId) return;
                PacketSendUtility.sendPacket(
                    player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 0));
                PacketSendUtility.broadcastPacket(
                    player,
                    new SM_EMOTION(player, EmotionType.START_LOOT, 0, targetObjectId),
                    true);
                sendEmotion(env, player, EmotionId.STAND, true);
                QuestState qs = player.getQuestStateList().getQuestState(questId);
                if (var != -1) qs.setQuestVarById(0, var);
                else {
                  playQuestMovie(env, 21);
                  qs.setStatus(QuestStatus.REWARD);
                }
                updateQuestStatus(env);
              }
            },
            3000);
  }
コード例 #17
0
  private void destroy(final int var, QuestEnv env) {
    final int targetObjectId = env.getVisibleObject().getObjectId();

    final Player player = env.getPlayer();
    PacketSendUtility.sendPacket(
        player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 1));
    PacketSendUtility.broadcastPacket(
        player, new SM_EMOTION(player, EmotionType.NEUTRALMODE2, 0, targetObjectId), true);
    ThreadPoolManager.getInstance()
        .schedule(
            new Runnable() {
              @Override
              public void run() {
                if (player.getTarget().getObjectId() != targetObjectId) return;
                PacketSendUtility.sendPacket(
                    player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 0));
                PacketSendUtility.broadcastPacket(
                    player,
                    new SM_EMOTION(player, EmotionType.START_LOOT, 0, targetObjectId),
                    true);
                PacketSendUtility.broadcastPacket(
                    player.getTarget(),
                    new SM_EMOTION((Creature) player.getTarget(), EmotionType.EMOTE, 128, 0));
                QuestState qs = player.getQuestStateList().getQuestState(questId);
                if (var == -1) PacketSendUtility.sendPacket(player, new SM_PLAY_MOVIE(0, 56));
                qs.setQuestVarById(0, qs.getQuestVarById(0) + 1);
                updateQuestStatus(player, qs);
              }
            },
            3000);
  }
コード例 #18
0
ファイル: _1006Ascension.java プロジェクト: xj2479564/AU-AD
  @Override
  public boolean onItemUseEvent(QuestEnv env, Item item) {
    final Player player = env.getPlayer();
    final int id = item.getItemTemplate().getTemplateId();
    final int itemObjId = item.getObjectId();

    if (id != 182200007) return false;
    if (!zoneService.isInsideZone(player, ZoneName.ITEMUSE_Q1006)) return false;
    final QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;
    PacketSendUtility.broadcastPacket(
        player, new SM_ITEM_USAGE_ANIMATION(player.getObjectId(), itemObjId, id, 3000, 0, 0), true);
    ThreadPoolManager.getInstance()
        .schedule(
            new Runnable() {
              @Override
              public void run() {
                PacketSendUtility.broadcastPacket(
                    player,
                    new SM_ITEM_USAGE_ANIMATION(player.getObjectId(), itemObjId, id, 0, 1, 0),
                    true);
                player.getInventory().removeFromBagByObjectId(itemObjId, 1);
                itemService.addItems(
                    player, Collections.singletonList(new QuestItems(182200008, 1)));
                qs.setQuestVarById(0, 2);
                updateQuestStatus(player, qs);
              }
            },
            3000);
    return true;
  }
コード例 #19
0
 @Override
 public boolean onDialogEvent(QuestEnv env) {
   final Player player = env.getPlayer();
   int targetId = 0;
   if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();
   final QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (qs == null) {
     if (targetId == 205130) {
       if (env.getDialogId() == 25)
         return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
       else return defaultQuestStartDialog(env);
     }
   } else if (qs.getStatus() == QuestStatus.START) {
     switch (targetId) {
       case 730107:
         {
           if (qs.getQuestVarById(0) == 0 && env.getDialogId() == -1) {
             final int targetObjectId = env.getVisibleObject().getObjectId();
             PacketSendUtility.sendPacket(
                 player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 1));
             PacketSendUtility.broadcastPacket(
                 player, new SM_EMOTION(player, 37, 0, targetObjectId), true);
             ThreadPoolManager.getInstance()
                 .schedule(
                     new Runnable() {
                       @Override
                       public void run() {
                         if (!player.isTargeting(targetObjectId)) return;
                         PacketSendUtility.sendPacket(
                             player,
                             new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 0));
                         PacketSendUtility.broadcastPacket(
                             player, new SM_EMOTION(player, 38, 0, targetObjectId), true);
                         qs.setQuestVarById(0, 1);
                         updateQuestStatus(player, qs);
                       }
                     },
                     3000);
           }
         }
       case 205130:
         {
           if (qs.getQuestVarById(0) == 1) {
             if (env.getDialogId() == 25)
               return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
             else if (env.getDialogId() == 1009) {
               qs.setStatus(QuestStatus.REWARD);
               updateQuestStatus(player, qs);
               return defaultQuestEndDialog(env);
             } else return defaultQuestEndDialog(env);
           }
         }
     }
   } else if (qs.getStatus() == QuestStatus.REWARD) {
     if (targetId == 205130) return defaultQuestEndDialog(env);
   }
   return false;
 }
コード例 #20
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    Player player = env.getPlayer();
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (qs == null) return false;
    int var = qs.getQuestVarById(0);
    int targetId = env.getTargetId();
    DialogAction dialog = env.getDialog();

    if (qs.getStatus() == QuestStatus.START) {
      if (targetId == 203518) { // Boromer
        switch (dialog) {
          case QUEST_SELECT:
            {
              if (var == 0) {
                return sendQuestDialog(env, 1011);
              } else if (var == 1) {
                return sendQuestDialog(env, 1352);
              } else if (var == 2) {
                return sendQuestDialog(env, 1694);
              }
            }
          case SELECT_ACTION_1012:
            {
              playQuestMovie(env, 51);
              return sendQuestDialog(env, 1012);
            }
          case SETPRO1:
            {
              return defaultCloseDialog(env, 0, 1); // 1
            }
          case SETPRO3:
            {
              return defaultCloseDialog(env, 2, 3); // 3
            }
          case CHECK_USER_HAS_QUEST_ITEM:
            {
              return checkQuestItems(env, 1, 2, false, 1694, 1693);
            }
          case FINISH_DIALOG:
            {
              return sendQuestSelectionDialog(env);
            }
        }
      } else if (targetId == 700093) {
        return true; // just give quest drop on use
      }
    } else if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 203518) { // Boromer
        if (dialog == DialogAction.USE_OBJECT) {
          return sendQuestDialog(env, 2034);
        } else {
          return sendQuestEndDialog(env);
        }
      }
    }
    return false;
  }
コード例 #21
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    int targetId = 0;
    if (env.getVisibleObject() instanceof Npc) {
      targetId = ((Npc) env.getVisibleObject()).getNpcId();
    }
    QuestState qs = player.getQuestStateList().getQuestState(questId);
    if (targetId == 204777) {
      if (qs == null || qs.getStatus() == QuestStatus.NONE) {
        if (env.getDialog() == DialogAction.QUEST_SELECT) {
          return sendQuestDialog(env, 1011);
        } else {
          return sendQuestStartDialog(env);
        }
      }
    }
    if (qs == null) {
      return false;
    }

    int var = qs.getQuestVarById(0);
    if (qs.getStatus() == QuestStatus.REWARD) {
      if (targetId == 204777) {
        if (env.getDialog() == DialogAction.USE_OBJECT) {
          return sendQuestDialog(env, 2375);
        } else if (env.getDialogId() == DialogAction.SELECT_QUEST_REWARD.id()) {
          return sendQuestDialog(env, 5);
        } else {
          return sendQuestEndDialog(env);
        }
      }
    } else if (qs.getStatus() != QuestStatus.START) {
      return false;
    }
    if (targetId == 204790) {
      switch (env.getDialog()) {
        case QUEST_SELECT:
          if (var == 0) {
            return sendQuestDialog(env, 1352);
          }
        case SETPRO1:
          if (var == 0) {
            qs.setQuestVarById(0, var + 1);
            qs.setStatus(QuestStatus.REWARD);
            if (!giveQuestItem(env, 182204489, 1)) {
              updateQuestStatus(env);
            }
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
            return true;
          }
          return false;
      }
    }
    return false;
  }
コード例 #22
0
 @Override
 public HandlerResult onItemUseEvent(QuestEnv env, Item item) {
   Player player = env.getPlayer();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (qs != null && qs.getStatus() == QuestStatus.START) {
     return HandlerResult.fromBoolean(useQuestItem(env, item, 0, 1, true));
   }
   return HandlerResult.FAILED;
 }
コード例 #23
0
 private boolean isStigmaEquipped(QuestEnv env) {
   Player player = env.getPlayer();
   for (Item i : player.getEquipment().getEquippedItemsAllStigma()) {
     if (i.getItemId() == getStoneId(player)) {
       return true;
     }
   }
   return false;
 }
コード例 #24
0
 @Override
 public HandlerResult onItemUseEvent(QuestEnv env, Item item) {
   Player player = env.getPlayer();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (qs == null || qs.getStatus() == QuestStatus.NONE) {
     return HandlerResult.fromBoolean(sendQuestDialog(env, 4));
   }
   return HandlerResult.FAILED;
 }
コード例 #25
0
ファイル: _1006Ascension.java プロジェクト: xj2479564/AU-AD
 private boolean setPlayerClass(QuestEnv env, QuestState qs, PlayerClass playerClass) {
   Player player = env.getPlayer();
   player.getCommonData().setPlayerClass(playerClass);
   player.getCommonData().upgradePlayer();
   qs.setStatus(QuestStatus.REWARD);
   updateQuestStatus(player, qs);
   sendQuestDialog(player, env.getVisibleObject().getObjectId(), 5);
   return true;
 }
コード例 #26
0
  @Override
  public boolean onDialogEvent(QuestEnv env) {
    final Player player = env.getPlayer();
    int targetId = 0;

    QuestState qs2 = player.getQuestStateList().getQuestState(3968);
    if (qs2 == null || qs2.getStatus() != QuestStatus.COMPLETE) return false;

    if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId();
    QuestState qs = player.getQuestStateList().getQuestState(questId);

    if (targetId == 798390) // Palentine
    {
      if (qs == null || qs.getStatus() == QuestStatus.NONE) {
        if (env.getDialogId() == -1)
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1011);
        else if (env.getDialogId() == 1002) {
          if (ItemService.addItems(
              player, Collections.singletonList(new QuestItems(182206126, 1)))) {
            return defaultQuestStartDialog(env);
          }
          return true;
        } else return defaultQuestStartDialog(env);
      }
    }

    if (qs == null) return false;

    int var = qs.getQuestVarById(0);

    if (targetId == 798391) // Andu
    {
      if (qs.getStatus() == QuestStatus.START && var == 0) {
        if (env.getDialogId() == -1)
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 1352);
        else if (env.getDialogId() == 10000) {
          if (ItemService.removeItemFromInventoryByItemId(player, 182206126)) {
            qs.setQuestVar(1);
            qs.setStatus(QuestStatus.REWARD);
            updateQuestStatus(player, qs);
            PacketSendUtility.sendPacket(
                player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10));
          }
          return true;
        } else return defaultQuestStartDialog(env);
      }
    } else if (targetId == 798390) // Palentine
    {
      if (qs.getStatus() == QuestStatus.REWARD) {
        if (env.getDialogId() == -1)
          return sendQuestDialog(player, env.getVisibleObject().getObjectId(), 2375);
        return defaultQuestEndDialog(env);
      }
    }
    return false;
  }
コード例 #27
0
ファイル: _2038ALostDaeva.java プロジェクト: soulxj/aion-cn
 @Override
 public boolean onDialogEvent(final QuestEnv env) {
   Player player = env.getPlayer();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (qs == null) return false;
   int var = qs.getQuestVarById(0);
   int targetId = env.getTargetId();
   DialogAction dialog = env.getDialog();
   if (qs.getStatus() == QuestStatus.START) {
     switch (targetId) {
       case 204342:
         { // Mirka
           switch (dialog) {
             case QUEST_SELECT:
               {
                 if (var == 0) {
                   return sendQuestDialog(env, 1011);
                 }
                 if (var == 4) return sendQuestDialog(env, 2375);
               }
             case SELECT_ACTION_1012:
               {
                 if (var == 0) {
                   playQuestMovie(env, 82);
                   return sendQuestDialog(env, 1012);
                 }
               }
             case SETPRO1:
               {
                 return defaultCloseDialog(env, 0, 1); // 1
               }
             case SET_SUCCEED:
               {
                 return defaultCloseDialog(env, 4, 4, true, false, 0, 0, 182204016, 1); // reward
               }
           }
           break;
         }
       case 700233:
         { // Pagimkin's Corpse
           if (dialog == DialogAction.USE_OBJECT && var == 1) {
             return useQuestObject(env, 1, 2, false, 0); // 2
           }
         }
     }
   } else if (qs.getStatus() == QuestStatus.REWARD) {
     if (targetId == 204053) { // Kvasir
       if (env.getDialog() == DialogAction.USE_OBJECT) {
         return sendQuestDialog(env, 10002);
       } else {
         return sendQuestEndDialog(env);
       }
     }
   }
   return false;
 }
コード例 #28
0
 @Override
 public boolean onGetItemEvent(QuestEnv env) {
   Player player = env.getPlayer();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (qs != null && qs.getStatus() == QuestStatus.START) {
     changeQuestStep(env, 0, 0, true); // reward
     return true;
   }
   return false;
 }
コード例 #29
0
ファイル: _1006Ascension.java プロジェクト: xj2479564/AU-AD
 @Override
 public boolean onQuestFinishEvent(QuestEnv env) {
   Player player = env.getPlayer();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (qs != null && qs.getStatus() == QuestStatus.REWARD) {
     teleportService.teleportTo(player, 210010000, 1, 242, 1638, 100, (byte) 20, 0);
     return true;
   }
   return false;
 }
コード例 #30
0
ファイル: _1006Ascension.java プロジェクト: xj2479564/AU-AD
 @Override
 public boolean onLvlUpEvent(QuestEnv env) {
   Player player = env.getPlayer();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (qs != null) return false;
   if (player.getCommonData().getLevel() < 9) return false;
   env.setQuestId(questId);
   questService.startQuest(env, QuestStatus.START);
   return true;
 }