예제 #1
0
파일: L2Fishing.java 프로젝트: 3mRe/L2Java
  public synchronized void doDie(boolean win) {
    if (_fishAiTask != null) {
      _fishAiTask.cancel(false);
      _fishAiTask = null;
    }

    if (_fisher == null) {
      return;
    }

    if (win) {
      final L2FishingMonster fishingMonster =
          FishingMonstersData.getInstance().getFishingMonster(_fisher.getLevel());
      if (fishingMonster != null) {
        if (Rnd.get(100) <= fishingMonster.getProbability()) {
          _fisher.sendPacket(SystemMessageId.YOU_VE_CAUGHT_GOLDEEN);
          final L2Npc monster =
              AbstractScript.addSpawn(fishingMonster.getFishingMonsterId(), _fisher);
          monster.setTarget(_fisher);
        } else {
          _fisher.sendPacket(SystemMessageId.YOU_CAUGHT_SOMETHING);
          _fisher.addItem("Fishing", _fishId, 1, null, true);
          FishingChampionshipManager.getInstance().newFish(_fisher, _lureId);
        }
      }
    }

    _fisher.endFishing(win, true);
    _fisher = null;
  }
예제 #2
0
  @Override
  protected void runImpl() {
    final L2PcInstance activeChar = getClient().getActiveChar();
    if (activeChar == null) {
      return;
    }

    if (Config.ALT_FISH_CHAMPIONSHIP_ENABLED) {
      FishingChampionshipManager.getInstance().showMidResult(activeChar);
    }
  }