From bbed4dfa0fcc4bf8ac31dbd9374bd5fe83594cc3 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment Date: Tue, 30 Jul 2024 01:47:27 +0300 Subject: [PATCH] Addition of Assassin character creation configuration. Contributed by Copyleft. --- .../dist/game/config/Custom/AllowedPlayerRaces.ini | 3 ++- .../java/org/l2jmobius/Config.java | 4 +++- .../gameserver/network/clientpackets/CharacterCreate.java | 6 ++++++ .../dist/game/config/Custom/AllowedPlayerRaces.ini | 3 ++- .../java/org/l2jmobius/Config.java | 4 +++- .../gameserver/network/clientpackets/CharacterCreate.java | 6 ++++++ 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/L2J_Mobius_Essence_7.1_Assassin/dist/game/config/Custom/AllowedPlayerRaces.ini b/L2J_Mobius_Essence_7.1_Assassin/dist/game/config/Custom/AllowedPlayerRaces.ini index c5da77df4b..7a33317014 100644 --- a/L2J_Mobius_Essence_7.1_Assassin/dist/game/config/Custom/AllowedPlayerRaces.ini +++ b/L2J_Mobius_Essence_7.1_Assassin/dist/game/config/Custom/AllowedPlayerRaces.ini @@ -12,4 +12,5 @@ AllowDwarf = True AllowKamael = True AllowDeathKnight = True AllowSylph = True -AllowVanguard = True \ No newline at end of file +AllowVanguard = True +AllowAssassin = True \ No newline at end of file diff --git a/L2J_Mobius_Essence_7.1_Assassin/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_7.1_Assassin/java/org/l2jmobius/Config.java index 2e44c75311..f6076914a8 100644 --- a/L2J_Mobius_Essence_7.1_Assassin/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_7.1_Assassin/java/org/l2jmobius/Config.java @@ -1280,6 +1280,7 @@ public class Config public static boolean ALLOW_DEATH_KNIGHT; public static boolean ALLOW_SYLPH; public static boolean ALLOW_VANGUARD; + public static boolean ALLOW_ASSASSIN; public static boolean AUTO_POTIONS_ENABLED; public static boolean AUTO_POTIONS_IN_OLYMPIAD; public static int AUTO_POTION_MIN_LEVEL; @@ -2768,7 +2769,8 @@ public class Config ALLOW_DEATH_KNIGHT = allowedPlayerRacesConfig.getBoolean("AllowDeathKnight", true); ALLOW_SYLPH = allowedPlayerRacesConfig.getBoolean("AllowSylph", true); ALLOW_VANGUARD = allowedPlayerRacesConfig.getBoolean("AllowVanguard", true); - + ALLOW_ASSASSIN = allowedPlayerRacesConfig.getBoolean("AllowAssassin", true); + // Load AutoPotions config file (if exists) final PropertiesParser autoPotionsConfig = new PropertiesParser(CUSTOM_AUTO_POTIONS_CONFIG_FILE); AUTO_POTIONS_ENABLED = autoPotionsConfig.getBoolean("AutoPotionsEnabled", false); diff --git a/L2J_Mobius_Essence_7.1_Assassin/java/org/l2jmobius/gameserver/network/clientpackets/CharacterCreate.java b/L2J_Mobius_Essence_7.1_Assassin/java/org/l2jmobius/gameserver/network/clientpackets/CharacterCreate.java index b60607430e..ac994eeafb 100644 --- a/L2J_Mobius_Essence_7.1_Assassin/java/org/l2jmobius/gameserver/network/clientpackets/CharacterCreate.java +++ b/L2J_Mobius_Essence_7.1_Assassin/java/org/l2jmobius/gameserver/network/clientpackets/CharacterCreate.java @@ -276,6 +276,12 @@ public class CharacterCreate extends ClientPacket return; } + if (!Config.ALLOW_ASSASSIN && CategoryData.getInstance().isInCategory(CategoryType.ASSASSIN_ALL_CLASS, _classId)) + { + client.sendPacket(new CharCreateFail(CharCreateFail.REASON_CREATION_FAILED)); + return; + } + newChar = Player.create(template, client.getAccountName(), _name, new PlayerAppearance(_face, _hairColor, _hairStyle, _isFemale)); } diff --git a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/config/Custom/AllowedPlayerRaces.ini b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/config/Custom/AllowedPlayerRaces.ini index c5da77df4b..7a33317014 100644 --- a/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/config/Custom/AllowedPlayerRaces.ini +++ b/L2J_Mobius_Essence_7.2_AztacansTemple/dist/game/config/Custom/AllowedPlayerRaces.ini @@ -12,4 +12,5 @@ AllowDwarf = True AllowKamael = True AllowDeathKnight = True AllowSylph = True -AllowVanguard = True \ No newline at end of file +AllowVanguard = True +AllowAssassin = True \ No newline at end of file diff --git a/L2J_Mobius_Essence_7.2_AztacansTemple/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_7.2_AztacansTemple/java/org/l2jmobius/Config.java index 5c260a35fd..1dc2f8e1cc 100644 --- a/L2J_Mobius_Essence_7.2_AztacansTemple/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_7.2_AztacansTemple/java/org/l2jmobius/Config.java @@ -1276,6 +1276,7 @@ public class Config public static boolean ALLOW_DEATH_KNIGHT; public static boolean ALLOW_SYLPH; public static boolean ALLOW_VANGUARD; + public static boolean ALLOW_ASSASSIN; public static boolean AUTO_POTIONS_ENABLED; public static boolean AUTO_POTIONS_IN_OLYMPIAD; public static int AUTO_POTION_MIN_LEVEL; @@ -2760,7 +2761,8 @@ public class Config ALLOW_DEATH_KNIGHT = allowedPlayerRacesConfig.getBoolean("AllowDeathKnight", true); ALLOW_SYLPH = allowedPlayerRacesConfig.getBoolean("AllowSylph", true); ALLOW_VANGUARD = allowedPlayerRacesConfig.getBoolean("AllowVanguard", true); - + ALLOW_ASSASSIN = allowedPlayerRacesConfig.getBoolean("AllowAssassin", true); + // Load AutoPotions config file (if exists) final PropertiesParser autoPotionsConfig = new PropertiesParser(CUSTOM_AUTO_POTIONS_CONFIG_FILE); AUTO_POTIONS_ENABLED = autoPotionsConfig.getBoolean("AutoPotionsEnabled", false); diff --git a/L2J_Mobius_Essence_7.2_AztacansTemple/java/org/l2jmobius/gameserver/network/clientpackets/CharacterCreate.java b/L2J_Mobius_Essence_7.2_AztacansTemple/java/org/l2jmobius/gameserver/network/clientpackets/CharacterCreate.java index b60607430e..ac994eeafb 100644 --- a/L2J_Mobius_Essence_7.2_AztacansTemple/java/org/l2jmobius/gameserver/network/clientpackets/CharacterCreate.java +++ b/L2J_Mobius_Essence_7.2_AztacansTemple/java/org/l2jmobius/gameserver/network/clientpackets/CharacterCreate.java @@ -276,6 +276,12 @@ public class CharacterCreate extends ClientPacket return; } + if (!Config.ALLOW_ASSASSIN && CategoryData.getInstance().isInCategory(CategoryType.ASSASSIN_ALL_CLASS, _classId)) + { + client.sendPacket(new CharCreateFail(CharCreateFail.REASON_CREATION_FAILED)); + return; + } + newChar = Player.create(template, client.getAccountName(), _name, new PlayerAppearance(_face, _hairColor, _hairStyle, _isFemale)); }