diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Backstab.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Backstab.java index 407c15af47..ab3b0d7f3c 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Backstab.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Backstab.java @@ -33,14 +33,14 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class Backstab extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final double _criticalChance; private final boolean _overHit; public Backstab(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _criticalChance = params.getDouble("criticalChance", 0); _overHit = params.getBoolean("overHit", false); } @@ -48,7 +48,7 @@ public final class Backstab extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java index 08c1164d08..4c94b296af 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java @@ -22,7 +22,6 @@ import java.util.Set; import com.l2jmobius.gameserver.enums.ShotType; import com.l2jmobius.gameserver.model.StatsSet; -import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; @@ -38,27 +37,24 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class FatalBlow extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final double _criticalChance; - private final boolean _overHit; - private final Set _abnormals; private final double _abnormalPower; public FatalBlow(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _criticalChance = params.getDouble("criticalChance", 0); - _overHit = params.getBoolean("overHit", false); - final String abnormals = params.getString("abnormalType", null); + String abnormals = params.getString("abnormalType", null); if ((abnormals != null) && !abnormals.isEmpty()) { _abnormals = new HashSet<>(); for (String slot : abnormals.split(";")) { - _abnormals.add(AbnormalType.getAbnormalType(slot)); + _abnormals.add(Enum.valueOf(AbnormalType.class, slot)); } } else @@ -71,7 +67,7 @@ public final class FatalBlow extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override @@ -94,11 +90,6 @@ public final class FatalBlow extends AbstractEffect return; } - if (_overHit && effected.isAttackable()) - { - ((L2Attackable) effected).overhitEnabled(true); - } - double power = _power; // Check if we apply an abnormal modifier diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java index 53d8257d8d..e97b9006e5 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java @@ -33,13 +33,13 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class SoulBlow extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final boolean _overHit; public SoulBlow(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _overHit = params.getBoolean("overHit", false); } @@ -52,7 +52,7 @@ public final class SoulBlow extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00000-00099.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00000-00099.xml index ebb28c6d8c..1deeeddf91 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00000-00099.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00000-00099.xml @@ -1784,7 +1784,7 @@ 977 true - 20 + 200 @@ -3290,7 +3290,7 @@ 15 15 - 40 + 400 true diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00200-00299.xml index e43a2f1ac1..abf3ea1e23 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00200-00299.xml @@ -4526,9 +4526,10 @@ 5479 true - 30 + 300 + 0 10 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00300-00399.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00300-00399.xml index 5530b2fcac..81628425f5 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00300-00399.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00300-00399.xml @@ -1079,12 +1079,13 @@ 3653 true - 25 + 250 80 + 0 5 @@ -1715,10 +1716,11 @@ 5773 20 - 30 + 300 true + 0 15 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00400-00499.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00400-00499.xml index bec2a52cba..271c56952b 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00400-00499.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00400-00499.xml @@ -1204,9 +1204,10 @@ 3653 true - 25 + 250 + 0 5 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00500-00599.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00500-00599.xml index edd4eb6023..f1474ffc36 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00500-00599.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00500-00599.xml @@ -525,7 +525,7 @@ 5479 true - 20 + 200 @@ -4198,9 +4198,10 @@ 5199 true - 20 + 200 + 0 10 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00600-00699.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00600-00699.xml index 624077d50c..77d784f27b 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00600-00699.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00600-00699.xml @@ -2634,9 +2634,10 @@ 6969 true - 20 + 200 + 0 10 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00900-00999.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00900-00999.xml index cd0ca7f3df..59039ea7da 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00900-00999.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/00900-00999.xml @@ -1604,7 +1604,7 @@ 11234 30 - 60 + 600 true diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/01500-01599.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/01500-01599.xml index 8f234f1408..d6aa350c10 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/01500-01599.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/01500-01599.xml @@ -3668,7 +3668,7 @@ 11234 30 - 60 + 600 true diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04000-04099.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04000-04099.xml index f6b3b35a2c..a4d6a55023 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04000-04099.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04000-04099.xml @@ -2431,7 +2431,7 @@ 7461 7850 - 20 + 200 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04100-04199.xml index f0fde7ad23..5a39ff053b 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04100-04199.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04100-04199.xml @@ -3417,7 +3417,7 @@ 44350 49193 - 115 + 1150 @@ -4046,7 +4046,7 @@ 73917 81989 - 67 + 670 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04500-04599.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04500-04599.xml index 41b6c10600..29a1734588 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04500-04599.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04500-04599.xml @@ -2542,7 +2542,7 @@ 7461 7850 - 20 + 200 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04700-04799.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04700-04799.xml index ce8130894a..13e4caf37f 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04700-04799.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/04700-04799.xml @@ -1082,8 +1082,8 @@ 9648 9830 - 30 - 50 + 10 + 200 @@ -2305,7 +2305,7 @@ 44350 49193 - 115 + 1150 @@ -2365,7 +2365,7 @@ 38806 43290 - 115 + 1150 @@ -2425,7 +2425,7 @@ 20667 23023 - 115 + 1150 @@ -2485,7 +2485,7 @@ 19381 21645 - 115 + 1150 @@ -2545,7 +2545,7 @@ 18140 20268 - 115 + 1150 @@ -3600,7 +3600,7 @@ 73917 81989 - 67 + 670 @@ -3660,7 +3660,7 @@ 64677 72150 - 67 + 670 @@ -3720,7 +3720,7 @@ 34445 38371 - 67 + 670 @@ -3780,7 +3780,7 @@ 32302 36075 - 67 + 670 @@ -3840,7 +3840,7 @@ 30232 33780 - 67 + 670 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/05000-05099.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/05000-05099.xml index e962c42a83..ae50bd58d1 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/05000-05099.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/05000-05099.xml @@ -2817,7 +2817,7 @@ 7306 8602 - 20 + 200 @@ -2916,15 +2916,13 @@ 6335 - 15 + 150 40 DIFF - - diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/05100-05199.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/05100-05199.xml index 03f7b878bb..b0c79fd59d 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/05100-05199.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/05100-05199.xml @@ -1309,7 +1309,7 @@ 39544 - 115 + 1150 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/06000-06099.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/06000-06099.xml index 94f5c21ec3..b4b8b211fe 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/06000-06099.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/06000-06099.xml @@ -1861,7 +1861,7 @@ 6844 6960 - 20 + 200 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/08500-08599.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/08500-08599.xml index 8af4f8e86d..28cbd5376c 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/08500-08599.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/08500-08599.xml @@ -1536,10 +1536,11 @@ 5773 20 - 30 + 300 true + 0 15 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/10500-10599.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/10500-10599.xml index 7b91578a41..6be1fadf68 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/10500-10599.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/10500-10599.xml @@ -494,7 +494,7 @@ {base + base / 100 * subIndex} 30 - 40 + 400 true @@ -516,7 +516,7 @@ {base + base / 100 * (5 + subIndex)} 30 - 40 + 400 true @@ -610,7 +610,7 @@ {base + base / 100 * subIndex} 15 - 36.5 + 365 true @@ -632,7 +632,7 @@ {base + base / 100 * (5 + subIndex)} 15 - 36.5 + 365 true @@ -739,7 +739,7 @@ 20 BLEEDING 4130 - 36.5 + 365 true @@ -762,8 +762,8 @@ 20 BLEEDING - 4130 - 36.5 + 4130 + 365 true @@ -838,7 +838,7 @@ {base + base / 100 * subIndex} 20 - 36.5 + 365 true @@ -856,7 +856,7 @@ {base + base / 100 * (5 + subIndex)} 20 - 36.5 + 365 true @@ -2929,7 +2929,7 @@ 8875 - 30 + 300 @@ -3117,7 +3117,7 @@ 27993 29472 - 30 + 300 -23 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/10700-10799.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/10700-10799.xml index 013ad6351a..a0ae79814f 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/10700-10799.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/10700-10799.xml @@ -327,11 +327,12 @@ 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 - 30 + 300 8875 true + 0 15 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/11300-11399.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/11300-11399.xml index 2b2e8f19a1..5d07d961e7 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/11300-11399.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/11300-11399.xml @@ -3613,7 +3613,7 @@ - 30 + 300 45696 47772 @@ -3621,7 +3621,7 @@ - + 0 10 @@ -3647,7 +3647,7 @@ - 30 + 300 51411 53747 @@ -3655,7 +3655,7 @@ - + 0 10 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14200-14299.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14200-14299.xml index bcf8d93cda..5941472e40 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14200-14299.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14200-14299.xml @@ -2857,7 +2857,7 @@ 5029 5479 - 20 + 200 100 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14500-14599.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14500-14599.xml index f8c8b6f003..21c9bbb51f 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14500-14599.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14500-14599.xml @@ -2872,9 +2872,10 @@ 7127 - 30 + 300 + 0 5 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14600-14699.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14600-14699.xml index 17c094857e..c10c41955e 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14600-14699.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14600-14699.xml @@ -2238,9 +2238,10 @@ 1700 - 30 + 300 + 0 5 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14900-14999.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14900-14999.xml index e315cc0dfe..efc305eec0 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14900-14999.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/14900-14999.xml @@ -1546,7 +1546,7 @@ 3000 - 20 + 200 @@ -1674,7 +1674,7 @@ 3000 - 20 + 200 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/20000-20099.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/20000-20099.xml index 345f2bc340..49d6859af6 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/20000-20099.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/20000-20099.xml @@ -64,7 +64,7 @@ 3420 true - 20 + 200 diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/skills.xsd b/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/skills.xsd index 8234b5b48f..d5d1f719bb 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/skills.xsd +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/skills.xsd @@ -830,6 +830,7 @@ + @@ -895,8 +896,8 @@ - - + + @@ -1158,6 +1159,21 @@ + + + + + + + + + + + + + + + @@ -1499,21 +1515,6 @@ - - - - - - - - - - - - - - - @@ -1986,6 +1987,7 @@ + @@ -2021,7 +2023,6 @@ - @@ -2347,22 +2348,6 @@ - - - - - - - - - - - - - - - - @@ -2490,7 +2475,7 @@ - + @@ -2536,7 +2521,7 @@ - + diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Formulas.java index d5f04ac1d3..ab68ad91ea 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Formulas.java @@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance; import com.l2jmobius.gameserver.model.cubic.CubicInstance; import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.L2EffectType; +import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.items.L2Armor; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Weapon; @@ -264,6 +265,37 @@ public final class Formulas return finalRate > Rnd.get(1000); } + /** + * Gets the default (10% for side, 30% for back) positional critical rate bonus and multiplies it by any buffs that give positional critical rate bonus. + * @param activeChar the attacker. + * @param target the target. + * @return a multiplier representing the positional critical rate bonus. Autoattacks for example get this bonus on top of the already capped critical rate of 500. + */ + public static double calcCriticalPositionBonus(L2Character activeChar, L2Character target) + { + // final Position position = activeChar.getStat().has(Stats.ATTACK_BEHIND) ? Position.BACK : Position.getPosition(activeChar, target); + switch (Position.getPosition(activeChar, target)) + { + case SIDE: // 10% Critical Chance bonus when attacking from side. + { + return 1.1 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.SIDE); + } + case BACK: // 30% Critical Chance bonus when attacking from back. + { + return 1.3 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.BACK); + } + default: // No Critical Chance bonus when attacking from front. + { + return activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.FRONT); + } + } + } + + public static double calcCriticalHeightBonus(ILocational from, ILocational target) + { + return ((((CommonUtil.constrain(from.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1; + } + /** * @param attacker * @param target @@ -1018,21 +1050,37 @@ public final class Formulas return cha.getStat().getValue(Stats.FALL, (fallHeight * cha.getMaxHp()) / 1000.0); } - public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double blowChance) + /** + * Basic chance formula:
+ *
    + *
  • chance = weapon_critical * dex_bonus * crit_height_bonus * crit_pos_bonus * effect_bonus * fatal_blow_rate
  • + *
  • weapon_critical = (12 for daggers)
  • + *
  • dex_bonus = dex modifier bonus for current dex (Seems unused in GOD, so its not used in formula).
  • + *
  • crit_height_bonus = (z_diff * 4 / 5 + 10) / 100 + 1 or alternatively (z_diff * 0.008) + 1.1. Be aware of z_diff constraint of -25 to 25.
  • + *
  • crit_pos_bonus = crit_pos(front = 1, side = 1.1, back = 1.3) * p_critical_rate_position_bonus
  • + *
  • effect_bonus = (p2 + 100) / 100, p2 - 2nd param of effect. Blow chance of effect.
  • + *
