From 0eeac80585ee98074d89c16bc79c51b711321d5d Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 15 Oct 2017 13:00:44 +0000 Subject: [PATCH] Addition of BonusDropRate effect handler. --- .../scripts/handlers/EffectMasterHandler.java | 1 + .../handlers/bypasshandlers/NpcViewMod.java | 8 +++++ .../communityboard/DropSearchBoard.java | 8 +++++ .../effecthandlers/BonusDropRate.java | 31 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../model/actor/templates/L2NpcTemplate.java | 8 +++++ .../gameserver/model/stats/Stats.java | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../handlers/bypasshandlers/NpcViewMod.java | 8 +++++ .../communityboard/DropSearchBoard.java | 8 +++++ .../effecthandlers/BonusDropRate.java | 31 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../model/actor/templates/L2NpcTemplate.java | 8 +++++ .../gameserver/model/stats/Stats.java | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../handlers/bypasshandlers/NpcViewMod.java | 8 +++++ .../communityboard/DropSearchBoard.java | 8 +++++ .../effecthandlers/BonusDropRate.java | 31 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../model/actor/templates/L2NpcTemplate.java | 8 +++++ .../gameserver/model/stats/Stats.java | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../handlers/bypasshandlers/NpcViewMod.java | 8 +++++ .../communityboard/DropSearchBoard.java | 8 +++++ .../effecthandlers/BonusDropRate.java | 31 +++++++++++++++++++ .../game/data/stats/skills/documentation.txt | 1 + .../model/actor/templates/L2NpcTemplate.java | 8 +++++ .../gameserver/model/stats/Stats.java | 1 + 28 files changed, 232 insertions(+) create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.java create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.java create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.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 738ad6dcdb..96074f182a 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 @@ -59,6 +59,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("BlockSkill", BlockSkill::new); EffectHandler.getInstance().registerHandler("BlockTarget", BlockTarget::new); EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); + EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::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 419c5d65db..4835bf1002 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 @@ -37,6 +37,7 @@ import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.items.L2Item; +import com.l2jmobius.gameserver.model.stats.Stats; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.util.HtmlUtil; import com.l2jmobius.gameserver.util.Util; @@ -400,6 +401,7 @@ public class NpcViewMod implements IBypassHandler int leftHeight = 0; int rightHeight = 0; + final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final StringBuilder leftSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder(); String limitReachedMsg = ""; @@ -499,6 +501,12 @@ public class NpcViewMod implements IBypassHandler rateAmount *= Config.PREMIUM_RATE_DROP_AMOUNT; } } + + // bonus drop rate effect + if (dropRateEffectBonus > 0) + { + 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 1e8aca6386..28db8bde36 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 @@ -40,6 +40,7 @@ import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate; +import com.l2jmobius.gameserver.model.stats.Stats; /** * @author yksdtc @@ -167,6 +168,7 @@ 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 dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); for (int index = start; index <= end; index++) { CBDropHolder cbDropHolder = list.get(index); @@ -261,6 +263,12 @@ public class DropSearchBoard implements IParseBoardHandler rateAmount *= Config.PREMIUM_RATE_DROP_AMOUNT; } } + + // bonus drop rate effect + if (dropRateEffectBonus > 0) + { + rateChance *= dropRateEffectBonus; + } } builder.append(""); diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.java new file mode 100644 index 0000000000..2edf5510f7 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.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 BonusDropRate extends AbstractStatEffect +{ + public BonusDropRate(StatsSet params) + { + super(params, Stats.BONUS_DROP_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 fff772a59b..b966a39476 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 @@ -27,6 +27,7 @@ BlockResurrection: Blocked target from getting ressurected. BlockSkill: Blocks usage of given skill magic types. Identity Crysis. BlockTarget: Causes the target to become untargetable. Bluff: Rotates the target so you face its back. +BonusDropRate: Bonus chance for dropping 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 2d0952b208..64052a9c58 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 @@ -43,6 +43,7 @@ import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.model.stats.Stats; import com.l2jmobius.gameserver.util.Util; /** @@ -714,6 +715,13 @@ 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 *= dropRateEffectBonus; + } + // calculate if item will drop 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 63eaeeec79..ef15c95559 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 @@ -130,6 +130,7 @@ public enum Stats EXPSP_RATE("rExp"), BONUS_EXP("bonusExp"), BONUS_SP("bonusSp"), + BONUS_DROP_RATE("bonusDropRate"), 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 738ad6dcdb..96074f182a 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 @@ -59,6 +59,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("BlockSkill", BlockSkill::new); EffectHandler.getInstance().registerHandler("BlockTarget", BlockTarget::new); EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); + EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::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 419c5d65db..4835bf1002 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 @@ -37,6 +37,7 @@ import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.items.L2Item; +import com.l2jmobius.gameserver.model.stats.Stats; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.util.HtmlUtil; import com.l2jmobius.gameserver.util.Util; @@ -400,6 +401,7 @@ public class NpcViewMod implements IBypassHandler int leftHeight = 0; int rightHeight = 0; + final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final StringBuilder leftSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder(); String limitReachedMsg = ""; @@ -499,6 +501,12 @@ public class NpcViewMod implements IBypassHandler rateAmount *= Config.PREMIUM_RATE_DROP_AMOUNT; } } + + // bonus drop rate effect + if (dropRateEffectBonus > 0) + { + 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 1e8aca6386..28db8bde36 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 @@ -40,6 +40,7 @@ import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate; +import com.l2jmobius.gameserver.model.stats.Stats; /** * @author yksdtc @@ -167,6 +168,7 @@ 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 dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); for (int index = start; index <= end; index++) { CBDropHolder cbDropHolder = list.get(index); @@ -261,6 +263,12 @@ public class DropSearchBoard implements IParseBoardHandler rateAmount *= Config.PREMIUM_RATE_DROP_AMOUNT; } } + + // bonus drop rate effect + if (dropRateEffectBonus > 0) + { + rateChance *= dropRateEffectBonus; + } } builder.append(""); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.java new file mode 100644 index 0000000000..2edf5510f7 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.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 BonusDropRate extends AbstractStatEffect +{ + public BonusDropRate(StatsSet params) + { + super(params, Stats.BONUS_DROP_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 fff772a59b..b966a39476 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 @@ -27,6 +27,7 @@ BlockResurrection: Blocked target from getting ressurected. BlockSkill: Blocks usage of given skill magic types. Identity Crysis. BlockTarget: Causes the target to become untargetable. Bluff: Rotates the target so you face its back. +BonusDropRate: Bonus chance for dropping 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 2d0952b208..64052a9c58 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 @@ -43,6 +43,7 @@ import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.model.stats.Stats; import com.l2jmobius.gameserver.util.Util; /** @@ -714,6 +715,13 @@ 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 *= dropRateEffectBonus; + } + // calculate if item will drop 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 63eaeeec79..ef15c95559 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 @@ -130,6 +130,7 @@ public enum Stats EXPSP_RATE("rExp"), BONUS_EXP("bonusExp"), BONUS_SP("bonusSp"), + BONUS_DROP_RATE("bonusDropRate"), 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 738ad6dcdb..96074f182a 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 @@ -59,6 +59,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("BlockSkill", BlockSkill::new); EffectHandler.getInstance().registerHandler("BlockTarget", BlockTarget::new); EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); + EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::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 419c5d65db..4835bf1002 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 @@ -37,6 +37,7 @@ import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.items.L2Item; +import com.l2jmobius.gameserver.model.stats.Stats; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.util.HtmlUtil; import com.l2jmobius.gameserver.util.Util; @@ -400,6 +401,7 @@ public class NpcViewMod implements IBypassHandler int leftHeight = 0; int rightHeight = 0; + final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final StringBuilder leftSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder(); String limitReachedMsg = ""; @@ -499,6 +501,12 @@ public class NpcViewMod implements IBypassHandler rateAmount *= Config.PREMIUM_RATE_DROP_AMOUNT; } } + + // bonus drop rate effect + if (dropRateEffectBonus > 0) + { + 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 1e8aca6386..28db8bde36 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 @@ -40,6 +40,7 @@ import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate; +import com.l2jmobius.gameserver.model.stats.Stats; /** * @author yksdtc @@ -167,6 +168,7 @@ 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 dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); for (int index = start; index <= end; index++) { CBDropHolder cbDropHolder = list.get(index); @@ -261,6 +263,12 @@ public class DropSearchBoard implements IParseBoardHandler rateAmount *= Config.PREMIUM_RATE_DROP_AMOUNT; } } + + // bonus drop rate effect + if (dropRateEffectBonus > 0) + { + rateChance *= dropRateEffectBonus; + } } builder.append(""); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.java new file mode 100644 index 0000000000..2edf5510f7 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.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 BonusDropRate extends AbstractStatEffect +{ + public BonusDropRate(StatsSet params) + { + super(params, Stats.BONUS_DROP_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 fff772a59b..b966a39476 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 @@ -27,6 +27,7 @@ BlockResurrection: Blocked target from getting ressurected. BlockSkill: Blocks usage of given skill magic types. Identity Crysis. BlockTarget: Causes the target to become untargetable. Bluff: Rotates the target so you face its back. +BonusDropRate: Bonus chance for dropping 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 2d0952b208..64052a9c58 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 @@ -43,6 +43,7 @@ import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.model.stats.Stats; import com.l2jmobius.gameserver.util.Util; /** @@ -714,6 +715,13 @@ 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 *= dropRateEffectBonus; + } + // calculate if item will drop 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 63eaeeec79..ef15c95559 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 @@ -130,6 +130,7 @@ public enum Stats EXPSP_RATE("rExp"), BONUS_EXP("bonusExp"), BONUS_SP("bonusSp"), + BONUS_DROP_RATE("bonusDropRate"), 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 738ad6dcdb..96074f182a 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 @@ -59,6 +59,7 @@ public final class EffectMasterHandler EffectHandler.getInstance().registerHandler("BlockSkill", BlockSkill::new); EffectHandler.getInstance().registerHandler("BlockTarget", BlockTarget::new); EffectHandler.getInstance().registerHandler("Bluff", Bluff::new); + EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::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 419c5d65db..4835bf1002 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 @@ -37,6 +37,7 @@ import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.items.L2Item; +import com.l2jmobius.gameserver.model.stats.Stats; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.util.HtmlUtil; import com.l2jmobius.gameserver.util.Util; @@ -400,6 +401,7 @@ public class NpcViewMod implements IBypassHandler int leftHeight = 0; int rightHeight = 0; + final double dropRateEffectBonus = activeChar.getStat().getValue(Stats.BONUS_DROP_RATE, 0); final StringBuilder leftSb = new StringBuilder(); final StringBuilder rightSb = new StringBuilder(); String limitReachedMsg = ""; @@ -499,6 +501,12 @@ public class NpcViewMod implements IBypassHandler rateAmount *= Config.PREMIUM_RATE_DROP_AMOUNT; } } + + // bonus drop rate effect + if (dropRateEffectBonus > 0) + { + 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 1e8aca6386..28db8bde36 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 @@ -40,6 +40,7 @@ import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate; +import com.l2jmobius.gameserver.model.stats.Stats; /** * @author yksdtc @@ -167,6 +168,7 @@ 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 dropRateEffectBonus = player.getStat().getValue(Stats.BONUS_DROP_RATE, 0); for (int index = start; index <= end; index++) { CBDropHolder cbDropHolder = list.get(index); @@ -261,6 +263,12 @@ public class DropSearchBoard implements IParseBoardHandler rateAmount *= Config.PREMIUM_RATE_DROP_AMOUNT; } } + + // bonus drop rate effect + if (dropRateEffectBonus > 0) + { + rateChance *= dropRateEffectBonus; + } } builder.append(""); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.java new file mode 100644 index 0000000000..2edf5510f7 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BonusDropRate.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 BonusDropRate extends AbstractStatEffect +{ + public BonusDropRate(StatsSet params) + { + super(params, Stats.BONUS_DROP_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 fff772a59b..b966a39476 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 @@ -27,6 +27,7 @@ BlockResurrection: Blocked target from getting ressurected. BlockSkill: Blocks usage of given skill magic types. Identity Crysis. BlockTarget: Causes the target to become untargetable. Bluff: Rotates the target so you face its back. +BonusDropRate: Bonus chance for dropping 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 2d0952b208..64052a9c58 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 @@ -43,6 +43,7 @@ import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.skills.Skill; +import com.l2jmobius.gameserver.model.stats.Stats; import com.l2jmobius.gameserver.util.Util; /** @@ -714,6 +715,13 @@ 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 *= dropRateEffectBonus; + } + // calculate if item will drop 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 63eaeeec79..ef15c95559 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 @@ -130,6 +130,7 @@ public enum Stats EXPSP_RATE("rExp"), BONUS_EXP("bonusExp"), BONUS_SP("bonusSp"), + BONUS_DROP_RATE("bonusDropRate"), ATTACK_CANCEL("cancel"), // ACCURACY & RANGE