Simplified pvePenalty calculation.
This commit is contained in:
parent
adf1653c1c
commit
6ee572a36a
@ -1407,26 +1407,6 @@ public final class Formulas
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcPveDamagePenalty(Creature attacker, Creature target, Skill skill, boolean crit)
|
||||
{
|
||||
if (target.isAttackable() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) > 1))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (skill != null)
|
||||
{
|
||||
return Config.NPC_SKILL_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_SKILL_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
else if (crit)
|
||||
{
|
||||
return Config.NPC_CRIT_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_CRIT_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return Config.NPC_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||
* @param creature the creature to be checked
|
||||
@ -1572,7 +1552,20 @@ public final class Formulas
|
||||
final double pveAttack;
|
||||
final double pveDefense;
|
||||
final double pveRaidDefense;
|
||||
final double pvePenalty = calcPveDamagePenalty(attacker, target, skill, crit);
|
||||
|
||||
double pvePenalty = 1;
|
||||
if (!target.isRaid() && !target.isRaidMinion() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (lvlDiff >= Config.NPC_SKILL_DMG_PENALTY.size())
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(Config.NPC_SKILL_DMG_PENALTY.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(lvlDiff);
|
||||
}
|
||||
}
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
|
@ -1407,26 +1407,6 @@ public final class Formulas
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcPveDamagePenalty(Creature attacker, Creature target, Skill skill, boolean crit)
|
||||
{
|
||||
if (target.isAttackable() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) > 1))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (skill != null)
|
||||
{
|
||||
return Config.NPC_SKILL_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_SKILL_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
else if (crit)
|
||||
{
|
||||
return Config.NPC_CRIT_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_CRIT_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return Config.NPC_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||
* @param creature the creature to be checked
|
||||
@ -1572,7 +1552,20 @@ public final class Formulas
|
||||
final double pveAttack;
|
||||
final double pveDefense;
|
||||
final double pveRaidDefense;
|
||||
final double pvePenalty = calcPveDamagePenalty(attacker, target, skill, crit);
|
||||
|
||||
double pvePenalty = 1;
|
||||
if (!target.isRaid() && !target.isRaidMinion() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (lvlDiff >= Config.NPC_SKILL_DMG_PENALTY.size())
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(Config.NPC_SKILL_DMG_PENALTY.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(lvlDiff);
|
||||
}
|
||||
}
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
|
@ -1407,26 +1407,6 @@ public final class Formulas
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcPveDamagePenalty(Creature attacker, Creature target, Skill skill, boolean crit)
|
||||
{
|
||||
if (target.isAttackable() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) > 1))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (skill != null)
|
||||
{
|
||||
return Config.NPC_SKILL_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_SKILL_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
else if (crit)
|
||||
{
|
||||
return Config.NPC_CRIT_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_CRIT_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return Config.NPC_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||
* @param creature the creature to be checked
|
||||
@ -1572,7 +1552,20 @@ public final class Formulas
|
||||
final double pveAttack;
|
||||
final double pveDefense;
|
||||
final double pveRaidDefense;
|
||||
final double pvePenalty = calcPveDamagePenalty(attacker, target, skill, crit);
|
||||
|
||||
double pvePenalty = 1;
|
||||
if (!target.isRaid() && !target.isRaidMinion() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (lvlDiff >= Config.NPC_SKILL_DMG_PENALTY.size())
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(Config.NPC_SKILL_DMG_PENALTY.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(lvlDiff);
|
||||
}
|
||||
}
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
|
@ -1407,26 +1407,6 @@ public final class Formulas
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcPveDamagePenalty(Creature attacker, Creature target, Skill skill, boolean crit)
|
||||
{
|
||||
if (target.isAttackable() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) > 1))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (skill != null)
|
||||
{
|
||||
return Config.NPC_SKILL_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_SKILL_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
else if (crit)
|
||||
{
|
||||
return Config.NPC_CRIT_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_CRIT_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return Config.NPC_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||
* @param creature the creature to be checked
|
||||
@ -1572,7 +1552,20 @@ public final class Formulas
|
||||
final double pveAttack;
|
||||
final double pveDefense;
|
||||
final double pveRaidDefense;
|
||||
final double pvePenalty = calcPveDamagePenalty(attacker, target, skill, crit);
|
||||
|
||||
double pvePenalty = 1;
|
||||
if (!target.isRaid() && !target.isRaidMinion() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (lvlDiff >= Config.NPC_SKILL_DMG_PENALTY.size())
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(Config.NPC_SKILL_DMG_PENALTY.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(lvlDiff);
|
||||
}
|
||||
}
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
|
@ -1407,26 +1407,6 @@ public final class Formulas
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcPveDamagePenalty(Creature attacker, Creature target, Skill skill, boolean crit)
|
||||
{
|
||||
if (target.isAttackable() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) > 1))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (skill != null)
|
||||
{
|
||||
return Config.NPC_SKILL_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_SKILL_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
else if (crit)
|
||||
{
|
||||
return Config.NPC_CRIT_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_CRIT_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return Config.NPC_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||
* @param creature the creature to be checked
|
||||
@ -1572,7 +1552,20 @@ public final class Formulas
|
||||
final double pveAttack;
|
||||
final double pveDefense;
|
||||
final double pveRaidDefense;
|
||||
final double pvePenalty = calcPveDamagePenalty(attacker, target, skill, crit);
|
||||
|
||||
double pvePenalty = 1;
|
||||
if (!target.isRaid() && !target.isRaidMinion() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (lvlDiff >= Config.NPC_SKILL_DMG_PENALTY.size())
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(Config.NPC_SKILL_DMG_PENALTY.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(lvlDiff);
|
||||
}
|
||||
}
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
|
@ -1407,26 +1407,6 @@ public final class Formulas
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcPveDamagePenalty(Creature attacker, Creature target, Skill skill, boolean crit)
|
||||
{
|
||||
if (target.isAttackable() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) > 1))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (skill != null)
|
||||
{
|
||||
return Config.NPC_SKILL_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_SKILL_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
else if (crit)
|
||||
{
|
||||
return Config.NPC_CRIT_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_CRIT_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return Config.NPC_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||
* @param creature the creature to be checked
|
||||
@ -1572,7 +1552,20 @@ public final class Formulas
|
||||
final double pveAttack;
|
||||
final double pveDefense;
|
||||
final double pveRaidDefense;
|
||||
final double pvePenalty = calcPveDamagePenalty(attacker, target, skill, crit);
|
||||
|
||||
double pvePenalty = 1;
|
||||
if (!target.isRaid() && !target.isRaidMinion() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (lvlDiff >= Config.NPC_SKILL_DMG_PENALTY.size())
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(Config.NPC_SKILL_DMG_PENALTY.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(lvlDiff);
|
||||
}
|
||||
}
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
|
@ -1407,26 +1407,6 @@ public final class Formulas
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcPveDamagePenalty(Creature attacker, Creature target, Skill skill, boolean crit)
|
||||
{
|
||||
if (target.isAttackable() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) > 1))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (skill != null)
|
||||
{
|
||||
return Config.NPC_SKILL_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_SKILL_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
else if (crit)
|
||||
{
|
||||
return Config.NPC_CRIT_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_CRIT_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return Config.NPC_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||
* @param creature the creature to be checked
|
||||
@ -1572,7 +1552,20 @@ public final class Formulas
|
||||
final double pveAttack;
|
||||
final double pveDefense;
|
||||
final double pveRaidDefense;
|
||||
final double pvePenalty = calcPveDamagePenalty(attacker, target, skill, crit);
|
||||
|
||||
double pvePenalty = 1;
|
||||
if (!target.isRaid() && !target.isRaidMinion() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (lvlDiff >= Config.NPC_SKILL_DMG_PENALTY.size())
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(Config.NPC_SKILL_DMG_PENALTY.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(lvlDiff);
|
||||
}
|
||||
}
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
|
@ -1407,26 +1407,6 @@ public final class Formulas
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcPveDamagePenalty(Creature attacker, Creature target, Skill skill, boolean crit)
|
||||
{
|
||||
if (target.isAttackable() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) > 1))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (skill != null)
|
||||
{
|
||||
return Config.NPC_SKILL_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_SKILL_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
else if (crit)
|
||||
{
|
||||
return Config.NPC_CRIT_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_CRIT_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return Config.NPC_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||
* @param creature the creature to be checked
|
||||
@ -1572,7 +1552,20 @@ public final class Formulas
|
||||
final double pveAttack;
|
||||
final double pveDefense;
|
||||
final double pveRaidDefense;
|
||||
final double pvePenalty = calcPveDamagePenalty(attacker, target, skill, crit);
|
||||
|
||||
double pvePenalty = 1;
|
||||
if (!target.isRaid() && !target.isRaidMinion() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (lvlDiff >= Config.NPC_SKILL_DMG_PENALTY.size())
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(Config.NPC_SKILL_DMG_PENALTY.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(lvlDiff);
|
||||
}
|
||||
}
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
|
@ -1407,26 +1407,6 @@ public final class Formulas
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcPveDamagePenalty(Creature attacker, Creature target, Skill skill, boolean crit)
|
||||
{
|
||||
if (target.isAttackable() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) > 1))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (skill != null)
|
||||
{
|
||||
return Config.NPC_SKILL_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_SKILL_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
else if (crit)
|
||||
{
|
||||
return Config.NPC_CRIT_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_CRIT_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return Config.NPC_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||
* @param creature the creature to be checked
|
||||
@ -1572,7 +1552,20 @@ public final class Formulas
|
||||
final double pveAttack;
|
||||
final double pveDefense;
|
||||
final double pveRaidDefense;
|
||||
final double pvePenalty = calcPveDamagePenalty(attacker, target, skill, crit);
|
||||
|
||||
double pvePenalty = 1;
|
||||
if (!target.isRaid() && !target.isRaidMinion() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (lvlDiff >= Config.NPC_SKILL_DMG_PENALTY.size())
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(Config.NPC_SKILL_DMG_PENALTY.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(lvlDiff);
|
||||
}
|
||||
}
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
|
@ -1407,26 +1407,6 @@ public final class Formulas
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcPveDamagePenalty(Creature attacker, Creature target, Skill skill, boolean crit)
|
||||
{
|
||||
if (target.isAttackable() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) > 1))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (skill != null)
|
||||
{
|
||||
return Config.NPC_SKILL_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_SKILL_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
else if (crit)
|
||||
{
|
||||
return Config.NPC_CRIT_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_CRIT_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return Config.NPC_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||
* @param creature the creature to be checked
|
||||
@ -1572,7 +1552,20 @@ public final class Formulas
|
||||
final double pveAttack;
|
||||
final double pveDefense;
|
||||
final double pveRaidDefense;
|
||||
final double pvePenalty = calcPveDamagePenalty(attacker, target, skill, crit);
|
||||
|
||||
double pvePenalty = 1;
|
||||
if (!target.isRaid() && !target.isRaidMinion() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (lvlDiff >= Config.NPC_SKILL_DMG_PENALTY.size())
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(Config.NPC_SKILL_DMG_PENALTY.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(lvlDiff);
|
||||
}
|
||||
}
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
|
@ -1407,26 +1407,6 @@ public final class Formulas
|
||||
}
|
||||
}
|
||||
|
||||
public static double calcPveDamagePenalty(Creature attacker, Creature target, Skill skill, boolean crit)
|
||||
{
|
||||
if (target.isAttackable() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) > 1))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (skill != null)
|
||||
{
|
||||
return Config.NPC_SKILL_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_SKILL_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
else if (crit)
|
||||
{
|
||||
return Config.NPC_CRIT_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_CRIT_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return Config.NPC_DMG_PENALTY.get(Math.min(lvlDiff, Config.NPC_DMG_PENALTY.size() - 1));
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||
* @param creature the creature to be checked
|
||||
@ -1572,7 +1552,20 @@ public final class Formulas
|
||||
final double pveAttack;
|
||||
final double pveDefense;
|
||||
final double pveRaidDefense;
|
||||
final double pvePenalty = calcPveDamagePenalty(attacker, target, skill, crit);
|
||||
|
||||
double pvePenalty = 1;
|
||||
if (!target.isRaid() && !target.isRaidMinion() && (target.getLevel() >= Config.MIN_NPC_LVL_DMG_PENALTY) && (attacker.getActingPlayer() != null) && ((target.getLevel() - attacker.getActingPlayer().getLevel()) >= 2))
|
||||
{
|
||||
final int lvlDiff = target.getLevel() - attacker.getActingPlayer().getLevel() - 1;
|
||||
if (lvlDiff >= Config.NPC_SKILL_DMG_PENALTY.size())
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(Config.NPC_SKILL_DMG_PENALTY.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pvePenalty = Config.NPC_SKILL_DMG_PENALTY.get(lvlDiff);
|
||||
}
|
||||
}
|
||||
|
||||
if (skill != null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user