Simplified pvePenalty calculation.
This commit is contained in:
@@ -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.
|
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||||
* @param creature the creature to be checked
|
* @param creature the creature to be checked
|
||||||
@@ -1572,7 +1552,20 @@ public final class Formulas
|
|||||||
final double pveAttack;
|
final double pveAttack;
|
||||||
final double pveDefense;
|
final double pveDefense;
|
||||||
final double pveRaidDefense;
|
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)
|
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.
|
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||||
* @param creature the creature to be checked
|
* @param creature the creature to be checked
|
||||||
@@ -1572,7 +1552,20 @@ public final class Formulas
|
|||||||
final double pveAttack;
|
final double pveAttack;
|
||||||
final double pveDefense;
|
final double pveDefense;
|
||||||
final double pveRaidDefense;
|
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)
|
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.
|
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||||
* @param creature the creature to be checked
|
* @param creature the creature to be checked
|
||||||
@@ -1572,7 +1552,20 @@ public final class Formulas
|
|||||||
final double pveAttack;
|
final double pveAttack;
|
||||||
final double pveDefense;
|
final double pveDefense;
|
||||||
final double pveRaidDefense;
|
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)
|
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.
|
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||||
* @param creature the creature to be checked
|
* @param creature the creature to be checked
|
||||||
@@ -1572,7 +1552,20 @@ public final class Formulas
|
|||||||
final double pveAttack;
|
final double pveAttack;
|
||||||
final double pveDefense;
|
final double pveDefense;
|
||||||
final double pveRaidDefense;
|
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)
|
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.
|
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||||
* @param creature the creature to be checked
|
* @param creature the creature to be checked
|
||||||
@@ -1572,7 +1552,20 @@ public final class Formulas
|
|||||||
final double pveAttack;
|
final double pveAttack;
|
||||||
final double pveDefense;
|
final double pveDefense;
|
||||||
final double pveRaidDefense;
|
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)
|
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.
|
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||||
* @param creature the creature to be checked
|
* @param creature the creature to be checked
|
||||||
@@ -1572,7 +1552,20 @@ public final class Formulas
|
|||||||
final double pveAttack;
|
final double pveAttack;
|
||||||
final double pveDefense;
|
final double pveDefense;
|
||||||
final double pveRaidDefense;
|
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)
|
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.
|
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||||
* @param creature the creature to be checked
|
* @param creature the creature to be checked
|
||||||
@@ -1572,7 +1552,20 @@ public final class Formulas
|
|||||||
final double pveAttack;
|
final double pveAttack;
|
||||||
final double pveDefense;
|
final double pveDefense;
|
||||||
final double pveRaidDefense;
|
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)
|
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.
|
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||||
* @param creature the creature to be checked
|
* @param creature the creature to be checked
|
||||||
@@ -1572,7 +1552,20 @@ public final class Formulas
|
|||||||
final double pveAttack;
|
final double pveAttack;
|
||||||
final double pveDefense;
|
final double pveDefense;
|
||||||
final double pveRaidDefense;
|
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)
|
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.
|
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||||
* @param creature the creature to be checked
|
* @param creature the creature to be checked
|
||||||
@@ -1572,7 +1552,20 @@ public final class Formulas
|
|||||||
final double pveAttack;
|
final double pveAttack;
|
||||||
final double pveDefense;
|
final double pveDefense;
|
||||||
final double pveRaidDefense;
|
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)
|
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.
|
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||||
* @param creature the creature to be checked
|
* @param creature the creature to be checked
|
||||||
@@ -1572,7 +1552,20 @@ public final class Formulas
|
|||||||
final double pveAttack;
|
final double pveAttack;
|
||||||
final double pveDefense;
|
final double pveDefense;
|
||||||
final double pveRaidDefense;
|
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)
|
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.
|
* Calculates if the specified creature can get its stun effect removed due to damage taken.
|
||||||
* @param creature the creature to be checked
|
* @param creature the creature to be checked
|
||||||
@@ -1572,7 +1552,20 @@ public final class Formulas
|
|||||||
final double pveAttack;
|
final double pveAttack;
|
||||||
final double pveDefense;
|
final double pveDefense;
|
||||||
final double pveRaidDefense;
|
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)
|
if (skill != null)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user