CommunityBoard teleport protection system.

This commit is contained in:
MobiusDev
2017-09-13 16:09:53 +00:00
parent 4e648532ab
commit 50cf2ca0e4
20 changed files with 265 additions and 127 deletions

View File

@@ -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)

View File

@@ -49,23 +49,23 @@
<td align="center">
<table align=center border="0" height=45>
<tr>
<td><button value="Giran" action="bypass _bbsteleport;82698,148638,-3473" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Aden" action="bypass _bbsteleport;147450,27064,-2208" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Goddard" action="bypass _bbsteleport;147725,-56517,-2780" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Giran" action="bypass _bbsteleport;Giran" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Aden" action="bypass _bbsteleport;Aden" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Goddard" action="bypass _bbsteleport;Goddard" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
<tr>
<td><button value="Rune" action="bypass _bbsteleport;44070,-50243,-796" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Dion" action="bypass _bbsteleport;18748,145437,-3132" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Oren" action="bypass _bbsteleport;82321,55139,-1529" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Rune" action="bypass _bbsteleport;Rune" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Dion" action="bypass _bbsteleport;Dion" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Oren" action="bypass _bbsteleport;Oren" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
<tr>
<td><button value="Gludio" action="bypass _bbsteleport;-14225,123540,-3121" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Schuttgart" action="bypass _bbsteleport;87358,-141982,-1341" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Heine" action="bypass _bbsteleport;111115,219017,-3547" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Gludio" action="bypass _bbsteleport;Gludio" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Schuttgart" action="bypass _bbsteleport;Schuttgart" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Heine" action="bypass _bbsteleport;Heine" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
<tr>
<td><button value="Gludin" action="bypass _bbsteleport;-83063,150791,-3133" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Hunters" action="bypass _bbsteleport;116589,76268,-2734" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Gludin" action="bypass _bbsteleport;Gludin" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Hunters" action="bypass _bbsteleport;Hunters" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
</table>
<table align=center border="0">
@@ -83,14 +83,14 @@
</table>
<table align=center border="0" height=45>
<tr>
<td><button value="Talking Island" action="bypass _bbsteleport;-82687,243157,-3734" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Dwarven" action="bypass _bbsteleport;116551,-182493,-1525" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Orc" action="bypass _bbsteleport;-44211,-113521,-241" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Talking Island" action="bypass _bbsteleport;TalkingIsland" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Dwarven" action="bypass _bbsteleport;Dwarven" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Orc" action="bypass _bbsteleport;Orc" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
<tr>
<td><button value="Dark Elven" action="bypass _bbsteleport;12428,16551,-4588" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Elven" action="bypass _bbsteleport;45873,49288,-3064" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Kamael" action="bypass _bbsteleport;-116934,46616,368" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Dark Elven" action="bypass _bbsteleport;DarkElven" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Elven" action="bypass _bbsteleport;Elven" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Kamael" action="bypass _bbsteleport;Kamael" width=140 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
</table>
</td>

View File

@@ -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"))

View File

@@ -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<Integer> COMMUNITY_AVAILABLE_BUFFS;
public static Map<String, Location> 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);