Пример #1
0
  @Override
  public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet) {
    if ((npc.getNpcId() == 29019)
        || (npc.getNpcId() == 29066)
        || (npc.getNpcId() == 29067)
        || (npc.getNpcId() == 29068)) {
      _LastAction = System.currentTimeMillis();
      if (GrandBossManager.getInstance().getBossStatus(_antharas.getNpcId()) != FIGHTING) {
        _Zone.oustAllPlayers();
      } else if (!FWA_OLDANTHARAS && (_mobsSpawnTask == null)) {
        startMinionSpawns(npc.getNpcId());
      }
    } else if ((npc.getNpcId() > 29069)
        && (npc.getNpcId() < 29077)
        && (npc.getCurrentHp() <= damage)) {
      L2Skill skill = null;
      switch (npc.getNpcId()) {
        case 29070:
        case 29071:
        case 29072:
        case 29073:
        case 29074:
        case 29075:
          skill = SkillTable.getInstance().getInfo(5097, 1);
          break;
        case 29076:
          skill = SkillTable.getInstance().getInfo(5094, 1);
          break;
      }

      npc.doCast(skill);
    }
    return super.onAttack(npc, attacker, damage, isPet);
  }
Пример #2
0
  public void removeSkills() {
    // Decrease Bow/Crossbow Attack Speed
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(5491, 1), false);
    // Transform Dispel
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);

    getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  }
Пример #3
0
  public void transformedSkills() {
    // Decrease Bow/Crossbow Attack Speed
    getPlayer().addSkill(SkillTable.getInstance().getInfo(5491, 1), false);
    // Transform Dispel
    getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);

    getPlayer().setTransformAllowedSkills(SKILLS);
  }
Пример #4
0
  public void removeSkills() {
    // Doll Blader Clairvoyance
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(754, 1), false, false);

    if (getPlayer().getLevel() >= 76) {
      // Doll Blader Sting (up to 3 levels)
      getPlayer().removeSkill(SkillTable.getInstance().getInfo(752, 3), false);
      // Doll Blader Throwing Knife (up to 3 levels)
      getPlayer().removeSkill(SkillTable.getInstance().getInfo(753, 3), false);
    } else if (getPlayer().getLevel() >= 73) {
      // Doll Blader Sting (up to 3 levels)
      getPlayer().removeSkill(SkillTable.getInstance().getInfo(752, 2), false);
      // Doll Blader Throwing Knife (up to 3 levels)
      getPlayer().removeSkill(SkillTable.getInstance().getInfo(753, 2), false);
    } else {
      // Doll Blader Sting (up to 3 levels)
      getPlayer().removeSkill(SkillTable.getInstance().getInfo(752, 1), false);
      // Doll Blader Throwing Knife (up to 3 levels)
      getPlayer().removeSkill(SkillTable.getInstance().getInfo(753, 1), false);
    }
    // Decrease Bow/Crossbow Attack Speed
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(5491, 1), false);
    // Transform Dispel
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);

    getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  }
Пример #5
0
  public void removeSkills() {
    // Transform Dispel
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);
    // Cursed Body
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(967, 1), false);
    // Treykan Claw
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(968, 1), false);
    // Treykan Dash
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(969, 1), false);
    // Dissonance
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(5437, 1), false);

    getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  }
Пример #6
0
  public void transformedSkills() {
    // Transform Dispel
    getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
    // Cursed Body
    getPlayer().addSkill(SkillTable.getInstance().getInfo(967, 1), false);
    // Treykan Claw
    getPlayer().addSkill(SkillTable.getInstance().getInfo(968, 1), false);
    // Treykan Dash
    getPlayer().addSkill(SkillTable.getInstance().getInfo(969, 1), false);
    // Dissonance
    getPlayer().addSkill(SkillTable.getInstance().getInfo(5437, 1), false);

    getPlayer().setTransformAllowedSkills(SKILLS);
  }
  @Override
  public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player) {
    QuestState st = player.getQuestState(qn);

    if (st == null) return "<html><body>目前沒有執行任務,或條件不符。</body></html>";

    final int cond = st.getInt("cond");
    if (event.equalsIgnoreCase("31001-05.htm")) {
      if (cond == 0) {
        st.set("cond", "1");
        st.setState(State.STARTED);
        st.playSound("ItemSound.quest_accept");
      }
    } else if (event.equalsIgnoreCase("32576-02.htm")) {
      if (cond == 1) {
        st.giveItems(IDENTITY_CARD, 1);
        st.set("cond", "2");
        st.playSound("ItemSound.quest_middle");
      }
    } else if (event.equalsIgnoreCase("30289-04.htm")) {
      if (cond == 2) {
        st.set("cond", "3");
        player.stopAllEffects();
        SkillTable.getInstance().getInfo(GUARD_DAWN, 1).getEffects(player, player);
      }
    } else if (event.equalsIgnoreCase("30289-07.htm")) {
      if (cond == 3) {
        SkillTable.getInstance().getInfo(GUARD_DAWN, 1).getEffects(player, player);
      }
    } else if (event.equalsIgnoreCase("30289-08.htm")) {
      if (cond == 3) {
        player.stopAllEffects();
      }
    } else if (event.equalsIgnoreCase("30289-11.htm")) {
      if (cond == 3) {
        st.set("cond", "4");
        st.playSound("ItemSound.quest_middle");
        player.stopAllEffects();
      }
    } else if (event.equalsIgnoreCase("30969-03.htm")) {
      if (cond == 4) {
        st.addExpAndSp(52518015, 5817677);
        // st.addExpAndSp(25000000, 2500000); // High Five
        st.unset("cond");
        st.exitQuest(false);
        st.playSound("ItemSound.quest_finish");
      }
    }
    return event;
  }
