Beispiel #1
0
  /**
   * Method restore.
   *
   * @param player Player
   */
  void restore(Player player) {
    if (player.getEffectList().getEffectsBySkillId(_skillId) != null) {
      for (Effect e : player.getEffectList().getAllEffects()) {
        if (e.getSkill().getId() == _skillId) {
          _level = e.getSkill().getLevel();
          e.exit();
        }
      }
    }

    if (!Config.ALLOW_DEATH_PENALTY_C5) {
      return;
    }

    if (getLevel(player) > 0) {
      Skill skill = SkillTable.getInstance().getInfo(_skillId, _level);

      if (skill == null) {
        return;
      }

      skill.getEffects(player, player, false, false);
      player.sendPacket(
          new SystemMessage(SystemMessage.THE_LEVEL_S1_SHILENS_BREATH_WILL_BE_ASSESSED)
              .addNumber(getLevel(player)));
    }

    player.updateStats();
  }
Beispiel #2
0
  /** Method reduceLevel. */
  public void reduceLevel() {
    Player player = getPlayer();

    if (player == null) {
      return;
    }

    for (Effect e : player.getEffectList().getAllEffects()) {
      if (e.getSkill().getId() == _skillId) {
        _level = e.getSkill().getLevel();
        e.exit();
      } else {
        return;
      }
    }

    _level--;

    if (getLevel(player) > 0) {
      player.broadcastPacket(new MagicSkillUse(player, player, _skillId, getLevel(player), 0, 0));
      player.sendPacket(
          new SystemMessage(SystemMessage.THE_LEVEL_S1_SHILENS_BREATH_WILL_BE_ASSESSED)
              .addNumber(getLevel(player)));
    } else {
      player.sendPacket(new SystemMessage(SystemMessage.THE_SHILENS_BREATH_HAS_BEEN_LIFTED));
    }

    player.updateStats();
  }
Beispiel #3
0
  /** Method addLevel. */
  private void addLevel() {
    Player player = getPlayer();

    if ((player == null) || (getLevel(player) >= 5)) {
      return;
    }

    if (player.getEffectList().getEffectsBySkillId(_skillId) != null) {
      for (Effect e : player.getEffectList().getAllEffects()) {
        if (e.getSkill().getId() == _skillId) {
          _level = e.getSkill().getLevel();
          e.exit();
        }
      }
    }

    _level++;
  }
Beispiel #4
0
  /**
   * Method getLevelOnSaveDB.
   *
   * @param player Player
   * @return int
   */
  public int getLevelOnSaveDB(Player player) {
    if ((player.getEffectList().getEffectsBySkillId(_skillId) != null) && (_level != 0)) {
      if (_level > 5) {
        _level = 5;
      }

      if (_level < 0) {
        _level = 0;
      }

      return _level;
    }

    return 0;
  }
Beispiel #5
0
  /** Method checkCharmOfLuck. */
  void checkCharmOfLuck() {
    Player player = getPlayer();

    if (player != null) {
      for (Effect e : player.getEffectList().getAllEffects()) {
        if ((e.getSkill().getId() == _charmOfLuckSkillId)
            || (e.getSkill().getId() == _fortuneOfNobleseSkillId)) {
          _hasCharmOfLuck = true;
          return;
        }
      }
    }

    _hasCharmOfLuck = false;
  }