Updated physical skill effects to use formulas calcCrit function.
This commit is contained in:
parent
6857c290c0
commit
c839674fe9
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -26,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -126,7 +124,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(attacker) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, attacker, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -138,7 +136,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
|
||||
// Skill specific mods.
|
||||
final double energyChargesBoost = 1 + (charge * 0.1); // 10% bonus damage for each charge used.
|
||||
final double critMod = critical ? Formulas.calcCritDamage(attacker, effected, skill) : 1;
|
||||
final double critMod = critical ? (2 * Formulas.calcCritDamage(attacker, effected, skill)) : 1;
|
||||
double ssmod = 1;
|
||||
if (skill.useSoulShot())
|
||||
{
|
||||
|
@ -20,7 +20,6 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -30,7 +29,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -135,7 +133,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effected, effector, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -147,7 +145,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double abnormalMod = _abnormals.stream().anyMatch(effected::hasAbnormalType) ? _abnormalPowerMod : 1;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -80,7 +78,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
final double attack = effector.getPAtk();
|
||||
final double power = _power * (-((effected.getCurrentHp() * 2) / effected.getMaxHp()) + 2);
|
||||
final double power = _power;
|
||||
double defence = effected.getPDef();
|
||||
|
||||
switch (Formulas.calcShldUse(effector, effected))
|
||||
@ -98,7 +96,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -110,9 +108,9 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
final double critMod = critical ? (2 * Formulas.calcCritDamage(effector, effected, skill)) : 1;
|
||||
double ssmod = 1;
|
||||
if (skill.useSoulShot())
|
||||
{
|
||||
@ -132,6 +130,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
final double baseMod = (wpnMod * ((attack * effector.getLevelMod()) + power + rangedBonus)) / defence;
|
||||
damage = baseMod * ssmod * critMod * weaponTraitMod * generalTraitMod * attributeMod * pvpPveMod * randomMod;
|
||||
damage = effector.getStat().getValue(Stats.PHYSICAL_SKILL_POWER, damage);
|
||||
damage *= Math.max(1.0d, ((100 - ((effected.getCurrentHp() / effected.getMaxHp()) * 100) - 40) * 2) / 100);
|
||||
}
|
||||
|
||||
effector.doAttack(damage, effected, skill, false, false, critical, false);
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -108,7 +106,7 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -120,7 +118,7 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
double ssmod = 1;
|
||||
|
@ -19,7 +19,6 @@ package handlers.effecthandlers;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -29,7 +28,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.items.type.WeaponType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -128,7 +126,7 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -140,7 +138,7 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double weaponBonus = _weaponBonus.getOrDefault(effector.getAttackType(), 1.0);
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -122,7 +120,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -134,7 +132,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
double ssmod = 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -26,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -126,7 +124,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(attacker) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, attacker, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -138,7 +136,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
|
||||
// Skill specific mods.
|
||||
final double energyChargesBoost = 1 + (charge * 0.1); // 10% bonus damage for each charge used.
|
||||
final double critMod = critical ? Formulas.calcCritDamage(attacker, effected, skill) : 1;
|
||||
final double critMod = critical ? (2 * Formulas.calcCritDamage(attacker, effected, skill)) : 1;
|
||||
double ssmod = 1;
|
||||
if (skill.useSoulShot())
|
||||
{
|
||||
|
@ -20,7 +20,6 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -30,7 +29,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -135,7 +133,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effected, effector, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -147,7 +145,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double abnormalMod = _abnormals.stream().anyMatch(effected::hasAbnormalType) ? _abnormalPowerMod : 1;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -80,7 +78,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
final double attack = effector.getPAtk();
|
||||
final double power = _power * (-((effected.getCurrentHp() * 2) / effected.getMaxHp()) + 2);
|
||||
final double power = _power;
|
||||
double defence = effected.getPDef();
|
||||
|
||||
switch (Formulas.calcShldUse(effector, effected))
|
||||
@ -98,7 +96,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -110,9 +108,9 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
final double critMod = critical ? (2 * Formulas.calcCritDamage(effector, effected, skill)) : 1;
|
||||
double ssmod = 1;
|
||||
if (skill.useSoulShot())
|
||||
{
|
||||
@ -132,6 +130,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
final double baseMod = (wpnMod * ((attack * effector.getLevelMod()) + power + rangedBonus)) / defence;
|
||||
damage = baseMod * ssmod * critMod * weaponTraitMod * generalTraitMod * attributeMod * pvpPveMod * randomMod;
|
||||
damage = effector.getStat().getValue(Stats.PHYSICAL_SKILL_POWER, damage);
|
||||
damage *= Math.max(1.0d, ((100 - ((effected.getCurrentHp() / effected.getMaxHp()) * 100) - 40) * 2) / 100);
|
||||
}
|
||||
|
||||
effector.doAttack(damage, effected, skill, false, false, critical, false);
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -108,7 +106,7 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -120,7 +118,7 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
double ssmod = 1;
|
||||
|
@ -19,7 +19,6 @@ package handlers.effecthandlers;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -29,7 +28,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.items.type.WeaponType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -128,7 +126,7 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -140,7 +138,7 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double weaponBonus = _weaponBonus.getOrDefault(effector.getAttackType(), 1.0);
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -122,7 +120,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -134,7 +132,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
double ssmod = 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -26,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -126,7 +124,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(attacker) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, attacker, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -138,7 +136,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
|
||||
// Skill specific mods.
|
||||
final double energyChargesBoost = 1 + (charge * 0.1); // 10% bonus damage for each charge used.
|
||||
final double critMod = critical ? Formulas.calcCritDamage(attacker, effected, skill) : 1;
|
||||
final double critMod = critical ? (2 * Formulas.calcCritDamage(attacker, effected, skill)) : 1;
|
||||
double ssmod = 1;
|
||||
if (skill.useSoulShot())
|
||||
{
|
||||
|
@ -20,7 +20,6 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -30,7 +29,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -135,7 +133,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effected, effector, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -147,7 +145,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double abnormalMod = _abnormals.stream().anyMatch(effected::hasAbnormalType) ? _abnormalPowerMod : 1;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -80,7 +78,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
final double attack = effector.getPAtk();
|
||||
final double power = _power * (-((effected.getCurrentHp() * 2) / effected.getMaxHp()) + 2);
|
||||
final double power = _power;
|
||||
double defence = effected.getPDef();
|
||||
|
||||
switch (Formulas.calcShldUse(effector, effected))
|
||||
@ -98,7 +96,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -110,9 +108,9 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
final double critMod = critical ? (2 * Formulas.calcCritDamage(effector, effected, skill)) : 1;
|
||||
double ssmod = 1;
|
||||
if (skill.useSoulShot())
|
||||
{
|
||||
@ -132,6 +130,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
final double baseMod = (wpnMod * ((attack * effector.getLevelMod()) + power + rangedBonus)) / defence;
|
||||
damage = baseMod * ssmod * critMod * weaponTraitMod * generalTraitMod * attributeMod * pvpPveMod * randomMod;
|
||||
damage = effector.getStat().getValue(Stats.PHYSICAL_SKILL_POWER, damage);
|
||||
damage *= Math.max(1.0d, ((100 - ((effected.getCurrentHp() / effected.getMaxHp()) * 100) - 40) * 2) / 100);
|
||||
}
|
||||
|
||||
effector.doAttack(damage, effected, skill, false, false, critical, false);
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -108,7 +106,7 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -120,7 +118,7 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
double ssmod = 1;
|
||||
|
@ -19,7 +19,6 @@ package handlers.effecthandlers;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -29,7 +28,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.items.type.WeaponType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -128,7 +126,7 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -140,7 +138,7 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double weaponBonus = _weaponBonus.getOrDefault(effector.getAttackType(), 1.0);
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -122,7 +120,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -134,7 +132,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
double ssmod = 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -26,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -126,7 +124,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(attacker) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, attacker, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -138,7 +136,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
|
||||
// Skill specific mods.
|
||||
final double energyChargesBoost = 1 + (charge * 0.1); // 10% bonus damage for each charge used.
|
||||
final double critMod = critical ? Formulas.calcCritDamage(attacker, effected, skill) : 1;
|
||||
final double critMod = critical ? (2 * Formulas.calcCritDamage(attacker, effected, skill)) : 1;
|
||||
double ssmod = 1;
|
||||
if (skill.useSoulShot())
|
||||
{
|
||||
|
@ -20,7 +20,6 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -30,7 +29,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -135,7 +133,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effected, effector, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -147,7 +145,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double abnormalMod = _abnormals.stream().anyMatch(effected::hasAbnormalType) ? _abnormalPowerMod : 1;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -80,7 +78,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
final double attack = effector.getPAtk();
|
||||
final double power = _power * (-((effected.getCurrentHp() * 2) / effected.getMaxHp()) + 2);
|
||||
final double power = _power;
|
||||
double defence = effected.getPDef();
|
||||
|
||||
switch (Formulas.calcShldUse(effector, effected))
|
||||
@ -98,7 +96,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -110,9 +108,9 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
final double critMod = critical ? (2 * Formulas.calcCritDamage(effector, effected, skill)) : 1;
|
||||
double ssmod = 1;
|
||||
if (skill.useSoulShot())
|
||||
{
|
||||
@ -132,6 +130,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
final double baseMod = (wpnMod * ((attack * effector.getLevelMod()) + power + rangedBonus)) / defence;
|
||||
damage = baseMod * ssmod * critMod * weaponTraitMod * generalTraitMod * attributeMod * pvpPveMod * randomMod;
|
||||
damage = effector.getStat().getValue(Stats.PHYSICAL_SKILL_POWER, damage);
|
||||
damage *= Math.max(1.0d, ((100 - ((effected.getCurrentHp() / effected.getMaxHp()) * 100) - 40) * 2) / 100);
|
||||
}
|
||||
|
||||
effector.doAttack(damage, effected, skill, false, false, critical, false);
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -108,7 +106,7 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -120,7 +118,7 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
double ssmod = 1;
|
||||
|
@ -19,7 +19,6 @@ package handlers.effecthandlers;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -29,7 +28,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.items.type.WeaponType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -128,7 +126,7 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -140,7 +138,7 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double weaponBonus = _weaponBonus.getOrDefault(effector.getAttackType(), 1.0);
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -122,7 +120,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -134,7 +132,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
double ssmod = 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -26,7 +25,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -126,7 +124,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(attacker) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, attacker, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -138,7 +136,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
|
||||
// Skill specific mods.
|
||||
final double energyChargesBoost = 1 + (charge * 0.1); // 10% bonus damage for each charge used.
|
||||
final double critMod = critical ? Formulas.calcCritDamage(attacker, effected, skill) : 1;
|
||||
final double critMod = critical ? (2 * Formulas.calcCritDamage(attacker, effected, skill)) : 1;
|
||||
double ssmod = 1;
|
||||
if (skill.useSoulShot())
|
||||
{
|
||||
|
@ -20,7 +20,6 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -30,7 +29,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.AbnormalType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -135,7 +133,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effected, effector, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -147,7 +145,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double abnormalMod = _abnormals.stream().anyMatch(effected::hasAbnormalType) ? _abnormalPowerMod : 1;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -80,7 +78,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
final double attack = effector.getPAtk();
|
||||
final double power = _power * (-((effected.getCurrentHp() * 2) / effected.getMaxHp()) + 2);
|
||||
final double power = _power;
|
||||
double defence = effected.getPDef();
|
||||
|
||||
switch (Formulas.calcShldUse(effector, effected))
|
||||
@ -98,7 +96,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -110,9 +108,9 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
final double critMod = critical ? (2 * Formulas.calcCritDamage(effector, effected, skill)) : 1;
|
||||
double ssmod = 1;
|
||||
if (skill.useSoulShot())
|
||||
{
|
||||
@ -132,6 +130,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
final double baseMod = (wpnMod * ((attack * effector.getLevelMod()) + power + rangedBonus)) / defence;
|
||||
damage = baseMod * ssmod * critMod * weaponTraitMod * generalTraitMod * attributeMod * pvpPveMod * randomMod;
|
||||
damage = effector.getStat().getValue(Stats.PHYSICAL_SKILL_POWER, damage);
|
||||
damage *= Math.max(1.0d, ((100 - ((effected.getCurrentHp() / effected.getMaxHp()) * 100) - 40) * 2) / 100);
|
||||
}
|
||||
|
||||
effector.doAttack(damage, effected, skill, false, false, critical, false);
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -108,7 +106,7 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -120,7 +118,7 @@ public final class PhysicalAttackSaveHp extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
double ssmod = 1;
|
||||
|
@ -19,7 +19,6 @@ package handlers.effecthandlers;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -29,7 +28,6 @@ import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.items.type.WeaponType;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
|
||||
@ -128,7 +126,7 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -140,7 +138,7 @@ public final class PhysicalAttackWeaponBonus extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double weaponBonus = _weaponBonus.getOrDefault(effector.getAttackType(), 1.0);
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import com.l2jmobius.commons.util.Rnd;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@ -25,7 +24,6 @@ import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.model.stats.BaseStats;
|
||||
import com.l2jmobius.gameserver.model.stats.Formulas;
|
||||
import com.l2jmobius.gameserver.model.stats.Stats;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -122,7 +120,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
double damage = 1;
|
||||
final boolean critical = (_criticalChance > 0) && ((BaseStats.STR.calcBonus(effector) * _criticalChance) > (Rnd.nextDouble() * 100));
|
||||
final boolean critical = Formulas.calcCrit(_criticalChance, effector, effected, skill);
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
@ -134,7 +132,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
final double randomMod = effector.getRandomDamageMultiplier();
|
||||
|
||||
// Skill specific mods.
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : (70 * 1.10113);
|
||||
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
|
||||
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
|
||||
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
|
||||
double ssmod = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user