From ebddd951ed89962ff9e0a16134ccb7432fedbe58 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 27 Oct 2021 02:19:35 +0000 Subject: [PATCH] Addition of RandomCraftCreateFee configuration. Thanks to MacuK. --- .../dist/game/config/RandomCraft.ini | 7 +++++-- .../java/org/l2jmobius/Config.java | 6 ++++-- .../gameserver/model/itemcontainer/PlayerRandomCraft.java | 3 ++- .../dist/game/config/RandomCraft.ini | 7 +++++-- .../java/org/l2jmobius/Config.java | 6 ++++-- .../gameserver/model/itemcontainer/PlayerRandomCraft.java | 3 ++- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/RandomCraft.ini b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/RandomCraft.ini index 2c8022720f..751a299b1e 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/RandomCraft.ini +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/RandomCraft.ini @@ -3,10 +3,13 @@ # --------------------------------------------------------------------------- # Enable random craft system. -RandomCraftEnabled = False +RandomCraftEnabled = True + +# Random craft create fee. +RandomCraftCreateFee = 500000 # Drop materials for random craft. # Cannot be reloaded. It needs server restart. # Works independently from above config. # Recommend to use same value as RandomCraftEnabled. -DropRandomCraftMaterials = False +DropRandomCraftMaterials = True diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java index a96571a642..619790c3b2 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java @@ -893,6 +893,7 @@ public class Config // Random Craft public static boolean ENABLE_RANDOM_CRAFT; + public static int RANDOM_CRAFT_CREATE_FEE; public static boolean DROP_RANDOM_CRAFT_MATERIALS; // GrandBoss Settings @@ -1951,8 +1952,9 @@ public class Config // Load Random Craft config file (if exists) final PropertiesParser randomCraftSettings = new PropertiesParser(RANDOM_CRAFT_FILE); - ENABLE_RANDOM_CRAFT = randomCraftSettings.getBoolean("RandomCraftEnabled", false); - DROP_RANDOM_CRAFT_MATERIALS = randomCraftSettings.getBoolean("DropRandomCraftMaterials", false); + ENABLE_RANDOM_CRAFT = randomCraftSettings.getBoolean("RandomCraftEnabled", true); + RANDOM_CRAFT_CREATE_FEE = randomCraftSettings.getInt("RandomCraftCreateFee", 500000); + DROP_RANDOM_CRAFT_MATERIALS = randomCraftSettings.getBoolean("DropRandomCraftMaterials", true); // Load Training Camp config file (if exists) final PropertiesParser trainingCampSettings = new PropertiesParser(TRAINING_CAMP_CONFIG_FILE); diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerRandomCraft.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerRandomCraft.java index 15fb43d9b4..912965eed6 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerRandomCraft.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerRandomCraft.java @@ -24,6 +24,7 @@ import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.data.xml.RandomCraftData; @@ -245,7 +246,7 @@ public class PlayerRandomCraft } _player.addRequest(new RandomCraftRequest(_player)); - if (_player.reduceAdena("RandomCraft Make", 500000, _player, true)) + if (_player.reduceAdena("RandomCraft Make", Config.RANDOM_CRAFT_CREATE_FEE, _player, true)) { final int madeId = Rnd.get(0, 4); final RandomCraftRewardItemHolder holder = _rewardList.get(madeId); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/RandomCraft.ini b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/RandomCraft.ini index 2c8022720f..90a3b01b35 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/RandomCraft.ini +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/RandomCraft.ini @@ -3,10 +3,13 @@ # --------------------------------------------------------------------------- # Enable random craft system. -RandomCraftEnabled = False +RandomCraftEnabled = True + +# Random craft create fee. +RandomCraftCreateFee = 300000 # Drop materials for random craft. # Cannot be reloaded. It needs server restart. # Works independently from above config. # Recommend to use same value as RandomCraftEnabled. -DropRandomCraftMaterials = False +DropRandomCraftMaterials = True diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java index 35150bac9d..12169bdbbf 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java @@ -893,6 +893,7 @@ public class Config // Random Craft public static boolean ENABLE_RANDOM_CRAFT; + public static int RANDOM_CRAFT_CREATE_FEE; public static boolean DROP_RANDOM_CRAFT_MATERIALS; // GrandBoss Settings @@ -1954,8 +1955,9 @@ public class Config // Load Random Craft config file (if exists) final PropertiesParser randomCraftSettings = new PropertiesParser(RANDOM_CRAFT_FILE); - ENABLE_RANDOM_CRAFT = randomCraftSettings.getBoolean("RandomCraftEnabled", false); - DROP_RANDOM_CRAFT_MATERIALS = randomCraftSettings.getBoolean("DropRandomCraftMaterials", false); + ENABLE_RANDOM_CRAFT = randomCraftSettings.getBoolean("RandomCraftEnabled", true); + RANDOM_CRAFT_CREATE_FEE = randomCraftSettings.getInt("RandomCraftCreateFee", 300000); + DROP_RANDOM_CRAFT_MATERIALS = randomCraftSettings.getBoolean("DropRandomCraftMaterials", true); // Load Training Camp config file (if exists) final PropertiesParser trainingCampSettings = new PropertiesParser(TRAINING_CAMP_CONFIG_FILE); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerRandomCraft.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerRandomCraft.java index 15fb43d9b4..912965eed6 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerRandomCraft.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerRandomCraft.java @@ -24,6 +24,7 @@ import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.data.xml.RandomCraftData; @@ -245,7 +246,7 @@ public class PlayerRandomCraft } _player.addRequest(new RandomCraftRequest(_player)); - if (_player.reduceAdena("RandomCraft Make", 500000, _player, true)) + if (_player.reduceAdena("RandomCraft Make", Config.RANDOM_CRAFT_CREATE_FEE, _player, true)) { final int madeId = Rnd.get(0, 4); final RandomCraftRewardItemHolder holder = _rewardList.get(madeId);