From 50cf2ca0e4d43ec080ea6475996e381743262a78 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 13 Sep 2017 16:09:53 +0000 Subject: [PATCH] CommunityBoard teleport protection system. --- .../game/config/Custom/CommunityBoard.ini | 26 ++++++++++++ .../Custom/gatekeeper/main.html | 42 +++++++++---------- .../handlers/communityboard/HomeBoard.java | 10 ++--- .../java/com/l2jmobius/Config.java | 8 ++++ .../game/config/Custom/CommunityBoard.ini | 26 ++++++++++++ .../Custom/gatekeeper/main.html | 42 +++++++++---------- .../handlers/communityboard/HomeBoard.java | 10 ++--- .../java/com/l2jmobius/Config.java | 8 ++++ .../game/config/Custom/CommunityBoard.ini | 26 ++++++++++++ .../Custom/gatekeeper/main.html | 42 +++++++++---------- .../handlers/communityboard/HomeBoard.java | 10 ++--- .../java/com/l2jmobius/Config.java | 8 ++++ .../dist/game/config/Custom.ini | 22 ++++++++++ .../Custom/gatekeeper/main.html | 34 +++++++-------- .../handlers/communityboard/HomeBoard.java | 10 ++--- .../java/com/l2jmobius/Config.java | 9 ++++ .../game/config/Custom/CommunityBoard.ini | 17 ++++++++ .../Custom/gatekeeper/main.html | 24 +++++------ .../handlers/communityboard/HomeBoard.java | 10 ++--- .../java/com/l2jmobius/Config.java | 8 ++++ 20 files changed, 265 insertions(+), 127 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/CommunityBoard.ini b/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/CommunityBoard.ini index 2bd51969bd..ce8f34ae39 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/CommunityBoard.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/CommunityBoard.ini @@ -65,3 +65,29 @@ CommunityPremiumPricePerDay = 1000000 # List of available buffs to avoid exploits. # Usage: SkillId1,SkillId2... CommunityAvailableBuffs = 11517,11522,11519,11520,11521,11518,11565,11824,11567,11615,11616,11529,11530,11532,11523,11524,11525,1259,982,5987,5988,1323 + +# List of available teleports to avoid exploits. +# Usage: TeleportName1,X1,Y1,Z1;TeleportName2,X2,Y2,Z2... +# the "\" indicates a new line +CommunityTeleportList = \ +Giran,82698,148638,-3473;\ +Aden,147450,27064,-2208;\ +Goddard,147725,-56517,-2780;\ +Rune,44070,-50243,-796;\ +Dion,18748,145437,-3132;\ +Oren,82321,55139,-1529;\ +Gludio,-14225,123540,-3121;\ +Schuttgart,87358,-141982,-1341;\ +Heine,111115,219017,-3547;\ +Gludin,-83063,150791,-3133;\ +Hunters,116589,76268,-2734;\ +Arcan,207320,87617,-1112;\ +TalkingIsland,-114351,255286,-1520;\ +Dwarven,116551,-182493,-1525;\ +Orc,-44211,-113521,-241;\ +DarkElven,12428,16551,-4588;\ +Elven,45873,49288,-3064;\ +Kamael,-116934,46616,368;\ +Ertheia,-80353,247981,-3507;\ +Floran,17144,170156,-3502;\ +Gainak,16358,-114071,-229; diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html b/L2J_Mobius_1.0_Ertheia/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html index 97d0100160..d190ac3381 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html @@ -49,24 +49,24 @@ - - - + + + - - - + + + - - - + + + - - - + + +
@@ -84,19 +84,19 @@
- - - + + + - - - + + + - - - + + +
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/communityboard/HomeBoard.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/communityboard/HomeBoard.java index e5ce598883..b39b9f0b38 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/communityboard/HomeBoard.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/communityboard/HomeBoard.java @@ -159,20 +159,16 @@ public final class HomeBoard implements IParseBoardHandler } else if (command.startsWith("_bbsteleport")) { - final String fullBypass = command.replace("_bbsteleport;", ""); - final String[] buypassOptions = fullBypass.split(","); - final int x = Integer.parseInt(buypassOptions[0]); - final int y = Integer.parseInt(buypassOptions[1]); - final int z = Integer.parseInt(buypassOptions[2]); + final String teleBuypass = command.replace("_bbsteleport;", ""); if (activeChar.getInventory().getInventoryItemCount(Config.COMMUNITYBOARD_CURRENCY, -1) < Config.COMMUNITYBOARD_TELEPORT_PRICE) { activeChar.sendMessage("Not enough currency!"); } - else + else if (Config.COMMUNITY_AVAILABLE_TELEPORTS.get(teleBuypass) != null) { activeChar.sendPacket(new ShowBoard()); activeChar.destroyItemByItemId("CB_Teleport", Config.COMMUNITYBOARD_CURRENCY, Config.COMMUNITYBOARD_TELEPORT_PRICE, activeChar, true); - activeChar.teleToLocation(x, y, z, 0); + activeChar.teleToLocation(Config.COMMUNITY_AVAILABLE_TELEPORTS.get(teleBuypass), 0); } } else if (command.startsWith("_bbsbuff")) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java index 6d7fe560ee..fc1a5a9712 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java @@ -1074,6 +1074,7 @@ public final class Config public static int COMMUNITY_PREMIUM_COIN_ID; public static int COMMUNITY_PREMIUM_PRICE_PER_DAY; public static List COMMUNITY_AVAILABLE_BUFFS; + public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; public static int FACTION_MANAGER_NPCID; @@ -2368,6 +2369,13 @@ public final class Config { COMMUNITY_AVAILABLE_BUFFS.add(Integer.parseInt(s)); } + final String[] availableTeleports = CommunityBoard.getString("CommunityTeleportList", "").split(";"); + COMMUNITY_AVAILABLE_TELEPORTS = new HashMap<>(availableTeleports.length); + for (String s : availableTeleports) + { + final String splitInfo[] = s.split(","); + COMMUNITY_AVAILABLE_TELEPORTS.put(splitInfo[0], new Location(Integer.parseInt(splitInfo[1]), Integer.parseInt(splitInfo[2]), Integer.parseInt(splitInfo[3]))); + } // Load DebugVoiceCommand config file (if exists) final PropertiesParser DebugVoiceCommand = new PropertiesParser(CUSTOM_DEBUG_VOICE_COMMAND_CONFIG_FILE); diff --git a/L2J_Mobius_2.5_Underground/dist/game/config/Custom/CommunityBoard.ini b/L2J_Mobius_2.5_Underground/dist/game/config/Custom/CommunityBoard.ini index 2bd51969bd..ce8f34ae39 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/Custom/CommunityBoard.ini +++ b/L2J_Mobius_2.5_Underground/dist/game/config/Custom/CommunityBoard.ini @@ -65,3 +65,29 @@ CommunityPremiumPricePerDay = 1000000 # List of available buffs to avoid exploits. # Usage: SkillId1,SkillId2... CommunityAvailableBuffs = 11517,11522,11519,11520,11521,11518,11565,11824,11567,11615,11616,11529,11530,11532,11523,11524,11525,1259,982,5987,5988,1323 + +# List of available teleports to avoid exploits. +# Usage: TeleportName1,X1,Y1,Z1;TeleportName2,X2,Y2,Z2... +# the "\" indicates a new line +CommunityTeleportList = \ +Giran,82698,148638,-3473;\ +Aden,147450,27064,-2208;\ +Goddard,147725,-56517,-2780;\ +Rune,44070,-50243,-796;\ +Dion,18748,145437,-3132;\ +Oren,82321,55139,-1529;\ +Gludio,-14225,123540,-3121;\ +Schuttgart,87358,-141982,-1341;\ +Heine,111115,219017,-3547;\ +Gludin,-83063,150791,-3133;\ +Hunters,116589,76268,-2734;\ +Arcan,207320,87617,-1112;\ +TalkingIsland,-114351,255286,-1520;\ +Dwarven,116551,-182493,-1525;\ +Orc,-44211,-113521,-241;\ +DarkElven,12428,16551,-4588;\ +Elven,45873,49288,-3064;\ +Kamael,-116934,46616,368;\ +Ertheia,-80353,247981,-3507;\ +Floran,17144,170156,-3502;\ +Gainak,16358,-114071,-229; diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html b/L2J_Mobius_2.5_Underground/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html index 97d0100160..d190ac3381 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html +++ b/L2J_Mobius_2.5_Underground/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html @@ -49,24 +49,24 @@ - - - + + + - - - + + + - - - + + + - - - + + +
@@ -84,19 +84,19 @@
- - - + + + - - - + + + - - - + + +
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/communityboard/HomeBoard.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/communityboard/HomeBoard.java index e5ce598883..b39b9f0b38 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/communityboard/HomeBoard.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/communityboard/HomeBoard.java @@ -159,20 +159,16 @@ public final class HomeBoard implements IParseBoardHandler } else if (command.startsWith("_bbsteleport")) { - final String fullBypass = command.replace("_bbsteleport;", ""); - final String[] buypassOptions = fullBypass.split(","); - final int x = Integer.parseInt(buypassOptions[0]); - final int y = Integer.parseInt(buypassOptions[1]); - final int z = Integer.parseInt(buypassOptions[2]); + final String teleBuypass = command.replace("_bbsteleport;", ""); if (activeChar.getInventory().getInventoryItemCount(Config.COMMUNITYBOARD_CURRENCY, -1) < Config.COMMUNITYBOARD_TELEPORT_PRICE) { activeChar.sendMessage("Not enough currency!"); } - else + else if (Config.COMMUNITY_AVAILABLE_TELEPORTS.get(teleBuypass) != null) { activeChar.sendPacket(new ShowBoard()); activeChar.destroyItemByItemId("CB_Teleport", Config.COMMUNITYBOARD_CURRENCY, Config.COMMUNITYBOARD_TELEPORT_PRICE, activeChar, true); - activeChar.teleToLocation(x, y, z, 0); + activeChar.teleToLocation(Config.COMMUNITY_AVAILABLE_TELEPORTS.get(teleBuypass), 0); } } else if (command.startsWith("_bbsbuff")) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java index 5e03ea7cc7..a71cee16be 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java @@ -1076,6 +1076,7 @@ public final class Config public static int COMMUNITY_PREMIUM_COIN_ID; public static int COMMUNITY_PREMIUM_PRICE_PER_DAY; public static List COMMUNITY_AVAILABLE_BUFFS; + public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; public static int FACTION_MANAGER_NPCID; @@ -2372,6 +2373,13 @@ public final class Config { COMMUNITY_AVAILABLE_BUFFS.add(Integer.parseInt(s)); } + final String[] availableTeleports = CommunityBoard.getString("CommunityTeleportList", "").split(";"); + COMMUNITY_AVAILABLE_TELEPORTS = new HashMap<>(availableTeleports.length); + for (String s : availableTeleports) + { + final String splitInfo[] = s.split(","); + COMMUNITY_AVAILABLE_TELEPORTS.put(splitInfo[0], new Location(Integer.parseInt(splitInfo[1]), Integer.parseInt(splitInfo[2]), Integer.parseInt(splitInfo[3]))); + } // Load DebugVoiceCommand config file (if exists) final PropertiesParser DebugVoiceCommand = new PropertiesParser(CUSTOM_DEBUG_VOICE_COMMAND_CONFIG_FILE); diff --git a/L2J_Mobius_3.0_Helios/dist/game/config/Custom/CommunityBoard.ini b/L2J_Mobius_3.0_Helios/dist/game/config/Custom/CommunityBoard.ini index 2bd51969bd..ce8f34ae39 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/Custom/CommunityBoard.ini +++ b/L2J_Mobius_3.0_Helios/dist/game/config/Custom/CommunityBoard.ini @@ -65,3 +65,29 @@ CommunityPremiumPricePerDay = 1000000 # List of available buffs to avoid exploits. # Usage: SkillId1,SkillId2... CommunityAvailableBuffs = 11517,11522,11519,11520,11521,11518,11565,11824,11567,11615,11616,11529,11530,11532,11523,11524,11525,1259,982,5987,5988,1323 + +# List of available teleports to avoid exploits. +# Usage: TeleportName1,X1,Y1,Z1;TeleportName2,X2,Y2,Z2... +# the "\" indicates a new line +CommunityTeleportList = \ +Giran,82698,148638,-3473;\ +Aden,147450,27064,-2208;\ +Goddard,147725,-56517,-2780;\ +Rune,44070,-50243,-796;\ +Dion,18748,145437,-3132;\ +Oren,82321,55139,-1529;\ +Gludio,-14225,123540,-3121;\ +Schuttgart,87358,-141982,-1341;\ +Heine,111115,219017,-3547;\ +Gludin,-83063,150791,-3133;\ +Hunters,116589,76268,-2734;\ +Arcan,207320,87617,-1112;\ +TalkingIsland,-114351,255286,-1520;\ +Dwarven,116551,-182493,-1525;\ +Orc,-44211,-113521,-241;\ +DarkElven,12428,16551,-4588;\ +Elven,45873,49288,-3064;\ +Kamael,-116934,46616,368;\ +Ertheia,-80353,247981,-3507;\ +Floran,17144,170156,-3502;\ +Gainak,16358,-114071,-229; diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html b/L2J_Mobius_3.0_Helios/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html index 97d0100160..d190ac3381 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html +++ b/L2J_Mobius_3.0_Helios/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html @@ -49,24 +49,24 @@ - - - + + + - - - + + + - - - + + + - - - + + +
@@ -84,19 +84,19 @@
- - - + + + - - - + + + - - - + + +
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/communityboard/HomeBoard.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/communityboard/HomeBoard.java index e5ce598883..b39b9f0b38 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/communityboard/HomeBoard.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/communityboard/HomeBoard.java @@ -159,20 +159,16 @@ public final class HomeBoard implements IParseBoardHandler } else if (command.startsWith("_bbsteleport")) { - final String fullBypass = command.replace("_bbsteleport;", ""); - final String[] buypassOptions = fullBypass.split(","); - final int x = Integer.parseInt(buypassOptions[0]); - final int y = Integer.parseInt(buypassOptions[1]); - final int z = Integer.parseInt(buypassOptions[2]); + final String teleBuypass = command.replace("_bbsteleport;", ""); if (activeChar.getInventory().getInventoryItemCount(Config.COMMUNITYBOARD_CURRENCY, -1) < Config.COMMUNITYBOARD_TELEPORT_PRICE) { activeChar.sendMessage("Not enough currency!"); } - else + else if (Config.COMMUNITY_AVAILABLE_TELEPORTS.get(teleBuypass) != null) { activeChar.sendPacket(new ShowBoard()); activeChar.destroyItemByItemId("CB_Teleport", Config.COMMUNITYBOARD_CURRENCY, Config.COMMUNITYBOARD_TELEPORT_PRICE, activeChar, true); - activeChar.teleToLocation(x, y, z, 0); + activeChar.teleToLocation(Config.COMMUNITY_AVAILABLE_TELEPORTS.get(teleBuypass), 0); } } else if (command.startsWith("_bbsbuff")) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java index 5e03ea7cc7..a71cee16be 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java @@ -1076,6 +1076,7 @@ public final class Config public static int COMMUNITY_PREMIUM_COIN_ID; public static int COMMUNITY_PREMIUM_PRICE_PER_DAY; public static List COMMUNITY_AVAILABLE_BUFFS; + public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; public static int FACTION_MANAGER_NPCID; @@ -2372,6 +2373,13 @@ public final class Config { COMMUNITY_AVAILABLE_BUFFS.add(Integer.parseInt(s)); } + final String[] availableTeleports = CommunityBoard.getString("CommunityTeleportList", "").split(";"); + COMMUNITY_AVAILABLE_TELEPORTS = new HashMap<>(availableTeleports.length); + for (String s : availableTeleports) + { + final String splitInfo[] = s.split(","); + COMMUNITY_AVAILABLE_TELEPORTS.put(splitInfo[0], new Location(Integer.parseInt(splitInfo[1]), Integer.parseInt(splitInfo[2]), Integer.parseInt(splitInfo[3]))); + } // Load DebugVoiceCommand config file (if exists) final PropertiesParser DebugVoiceCommand = new PropertiesParser(CUSTOM_DEBUG_VOICE_COMMAND_CONFIG_FILE); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom.ini index f88a878f72..11821c28a4 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom.ini @@ -637,6 +637,28 @@ CommunityPremiumPricePerDay = 1000000 # Usage: SkillId1,SkillId2... CommunityAvailableBuffs = 1077,1240,1086,1032,1073,1036,1035,1068,1040,1044,1182,1191,1033,1189,1392,1393,1303,1059,1242,1268 +# List of available teleports to avoid exploits. +# Usage: TeleportName1,X1,Y1,Z1;TeleportName2,X2,Y2,Z2... +# the "\" indicates a new line +CommunityTeleportList = \ +Giran,82698,148638,-3473;\ +Aden,147450,27064,-2208;\ +Goddard,147725,-56517,-2780;\ +Rune,44070,-50243,-796;\ +Dion,18748,145437,-3132;\ +Oren,82321,55139,-1529;\ +Gludio,-14225,123540,-3121;\ +Schuttgart,87358,-141982,-1341;\ +Heine,111115,219017,-3547;\ +Gludin,-83063,150791,-3133;\ +Hunters,116589,76268,-2734;\ +TalkingIsland,-82687,243157,-3734;\ +Dwarven,116551,-182493,-1525;\ +Orc,-44211,-113521,-241;\ +DarkElven,12428,16551,-4588;\ +Elven,45873,49288,-3064;\ +Kamael,-116934,46616,368; + # --------------------------------------------------------------------------- # Premium System (VIP) diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html index e9fdf17659..f28e2bf598 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html @@ -49,23 +49,23 @@ - - - + + + - - - + + + - - - + + + - - + +
@@ -83,14 +83,14 @@
- - - + + + - - - + + +
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/communityboard/HomeBoard.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/communityboard/HomeBoard.java index bc0d4dbc77..0bbc15d43b 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/communityboard/HomeBoard.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/communityboard/HomeBoard.java @@ -158,20 +158,16 @@ public final class HomeBoard implements IParseBoardHandler } else if (command.startsWith("_bbsteleport")) { - final String fullBypass = command.replace("_bbsteleport;", ""); - final String[] buypassOptions = fullBypass.split(","); - final int x = Integer.parseInt(buypassOptions[0]); - final int y = Integer.parseInt(buypassOptions[1]); - final int z = Integer.parseInt(buypassOptions[2]); + final String teleBuypass = command.replace("_bbsteleport;", ""); if (activeChar.getInventory().getInventoryItemCount(Config.COMMUNITYBOARD_CURRENCY, -1) < Config.COMMUNITYBOARD_TELEPORT_PRICE) { activeChar.sendMessage("Not enough currency!"); } - else + else if (Config.COMMUNITY_AVAILABLE_TELEPORTS.get(teleBuypass) != null) { activeChar.sendPacket(new ShowBoard()); activeChar.destroyItemByItemId("CB_Teleport", Config.COMMUNITYBOARD_CURRENCY, Config.COMMUNITYBOARD_TELEPORT_PRICE, activeChar, true); - activeChar.teleToLocation(x, y, z, 0); + activeChar.teleToLocation(Config.COMMUNITY_AVAILABLE_TELEPORTS.get(teleBuypass), 0); } } else if (command.startsWith("_bbsbuff")) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java index d8f845ff63..e7fe7cd902 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java @@ -55,6 +55,7 @@ import org.w3c.dom.Node; import com.l2jmobius.gameserver.GameServer; import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.enums.IllegalActionPunishmentType; +import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.holders.ItemHolder; import com.l2jmobius.gameserver.util.FloodProtectorConfig; import com.l2jmobius.gameserver.util.Util; @@ -809,6 +810,7 @@ public final class Config public static int COMMUNITY_PREMIUM_COIN_ID; public static int COMMUNITY_PREMIUM_PRICE_PER_DAY; public static List COMMUNITY_AVAILABLE_BUFFS; + public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean PREMIUM_SYSTEM_ENABLED; public static float PREMIUM_RATE_XP; public static float PREMIUM_RATE_SP; @@ -2617,6 +2619,13 @@ public final class Config { COMMUNITY_AVAILABLE_BUFFS.add(Integer.parseInt(s)); } + final String[] availableTeleports = CustomSettings.getString("CommunityTeleportList", "").split(";"); + COMMUNITY_AVAILABLE_TELEPORTS = new HashMap<>(availableTeleports.length); + for (String s : availableTeleports) + { + final String splitInfo[] = s.split(","); + COMMUNITY_AVAILABLE_TELEPORTS.put(splitInfo[0], new Location(Integer.parseInt(splitInfo[1]), Integer.parseInt(splitInfo[2]), Integer.parseInt(splitInfo[3]))); + } PREMIUM_SYSTEM_ENABLED = CustomSettings.getBoolean("EnablePremiumSystem", false); PREMIUM_RATE_XP = CustomSettings.getFloat("PremiumRateXp", 2); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/CommunityBoard.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/CommunityBoard.ini index 6e97ebae13..18a84cc6c4 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/CommunityBoard.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/CommunityBoard.ini @@ -65,3 +65,20 @@ CommunityPremiumPricePerDay = 1000000 # List of available buffs to avoid exploits. # Usage: SkillId1,SkillId2... CommunityAvailableBuffs = 1077,1240,1086,1032,1073,1036,1035,1068,1040,1044,1182,1191,1033,1189,1392,1393,1303,1059,1242,1268 + +# List of available teleports to avoid exploits. +# Usage: TeleportName1,X1,Y1,Z1;TeleportName2,X2,Y2,Z2... +# the "\" indicates a new line +CommunityTeleportList = \ +Gludio,-14225,123540,-3121;\ +Gludin,-83063,150791,-3133;\ +Giran,82698,148638,-3473;\ +Dion,18748,145437,-3132;\ +Hunters,116589,76268,-2734;\ +Oren,82321,55139,-1529;\ +Aden,147450,27064,-2208;\ +TalkingIsland,-82687,243157,-3734;\ +Dwarven,116551,-182493,-1525;\ +Orc,-44211,-113521,-241;\ +DarkElven,12428,16551,-4588;\ +Elven,45873,49288,-3064; diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html index 40627779e7..6c6286ff8d 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/html/CommunityBoard/Custom/gatekeeper/main.html @@ -49,17 +49,17 @@ - - - + + + - - - + + + - +
@@ -77,13 +77,13 @@
- - - + + + - - + +
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/communityboard/HomeBoard.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/communityboard/HomeBoard.java index e5ce598883..b39b9f0b38 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/communityboard/HomeBoard.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/communityboard/HomeBoard.java @@ -159,20 +159,16 @@ public final class HomeBoard implements IParseBoardHandler } else if (command.startsWith("_bbsteleport")) { - final String fullBypass = command.replace("_bbsteleport;", ""); - final String[] buypassOptions = fullBypass.split(","); - final int x = Integer.parseInt(buypassOptions[0]); - final int y = Integer.parseInt(buypassOptions[1]); - final int z = Integer.parseInt(buypassOptions[2]); + final String teleBuypass = command.replace("_bbsteleport;", ""); if (activeChar.getInventory().getInventoryItemCount(Config.COMMUNITYBOARD_CURRENCY, -1) < Config.COMMUNITYBOARD_TELEPORT_PRICE) { activeChar.sendMessage("Not enough currency!"); } - else + else if (Config.COMMUNITY_AVAILABLE_TELEPORTS.get(teleBuypass) != null) { activeChar.sendPacket(new ShowBoard()); activeChar.destroyItemByItemId("CB_Teleport", Config.COMMUNITYBOARD_CURRENCY, Config.COMMUNITYBOARD_TELEPORT_PRICE, activeChar, true); - activeChar.teleToLocation(x, y, z, 0); + activeChar.teleToLocation(Config.COMMUNITY_AVAILABLE_TELEPORTS.get(teleBuypass), 0); } } else if (command.startsWith("_bbsbuff")) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java index e20446e850..49f6e5a4a9 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java @@ -1027,6 +1027,7 @@ public final class Config public static int COMMUNITY_PREMIUM_COIN_ID; public static int COMMUNITY_PREMIUM_PRICE_PER_DAY; public static List COMMUNITY_AVAILABLE_BUFFS; + public static Map COMMUNITY_AVAILABLE_TELEPORTS; public static boolean FACTION_SYSTEM_ENABLED; public static Location FACTION_STARTING_LOCATION; public static int FACTION_MANAGER_NPCID; @@ -2285,6 +2286,13 @@ public final class Config { COMMUNITY_AVAILABLE_BUFFS.add(Integer.parseInt(s)); } + final String[] availableTeleports = CommunityBoard.getString("CommunityTeleportList", "").split(";"); + COMMUNITY_AVAILABLE_TELEPORTS = new HashMap<>(availableTeleports.length); + for (String s : availableTeleports) + { + final String splitInfo[] = s.split(","); + COMMUNITY_AVAILABLE_TELEPORTS.put(splitInfo[0], new Location(Integer.parseInt(splitInfo[1]), Integer.parseInt(splitInfo[2]), Integer.parseInt(splitInfo[3]))); + } // Load DebugVoiceCommand config file (if exists) final PropertiesParser DebugVoiceCommand = new PropertiesParser(CUSTOM_DEBUG_VOICE_COMMAND_CONFIG_FILE);