diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java index a00c0a316a..3b4f35277b 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -217,6 +217,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/30000-30099.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/30000-30099.xml index c75b68b999..1b5b4f6bd3 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/30000-30099.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/30000-30099.xml @@ -1587,7 +1587,7 @@ P 85 - + 550 DIFF diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt index 7279e43560..07624c4627 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/skills/documentation.txt @@ -187,6 +187,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Stat.java index db67a9047c..31b18b7cc7 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -125,6 +125,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java index a00c0a316a..3b4f35277b 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -217,6 +217,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/30000-30099.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/30000-30099.xml index d62dc91abc..dc6f636cc2 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/30000-30099.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/30000-30099.xml @@ -1926,7 +1926,7 @@ P 85 - + 550 DIFF diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt index 7279e43560..07624c4627 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/skills/documentation.txt @@ -187,6 +187,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/Stat.java index db67a9047c..31b18b7cc7 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -125,6 +125,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java index a00c0a316a..3b4f35277b 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -217,6 +217,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/30000-30099.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/30000-30099.xml index cca62ae95f..8edd039b3a 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/30000-30099.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/30000-30099.xml @@ -1926,7 +1926,7 @@ P 85 - + 550 DIFF diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt index 7279e43560..07624c4627 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/skills/documentation.txt @@ -187,6 +187,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/Stat.java index db67a9047c..31b18b7cc7 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -125,6 +125,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java index d71b75de7d..446bef4a1f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -221,6 +221,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/30000-30099.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/30000-30099.xml index 2bd5e553c1..572bbf4132 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/30000-30099.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/30000-30099.xml @@ -1844,7 +1844,7 @@ P 85 - + 550 DIFF diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt index 6491151b35..f59d4aeb2c 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt @@ -191,6 +191,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Stat.java index b735dbe020..c0bbdc2d26 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -125,6 +125,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java index e004020b8b..a6771f5a69 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -224,6 +224,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/30000-30099.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/30000-30099.xml index c1f849b1d8..db6de83e3e 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/30000-30099.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/30000-30099.xml @@ -1844,7 +1844,7 @@ P 85 - + 550 DIFF diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/documentation.txt index 43fac57663..024395791e 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/skills/documentation.txt @@ -194,6 +194,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Stat.java index caee9f0caf..05b494f43b 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -127,6 +127,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java index e7526d3c70..b098d3f33b 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -225,6 +225,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/30000-30099.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/30000-30099.xml index ce22e23137..facd81547b 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/30000-30099.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/30000-30099.xml @@ -1844,7 +1844,7 @@ P 85 - + 550 DIFF diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/documentation.txt index f648fae112..301c1ff048 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/skills/documentation.txt @@ -195,6 +195,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Stat.java index 8c42961c9b..d898082279 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -127,6 +127,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java index e7526d3c70..b098d3f33b 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -225,6 +225,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/30000-30099.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/30000-30099.xml index 18f6232dfc..3776861679 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/30000-30099.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/30000-30099.xml @@ -1934,7 +1934,7 @@ P 85 - + 550 DIFF diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/documentation.txt index f648fae112..301c1ff048 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/skills/documentation.txt @@ -195,6 +195,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Stat.java index 8c42961c9b..d898082279 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -127,6 +127,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java index ba50623df0..28fdc4502d 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -225,6 +225,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/30000-30099.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/30000-30099.xml index 57bd399494..ba026f7752 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/30000-30099.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/30000-30099.xml @@ -1951,7 +1951,7 @@ P 85 - + 550 DIFF diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt index 36e963a5fe..a3b0d0ce19 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt @@ -195,6 +195,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Stat.java index 8c42961c9b..d898082279 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -127,6 +127,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java index aaf2356517..6d50afa787 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -215,6 +215,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt index e7f4b6dcb2..13b34c8be6 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt @@ -185,6 +185,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Stat.java index 425be400f0..c9be09a695 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -125,6 +125,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java index aaf2356517..6d50afa787 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -215,6 +215,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt index e7f4b6dcb2..13b34c8be6 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt @@ -185,6 +185,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Stat.java index 425be400f0..c9be09a695 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -125,6 +125,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java index 69a4201f2e..62898b1101 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -216,6 +216,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt index 9d7d5602fe..a9f91c61ce 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt @@ -186,6 +186,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Stat.java index 881a1d438e..9d448e4cac 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -127,6 +127,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4d3fe42293..0529a171b8 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -219,6 +219,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt index 1dd026b079..72f4333b00 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt @@ -189,6 +189,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Stat.java index 568b64aa89..7d6a40a7c4 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -140,6 +140,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4d3fe42293..0529a171b8 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -219,6 +219,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt index 1dd026b079..72f4333b00 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt @@ -189,6 +189,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Stat.java index 568b64aa89..7d6a40a7c4 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -140,6 +140,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java index e3defc2584..e279ed16a8 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -221,6 +221,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtkByPAtk", MAtkByPAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt index 2a0119128f..4090d54d70 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt @@ -191,6 +191,7 @@ MAtk: M. Atk. stat. MAtkByPAtk: M. Atk. bonus from P. Atk stat. (l2jmobius) MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Stat.java index 2fa3ceb7bb..302b2a2496 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -141,6 +141,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), MAGIC_CRITICAL_RATE_BY_CRITICAL_RATE("mCritRateByRCrit"), BLOW_RATE("blowRate"), diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index c981fa59fe..f8c075f12e 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -44,7 +44,7 @@ public class MCritRateFinalizer implements IStatFunction final double physicalBonus = creature.getStat().getValue(Stat.MAGIC_CRITICAL_RATE_BY_CRITICAL_RATE, 0) * creature.getStat().getCriticalHit(); final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, (baseValue * witBonus * 10) + physicalBonus), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, (baseValue * witBonus * 10) + physicalBonus), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java index a00c0a316a..3b4f35277b 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -217,6 +217,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("MAtk", MAtk::new); EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new); EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new); + EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new); EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new); EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new); EffectHandler.getInstance().registerHandler("Mp", Mp::new); diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java new file mode 100644 index 0000000000..3550bbb28a --- /dev/null +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/MaxMagicCriticalRate.java @@ -0,0 +1,31 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class MaxMagicCriticalRate extends AbstractStatEffect +{ + public MaxMagicCriticalRate(StatSet params) + { + super(params, Stat.MAX_MAGIC_CRITICAL_RATE); + } +} diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/30000-30099.xml b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/30000-30099.xml index 2bd5e553c1..572bbf4132 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/30000-30099.xml +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/30000-30099.xml @@ -1844,7 +1844,7 @@ P 85 - + 550 DIFF diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt index 7c90ac772c..409cb37e28 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt @@ -187,6 +187,7 @@ ManaHealPercent: Increases current MP by a given percentage. MAtk: M. Atk. stat. MaxCp: Max. CP stat. MaxHp: Max. HP stat. +MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius) MaxMp: Max. MP stat. ModifyVital: Modifies current HP/MP/CP MpConsumePerLevel: Consumes mana over time depending on your level. diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Stat.java index db67a9047c..31b18b7cc7 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -125,6 +125,7 @@ public enum Stat SHIELD_DEFENCE_RATE("rShld", new ShieldDefenceRateFinalizer()), CRITICAL_RATE("rCrit", new PCriticalRateFinalizer(), MathUtil::add, MathUtil::add, 0, 1), CRITICAL_RATE_SKILL("rCritSkill", Stat::defaultValue, MathUtil::add, MathUtil::add, 0, 1), + MAX_MAGIC_CRITICAL_RATE("maxMagicCritRate"), MAGIC_CRITICAL_RATE("mCritRate", new MCritRateFinalizer()), BLOW_RATE("blowRate"), BLOW_RATE_DEFENCE("blowRateDefence"), diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java index 719ae25c4b..eb6806e4c2 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/finalizers/MCritRateFinalizer.java @@ -43,7 +43,7 @@ public class MCritRateFinalizer implements IStatFunction } final double witBonus = creature.getWIT() > 0 ? BaseStat.WIT.calcBonus(creature) : 1.; - return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? Config.MAX_MCRIT_RATE : Double.MAX_VALUE); + return validateValue(creature, Stat.defaultValue(creature, stat, baseValue * witBonus * 10), 0, creature.isPlayer() ? creature.getStat().getValue(Stat.MAX_MAGIC_CRITICAL_RATE, Config.MAX_MCRIT_RATE) : Double.MAX_VALUE); } @Override