+ * Chance cannot be higher than 80%. + * @param activeChar + * @param target + * @param skill + * @param chanceBoost + * @return + */ + public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double chanceBoost) { - final double weaponCritical = 12; // Dagger weapon critical mod is 12... TODO: Make it work for other weapons. + final L2Weapon weapon = activeChar.getActiveWeaponItem(); + final double weaponCritical = weapon != null ? weapon.getStats(Stats.CRITICAL_RATE, activeChar.getTemplate().getBaseCritRate()) : activeChar.getTemplate().getBaseCritRate(); // double dexBonus = BaseStats.DEX.calcBonus(activeChar); Not used in GOD - final double critHeightBonus = ((((CommonUtil.constrain(activeChar.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1; - final Position position = Position.getPosition(activeChar, target); - final double criticalPosition = position == Position.BACK ? 1.3 : position == Position.SIDE ? 1.1 : 1; // 30% chance from back, 10% chance from side. - final double criticalPositionMod = criticalPosition * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, position); + final double critHeightBonus = calcCriticalHeightBonus(activeChar, target); + final double criticalPosition = calcCriticalPositionBonus(activeChar, target); // 30% chance from back, 10% chance from side. Include buffs that give positional crit rate. + final double chanceBoostMod = (100 + chanceBoost) / 100; final double blowRateMod = activeChar.getStat().getValue(Stats.BLOW_RATE, 1); - blowChance = (weaponCritical + blowChance) * 10; - final double rate = blowChance * critHeightBonus * criticalPositionMod * blowRateMod; + final double rate = criticalPosition * critHeightBonus * weaponCritical * chanceBoostMod * blowRateMod; // Blow rate is capped at 80% - return Rnd.get(1000) < Math.min(rate, 800); + return Rnd.get(100) < Math.min(rate, 80); } public static List calcCancelStealEffects(L2Character activeChar, L2Character target, Skill skill, DispelSlotType slot, int rate, int max) diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Backstab.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Backstab.java index 407c15af47..ab3b0d7f3c 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Backstab.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Backstab.java @@ -33,14 +33,14 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class Backstab extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final double _criticalChance; private final boolean _overHit; public Backstab(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _criticalChance = params.getDouble("criticalChance", 0); _overHit = params.getBoolean("overHit", false); } @@ -48,7 +48,7 @@ public final class Backstab extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java index 08c1164d08..4c94b296af 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java @@ -22,7 +22,6 @@ import java.util.Set; import com.l2jmobius.gameserver.enums.ShotType; import com.l2jmobius.gameserver.model.StatsSet; -import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; @@ -38,27 +37,24 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class FatalBlow extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final double _criticalChance; - private final boolean _overHit; - private final Set _abnormals; private final double _abnormalPower; public FatalBlow(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _criticalChance = params.getDouble("criticalChance", 0); - _overHit = params.getBoolean("overHit", false); - final String abnormals = params.getString("abnormalType", null); + String abnormals = params.getString("abnormalType", null); if ((abnormals != null) && !abnormals.isEmpty()) { _abnormals = new HashSet<>(); for (String slot : abnormals.split(";")) { - _abnormals.add(AbnormalType.getAbnormalType(slot)); + _abnormals.add(Enum.valueOf(AbnormalType.class, slot)); } } else @@ -71,7 +67,7 @@ public final class FatalBlow extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override @@ -94,11 +90,6 @@ public final class FatalBlow extends AbstractEffect return; } - if (_overHit && effected.isAttackable()) - { - ((L2Attackable) effected).overhitEnabled(true); - } - double power = _power; // Check if we apply an abnormal modifier diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java index 53d8257d8d..e97b9006e5 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java @@ -33,13 +33,13 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class SoulBlow extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final boolean _overHit; public SoulBlow(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _overHit = params.getBoolean("overHit", false); } @@ -52,7 +52,7 @@ public final class SoulBlow extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00000-00099.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00000-00099.xml index 7c7351af76..d3a5044778 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00000-00099.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00000-00099.xml @@ -1784,7 +1784,7 @@ 977 true - 20 + 200 @@ -3290,7 +3290,7 @@ 15 15 - 40 + 400 true diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00200-00299.xml index 1a95bc523c..f978a25669 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00200-00299.xml @@ -4526,9 +4526,10 @@ 5479 true - 30 + 300 + 0 10 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00300-00399.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00300-00399.xml index ed340276a6..ab25920919 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00300-00399.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00300-00399.xml @@ -1079,12 +1079,13 @@ 3653 true - 25 + 250 80 + 0 5 @@ -1715,10 +1716,11 @@ 5773 20 - 30 + 300 true + 0 15 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00400-00499.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00400-00499.xml index 02dfee2d47..367c472f59 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00400-00499.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00400-00499.xml @@ -1210,9 +1210,10 @@ 3653 true - 25 + 250 + 0 5 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00500-00599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00500-00599.xml index f3452c5137..01a3b1845a 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00500-00599.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00500-00599.xml @@ -525,7 +525,7 @@ 5479 true - 20 + 200 @@ -4201,9 +4201,10 @@ 5199 true - 20 + 200 + 0 10 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00600-00699.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00600-00699.xml index 26e67beed8..5c4cfa58c2 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00600-00699.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00600-00699.xml @@ -2634,9 +2634,10 @@ 6969 true - 20 + 200 + 0 10 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00900-00999.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00900-00999.xml index 4697f67906..6fc1ba88e3 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00900-00999.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/00900-00999.xml @@ -1604,7 +1604,7 @@ 11234 30 - 60 + 600 true diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/01500-01599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/01500-01599.xml index 3af5549a63..76dc79ce4f 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/01500-01599.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/01500-01599.xml @@ -3668,7 +3668,7 @@ 11234 30 - 60 + 600 true diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04000-04099.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04000-04099.xml index 52c890d121..40de5b0e57 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04000-04099.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04000-04099.xml @@ -2431,7 +2431,7 @@ 7461 7850 - 20 + 200 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04100-04199.xml index 8d26ef9640..9cdfab0ed8 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04100-04199.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04100-04199.xml @@ -3417,7 +3417,7 @@ 44350 49193 - 115 + 1150 @@ -4046,7 +4046,7 @@ 73917 81989 - 67 + 670 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04500-04599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04500-04599.xml index 79a94d08c8..b07ddcb7fa 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04500-04599.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04500-04599.xml @@ -2542,7 +2542,7 @@ 7461 7850 - 20 + 200 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04700-04799.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04700-04799.xml index 816b5da4c2..24e129b766 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04700-04799.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/04700-04799.xml @@ -1082,8 +1082,8 @@ 9648 9830 - 30 - 50 + 10 + 200 @@ -2305,7 +2305,7 @@ 44350 49193 - 115 + 1150 @@ -2365,7 +2365,7 @@ 38806 43290 - 115 + 1150 @@ -2425,7 +2425,7 @@ 20667 23023 - 115 + 1150 @@ -2485,7 +2485,7 @@ 19381 21645 - 115 + 1150 @@ -2545,7 +2545,7 @@ 18140 20268 - 115 + 1150 @@ -3600,7 +3600,7 @@ 73917 81989 - 67 + 670 @@ -3660,7 +3660,7 @@ 64677 72150 - 67 + 670 @@ -3720,7 +3720,7 @@ 34445 38371 - 67 + 670 @@ -3780,7 +3780,7 @@ 32302 36075 - 67 + 670 @@ -3840,7 +3840,7 @@ 30232 33780 - 67 + 670 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/05000-05099.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/05000-05099.xml index 4e4fa00af7..691dc30e75 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/05000-05099.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/05000-05099.xml @@ -2817,7 +2817,7 @@ 7306 8602 - 20 + 200 @@ -2916,15 +2916,13 @@ 6335 - 15 + 150 40 DIFF - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/05100-05199.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/05100-05199.xml index 82adca6979..fde3e20670 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/05100-05199.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/05100-05199.xml @@ -1309,7 +1309,7 @@ 39544 - 115 + 1150 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/06000-06099.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/06000-06099.xml index b623081de9..c834fb12f0 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/06000-06099.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/06000-06099.xml @@ -1861,7 +1861,7 @@ 6844 6960 - 20 + 200 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/08500-08599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/08500-08599.xml index 34b373016d..242da9a97d 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/08500-08599.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/08500-08599.xml @@ -1536,10 +1536,11 @@ 5773 20 - 30 + 300 true + 0 15 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/10500-10599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/10500-10599.xml index cf5f573239..c1ad52636e 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/10500-10599.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/10500-10599.xml @@ -494,7 +494,7 @@ {base + base / 100 * subIndex} 30 - 40 + 400 true @@ -516,7 +516,7 @@ {base + base / 100 * (5 + subIndex)} 30 - 40 + 400 true @@ -610,7 +610,7 @@ {base + base / 100 * subIndex} 15 - 36.5 + 365 true @@ -632,7 +632,7 @@ {base + base / 100 * (5 + subIndex)} 15 - 36.5 + 365 true @@ -739,7 +739,7 @@ 20 BLEEDING 4130 - 36.5 + 365 true @@ -762,8 +762,8 @@ 20 BLEEDING - 4130 - 36.5 + 4130 + 365 true @@ -838,7 +838,7 @@ {base + base / 100 * subIndex} 20 - 36.5 + 365 true @@ -856,7 +856,7 @@ {base + base / 100 * (5 + subIndex)} 20 - 36.5 + 365 true @@ -2935,7 +2935,7 @@ 8875 - 30 + 300 @@ -3123,7 +3123,7 @@ 27993 29472 - 30 + 300 -23 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/10700-10799.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/10700-10799.xml index 9aa2bbae76..d0c67bc0db 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/10700-10799.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/10700-10799.xml @@ -337,11 +337,12 @@ 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 - 30 + 300 8875 true + 0 15 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/11300-11399.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/11300-11399.xml index 6cfafb50a5..e6d6757716 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/11300-11399.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/11300-11399.xml @@ -3618,7 +3618,7 @@ - 30 + 300 45696 47772 @@ -3626,7 +3626,7 @@ - + 0 10 @@ -3652,7 +3652,7 @@ - 30 + 300 51411 53747 @@ -3660,7 +3660,7 @@ - + 0 10 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14200-14299.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14200-14299.xml index 937cdea94e..3396904bf7 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14200-14299.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14200-14299.xml @@ -2857,7 +2857,7 @@ 5029 5479 - 20 + 200 100 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14500-14599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14500-14599.xml index b0ace17a28..edb599718f 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14500-14599.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14500-14599.xml @@ -2872,9 +2872,10 @@ 7127 - 30 + 300 + 0 5 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14600-14699.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14600-14699.xml index 53731c0027..c07a740d3b 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14600-14699.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14600-14699.xml @@ -2238,9 +2238,10 @@ 1700 - 30 + 300 + 0 5 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14900-14999.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14900-14999.xml index a419d23812..1b11990707 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14900-14999.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/14900-14999.xml @@ -1546,7 +1546,7 @@ 3000 - 20 + 200 @@ -1674,7 +1674,7 @@ 3000 - 20 + 200 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/20000-20099.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/20000-20099.xml index 8e10d1bb6d..4c7d5f5cd9 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/20000-20099.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/20000-20099.xml @@ -64,7 +64,7 @@ 3420 true - 20 + 200 diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/xsd/skills.xsd b/L2J_Mobius_2.5_Underground/dist/game/data/xsd/skills.xsd index a25cfc4399..bc0a2fd426 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/xsd/skills.xsd +++ b/L2J_Mobius_2.5_Underground/dist/game/data/xsd/skills.xsd @@ -834,6 +834,7 @@
+ @@ -899,8 +900,8 @@ - - + + @@ -1162,6 +1163,21 @@ + + + + + + + + + + + + + + + @@ -1503,21 +1519,6 @@ - - - - - - - - - - - - - - - @@ -2074,6 +2075,7 @@ + @@ -2109,7 +2111,6 @@ - @@ -2470,22 +2471,6 @@ - - - - - - - - - - - - - - - - @@ -2613,7 +2598,7 @@ - + @@ -2659,7 +2644,7 @@ - + diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Formulas.java index d5f04ac1d3..ab68ad91ea 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Formulas.java @@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance; import com.l2jmobius.gameserver.model.cubic.CubicInstance; import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.L2EffectType; +import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.items.L2Armor; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Weapon; @@ -264,6 +265,37 @@ public final class Formulas return finalRate > Rnd.get(1000); } + /** + * Gets the default (10% for side, 30% for back) positional critical rate bonus and multiplies it by any buffs that give positional critical rate bonus. + * @param activeChar the attacker. + * @param target the target. + * @return a multiplier representing the positional critical rate bonus. Autoattacks for example get this bonus on top of the already capped critical rate of 500. + */ + public static double calcCriticalPositionBonus(L2Character activeChar, L2Character target) + { + // final Position position = activeChar.getStat().has(Stats.ATTACK_BEHIND) ? Position.BACK : Position.getPosition(activeChar, target); + switch (Position.getPosition(activeChar, target)) + { + case SIDE: // 10% Critical Chance bonus when attacking from side. + { + return 1.1 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.SIDE); + } + case BACK: // 30% Critical Chance bonus when attacking from back. + { + return 1.3 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.BACK); + } + default: // No Critical Chance bonus when attacking from front. + { + return activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.FRONT); + } + } + } + + public static double calcCriticalHeightBonus(ILocational from, ILocational target) + { + return ((((CommonUtil.constrain(from.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1; + } + /** * @param attacker * @param target @@ -1018,21 +1050,37 @@ public final class Formulas return cha.getStat().getValue(Stats.FALL, (fallHeight * cha.getMaxHp()) / 1000.0); } - public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double blowChance) + /** + * Basic chance formula:
+ *
    + *
  • chance = weapon_critical * dex_bonus * crit_height_bonus * crit_pos_bonus * effect_bonus * fatal_blow_rate
  • + *
  • weapon_critical = (12 for daggers)
  • + *
  • dex_bonus = dex modifier bonus for current dex (Seems unused in GOD, so its not used in formula).
  • + *
  • crit_height_bonus = (z_diff * 4 / 5 + 10) / 100 + 1 or alternatively (z_diff * 0.008) + 1.1. Be aware of z_diff constraint of -25 to 25.
  • + *
  • crit_pos_bonus = crit_pos(front = 1, side = 1.1, back = 1.3) * p_critical_rate_position_bonus
  • + *
  • effect_bonus = (p2 + 100) / 100, p2 - 2nd param of effect. Blow chance of effect.
  • + *
+ * Chance cannot be higher than 80%. + * @param activeChar + * @param target + * @param skill + * @param chanceBoost + * @return + */ + public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double chanceBoost) { - final double weaponCritical = 12; // Dagger weapon critical mod is 12... TODO: Make it work for other weapons. + final L2Weapon weapon = activeChar.getActiveWeaponItem(); + final double weaponCritical = weapon != null ? weapon.getStats(Stats.CRITICAL_RATE, activeChar.getTemplate().getBaseCritRate()) : activeChar.getTemplate().getBaseCritRate(); // double dexBonus = BaseStats.DEX.calcBonus(activeChar); Not used in GOD - final double critHeightBonus = ((((CommonUtil.constrain(activeChar.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1; - final Position position = Position.getPosition(activeChar, target); - final double criticalPosition = position == Position.BACK ? 1.3 : position == Position.SIDE ? 1.1 : 1; // 30% chance from back, 10% chance from side. - final double criticalPositionMod = criticalPosition * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, position); + final double critHeightBonus = calcCriticalHeightBonus(activeChar, target); + final double criticalPosition = calcCriticalPositionBonus(activeChar, target); // 30% chance from back, 10% chance from side. Include buffs that give positional crit rate. + final double chanceBoostMod = (100 + chanceBoost) / 100; final double blowRateMod = activeChar.getStat().getValue(Stats.BLOW_RATE, 1); - blowChance = (weaponCritical + blowChance) * 10; - final double rate = blowChance * critHeightBonus * criticalPositionMod * blowRateMod; + final double rate = criticalPosition * critHeightBonus * weaponCritical * chanceBoostMod * blowRateMod; // Blow rate is capped at 80% - return Rnd.get(1000) < Math.min(rate, 800); + return Rnd.get(100) < Math.min(rate, 80); } public static List calcCancelStealEffects(L2Character activeChar, L2Character target, Skill skill, DispelSlotType slot, int rate, int max) diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Backstab.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Backstab.java index 407c15af47..ab3b0d7f3c 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Backstab.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Backstab.java @@ -33,14 +33,14 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class Backstab extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final double _criticalChance; private final boolean _overHit; public Backstab(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _criticalChance = params.getDouble("criticalChance", 0); _overHit = params.getBoolean("overHit", false); } @@ -48,7 +48,7 @@ public final class Backstab extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java index 08c1164d08..4c94b296af 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java @@ -22,7 +22,6 @@ import java.util.Set; import com.l2jmobius.gameserver.enums.ShotType; import com.l2jmobius.gameserver.model.StatsSet; -import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; @@ -38,27 +37,24 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class FatalBlow extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final double _criticalChance; - private final boolean _overHit; - private final Set _abnormals; private final double _abnormalPower; public FatalBlow(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _criticalChance = params.getDouble("criticalChance", 0); - _overHit = params.getBoolean("overHit", false); - final String abnormals = params.getString("abnormalType", null); + String abnormals = params.getString("abnormalType", null); if ((abnormals != null) && !abnormals.isEmpty()) { _abnormals = new HashSet<>(); for (String slot : abnormals.split(";")) { - _abnormals.add(AbnormalType.getAbnormalType(slot)); + _abnormals.add(Enum.valueOf(AbnormalType.class, slot)); } } else @@ -71,7 +67,7 @@ public final class FatalBlow extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override @@ -94,11 +90,6 @@ public final class FatalBlow extends AbstractEffect return; } - if (_overHit && effected.isAttackable()) - { - ((L2Attackable) effected).overhitEnabled(true); - } - double power = _power; // Check if we apply an abnormal modifier diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java index 53d8257d8d..e97b9006e5 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java @@ -33,13 +33,13 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class SoulBlow extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final boolean _overHit; public SoulBlow(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _overHit = params.getBoolean("overHit", false); } @@ -52,7 +52,7 @@ public final class SoulBlow extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00000-00099.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00000-00099.xml index 7c7351af76..d3a5044778 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00000-00099.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00000-00099.xml @@ -1784,7 +1784,7 @@ 977 true - 20 + 200 @@ -3290,7 +3290,7 @@ 15 15 - 40 + 400 true diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00200-00299.xml index 7549081dca..1037f9a633 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00200-00299.xml @@ -4526,9 +4526,10 @@ 5479 true - 30 + 300 + 0 10 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00300-00399.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00300-00399.xml index 5530b2fcac..81628425f5 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00300-00399.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00300-00399.xml @@ -1079,12 +1079,13 @@ 3653 true - 25 + 250 80 + 0 5 @@ -1715,10 +1716,11 @@ 5773 20 - 30 + 300 true + 0 15 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00400-00499.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00400-00499.xml index 1378f90d8e..3210b36455 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00400-00499.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00400-00499.xml @@ -1210,9 +1210,10 @@ 3653 true - 25 + 250 + 0 5 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00500-00599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00500-00599.xml index 7229169933..4f3e523c10 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00500-00599.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00500-00599.xml @@ -525,7 +525,7 @@ 5479 true - 20 + 200 @@ -4201,9 +4201,10 @@ 5199 true - 20 + 200 + 0 10 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00600-00699.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00600-00699.xml index 624077d50c..77d784f27b 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00600-00699.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00600-00699.xml @@ -2634,9 +2634,10 @@ 6969 true - 20 + 200 + 0 10 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00900-00999.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00900-00999.xml index df4fb89f6b..36643bd149 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00900-00999.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/00900-00999.xml @@ -1604,7 +1604,7 @@ 11234 30 - 60 + 600 true diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/01500-01599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/01500-01599.xml index 8f234f1408..d6aa350c10 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/01500-01599.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/01500-01599.xml @@ -3668,7 +3668,7 @@ 11234 30 - 60 + 600 true diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04000-04099.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04000-04099.xml index f6b3b35a2c..a4d6a55023 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04000-04099.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04000-04099.xml @@ -2431,7 +2431,7 @@ 7461 7850 - 20 + 200 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04100-04199.xml index ebbe3bf43d..0ed17d6612 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04100-04199.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04100-04199.xml @@ -3417,7 +3417,7 @@ 44350 49193 - 115 + 1150 @@ -4046,7 +4046,7 @@ 73917 81989 - 67 + 670 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04500-04599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04500-04599.xml index 1827caef1c..e03fbf9756 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04500-04599.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04500-04599.xml @@ -2542,7 +2542,7 @@ 7461 7850 - 20 + 200 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04700-04799.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04700-04799.xml index 816b5da4c2..24e129b766 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04700-04799.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/04700-04799.xml @@ -1082,8 +1082,8 @@ 9648 9830 - 30 - 50 + 10 + 200 @@ -2305,7 +2305,7 @@ 44350 49193 - 115 + 1150 @@ -2365,7 +2365,7 @@ 38806 43290 - 115 + 1150 @@ -2425,7 +2425,7 @@ 20667 23023 - 115 + 1150 @@ -2485,7 +2485,7 @@ 19381 21645 - 115 + 1150 @@ -2545,7 +2545,7 @@ 18140 20268 - 115 + 1150 @@ -3600,7 +3600,7 @@ 73917 81989 - 67 + 670 @@ -3660,7 +3660,7 @@ 64677 72150 - 67 + 670 @@ -3720,7 +3720,7 @@ 34445 38371 - 67 + 670 @@ -3780,7 +3780,7 @@ 32302 36075 - 67 + 670 @@ -3840,7 +3840,7 @@ 30232 33780 - 67 + 670 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/05000-05099.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/05000-05099.xml index ac93be2650..281cc88e8e 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/05000-05099.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/05000-05099.xml @@ -2817,7 +2817,7 @@ 7306 8602 - 20 + 200 @@ -2916,15 +2916,13 @@ 6335 - 15 + 150 40 DIFF - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/05100-05199.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/05100-05199.xml index 72453b7cb7..0a81e16374 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/05100-05199.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/05100-05199.xml @@ -1309,7 +1309,7 @@ 39544 - 115 + 1150 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/06000-06099.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/06000-06099.xml index b623081de9..c834fb12f0 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/06000-06099.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/06000-06099.xml @@ -1861,7 +1861,7 @@ 6844 6960 - 20 + 200 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/08500-08599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/08500-08599.xml index 8af4f8e86d..28cbd5376c 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/08500-08599.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/08500-08599.xml @@ -1536,10 +1536,11 @@ 5773 20 - 30 + 300 true + 0 15 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/10500-10599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/10500-10599.xml index 3755dc43b9..c021e3cbed 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/10500-10599.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/10500-10599.xml @@ -494,7 +494,7 @@ {base + base / 100 * subIndex} 30 - 40 + 400 true @@ -516,7 +516,7 @@ {base + base / 100 * (5 + subIndex)} 30 - 40 + 400 true @@ -610,7 +610,7 @@ {base + base / 100 * subIndex} 15 - 36.5 + 365 true @@ -632,7 +632,7 @@ {base + base / 100 * (5 + subIndex)} 15 - 36.5 + 365 true @@ -739,7 +739,7 @@ 20 BLEEDING 4130 - 36.5 + 365 true @@ -762,8 +762,8 @@ 20 BLEEDING - 4130 - 36.5 + 4130 + 365 true @@ -838,7 +838,7 @@ {base + base / 100 * subIndex} 20 - 36.5 + 365 true @@ -856,7 +856,7 @@ {base + base / 100 * (5 + subIndex)} 20 - 36.5 + 365 true @@ -2928,7 +2928,7 @@ 8875 - 30 + 300 @@ -3116,7 +3116,7 @@ 27993 29472 - 30 + 300 -23 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/10700-10799.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/10700-10799.xml index 74e792caed..094fe52ca5 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/10700-10799.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/10700-10799.xml @@ -337,11 +337,12 @@ 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 - 30 + 300 8875 true + 0 15 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/11300-11399.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/11300-11399.xml index 02c1d14f26..9d83589411 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/11300-11399.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/11300-11399.xml @@ -3787,7 +3787,7 @@ - 30 + 300 45696 47772 @@ -3795,7 +3795,7 @@ - + 0 10 @@ -3821,7 +3821,7 @@ - 30 + 300 51411 53747 @@ -3829,7 +3829,7 @@ - + 0 10 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14200-14299.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14200-14299.xml index 5d7f3791c1..143af842f3 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14200-14299.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14200-14299.xml @@ -2857,7 +2857,7 @@ 5029 5479 - 20 + 200 100 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14500-14599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14500-14599.xml index b0ace17a28..edb599718f 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14500-14599.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14500-14599.xml @@ -2872,9 +2872,10 @@ 7127 - 30 + 300 + 0 5 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14600-14699.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14600-14699.xml index bdba7a8c2d..c902fc0675 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14600-14699.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14600-14699.xml @@ -2238,9 +2238,10 @@ 1700 - 30 + 300 + 0 5 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14900-14999.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14900-14999.xml index a419d23812..1b11990707 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14900-14999.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/14900-14999.xml @@ -1546,7 +1546,7 @@ 3000 - 20 + 200 @@ -1674,7 +1674,7 @@ 3000 - 20 + 200 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/20000-20099.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/20000-20099.xml index 8e10d1bb6d..4c7d5f5cd9 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/20000-20099.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/20000-20099.xml @@ -64,7 +64,7 @@ 3420 true - 20 + 200 diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/xsd/skills.xsd b/L2J_Mobius_3.0_Helios/dist/game/data/xsd/skills.xsd index c342e9420f..864b50d175 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/xsd/skills.xsd +++ b/L2J_Mobius_3.0_Helios/dist/game/data/xsd/skills.xsd @@ -866,6 +866,7 @@
+ @@ -931,8 +932,8 @@ - - + + @@ -1194,6 +1195,21 @@ + + + + + + + + + + + + + + + @@ -1535,21 +1551,6 @@ - - - - - - - - - - - - - - - @@ -2105,6 +2106,7 @@ + @@ -2140,7 +2142,6 @@ - @@ -2502,22 +2503,6 @@ - - - - - - - - - - - - - - - - @@ -2645,7 +2630,7 @@ - + @@ -2666,6 +2651,8 @@ + + @@ -2693,8 +2680,7 @@ - - + diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Formulas.java index d5f04ac1d3..ab68ad91ea 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Formulas.java @@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance; import com.l2jmobius.gameserver.model.cubic.CubicInstance; import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.L2EffectType; +import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.items.L2Armor; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Weapon; @@ -264,6 +265,37 @@ public final class Formulas return finalRate > Rnd.get(1000); } + /** + * Gets the default (10% for side, 30% for back) positional critical rate bonus and multiplies it by any buffs that give positional critical rate bonus. + * @param activeChar the attacker. + * @param target the target. + * @return a multiplier representing the positional critical rate bonus. Autoattacks for example get this bonus on top of the already capped critical rate of 500. + */ + public static double calcCriticalPositionBonus(L2Character activeChar, L2Character target) + { + // final Position position = activeChar.getStat().has(Stats.ATTACK_BEHIND) ? Position.BACK : Position.getPosition(activeChar, target); + switch (Position.getPosition(activeChar, target)) + { + case SIDE: // 10% Critical Chance bonus when attacking from side. + { + return 1.1 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.SIDE); + } + case BACK: // 30% Critical Chance bonus when attacking from back. + { + return 1.3 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.BACK); + } + default: // No Critical Chance bonus when attacking from front. + { + return activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.FRONT); + } + } + } + + public static double calcCriticalHeightBonus(ILocational from, ILocational target) + { + return ((((CommonUtil.constrain(from.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1; + } + /** * @param attacker * @param target @@ -1018,21 +1050,37 @@ public final class Formulas return cha.getStat().getValue(Stats.FALL, (fallHeight * cha.getMaxHp()) / 1000.0); } - public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double blowChance) + /** + * Basic chance formula:
+ *
    + *
  • chance = weapon_critical * dex_bonus * crit_height_bonus * crit_pos_bonus * effect_bonus * fatal_blow_rate
  • + *
  • weapon_critical = (12 for daggers)
  • + *
  • dex_bonus = dex modifier bonus for current dex (Seems unused in GOD, so its not used in formula).
  • + *
  • crit_height_bonus = (z_diff * 4 / 5 + 10) / 100 + 1 or alternatively (z_diff * 0.008) + 1.1. Be aware of z_diff constraint of -25 to 25.
  • + *
  • crit_pos_bonus = crit_pos(front = 1, side = 1.1, back = 1.3) * p_critical_rate_position_bonus
  • + *
  • effect_bonus = (p2 + 100) / 100, p2 - 2nd param of effect. Blow chance of effect.
  • + *
+ * Chance cannot be higher than 80%. + * @param activeChar + * @param target + * @param skill + * @param chanceBoost + * @return + */ + public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double chanceBoost) { - final double weaponCritical = 12; // Dagger weapon critical mod is 12... TODO: Make it work for other weapons. + final L2Weapon weapon = activeChar.getActiveWeaponItem(); + final double weaponCritical = weapon != null ? weapon.getStats(Stats.CRITICAL_RATE, activeChar.getTemplate().getBaseCritRate()) : activeChar.getTemplate().getBaseCritRate(); // double dexBonus = BaseStats.DEX.calcBonus(activeChar); Not used in GOD - final double critHeightBonus = ((((CommonUtil.constrain(activeChar.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1; - final Position position = Position.getPosition(activeChar, target); - final double criticalPosition = position == Position.BACK ? 1.3 : position == Position.SIDE ? 1.1 : 1; // 30% chance from back, 10% chance from side. - final double criticalPositionMod = criticalPosition * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, position); + final double critHeightBonus = calcCriticalHeightBonus(activeChar, target); + final double criticalPosition = calcCriticalPositionBonus(activeChar, target); // 30% chance from back, 10% chance from side. Include buffs that give positional crit rate. + final double chanceBoostMod = (100 + chanceBoost) / 100; final double blowRateMod = activeChar.getStat().getValue(Stats.BLOW_RATE, 1); - blowChance = (weaponCritical + blowChance) * 10; - final double rate = blowChance * critHeightBonus * criticalPositionMod * blowRateMod; + final double rate = criticalPosition * critHeightBonus * weaponCritical * chanceBoostMod * blowRateMod; // Blow rate is capped at 80% - return Rnd.get(1000) < Math.min(rate, 800); + return Rnd.get(100) < Math.min(rate, 80); } public static List calcCancelStealEffects(L2Character activeChar, L2Character target, Skill skill, DispelSlotType slot, int rate, int max) diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Backstab.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Backstab.java index 407c15af47..ab3b0d7f3c 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Backstab.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Backstab.java @@ -33,14 +33,14 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class Backstab extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final double _criticalChance; private final boolean _overHit; public Backstab(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _criticalChance = params.getDouble("criticalChance", 0); _overHit = params.getBoolean("overHit", false); } @@ -48,7 +48,7 @@ public final class Backstab extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java index 08c1164d08..4c94b296af 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java @@ -22,7 +22,6 @@ import java.util.Set; import com.l2jmobius.gameserver.enums.ShotType; import com.l2jmobius.gameserver.model.StatsSet; -import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; @@ -38,27 +37,24 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class FatalBlow extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final double _criticalChance; - private final boolean _overHit; - private final Set _abnormals; private final double _abnormalPower; public FatalBlow(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _criticalChance = params.getDouble("criticalChance", 0); - _overHit = params.getBoolean("overHit", false); - final String abnormals = params.getString("abnormalType", null); + String abnormals = params.getString("abnormalType", null); if ((abnormals != null) && !abnormals.isEmpty()) { _abnormals = new HashSet<>(); for (String slot : abnormals.split(";")) { - _abnormals.add(AbnormalType.getAbnormalType(slot)); + _abnormals.add(Enum.valueOf(AbnormalType.class, slot)); } } else @@ -71,7 +67,7 @@ public final class FatalBlow extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override @@ -94,11 +90,6 @@ public final class FatalBlow extends AbstractEffect return; } - if (_overHit && effected.isAttackable()) - { - ((L2Attackable) effected).overhitEnabled(true); - } - double power = _power; // Check if we apply an abnormal modifier diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java index 53d8257d8d..e97b9006e5 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java @@ -33,13 +33,13 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class SoulBlow extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final boolean _overHit; public SoulBlow(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _overHit = params.getBoolean("overHit", false); } @@ -52,7 +52,7 @@ public final class SoulBlow extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00000-00099.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00000-00099.xml index 04f271e94b..1f47aed099 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00000-00099.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00000-00099.xml @@ -1784,7 +1784,7 @@ 977 true - 20 + 200 @@ -3290,7 +3290,7 @@ 15 15 - 40 + 400 true diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00200-00299.xml index ef9977ac2f..b35033f2e0 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00200-00299.xml @@ -4554,9 +4554,10 @@ 5479 true - 30 + 300 + 0 10 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00300-00399.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00300-00399.xml index 5b46c78d0e..cec2b40db8 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00300-00399.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00300-00399.xml @@ -1079,12 +1079,13 @@ 3653 true - 25 + 250 80 + 0 5 @@ -1715,10 +1716,11 @@ 5773 20 - 30 + 300 true + 0 15 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00400-00499.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00400-00499.xml index 3ca84848be..487db41b2d 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00400-00499.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00400-00499.xml @@ -1210,9 +1210,10 @@ 3653 true - 25 + 250 + 0 5 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00500-00599.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00500-00599.xml index c8e9525259..3a23ef2bbd 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00500-00599.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00500-00599.xml @@ -525,7 +525,7 @@ 5479 true - 20 + 200 @@ -4201,9 +4201,10 @@ 5199 true - 20 + 200 + 0 10 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00600-00699.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00600-00699.xml index 624077d50c..77d784f27b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00600-00699.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00600-00699.xml @@ -2634,9 +2634,10 @@ 6969 true - 20 + 200 + 0 10 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00900-00999.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00900-00999.xml index df4fb89f6b..36643bd149 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00900-00999.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/00900-00999.xml @@ -1604,7 +1604,7 @@ 11234 30 - 60 + 600 true diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/01500-01599.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/01500-01599.xml index 663f08b495..8b9c850279 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/01500-01599.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/01500-01599.xml @@ -3668,7 +3668,7 @@ 11234 30 - 60 + 600 true diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04000-04099.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04000-04099.xml index f6b3b35a2c..a4d6a55023 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04000-04099.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04000-04099.xml @@ -2431,7 +2431,7 @@ 7461 7850 - 20 + 200 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04100-04199.xml index ebbe3bf43d..0ed17d6612 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04100-04199.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04100-04199.xml @@ -3417,7 +3417,7 @@ 44350 49193 - 115 + 1150 @@ -4046,7 +4046,7 @@ 73917 81989 - 67 + 670 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04500-04599.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04500-04599.xml index 41b6c10600..29a1734588 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04500-04599.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04500-04599.xml @@ -2542,7 +2542,7 @@ 7461 7850 - 20 + 200 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04700-04799.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04700-04799.xml index 816b5da4c2..24e129b766 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04700-04799.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/04700-04799.xml @@ -1082,8 +1082,8 @@ 9648 9830 - 30 - 50 + 10 + 200 @@ -2305,7 +2305,7 @@ 44350 49193 - 115 + 1150 @@ -2365,7 +2365,7 @@ 38806 43290 - 115 + 1150 @@ -2425,7 +2425,7 @@ 20667 23023 - 115 + 1150 @@ -2485,7 +2485,7 @@ 19381 21645 - 115 + 1150 @@ -2545,7 +2545,7 @@ 18140 20268 - 115 + 1150 @@ -3600,7 +3600,7 @@ 73917 81989 - 67 + 670 @@ -3660,7 +3660,7 @@ 64677 72150 - 67 + 670 @@ -3720,7 +3720,7 @@ 34445 38371 - 67 + 670 @@ -3780,7 +3780,7 @@ 32302 36075 - 67 + 670 @@ -3840,7 +3840,7 @@ 30232 33780 - 67 + 670 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/05000-05099.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/05000-05099.xml index e962c42a83..ae50bd58d1 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/05000-05099.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/05000-05099.xml @@ -2817,7 +2817,7 @@ 7306 8602 - 20 + 200 @@ -2916,15 +2916,13 @@ 6335 - 15 + 150 40 DIFF - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/05100-05199.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/05100-05199.xml index 72453b7cb7..0a81e16374 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/05100-05199.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/05100-05199.xml @@ -1309,7 +1309,7 @@ 39544 - 115 + 1150 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/06000-06099.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/06000-06099.xml index b623081de9..c834fb12f0 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/06000-06099.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/06000-06099.xml @@ -1861,7 +1861,7 @@ 6844 6960 - 20 + 200 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/08500-08599.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/08500-08599.xml index 8af4f8e86d..28cbd5376c 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/08500-08599.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/08500-08599.xml @@ -1536,10 +1536,11 @@ 5773 20 - 30 + 300 true + 0 15 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/10500-10599.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/10500-10599.xml index a92cb8fec7..6a89ebc670 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/10500-10599.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/10500-10599.xml @@ -799,7 +799,7 @@ 20 BLEEDING - 4130 + 4130 365 true @@ -859,6 +859,7 @@ + 0 15 @@ -875,7 +876,7 @@ {base + base / 100 * subIndex} 20 - 36.5 + 365 true @@ -893,7 +894,7 @@ {base + base / 100 * (5 + subIndex)} 20 - 36.5 + 365 true @@ -2974,7 +2975,7 @@ 8875 - 30 + 300 @@ -3162,7 +3163,7 @@ 27993 29472 - 30 + 300 -23 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/10700-10799.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/10700-10799.xml index 146adb9c7d..584b5350d5 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/10700-10799.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/10700-10799.xml @@ -296,19 +296,19 @@ 1 - + 56030 58530 61030 - 15 - 300 - true - - - + 15 + 365 + true + + + icon.skill0217 @@ -358,11 +358,12 @@ 10279;10517;10025;10776;11770;1904;11264;11093;13314;1912 - 30 + 300 8875 true + 0 15 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/11300-11399.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/11300-11399.xml index e0f8e4f7b9..50444f17fa 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/11300-11399.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/11300-11399.xml @@ -3737,7 +3737,7 @@ - 30 + 300 45696 47772 @@ -3745,7 +3745,7 @@ - + 0 10 @@ -3771,7 +3771,7 @@ - 30 + 300 51411 53747 @@ -3779,7 +3779,7 @@ - + 0 10 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14200-14299.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14200-14299.xml index 7d3287ddd5..0f15800ed5 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14200-14299.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14200-14299.xml @@ -2857,7 +2857,7 @@ 5029 5479 - 20 + 200 100 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14500-14599.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14500-14599.xml index b0ace17a28..edb599718f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14500-14599.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14500-14599.xml @@ -2872,9 +2872,10 @@ 7127 - 30 + 300 + 0 5 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14600-14699.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14600-14699.xml index 7ae2749782..dc39943c96 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14600-14699.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14600-14699.xml @@ -2238,9 +2238,10 @@ 1700 - 30 + 300 + 0 5 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14900-14999.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14900-14999.xml index a419d23812..1b11990707 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14900-14999.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/14900-14999.xml @@ -1546,7 +1546,7 @@ 3000 - 20 + 200 @@ -1674,7 +1674,7 @@ 3000 - 20 + 200 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/20000-20099.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/20000-20099.xml index aa8c974adb..482c488e6f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/20000-20099.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/20000-20099.xml @@ -64,7 +64,7 @@ 3420 true - 20 + 200 diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/skills.xsd b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/skills.xsd index 3c3240ca2e..ae48ac3ceb 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/skills.xsd +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/skills.xsd @@ -870,6 +870,7 @@
+ @@ -1213,6 +1214,21 @@ + + + + + + + + + + + + + + + @@ -1554,21 +1570,6 @@ - - - - - - - - - - - - - - - @@ -2014,7 +2015,6 @@ - @@ -2073,6 +2073,7 @@ + @@ -2108,7 +2109,6 @@ - @@ -2477,22 +2477,6 @@ - - - - - - - - - - - - - - - - @@ -2619,7 +2603,6 @@ - @@ -2656,63 +2639,65 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/stats/Formulas.java index 5acce4493e..11e9bd8d9b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/stats/Formulas.java @@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance; import com.l2jmobius.gameserver.model.cubic.CubicInstance; import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.L2EffectType; +import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.items.L2Armor; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Weapon; @@ -264,6 +265,37 @@ public final class Formulas return finalRate > Rnd.get(1000); } + /** + * Gets the default (10% for side, 30% for back) positional critical rate bonus and multiplies it by any buffs that give positional critical rate bonus. + * @param activeChar the attacker. + * @param target the target. + * @return a multiplier representing the positional critical rate bonus. Autoattacks for example get this bonus on top of the already capped critical rate of 500. + */ + public static double calcCriticalPositionBonus(L2Character activeChar, L2Character target) + { + // final Position position = activeChar.getStat().has(Stats.ATTACK_BEHIND) ? Position.BACK : Position.getPosition(activeChar, target); + switch (Position.getPosition(activeChar, target)) + { + case SIDE: // 10% Critical Chance bonus when attacking from side. + { + return 1.1 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.SIDE); + } + case BACK: // 30% Critical Chance bonus when attacking from back. + { + return 1.3 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.BACK); + } + default: // No Critical Chance bonus when attacking from front. + { + return activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.FRONT); + } + } + } + + public static double calcCriticalHeightBonus(ILocational from, ILocational target) + { + return ((((CommonUtil.constrain(from.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1; + } + /** * @param attacker * @param target @@ -1018,21 +1050,37 @@ public final class Formulas return cha.getStat().getValue(Stats.FALL, (fallHeight * cha.getMaxHp()) / 1000.0); } - public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double blowChance) + /** + * Basic chance formula:
+ *
    + *
  • chance = weapon_critical * dex_bonus * crit_height_bonus * crit_pos_bonus * effect_bonus * fatal_blow_rate
  • + *
  • weapon_critical = (12 for daggers)
  • + *
  • dex_bonus = dex modifier bonus for current dex (Seems unused in GOD, so its not used in formula).
  • + *
  • crit_height_bonus = (z_diff * 4 / 5 + 10) / 100 + 1 or alternatively (z_diff * 0.008) + 1.1. Be aware of z_diff constraint of -25 to 25.
  • + *
  • crit_pos_bonus = crit_pos(front = 1, side = 1.1, back = 1.3) * p_critical_rate_position_bonus
  • + *
  • effect_bonus = (p2 + 100) / 100, p2 - 2nd param of effect. Blow chance of effect.
  • + *
+ * Chance cannot be higher than 80%. + * @param activeChar + * @param target + * @param skill + * @param chanceBoost + * @return + */ + public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double chanceBoost) { - final double weaponCritical = 12; // Dagger weapon critical mod is 12... TODO: Make it work for other weapons. + final L2Weapon weapon = activeChar.getActiveWeaponItem(); + final double weaponCritical = weapon != null ? weapon.getStats(Stats.CRITICAL_RATE, activeChar.getTemplate().getBaseCritRate()) : activeChar.getTemplate().getBaseCritRate(); // double dexBonus = BaseStats.DEX.calcBonus(activeChar); Not used in GOD - final double critHeightBonus = ((((CommonUtil.constrain(activeChar.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1; - final Position position = Position.getPosition(activeChar, target); - final double criticalPosition = position == Position.BACK ? 1.3 : position == Position.SIDE ? 1.1 : 1; // 30% chance from back, 10% chance from side. - final double criticalPositionMod = criticalPosition * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, position); + final double critHeightBonus = calcCriticalHeightBonus(activeChar, target); + final double criticalPosition = calcCriticalPositionBonus(activeChar, target); // 30% chance from back, 10% chance from side. Include buffs that give positional crit rate. + final double chanceBoostMod = (100 + chanceBoost) / 100; final double blowRateMod = activeChar.getStat().getValue(Stats.BLOW_RATE, 1); - blowChance = (weaponCritical + blowChance) * 10; - final double rate = blowChance * critHeightBonus * criticalPositionMod * blowRateMod; + final double rate = criticalPosition * critHeightBonus * weaponCritical * chanceBoostMod * blowRateMod; // Blow rate is capped at 80% - return Rnd.get(1000) < Math.min(rate, 800); + return Rnd.get(100) < Math.min(rate, 80); } public static List calcCancelStealEffects(L2Character activeChar, L2Character target, Skill skill, DispelSlotType slot, int rate, int max) diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Backstab.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Backstab.java index 407c15af47..ab3b0d7f3c 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Backstab.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Backstab.java @@ -33,14 +33,14 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class Backstab extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final double _criticalChance; private final boolean _overHit; public Backstab(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _criticalChance = params.getDouble("criticalChance", 0); _overHit = params.getBoolean("overHit", false); } @@ -48,7 +48,7 @@ public final class Backstab extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !effector.isInFrontOf(effected) && !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java index 08c1164d08..4c94b296af 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java @@ -22,7 +22,6 @@ import java.util.Set; import com.l2jmobius.gameserver.enums.ShotType; import com.l2jmobius.gameserver.model.StatsSet; -import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; @@ -38,27 +37,24 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class FatalBlow extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final double _criticalChance; - private final boolean _overHit; - private final Set _abnormals; private final double _abnormalPower; public FatalBlow(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _criticalChance = params.getDouble("criticalChance", 0); - _overHit = params.getBoolean("overHit", false); - final String abnormals = params.getString("abnormalType", null); + String abnormals = params.getString("abnormalType", null); if ((abnormals != null) && !abnormals.isEmpty()) { _abnormals = new HashSet<>(); for (String slot : abnormals.split(";")) { - _abnormals.add(AbnormalType.getAbnormalType(slot)); + _abnormals.add(Enum.valueOf(AbnormalType.class, slot)); } } else @@ -71,7 +67,7 @@ public final class FatalBlow extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override @@ -94,11 +90,6 @@ public final class FatalBlow extends AbstractEffect return; } - if (_overHit && effected.isAttackable()) - { - ((L2Attackable) effected).overhitEnabled(true); - } - double power = _power; // Check if we apply an abnormal modifier diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java index 53d8257d8d..e97b9006e5 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/SoulBlow.java @@ -33,13 +33,13 @@ import com.l2jmobius.gameserver.model.stats.Formulas; public final class SoulBlow extends AbstractEffect { private final double _power; - private final double _chance; + private final double _chanceBoost; private final boolean _overHit; public SoulBlow(StatsSet params) { - _power = params.getDouble("power", 0); - _chance = params.getDouble("chance", 0); + _power = params.getDouble("power"); + _chanceBoost = params.getDouble("chanceBoost"); _overHit = params.getBoolean("overHit", false); } @@ -52,7 +52,7 @@ public final class SoulBlow extends AbstractEffect @Override public boolean calcSuccess(L2Character effector, L2Character effected, Skill skill) { - return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chance); + return !Formulas.calcPhysicalSkillEvasion(effector, effected, skill) && Formulas.calcBlowSuccess(effector, effected, skill, _chanceBoost); } @Override diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00000-00099.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00000-00099.xml index a1e4ebc909..3021d3ba76 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00000-00099.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00000-00099.xml @@ -1840,7 +1840,7 @@ 977 true - 20 + 200 @@ -3423,7 +3423,7 @@ 15 15 - 40 + 400 true diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00200-00299.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00200-00299.xml index 1ba4a29427..d681e25115 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00200-00299.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00200-00299.xml @@ -4657,9 +4657,10 @@ 6215 true - 30 + 300 + 0 10 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00300-00399.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00300-00399.xml index 1f322b3c9d..7eabca91f4 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00300-00399.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00300-00399.xml @@ -1099,12 +1099,13 @@ 3653 true - 25 + 250 80 + 0 5 @@ -1661,10 +1662,11 @@ 5773 20 - 30 + 300 true + 0 15 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00400-00499.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00400-00499.xml index ae8f1b8c1d..d67270791f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00400-00499.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00400-00499.xml @@ -1466,9 +1466,10 @@ 3653 true - 25 + 250 + 0 5 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00500-00599.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00500-00599.xml index 1e1be89692..d5e6cb014a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00500-00599.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00500-00599.xml @@ -525,7 +525,7 @@ 5479 true - 20 + 200 @@ -3007,9 +3007,10 @@ 5199 true - 20 + 200 + 0 10 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00600-00699.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00600-00699.xml index dda9927ab7..6491e9a784 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00600-00699.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00600-00699.xml @@ -1765,9 +1765,10 @@ 6969 true - 20 + 200 + 0 10 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00900-00999.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00900-00999.xml index a5907b97cd..39dcc845b4 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00900-00999.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/00900-00999.xml @@ -1600,7 +1600,7 @@ 11234 30 - 60 + 600 true diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01500-01599.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01500-01599.xml index 7bfd0c88a1..7c61a842c7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01500-01599.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/01500-01599.xml @@ -3556,7 +3556,7 @@ 11234 30 - 60 + 600 true diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04000-04099.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04000-04099.xml index d7ead2eb40..0278e4e1f7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04000-04099.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04000-04099.xml @@ -2419,7 +2419,7 @@ 7461 7850 - 20 + 200 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04100-04199.xml index 10cf0dcd17..a77e5131f7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04100-04199.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04100-04199.xml @@ -3379,7 +3379,7 @@ 44350 49193 - 115 + 1150 @@ -4008,7 +4008,7 @@ 73917 81989 - 67 + 670 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04500-04599.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04500-04599.xml index a0b16f988b..74e65f9d8b 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04500-04599.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04500-04599.xml @@ -2546,7 +2546,7 @@ 7461 7850 - 20 + 200 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04700-04799.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04700-04799.xml index 65152868c7..3c38f9faea 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04700-04799.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04700-04799.xml @@ -892,8 +892,6 @@ - - 1 9 STUN @@ -997,8 +995,6 @@ - - 40 -279 @@ -1087,7 +1083,7 @@ 9830 10 - 20 + 200 @@ -2309,7 +2305,7 @@ 44350 49193 - 115 + 1150 @@ -2369,7 +2365,7 @@ 38806 43290 - 115 + 1150 @@ -2429,7 +2425,7 @@ 20667 23023 - 115 + 1150 @@ -2489,7 +2485,7 @@ 19381 21645 - 115 + 1150 @@ -2549,7 +2545,7 @@ 18140 20268 - 115 + 1150 @@ -3604,7 +3600,7 @@ 73917 81989 - 67 + 670 @@ -3664,7 +3660,7 @@ 64677 72150 - 67 + 670 @@ -3724,7 +3720,7 @@ 34445 38371 - 67 + 670 @@ -3784,7 +3780,7 @@ 32302 36075 - 67 + 670 @@ -3844,7 +3840,7 @@ 30232 33780 - 67 + 670 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/05000-05099.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/05000-05099.xml index cf16b2056e..8a3f50bdad 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/05000-05099.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/05000-05099.xml @@ -2658,7 +2658,7 @@ 7306 8602 - 20 + 200 @@ -2757,15 +2757,13 @@ 6335 - 15 + 150 40 DIFF - - diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/05100-05199.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/05100-05199.xml index 90486afaa9..4fbbaf8cd1 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/05100-05199.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/05100-05199.xml @@ -1309,7 +1309,7 @@ 39544 - 115 + 1150 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/06000-06099.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/06000-06099.xml index 76ffa5d161..f4dbb2094f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/06000-06099.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/06000-06099.xml @@ -1783,7 +1783,7 @@ 6844 6960 - 20 + 200 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/20000-20099.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/20000-20099.xml index 1fb03750cd..2545000ddb 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/20000-20099.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/20000-20099.xml @@ -40,7 +40,7 @@ 3420 true - 20 + 200 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/skills.xsd b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/skills.xsd index 3cf5a3db91..ddf0629be1 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/skills.xsd +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/skills.xsd @@ -664,6 +664,7 @@
+ @@ -984,6 +985,21 @@ + + + + + + + + + + + + + + + @@ -1279,21 +1295,6 @@ - - - - - - - - - - - - - - - @@ -1529,6 +1530,7 @@ + diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Formulas.java index d5f04ac1d3..ab68ad91ea 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Formulas.java @@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2StaticObjectInstance; import com.l2jmobius.gameserver.model.cubic.CubicInstance; import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.L2EffectType; +import com.l2jmobius.gameserver.model.interfaces.ILocational; import com.l2jmobius.gameserver.model.items.L2Armor; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.L2Weapon; @@ -264,6 +265,37 @@ public final class Formulas return finalRate > Rnd.get(1000); } + /** + * Gets the default (10% for side, 30% for back) positional critical rate bonus and multiplies it by any buffs that give positional critical rate bonus. + * @param activeChar the attacker. + * @param target the target. + * @return a multiplier representing the positional critical rate bonus. Autoattacks for example get this bonus on top of the already capped critical rate of 500. + */ + public static double calcCriticalPositionBonus(L2Character activeChar, L2Character target) + { + // final Position position = activeChar.getStat().has(Stats.ATTACK_BEHIND) ? Position.BACK : Position.getPosition(activeChar, target); + switch (Position.getPosition(activeChar, target)) + { + case SIDE: // 10% Critical Chance bonus when attacking from side. + { + return 1.1 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.SIDE); + } + case BACK: // 30% Critical Chance bonus when attacking from back. + { + return 1.3 * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.BACK); + } + default: // No Critical Chance bonus when attacking from front. + { + return activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, Position.FRONT); + } + } + } + + public static double calcCriticalHeightBonus(ILocational from, ILocational target) + { + return ((((CommonUtil.constrain(from.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1; + } + /** * @param attacker * @param target @@ -1018,21 +1050,37 @@ public final class Formulas return cha.getStat().getValue(Stats.FALL, (fallHeight * cha.getMaxHp()) / 1000.0); } - public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double blowChance) + /** + * Basic chance formula:
+ *
    + *
  • chance = weapon_critical * dex_bonus * crit_height_bonus * crit_pos_bonus * effect_bonus * fatal_blow_rate
  • + *
  • weapon_critical = (12 for daggers)
  • + *
  • dex_bonus = dex modifier bonus for current dex (Seems unused in GOD, so its not used in formula).
  • + *
  • crit_height_bonus = (z_diff * 4 / 5 + 10) / 100 + 1 or alternatively (z_diff * 0.008) + 1.1. Be aware of z_diff constraint of -25 to 25.
  • + *
  • crit_pos_bonus = crit_pos(front = 1, side = 1.1, back = 1.3) * p_critical_rate_position_bonus
  • + *
  • effect_bonus = (p2 + 100) / 100, p2 - 2nd param of effect. Blow chance of effect.
  • + *
+ * Chance cannot be higher than 80%. + * @param activeChar + * @param target + * @param skill + * @param chanceBoost + * @return + */ + public static boolean calcBlowSuccess(L2Character activeChar, L2Character target, Skill skill, double chanceBoost) { - final double weaponCritical = 12; // Dagger weapon critical mod is 12... TODO: Make it work for other weapons. + final L2Weapon weapon = activeChar.getActiveWeaponItem(); + final double weaponCritical = weapon != null ? weapon.getStats(Stats.CRITICAL_RATE, activeChar.getTemplate().getBaseCritRate()) : activeChar.getTemplate().getBaseCritRate(); // double dexBonus = BaseStats.DEX.calcBonus(activeChar); Not used in GOD - final double critHeightBonus = ((((CommonUtil.constrain(activeChar.getZ() - target.getZ(), -25, 25) * 4) / 5) + 10) / 100) + 1; - final Position position = Position.getPosition(activeChar, target); - final double criticalPosition = position == Position.BACK ? 1.3 : position == Position.SIDE ? 1.1 : 1; // 30% chance from back, 10% chance from side. - final double criticalPositionMod = criticalPosition * activeChar.getStat().getPositionTypeValue(Stats.CRITICAL_RATE, position); + final double critHeightBonus = calcCriticalHeightBonus(activeChar, target); + final double criticalPosition = calcCriticalPositionBonus(activeChar, target); // 30% chance from back, 10% chance from side. Include buffs that give positional crit rate. + final double chanceBoostMod = (100 + chanceBoost) / 100; final double blowRateMod = activeChar.getStat().getValue(Stats.BLOW_RATE, 1); - blowChance = (weaponCritical + blowChance) * 10; - final double rate = blowChance * critHeightBonus * criticalPositionMod * blowRateMod; + final double rate = criticalPosition * critHeightBonus * weaponCritical * chanceBoostMod * blowRateMod; // Blow rate is capped at 80% - return Rnd.get(1000) < Math.min(rate, 800); + return Rnd.get(100) < Math.min(rate, 80); } public static List calcCancelStealEffects(L2Character activeChar, L2Character target, Skill skill, DispelSlotType slot, int rate, int max)