diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/config/Character.ini b/L2J_Mobius_8.0_Homunculus/dist/game/config/Character.ini index 8cf084a04d..7854971ec9 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/config/Character.ini +++ b/L2J_Mobius_8.0_Homunculus/dist/game/config/Character.ini @@ -839,8 +839,16 @@ GoDVideoIntro = False # --------------------------------------------------------------------------- -# Ability Settings: +# Ability Settings # --------------------------------------------------------------------------- # SP needed to reset used ability point. # Default: 500000000 AbilityPointsResetSP = 500000000 + + +# --------------------------------------------------------------------------- +# Homunculus Settings +# --------------------------------------------------------------------------- +# Maximum Homunculus count. +# Default: 3 +MaxHomunculusCount = 3 diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/Config.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/Config.java index ac4ba56402..15d9a5bd19 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/Config.java @@ -576,6 +576,7 @@ public class Config public static boolean HBCE_FAIR_PLAY; public static int PLAYER_MOVEMENT_BLOCK_TIME; public static long ABILITY_POINTS_RESET_SP; + public static int MAX_HOMUNCULUS_COUNT; public static boolean BOTREPORT_ENABLE; public static String[] BOTREPORT_RESETPOINT_HOUR; public static long BOTREPORT_REPORT_DELAY; @@ -1976,6 +1977,7 @@ public class Config SHOW_GOD_VIDEO_INTRO = Character.getBoolean("GoDVideoIntro", true); PLAYER_MOVEMENT_BLOCK_TIME = Character.getInt("NpcTalkBlockingTime", 0) * 1000; ABILITY_POINTS_RESET_SP = Character.getLong("AbilityPointsResetSP", 500000000); + MAX_HOMUNCULUS_COUNT = Character.getInt("MaxHomunculusCount", 3); // Load Telnet config file (if exists) final PropertiesParser telnetSettings = new PropertiesParser(TELNET_CONFIG_FILE); diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/homunculus/HomunculusList.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/homunculus/HomunculusList.java index 6c91ad47ee..c3875b4d3c 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/homunculus/HomunculusList.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/homunculus/HomunculusList.java @@ -21,8 +21,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.logging.Logger; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.instancemanager.HomunculusManager; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.holders.SkillHolder; @@ -32,10 +32,6 @@ import org.l2jmobius.gameserver.model.holders.SkillHolder; */ public class HomunculusList { - private static final Logger LOGGER = Logger.getLogger(HomunculusList.class.getName()); - - public static final int MAX_SIZE = 2; - private List _homunculusList = Collections.emptyList(); private int _hp; private int _atk; @@ -62,11 +58,9 @@ public class HomunculusList Collections.sort(_homunculusList); - if (_homunculusList.size() > MAX_SIZE) + if (_homunculusList.size() > Config.MAX_HOMUNCULUS_COUNT) { - LOGGER.warning(this + ": Contains more than two homunculus's!"); - - for (int i = MAX_SIZE; i < _homunculusList.size(); i++) + for (int i = Config.MAX_HOMUNCULUS_COUNT; i < _homunculusList.size(); i++) { _homunculusList.remove(i); } @@ -94,7 +88,7 @@ public class HomunculusList public int getFreeSize() { - return Math.max(0, MAX_SIZE - size()); + return Math.max(0, Config.MAX_HOMUNCULUS_COUNT - size()); } public boolean isFull() diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusList.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusList.java index 8eb2384ba0..312eec2704 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusList.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusList.java @@ -16,10 +16,10 @@ */ package org.l2jmobius.gameserver.network.serverpackets.homunculus; +import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.homunculus.Homunculus; -import org.l2jmobius.gameserver.model.homunculus.HomunculusList; import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; @@ -44,7 +44,7 @@ public class ExShowHomunculusList implements IClientOutgoingPacket { packet.writeD(_player.getHomunculusList().size()); // homunculus count int counter = 0; - for (int i = 0; i < HomunculusList.MAX_SIZE; i++) + for (int i = 0; i < Config.MAX_HOMUNCULUS_COUNT; i++) { final Homunculus homunculus = _player.getHomunculusList().get(i); if (homunculus == null) diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/config/Character.ini b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/config/Character.ini index 8cf084a04d..781ef95146 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/config/Character.ini +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/config/Character.ini @@ -839,8 +839,16 @@ GoDVideoIntro = False # --------------------------------------------------------------------------- -# Ability Settings: +# Ability Settings # --------------------------------------------------------------------------- # SP needed to reset used ability point. # Default: 500000000 AbilityPointsResetSP = 500000000 + + +# --------------------------------------------------------------------------- +# Homunculus Settings +# --------------------------------------------------------------------------- +# Maximum Homunculus count. +# Default: 9 +MaxHomunculusCount = 9 diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java index ac4ba56402..9187c9fa16 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java @@ -576,6 +576,7 @@ public class Config public static boolean HBCE_FAIR_PLAY; public static int PLAYER_MOVEMENT_BLOCK_TIME; public static long ABILITY_POINTS_RESET_SP; + public static int MAX_HOMUNCULUS_COUNT; public static boolean BOTREPORT_ENABLE; public static String[] BOTREPORT_RESETPOINT_HOUR; public static long BOTREPORT_REPORT_DELAY; @@ -1976,6 +1977,7 @@ public class Config SHOW_GOD_VIDEO_INTRO = Character.getBoolean("GoDVideoIntro", true); PLAYER_MOVEMENT_BLOCK_TIME = Character.getInt("NpcTalkBlockingTime", 0) * 1000; ABILITY_POINTS_RESET_SP = Character.getLong("AbilityPointsResetSP", 500000000); + MAX_HOMUNCULUS_COUNT = Character.getInt("MaxHomunculusCount", 9); // Load Telnet config file (if exists) final PropertiesParser telnetSettings = new PropertiesParser(TELNET_CONFIG_FILE); diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/homunculus/HomunculusList.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/homunculus/HomunculusList.java index 63e2ff0e8b..c3875b4d3c 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/homunculus/HomunculusList.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/homunculus/HomunculusList.java @@ -21,8 +21,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.logging.Logger; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.instancemanager.HomunculusManager; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.holders.SkillHolder; @@ -32,10 +32,6 @@ import org.l2jmobius.gameserver.model.holders.SkillHolder; */ public class HomunculusList { - private static final Logger LOGGER = Logger.getLogger(HomunculusList.class.getName()); - - public static final int MAX_SIZE = 9; - private List _homunculusList = Collections.emptyList(); private int _hp; private int _atk; @@ -62,11 +58,9 @@ public class HomunculusList Collections.sort(_homunculusList); - if (_homunculusList.size() > MAX_SIZE) + if (_homunculusList.size() > Config.MAX_HOMUNCULUS_COUNT) { - LOGGER.warning(this + ": Contains more than two homunculus's!"); - - for (int i = MAX_SIZE; i < _homunculusList.size(); i++) + for (int i = Config.MAX_HOMUNCULUS_COUNT; i < _homunculusList.size(); i++) { _homunculusList.remove(i); } @@ -94,7 +88,7 @@ public class HomunculusList public int getFreeSize() { - return Math.max(0, MAX_SIZE - size()); + return Math.max(0, Config.MAX_HOMUNCULUS_COUNT - size()); } public boolean isFull() diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusPointInfo.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusPointInfo.java index fcc65219fe..f8cd199633 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusPointInfo.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExHomunculusPointInfo.java @@ -16,9 +16,9 @@ */ package org.l2jmobius.gameserver.network.serverpackets.homunculus; +import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; -import org.l2jmobius.gameserver.model.homunculus.HomunculusList; import org.l2jmobius.gameserver.model.variables.PlayerVariables; import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; @@ -46,7 +46,7 @@ public class ExHomunculusPointInfo implements IClientOutgoingPacket packet.writeD(_player.getVariables().getInt(PlayerVariables.HOMUNCULUS_USED_VP_POINTS, 0)); // vp points packet.writeD(_player.getVariables().getInt(PlayerVariables.HOMUNCULUS_USED_VP_CONVERT, 0)); // consumed basic vp points packet.writeD(_player.getVariables().getInt(PlayerVariables.HOMUNCULUS_USED_RESET_VP, 0)); // consumed reset vp points - packet.writeD(Math.min(HomunculusList.MAX_SIZE, _player.getHomunculusList().size() + 1)); // 306 + packet.writeD(Math.min(Config.MAX_HOMUNCULUS_COUNT, _player.getHomunculusList().size() + 1)); // 306 return true; } } diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusList.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusList.java index 8eb2384ba0..312eec2704 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusList.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/homunculus/ExShowHomunculusList.java @@ -16,10 +16,10 @@ */ package org.l2jmobius.gameserver.network.serverpackets.homunculus; +import org.l2jmobius.Config; import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.homunculus.Homunculus; -import org.l2jmobius.gameserver.model.homunculus.HomunculusList; import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; @@ -44,7 +44,7 @@ public class ExShowHomunculusList implements IClientOutgoingPacket { packet.writeD(_player.getHomunculusList().size()); // homunculus count int counter = 0; - for (int i = 0; i < HomunculusList.MAX_SIZE; i++) + for (int i = 0; i < Config.MAX_HOMUNCULUS_COUNT; i++) { final Homunculus homunculus = _player.getHomunculusList().get(i); if (homunculus == null)