/**
   * @param player
   * @param target
   * @return DP reward
   */
  public static int calculateGroupDPReward(Player player, Creature target) {
    int playerLevel = player.getCommonData().getLevel();
    int targetLevel = target.getLevel();
    NpcRating npcRating = ((Npc) target).getObjectTemplate().getRating();

    // TODO: fix to see monster Rating level, NORMAL lvl 1, 2 | ELITE lvl 1, 2 etc..
    int baseDP = targetLevel * calculateRatingMultipler(npcRating);
    int xpPercentage = XPRewardEnum.xpRewardFrom(targetLevel - playerLevel);
    float rate = player.getRates().getDpNpcRate();

    return (int) Math.floor(baseDP * xpPercentage * rate / 100);
  }
  /**
   * ref:
   * http://www.aionsource.com/forum/mechanic-analysis/42597-character-stats-xp-dp-origin-gerbator-team-july-2009-
   * a.html
   *
   * @param player
   * @param target
   * @return DP reward from target
   */
  public static int calculateSoloDPReward(Player player, Creature target) {
    int playerLevel = player.getCommonData().getLevel();
    int targetLevel = target.getLevel();
    NpcRating npcRating = ((Npc) target).getObjectTemplate().getRating();

    // TODO: fix to see monster Rating level, NORMAL lvl 1, 2 | ELITE lvl 1, 2 etc..
    // look at:
    // http://www.aionsource.com/forum/mechanic-analysis/42597-character-stats-xp-dp-origin-gerbator-team-july-2009-a.html
    int baseDP = targetLevel * calculateRatingMultipler(npcRating);

    int xpPercentage = XPRewardEnum.xpRewardFrom(targetLevel - playerLevel);
    float rate = player.getRates().getDpNpcRate();
    return (int) Math.floor(baseDP * xpPercentage * rate / 100);
  }
 @Override
 public boolean onMovieEndEvent(QuestEnv env, int movieId) {
   if (movieId != 16) return false;
   Player player = env.getPlayer();
   QuestState qs = player.getQuestStateList().getQuestState(questId);
   if (qs == null || qs.getStatus() != QuestStatus.REWARD) return false;
   int rewardExp = player.getRates().getQuestXpRate() * 8410;
   player.getCommonData().addExp(rewardExp);
   qs.setStatus(QuestStatus.COMPLETE);
   qs.setCompliteCount(1);
   updateQuestStatus(player, qs);
   PacketSendUtility.sendPacket(player, new SM_QUEST_ACCEPTED(questId, QuestStatus.COMPLETE, 2));
   return true;
 }
  /**
   * @param defeated
   * @param winner
   * @return Points Lost in PvP Death
   */
  public static int calculatePvPApLost(Player defeated, Player winner) {
    int pointsLost =
        Math.round(
            defeated.getAbyssRank().getRank().getPointsLost()
                * defeated.getRates().getApPlayerLossRate());

    // Level penalty calculation
    int difference = winner.getLevel() - defeated.getLevel();

    if (difference > 4) {
      pointsLost = Math.round(pointsLost * 0.1f);
    } else {
      switch (difference) {
        case 3:
          pointsLost = Math.round(pointsLost * 0.85f);
          break;
        case 4:
          pointsLost = Math.round(pointsLost * 0.65f);
          break;
      }
    }
    return pointsLost;
  }
Beispiel #5
0
  public void rewardPlayer(Player player) {
    if (player != null) {
      int skillLvl = getObjectTemplate().getSkillLevel();
      int xpReward =
          (int)
              ((0.008 * (skillLvl + 100) * (skillLvl + 100) + 60)
                  * player.getRates().getGatheringXPRate());

      if (player
          .getSkillList()
          .addSkillXp(player, getObjectTemplate().getHarvestSkill(), xpReward)) {
        PacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.EXTRACT_GATHER_SUCCESS_GETEXP());
        player.getCommonData().addExp(xpReward);
      } else
        PacketSendUtility.sendPacket(
            player,
            SM_SYSTEM_MESSAGE.MSG_DONT_GET_PRODUCTION_EXP(
                new DescriptionId(
                    DataManager.SKILL_DATA
                        .getSkillTemplate(getObjectTemplate().getHarvestSkill())
                        .getNameId())));
    }
  }