From c839674fe93cd6f08ecb6c7cf89d50535e3d5390 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 16 Feb 2018 17:33:09 +0000 Subject: [PATCH] Updated physical skill effects to use formulas calcCrit function. --- .../scripts/handlers/effecthandlers/EnergyAttack.java | 6 ++---- .../handlers/effecthandlers/PhysicalAttack.java | 6 ++---- .../handlers/effecthandlers/PhysicalAttackHpLink.java | 11 +++++------ .../handlers/effecthandlers/PhysicalAttackSaveHp.java | 6 ++---- .../effecthandlers/PhysicalAttackWeaponBonus.java | 6 ++---- .../handlers/effecthandlers/PhysicalSoulAttack.java | 6 ++---- .../scripts/handlers/effecthandlers/EnergyAttack.java | 6 ++---- .../handlers/effecthandlers/PhysicalAttack.java | 6 ++---- .../handlers/effecthandlers/PhysicalAttackHpLink.java | 11 +++++------ .../handlers/effecthandlers/PhysicalAttackSaveHp.java | 6 ++---- .../effecthandlers/PhysicalAttackWeaponBonus.java | 6 ++---- .../handlers/effecthandlers/PhysicalSoulAttack.java | 6 ++---- .../scripts/handlers/effecthandlers/EnergyAttack.java | 6 ++---- .../handlers/effecthandlers/PhysicalAttack.java | 6 ++---- .../handlers/effecthandlers/PhysicalAttackHpLink.java | 11 +++++------ .../handlers/effecthandlers/PhysicalAttackSaveHp.java | 6 ++---- .../effecthandlers/PhysicalAttackWeaponBonus.java | 6 ++---- .../handlers/effecthandlers/PhysicalSoulAttack.java | 6 ++---- .../scripts/handlers/effecthandlers/EnergyAttack.java | 6 ++---- .../handlers/effecthandlers/PhysicalAttack.java | 6 ++---- .../handlers/effecthandlers/PhysicalAttackHpLink.java | 11 +++++------ .../handlers/effecthandlers/PhysicalAttackSaveHp.java | 6 ++---- .../effecthandlers/PhysicalAttackWeaponBonus.java | 6 ++---- .../handlers/effecthandlers/PhysicalSoulAttack.java | 6 ++---- .../scripts/handlers/effecthandlers/EnergyAttack.java | 6 ++---- .../handlers/effecthandlers/PhysicalAttack.java | 6 ++---- .../handlers/effecthandlers/PhysicalAttackHpLink.java | 11 +++++------ .../handlers/effecthandlers/PhysicalAttackSaveHp.java | 6 ++---- .../effecthandlers/PhysicalAttackWeaponBonus.java | 6 ++---- .../handlers/effecthandlers/PhysicalSoulAttack.java | 6 ++---- 30 files changed, 75 insertions(+), 130 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java index f8ab8aa773..dbfd92ec67 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java @@ -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()) { diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java index ee26388cd5..3cf1a3e34a 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java @@ -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; diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java index 5058c0934e..a8a692f62a 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java @@ -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); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java index a2c1c39d1a..75736d0195 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java @@ -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; diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java index 4f9565f0fe..4201b25e31 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java @@ -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; diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java index b591dab322..24d31fb577 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java @@ -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; diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java index f8ab8aa773..dbfd92ec67 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java @@ -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()) { diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java index ee26388cd5..3cf1a3e34a 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java @@ -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; diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java index 5058c0934e..a8a692f62a 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java @@ -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); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java index a2c1c39d1a..75736d0195 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java @@ -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; diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java index 4f9565f0fe..4201b25e31 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java @@ -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; diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java index b591dab322..24d31fb577 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java @@ -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; diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java index f8ab8aa773..dbfd92ec67 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java @@ -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()) { diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java index ee26388cd5..3cf1a3e34a 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java @@ -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; diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java index 5058c0934e..a8a692f62a 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java @@ -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); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java index a2c1c39d1a..75736d0195 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java @@ -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; diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java index 4f9565f0fe..4201b25e31 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java @@ -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; diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java index b591dab322..24d31fb577 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java @@ -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; diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java index f8ab8aa773..dbfd92ec67 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java @@ -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()) { diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java index ee26388cd5..3cf1a3e34a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java @@ -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; diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java index 5058c0934e..a8a692f62a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java @@ -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); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java index a2c1c39d1a..75736d0195 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java @@ -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; diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java index 4f9565f0fe..4201b25e31 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java @@ -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; diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java index b591dab322..24d31fb577 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java @@ -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; diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java index f8ab8aa773..dbfd92ec67 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/EnergyAttack.java @@ -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()) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java index ee26388cd5..3cf1a3e34a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttack.java @@ -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; diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java index 5058c0934e..a8a692f62a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackHpLink.java @@ -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); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java index a2c1c39d1a..75736d0195 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackSaveHp.java @@ -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; diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java index 4f9565f0fe..4201b25e31 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalAttackWeaponBonus.java @@ -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; diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java index b591dab322..24d31fb577 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PhysicalSoulAttack.java @@ -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;