Пример #1
0
  /**
   * Method giveItems.
   *
   * @param player Player
   * @param previousClassId
   * @param newClassId
   */
  public void giveItems(Player player, Integer previousClassId, Integer newClassId) {
    if (!player.getSubClassList().isDualClassActive()) {
      ItemFunctions.addItem(player, AWAKEN_POWER.get(newClassId), 1, true);
      ItemFunctions.addItem(player, LEGACY_WEAPONS.get(previousClassId), 1, true);
    } else {
      if (previousClassId >= 139) {
        player.getInventory().destroyItemByItemId(CLOAK_DUAL_CLASS.get(previousClassId), 1);
        player.getWarehouse().destroyItemByItemId(CLOAK_DUAL_CLASS.get(previousClassId), 1);
      }

      ItemFunctions.addItem(player, CLOAK_DUAL_CLASS.get(newClassId), 1, true);
    }
  }
  /**
   * Method hasPartyAKey.
   *
   * @param player Player
   * @return boolean
   */
  private boolean hasPartyAKey(Player player) {
    for (Player m : player.getParty().getPartyMembers()) {
      if (ItemFunctions.getItemCount(m, HALLS_KEY) > 0) {
        return true;
      }
    }

    return false;
  }
Пример #3
0
  /**
   * Method giveGiantEssences.
   *
   * @param player Player
   * @param onlyCalculateCount boolean
   * @return int
   */
  public int giveGiantEssences(Player player, boolean onlyCalculateCount) {
    List<Integer> enchantedSkills = new FastList<>();
    int count = 0;

    for (Skill skill : player.getAllSkills()) {
      if ((SkillTreeTable.isEnchantable(skill) != 0)
          && (player.getSkillDisplayLevel(skill.getId()) > 99)) {
        int skillLvl = skill.getDisplayLevel();
        int elevel = skillLvl % 100;
        EnchantSkillLearn sl = SkillTreeTable.getSkillEnchant(skill.getId(), skillLvl);

        if (sl != null) {
          if (sl.getMaxLevel() == 15) {
            elevel = Math.min(count15T.length, elevel);
            count += count15T[elevel];
          } else {
            elevel = Math.min(count30T.length, elevel);
            count += count30T[elevel];
          }
        }
      }

      enchantedSkills.add(Integer.valueOf(skill.getId()));
    }

    if (!onlyCalculateCount) {
      if (count > 0) {
        for (int i = 0; i < enchantedSkills.size(); i++) {
          player.removeSkillById(enchantedSkills.get(i));
          player.addSkill(
              SkillTable.getInstance()
                  .getInfo(
                      enchantedSkills.get(i),
                      SkillTable.getInstance().getBaseLevel(enchantedSkills.get(i))),
              true);
        }

        ItemFunctions.addItem(player, ESSENCE_OF_THE_LESSER_GIANTS, count, true);
      }
    }

    return count;
  }
Пример #4
0
 public void giveItemsChaosEssence(Player player) {
   ItemFunctions.addItem(
       player, player.isBaseClassActive() ? CHAOS_ESSENCE : CHAOS_ESSENCE_DUAL_CLASS, 1, true);
 }
Пример #5
0
 public void giveItemsChaosPomander(Player player) {
   ItemFunctions.addItem(
       player, player.isBaseClassActive() ? CHAOS_POMANDER : CHAOS_POMANDER_DUAL_CLASS, 2, true);
 }