From e407b31cd0296165a4be9557ca6157100d9ea133 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 16 Oct 2017 16:52:50 +0000 Subject: [PATCH] Addition of BonusSpoilRate effect. --- .../scripts/handlers/EffectMasterHandler.java | 1 + .../handlers/bypasshandlers/NpcViewMod.java | 19 +++++------- .../communityboard/DropSearchBoard.java | 19 +++++------- .../effecthandlers/BonusSpoilRate.java | 31 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../model/actor/templates/L2NpcTemplate.java | 14 +++------ .../gameserver/model/stats/Stats.java | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../handlers/bypasshandlers/NpcViewMod.java | 19 +++++------- .../communityboard/DropSearchBoard.java | 19 +++++------- .../effecthandlers/BonusSpoilRate.java | 31 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../model/actor/templates/L2NpcTemplate.java | 14 +++------ .../gameserver/model/stats/Stats.java | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../handlers/bypasshandlers/NpcViewMod.java | 19 +++++------- .../communityboard/DropSearchBoard.java | 19 +++++------- .../effecthandlers/BonusSpoilRate.java | 31 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../model/actor/templates/L2NpcTemplate.java | 14 +++------ .../gameserver/model/stats/Stats.java | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../handlers/bypasshandlers/NpcViewMod.java | 19 +++++------- .../communityboard/DropSearchBoard.java | 19 +++++------- .../effecthandlers/BonusSpoilRate.java | 31 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../model/actor/templates/L2NpcTemplate.java | 14 +++------ .../gameserver/model/stats/Stats.java | 1 + 28 files changed, 216 insertions(+), 128 deletions(-) create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java 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 1ebf0e8079..a44f0db440 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 @@ -61,6 +61,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new); EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new); + EffectHandler.getInstance().registerHandler("BonusSpoilRate", BonusSpoilRate::new); EffectHandler.getInstance().registerHandler("Breath", Breath::new); EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java index 9d944500a0..ff46e2dcd5 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java @@ -401,8 +401,9 @@ public class NpcViewMod implements IBypassHandler int leftHeight = 0; int rightHeight = 0; - final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); + final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); + final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 1); + final double spoilRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); final StringBuilder leftSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder(); String limitReachedMsg = ""; @@ -428,6 +429,9 @@ public class NpcViewMod implements IBypassHandler rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; } + + // bonus spoil rate effect + rateChance *= spoilRateEffectBonus; } else { @@ -504,16 +508,9 @@ public class NpcViewMod implements IBypassHandler } // bonus drop amount effect - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } - + rateAmount *= dropAmountEffectBonus; // bonus drop rate effect - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= dropRateEffectBonus; } sb.append(""); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java index 2c04a03e34..26884eff81 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java @@ -168,8 +168,9 @@ public class DropSearchBoard implements IParseBoardHandler int start = (page - 1) * 14; int end = Math.min(list.size() - 1, start + 14); StringBuilder builder = new StringBuilder(); - final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); + final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); + final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 1); + final double spoilRateEffectBonus = player.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); for (int index = start; index <= end; index++) { CBDropHolder cbDropHolder = list.get(index); @@ -188,6 +189,9 @@ public class DropSearchBoard implements IParseBoardHandler rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; } + + // bonus spoil rate effect + rateChance *= spoilRateEffectBonus; } else { @@ -266,16 +270,9 @@ public class DropSearchBoard implements IParseBoardHandler } // bonus drop amount effect - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } - + rateAmount *= dropAmountEffectBonus; // bonus drop rate effect - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= dropRateEffectBonus; } builder.append(""); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java new file mode 100644 index 0000000000..ece63bdd46 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.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 com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.stats.Stats; + +/** + * @author Mobius + */ +public class BonusSpoilRate extends AbstractStatEffect +{ + public BonusSpoilRate(StatsSet params) + { + super(params, Stats.BONUS_SPOIL_RATE); + } +} 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 3abbd62768..705b6b6cc6 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 @@ -29,6 +29,7 @@ BlockTarget: Causes the target to become untargetable. Bluff: Rotates the target so you face its back. BonusDropAmount: Bonus amount for dropped items. (l2jmobius) BonusDropRate: Bonus chance for dropping items. (l2jmobius) +BonusSpoilRate: Bonus chance for acquiring spoil items. (l2jmobius) Breath: Underwater breathing stat. BuffBlock: Blocks target from receiving buffs. CallParty: Recalls whole party. diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java index 969b711b60..c0a9bd49c7 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java @@ -716,11 +716,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable } // bonus drop rate effect - final double dropRateEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_RATE, 0); - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= killer.getStat().getValue(Stats.BONUS_DROP_RATE, 1); // calculate if item will drop if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) @@ -766,11 +762,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable } // bonus drop amount effect - final double dropAmountEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } + rateAmount *= killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); // finally return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount)); @@ -786,6 +778,8 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable { rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; } + // bonus drop rate effect + rateChance *= killer.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); // calculate if item will be rewarded if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Stats.java index 70305dd3c9..3eb0a2828c 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -132,6 +132,7 @@ public enum Stats BONUS_SP("bonusSp"), BONUS_DROP_AMOUNT("bonusDropAmount"), BONUS_DROP_RATE("bonusDropRate"), + BONUS_SPOIL_RATE("bonusSpoilRate"), ATTACK_CANCEL("cancel"), // ACCURACY & RANGE 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 1ebf0e8079..a44f0db440 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 @@ -61,6 +61,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new); EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new); + EffectHandler.getInstance().registerHandler("BonusSpoilRate", BonusSpoilRate::new); EffectHandler.getInstance().registerHandler("Breath", Breath::new); EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java index 9d944500a0..ff46e2dcd5 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java @@ -401,8 +401,9 @@ public class NpcViewMod implements IBypassHandler int leftHeight = 0; int rightHeight = 0; - final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); + final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); + final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 1); + final double spoilRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); final StringBuilder leftSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder(); String limitReachedMsg = ""; @@ -428,6 +429,9 @@ public class NpcViewMod implements IBypassHandler rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; } + + // bonus spoil rate effect + rateChance *= spoilRateEffectBonus; } else { @@ -504,16 +508,9 @@ public class NpcViewMod implements IBypassHandler } // bonus drop amount effect - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } - + rateAmount *= dropAmountEffectBonus; // bonus drop rate effect - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= dropRateEffectBonus; } sb.append("
"); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java index 2c04a03e34..26884eff81 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java @@ -168,8 +168,9 @@ public class DropSearchBoard implements IParseBoardHandler int start = (page - 1) * 14; int end = Math.min(list.size() - 1, start + 14); StringBuilder builder = new StringBuilder(); - final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); + final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); + final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 1); + final double spoilRateEffectBonus = player.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); for (int index = start; index <= end; index++) { CBDropHolder cbDropHolder = list.get(index); @@ -188,6 +189,9 @@ public class DropSearchBoard implements IParseBoardHandler rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; } + + // bonus spoil rate effect + rateChance *= spoilRateEffectBonus; } else { @@ -266,16 +270,9 @@ public class DropSearchBoard implements IParseBoardHandler } // bonus drop amount effect - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } - + rateAmount *= dropAmountEffectBonus; // bonus drop rate effect - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= dropRateEffectBonus; } builder.append(""); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java new file mode 100644 index 0000000000..ece63bdd46 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.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 com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.stats.Stats; + +/** + * @author Mobius + */ +public class BonusSpoilRate extends AbstractStatEffect +{ + public BonusSpoilRate(StatsSet params) + { + super(params, Stats.BONUS_SPOIL_RATE); + } +} 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 3abbd62768..705b6b6cc6 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 @@ -29,6 +29,7 @@ BlockTarget: Causes the target to become untargetable. Bluff: Rotates the target so you face its back. BonusDropAmount: Bonus amount for dropped items. (l2jmobius) BonusDropRate: Bonus chance for dropping items. (l2jmobius) +BonusSpoilRate: Bonus chance for acquiring spoil items. (l2jmobius) Breath: Underwater breathing stat. BuffBlock: Blocks target from receiving buffs. CallParty: Recalls whole party. diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java index 969b711b60..c0a9bd49c7 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java @@ -716,11 +716,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable } // bonus drop rate effect - final double dropRateEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_RATE, 0); - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= killer.getStat().getValue(Stats.BONUS_DROP_RATE, 1); // calculate if item will drop if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) @@ -766,11 +762,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable } // bonus drop amount effect - final double dropAmountEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } + rateAmount *= killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); // finally return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount)); @@ -786,6 +778,8 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable { rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; } + // bonus drop rate effect + rateChance *= killer.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); // calculate if item will be rewarded if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Stats.java index 70305dd3c9..3eb0a2828c 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -132,6 +132,7 @@ public enum Stats BONUS_SP("bonusSp"), BONUS_DROP_AMOUNT("bonusDropAmount"), BONUS_DROP_RATE("bonusDropRate"), + BONUS_SPOIL_RATE("bonusSpoilRate"), ATTACK_CANCEL("cancel"), // ACCURACY & RANGE 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 1ebf0e8079..a44f0db440 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 @@ -61,6 +61,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new); EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new); + EffectHandler.getInstance().registerHandler("BonusSpoilRate", BonusSpoilRate::new); EffectHandler.getInstance().registerHandler("Breath", Breath::new); EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java index 9d944500a0..ff46e2dcd5 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java @@ -401,8 +401,9 @@ public class NpcViewMod implements IBypassHandler int leftHeight = 0; int rightHeight = 0; - final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); + final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); + final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 1); + final double spoilRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); final StringBuilder leftSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder(); String limitReachedMsg = ""; @@ -428,6 +429,9 @@ public class NpcViewMod implements IBypassHandler rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; } + + // bonus spoil rate effect + rateChance *= spoilRateEffectBonus; } else { @@ -504,16 +508,9 @@ public class NpcViewMod implements IBypassHandler } // bonus drop amount effect - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } - + rateAmount *= dropAmountEffectBonus; // bonus drop rate effect - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= dropRateEffectBonus; } sb.append("
"); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java index 2c04a03e34..26884eff81 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java @@ -168,8 +168,9 @@ public class DropSearchBoard implements IParseBoardHandler int start = (page - 1) * 14; int end = Math.min(list.size() - 1, start + 14); StringBuilder builder = new StringBuilder(); - final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); + final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); + final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 1); + final double spoilRateEffectBonus = player.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); for (int index = start; index <= end; index++) { CBDropHolder cbDropHolder = list.get(index); @@ -188,6 +189,9 @@ public class DropSearchBoard implements IParseBoardHandler rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; } + + // bonus spoil rate effect + rateChance *= spoilRateEffectBonus; } else { @@ -266,16 +270,9 @@ public class DropSearchBoard implements IParseBoardHandler } // bonus drop amount effect - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } - + rateAmount *= dropAmountEffectBonus; // bonus drop rate effect - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= dropRateEffectBonus; } builder.append(""); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java new file mode 100644 index 0000000000..ece63bdd46 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.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 com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.stats.Stats; + +/** + * @author Mobius + */ +public class BonusSpoilRate extends AbstractStatEffect +{ + public BonusSpoilRate(StatsSet params) + { + super(params, Stats.BONUS_SPOIL_RATE); + } +} 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 3abbd62768..705b6b6cc6 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 @@ -29,6 +29,7 @@ BlockTarget: Causes the target to become untargetable. Bluff: Rotates the target so you face its back. BonusDropAmount: Bonus amount for dropped items. (l2jmobius) BonusDropRate: Bonus chance for dropping items. (l2jmobius) +BonusSpoilRate: Bonus chance for acquiring spoil items. (l2jmobius) Breath: Underwater breathing stat. BuffBlock: Blocks target from receiving buffs. CallParty: Recalls whole party. diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java index 969b711b60..c0a9bd49c7 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java @@ -716,11 +716,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable } // bonus drop rate effect - final double dropRateEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_RATE, 0); - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= killer.getStat().getValue(Stats.BONUS_DROP_RATE, 1); // calculate if item will drop if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) @@ -766,11 +762,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable } // bonus drop amount effect - final double dropAmountEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } + rateAmount *= killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); // finally return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount)); @@ -786,6 +778,8 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable { rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; } + // bonus drop rate effect + rateChance *= killer.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); // calculate if item will be rewarded if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Stats.java index 70305dd3c9..3eb0a2828c 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -132,6 +132,7 @@ public enum Stats BONUS_SP("bonusSp"), BONUS_DROP_AMOUNT("bonusDropAmount"), BONUS_DROP_RATE("bonusDropRate"), + BONUS_SPOIL_RATE("bonusSpoilRate"), ATTACK_CANCEL("cancel"), // ACCURACY & RANGE 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 1ebf0e8079..a44f0db440 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 @@ -61,6 +61,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new); EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new); + EffectHandler.getInstance().registerHandler("BonusSpoilRate", BonusSpoilRate::new); EffectHandler.getInstance().registerHandler("Breath", Breath::new); EffectHandler.getInstance().registerHandler("BuffBlock", BuffBlock::new); EffectHandler.getInstance().registerHandler("CallParty", CallParty::new); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java index 9d944500a0..ff46e2dcd5 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java @@ -401,8 +401,9 @@ public class NpcViewMod implements IBypassHandler int leftHeight = 0; int rightHeight = 0; - final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); + final double dropAmountEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); + final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 1); + final double spoilRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); final StringBuilder leftSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder(); String limitReachedMsg = ""; @@ -428,6 +429,9 @@ public class NpcViewMod implements IBypassHandler rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; } + + // bonus spoil rate effect + rateChance *= spoilRateEffectBonus; } else { @@ -504,16 +508,9 @@ public class NpcViewMod implements IBypassHandler } // bonus drop amount effect - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } - + rateAmount *= dropAmountEffectBonus; // bonus drop rate effect - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= dropRateEffectBonus; } sb.append("
"); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java index 2c04a03e34..26884eff81 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java @@ -168,8 +168,9 @@ public class DropSearchBoard implements IParseBoardHandler int start = (page - 1) * 14; int end = Math.min(list.size() - 1, start + 14); StringBuilder builder = new StringBuilder(); - final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); + final double dropAmountEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); + final double dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 1); + final double spoilRateEffectBonus = player.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); for (int index = start; index <= end; index++) { CBDropHolder cbDropHolder = list.get(index); @@ -188,6 +189,9 @@ public class DropSearchBoard implements IParseBoardHandler rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; rateAmount *= Config.PREMIUM_RATE_SPOIL_AMOUNT; } + + // bonus spoil rate effect + rateChance *= spoilRateEffectBonus; } else { @@ -266,16 +270,9 @@ public class DropSearchBoard implements IParseBoardHandler } // bonus drop amount effect - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } - + rateAmount *= dropAmountEffectBonus; // bonus drop rate effect - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= dropRateEffectBonus; } builder.append(""); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.java new file mode 100644 index 0000000000..ece63bdd46 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BonusSpoilRate.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 com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.stats.Stats; + +/** + * @author Mobius + */ +public class BonusSpoilRate extends AbstractStatEffect +{ + public BonusSpoilRate(StatsSet params) + { + super(params, Stats.BONUS_SPOIL_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 3abbd62768..705b6b6cc6 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 @@ -29,6 +29,7 @@ BlockTarget: Causes the target to become untargetable. Bluff: Rotates the target so you face its back. BonusDropAmount: Bonus amount for dropped items. (l2jmobius) BonusDropRate: Bonus chance for dropping items. (l2jmobius) +BonusSpoilRate: Bonus chance for acquiring spoil items. (l2jmobius) Breath: Underwater breathing stat. BuffBlock: Blocks target from receiving buffs. CallParty: Recalls whole party. diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java index 969b711b60..c0a9bd49c7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java @@ -716,11 +716,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable } // bonus drop rate effect - final double dropRateEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_RATE, 0); - if (dropRateEffectBonus > 0) - { - rateChance += rateChance * dropRateEffectBonus; - } + rateChance *= killer.getStat().getValue(Stats.BONUS_DROP_RATE, 1); // calculate if item will drop if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) @@ -766,11 +762,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable } // bonus drop amount effect - final double dropAmountEffectBonus = killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 0); - if (dropAmountEffectBonus > 0) - { - rateAmount += rateAmount * dropAmountEffectBonus; - } + rateAmount *= killer.getStat().getValue(Stats.BONUS_DROP_AMOUNT, 1); // finally return new ItemHolder(dropItem.getItemId(), (long) (Rnd.get(dropItem.getMin(), dropItem.getMax()) * rateAmount)); @@ -786,6 +778,8 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable { rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE; } + // bonus drop rate effect + rateChance *= killer.getStat().getValue(Stats.BONUS_SPOIL_RATE, 1); // calculate if item will be rewarded if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Stats.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Stats.java index 70305dd3c9..3eb0a2828c 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Stats.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/stats/Stats.java @@ -132,6 +132,7 @@ public enum Stats BONUS_SP("bonusSp"), BONUS_DROP_AMOUNT("bonusDropAmount"), BONUS_DROP_RATE("bonusDropRate"), + BONUS_SPOIL_RATE("bonusSpoilRate"), ATTACK_CANCEL("cancel"), // ACCURACY & RANGE