Пример #8
0
    @Override
    public void run() {
      L2Skill skill = null;
      switch (_bomber.getNpcId()) {
        case 29070:
        case 29071:
        case 29072:
        case 29073:
        case 29074:
        case 29075:
          skill = SkillTable.getInstance().getInfo(5097, 1);
          break;
        case 29076:
          skill = SkillTable.getInstance().getInfo(5094, 1);
          break;
      }

      _bomber.doCast(skill);
      if (_selfDestructionTask != null) {
        _selfDestructionTask.cancel(false);
        _selfDestructionTask = null;
      }
    }
  public void removeSkills() {
    // Attack Buster (up to 4 levels)
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(568, 2), false);
    // Attack Storm (up to 4 levels)
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(569, 2), false);
    // Attack Rage (up to 4 levels)
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(570, 2), false);
    // Poison Dust (up to 4 levels)
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(571, 2), false);
    // Decrease Bow/Crossbow Attack Speed
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(5491, 1), false);
    // Transform Dispel
    getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);

    getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  }
Пример #10
0
  /**
   * @see
   *     com.l2jserver.gameserver.handler.IItemHandler#useItem(com.l2jserver.gameserver.model.actor.L2Playable,
   *     com.l2jserver.gameserver.model.L2ItemInstance)
   */
  public void useItem(L2Playable playable, L2ItemInstance _item) {
    if (!(playable instanceof L2PcInstance)) return;

    if (CastleManorManager.getInstance().isDisabled()) return;

    _activeChar = (L2PcInstance) playable;

    if (!(_activeChar.getTarget() instanceof L2MonsterInstance)) {
      _activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
      _activeChar.sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }

    _target = (L2MonsterInstance) _activeChar.getTarget();

    if (_target == null || !_target.isDead()) {
      _activeChar.sendPacket(ActionFailed.STATIC_PACKET);
      return;
    }

    L2Skill skill = SkillTable.getInstance().getInfo(2098, 1); // harvesting skill
    if (skill != null) _activeChar.useMagic(skill, false, false);
  }
  private void initNewChar(L2GameClient client, L2PcInstance newChar) {
    if (Config.DEBUG) _log.fine("Character init start");

    L2World.getInstance().storeObject(newChar);

    L2PcTemplate template = newChar.getTemplate();

    newChar.addAdena("Init", Config.STARTING_ADENA, null, false);

    newChar.setXYZInvisible(template.spawnX, template.spawnY, template.spawnZ);
    newChar.setTitle("");

    if (Config.ENABLE_VITALITY)
      newChar.setVitalityPoints(
          Math.min(Config.STARTING_VITALITY_POINTS, PcStat.MAX_VITALITY_POINTS), true);

    if (Config.STARTING_LEVEL > 1) {
      newChar.getStat().addLevel((byte) (Config.STARTING_LEVEL - 1));
    }
    if (Config.STARTING_SP > 0) {
      newChar.getStat().addSp(Config.STARTING_SP);
    }

    L2ShortCut shortcut;
    // add attack shortcut
    shortcut = new L2ShortCut(0, 0, 3, 2, 0, 1);
    newChar.registerShortCut(shortcut);
    // add take shortcut
    shortcut = new L2ShortCut(3, 0, 3, 5, 0, 1);
    newChar.registerShortCut(shortcut);
    // add sit shortcut
    shortcut = new L2ShortCut(10, 0, 3, 0, 0, 1);
    newChar.registerShortCut(shortcut);

    for (PcTemplateItem ia : template.getItems()) {
      L2ItemInstance item =
          newChar.getInventory().addItem("Init", ia.getItemId(), ia.getAmount(), newChar, null);

      if (item == null) {
        _log.warning(
            "Could not create item during char creation: itemId "
                + ia.getItemId()
                + ", amount "
                + ia.getAmount()
                + ".");
        continue;
      }

      // add tutbook shortcut
      if (item.getItemId() == 5588) {
        shortcut = new L2ShortCut(11, 0, 1, item.getObjectId(), 0, 1);
        newChar.registerShortCut(shortcut);
      }

      if (item.isEquipable() && ia.isEquipped()) {
        newChar.getInventory().equipItem(item);
      }
    }

    for (L2SkillLearn skill :
        SkillTreesData.getInstance()
            .getAvailableSkills(newChar, newChar.getClassId(), false, true)) {
      newChar.addSkill(
          SkillTable.getInstance().getInfo(skill.getSkillId(), skill.getSkillLevel()), true);
      if (skill.getSkillId() == 1001 || skill.getSkillId() == 1177) {
        shortcut = new L2ShortCut(1, 0, 2, skill.getSkillId(), skill.getSkillLevel(), 1);
        newChar.registerShortCut(shortcut);
      }
      if (skill.getSkillId() == 1216) {
        shortcut = new L2ShortCut(10, 0, 2, skill.getSkillId(), skill.getSkillLevel(), 1);
        newChar.registerShortCut(shortcut);
      }
      if (Config.DEBUG)
        _log.fine("Adding starter skill:" + skill.getSkillId() + " / " + skill.getSkillLevel());
    }

    if (!Config.DISABLE_TUTORIAL) startTutorialQuest(newChar);

    newChar.setOnlineStatus(true, false);
    newChar.deleteMe();

    CharSelectionInfo cl =
        new CharSelectionInfo(client.getAccountName(), client.getSessionId().playOkID1);
    client.getConnection().sendPacket(cl);
    client.setCharSelection(cl.getCharInfo());

    if (Config.DEBUG) _log.fine("Character init end");
  }