From 20f3d3114d9c47fd66032597af0b81fd875b5845 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 18 Oct 2021 22:35:00 +0000 Subject: [PATCH] Addition of BonusDropRateLCoin effect. --- .../scripts/handlers/EffectMasterHandler.java | 1 + .../handlers/bypasshandlers/NpcViewMod.java | 4 +++ .../communityboard/DropSearchBoard.java | 4 +++ .../effecthandlers/BonusDropRateLCoin.java | 31 +++++++++++++++++++ .../game/data/stats/skills/51400-51499.xml | 3 ++ .../game/data/stats/skills/documentation.txt | 1 + .../model/actor/templates/NpcTemplate.java | 4 +++ .../gameserver/model/stats/Stat.java | 1 + .../scripts/handlers/EffectMasterHandler.java | 1 + .../handlers/bypasshandlers/NpcViewMod.java | 4 +++ .../communityboard/DropSearchBoard.java | 4 +++ .../effecthandlers/BonusDropRateLCoin.java | 31 +++++++++++++++++++ .../game/data/stats/skills/51400-51499.xml | 3 ++ .../game/data/stats/skills/documentation.txt | 1 + .../model/actor/templates/NpcTemplate.java | 4 +++ .../gameserver/model/stats/Stat.java | 1 + 16 files changed, 98 insertions(+) create mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BonusDropRateLCoin.java create mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BonusDropRateLCoin.java diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java index da78aaa3e8..e00ae485ed 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -69,6 +69,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("BonusDropAdena", BonusDropAdena::new); EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new); EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new); + EffectHandler.getInstance().registerHandler("BonusDropRateLCoin", BonusDropRateLCoin::new); EffectHandler.getInstance().registerHandler("BonusRaidPoints", BonusRaidPoints::new); EffectHandler.getInstance().registerHandler("BonusSpoilRate", BonusSpoilRate::new); EffectHandler.getInstance().registerHandler("Breath", Breath::new); diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java index 0f5a9295c9..ff4ff41bbe 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java @@ -500,6 +500,10 @@ public class NpcViewMod implements IBypassHandler } // bonus drop rate effect rateChance *= dropRateEffectBonus; + if (item.getId() == Inventory.LCOIN_ID) + { + rateChance *= player.getStat().getMul(Stat.BONUS_DROP_RATE_LCOIN, 1); + } } sb.append(""); diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java index 46fbc3e377..83ed7318ad 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java @@ -278,6 +278,10 @@ public class DropSearchBoard implements IParseBoardHandler } // bonus drop rate effect rateChance *= dropRateEffectBonus; + if (item.getId() == Inventory.LCOIN_ID) + { + rateChance *= player.getStat().getMul(Stat.BONUS_DROP_RATE_LCOIN, 1); + } } builder.append(""); diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BonusDropRateLCoin.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BonusDropRateLCoin.java new file mode 100644 index 0000000000..f154e6d4ab --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BonusDropRateLCoin.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 BonusDropRateLCoin extends AbstractStatPercentEffect +{ + public BonusDropRateLCoin(StatSet params) + { + super(params, Stat.BONUS_DROP_RATE_LCOIN); + } +} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/51400-51499.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/51400-51499.xml index 5cd47418fe..97744b6119 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/51400-51499.xml +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/51400-51499.xml @@ -216,6 +216,9 @@ 5 0 + + 100 + 10 diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt index cbc90524bf..58c4fcf311 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt @@ -39,6 +39,7 @@ Bluff: Rotates the target so you face its back. BonusDropAdena: Bonus amount for dropped adena. (l2jmobius) BonusDropAmount: Bonus amount for dropped items. (l2jmobius) BonusDropRate: Bonus chance for dropping items. (l2jmobius) +BonusDropRateLCoin: Bonus chance for LCoins. (l2jmobius) BonusRaidPoints: Bonus amount for raid points. (l2jmobius) BonusSpoilRate: Bonus chance for acquiring spoil items. (l2jmobius) Breath: Underwater breathing stat. diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index 497b3ca8b3..7d24dac643 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -849,6 +849,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable // bonus drop rate effect rateChance *= killer.getStat().getMul(Stat.BONUS_DROP_RATE, 1); + if (item.getId() == Inventory.LCOIN_ID) + { + rateChance *= killer.getStat().getMul(Stat.BONUS_DROP_RATE_LCOIN, 1); + } // calculate if item will drop if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/Stat.java index 6cb3682b47..afe38e6139 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -166,6 +166,7 @@ public enum Stat BONUS_DROP_ADENA("bonusDropAdena"), BONUS_DROP_AMOUNT("bonusDropAmount"), BONUS_DROP_RATE("bonusDropRate"), + BONUS_DROP_RATE_LCOIN("bonusDropRateLCoin"), BONUS_SPOIL_RATE("bonusSpoilRate"), BONUS_RAID_POINTS("bonusRaidPoints"), ATTACK_CANCEL("cancel"), diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java index 367e688017..1b3e33fed2 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -69,6 +69,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("BonusDropAdena", BonusDropAdena::new); EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new); EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new); + EffectHandler.getInstance().registerHandler("BonusDropRateLCoin", BonusDropRateLCoin::new); EffectHandler.getInstance().registerHandler("BonusRaidPoints", BonusRaidPoints::new); EffectHandler.getInstance().registerHandler("BonusSpoilRate", BonusSpoilRate::new); EffectHandler.getInstance().registerHandler("Breath", Breath::new); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java index 0f5a9295c9..ff4ff41bbe 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java @@ -500,6 +500,10 @@ public class NpcViewMod implements IBypassHandler } // bonus drop rate effect rateChance *= dropRateEffectBonus; + if (item.getId() == Inventory.LCOIN_ID) + { + rateChance *= player.getStat().getMul(Stat.BONUS_DROP_RATE_LCOIN, 1); + } } sb.append("
"); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java index 46fbc3e377..83ed7318ad 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java @@ -278,6 +278,10 @@ public class DropSearchBoard implements IParseBoardHandler } // bonus drop rate effect rateChance *= dropRateEffectBonus; + if (item.getId() == Inventory.LCOIN_ID) + { + rateChance *= player.getStat().getMul(Stat.BONUS_DROP_RATE_LCOIN, 1); + } } builder.append(""); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BonusDropRateLCoin.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BonusDropRateLCoin.java new file mode 100644 index 0000000000..f154e6d4ab --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BonusDropRateLCoin.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 BonusDropRateLCoin extends AbstractStatPercentEffect +{ + public BonusDropRateLCoin(StatSet params) + { + super(params, Stat.BONUS_DROP_RATE_LCOIN); + } +} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/51400-51499.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/51400-51499.xml index 3e61847471..7e8375a7a9 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/51400-51499.xml +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/51400-51499.xml @@ -216,6 +216,9 @@ 5 0 + + 100 + 10 diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt index d3048d3c5a..9eb9cd7c15 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt @@ -39,6 +39,7 @@ Bluff: Rotates the target so you face its back. BonusDropAdena: Bonus amount for dropped adena. (l2jmobius) BonusDropAmount: Bonus amount for dropped items. (l2jmobius) BonusDropRate: Bonus chance for dropping items. (l2jmobius) +BonusDropRateLCoin: Bonus chance for LCoins. (l2jmobius) BonusRaidPoints: Bonus amount for raid points. (l2jmobius) BonusSpoilRate: Bonus chance for acquiring spoil items. (l2jmobius) Breath: Underwater breathing stat. diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java index 497b3ca8b3..7d24dac643 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java @@ -849,6 +849,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable // bonus drop rate effect rateChance *= killer.getStat().getMul(Stat.BONUS_DROP_RATE, 1); + if (item.getId() == Inventory.LCOIN_ID) + { + rateChance *= killer.getStat().getMul(Stat.BONUS_DROP_RATE_LCOIN, 1); + } // calculate if item will drop if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance)) diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/Stat.java index 6cb3682b47..afe38e6139 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -166,6 +166,7 @@ public enum Stat BONUS_DROP_ADENA("bonusDropAdena"), BONUS_DROP_AMOUNT("bonusDropAmount"), BONUS_DROP_RATE("bonusDropRate"), + BONUS_DROP_RATE_LCOIN("bonusDropRateLCoin"), BONUS_SPOIL_RATE("bonusSpoilRate"), BONUS_RAID_POINTS("bonusRaidPoints"), ATTACK_CANCEL("cancel"),