@Override
  public String onTalk(L2Npc npc, L2PcInstance player) {
    final QuestState qs = getQuestState(player, true);
    String htmltext = getNoQuestMsg(player);
    if (qs.isCompleted()) {
      return getAlreadyCompletedMsg(player);
    }
    if (player.getRace() == Race.ERTHEIA) {
      return "31292-noErtheia.html";
    }
    if (player.isMageClass()) {
      return "31292-noMage.html";
    }

    switch (npc.getId()) {
      case ANDREI:
        {
          if (qs.isCreated()) {
            htmltext = "31292-01.htm";
          } else if (qs.isStarted()) {
            htmltext = "31292-03.html";
          }
          break;
        }
      case JANITT:
        {
          if (qs.isCond(1)) {
            htmltext = "33851-01.html";
          }
          break;
        }
    }
    return htmltext;
  }
Ejemplo n.º 2
0
  /**
   * Called on Appearing packet received (player finished teleporting)
   *
   * @param playerInstance
   */
  public static void onTeleported(L2PcInstance playerInstance) {
    if (!isStarted()
        || (playerInstance == null)
        || !isPlayerParticipant(playerInstance.getObjectId())) {
      return;
    }

    if (playerInstance.isMageClass()) {
      if ((Config.TVT_EVENT_MAGE_BUFFS != null) && !Config.TVT_EVENT_MAGE_BUFFS.isEmpty()) {
        for (Entry<Integer, Integer> e : Config.TVT_EVENT_MAGE_BUFFS.entrySet()) {
          final Skill skill = SkillData.getInstance().getSkill(e.getKey(), e.getValue());
          if (skill != null) {
            skill.applyEffects(playerInstance, playerInstance);
          }
        }
      }
    } else {
      if ((Config.TVT_EVENT_FIGHTER_BUFFS != null) && !Config.TVT_EVENT_FIGHTER_BUFFS.isEmpty()) {
        for (Entry<Integer, Integer> e : Config.TVT_EVENT_FIGHTER_BUFFS.entrySet()) {
          final Skill skill = SkillData.getInstance().getSkill(e.getKey(), e.getValue());
          if (skill != null) {
            skill.applyEffects(playerInstance, playerInstance);
          }
        }
      }
    }
  }