コード例 #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
  // Clean Antharas's lair.
  public void setUnspawn() {
    // Eliminate players.
    _Zone.oustAllPlayers();

    // Not executed tasks is canceled.
    if (_cubeSpawnTask != null) {
      _cubeSpawnTask.cancel(true);
      _cubeSpawnTask = null;
    }
    if (_monsterSpawnTask != null) {
      _monsterSpawnTask.cancel(true);
      _monsterSpawnTask = null;
    }
    if (_activityCheckTask != null) {
      _activityCheckTask.cancel(false);
      _activityCheckTask = null;
    }
    if (_socialTask != null) {
      _socialTask.cancel(true);
      _socialTask = null;
    }
    if (_mobiliseTask != null) {
      _mobiliseTask.cancel(true);
      _mobiliseTask = null;
    }
    if (_mobsSpawnTask != null) {
      _mobsSpawnTask.cancel(true);
      _mobsSpawnTask = null;
    }
    if (_selfDestructionTask != null) {
      _selfDestructionTask.cancel(true);
      _selfDestructionTask = null;
    }
    if (_moveAtRandomTask != null) {
      _moveAtRandomTask.cancel(true);
      _moveAtRandomTask = null;
    }

    // Delete monsters.
    for (L2Npc mob : _monsters) {
      mob.getSpawn().stopRespawn();
      mob.deleteMe();
    }
    _monsters.clear();

    // Delete teleport cube.
    for (L2Npc cube : _teleportCube) {
      cube.getSpawn().stopRespawn();
      cube.deleteMe();
    }
    _teleportCube.clear();
  }