/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.entity;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Calendar;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.logging.Logger;
import com.l2jserver.commons.database.pool.impl.ConnectionFactory;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.instance.L2FactTeleporterInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.instance.L2TpFlagInstance;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jserver.gameserver.util.Broadcast;
import com.l2jserver.util.StringUtil;
/**
* @author Laikeriz
*/
public class FactionMaps
{
private final static Logger _log = Logger.getLogger(FactionMaps.class.getName());
public static Map<Integer, String> _all_maps = new HashMap<>();
public static int _mapId = 0;
public static String _mapName = "";
public static int _maps_count = 0;
public static boolean _voting = false;
public static int[] _mapVotes = new int[10];
public static String[] _mapNames = new String[10];
private static long _nextMapIn = 0;
public static boolean isVoting()
{
return _voting;
}
public static int getMapId()
{
return _mapId;
}
public static String getMapName()
{
return _mapName;
}
public static String getDelayUntilVoting()
{
long trim = _nextMapIn - Calendar.getInstance().getTimeInMillis();
int h = 0;
int m = 0;
int s = 0;
int k = 1 / 2;
if ((trim / 3600000) >= 1)
{
h = Math.round((trim / 3600000) - k);
trim -= h * 3600000;
}
if ((trim / 60) >= 1)
{
m = Math.round((trim / 60000) - k);
trim -= m * 60000;
}
if ((trim / 1000) >= 1)
{
s = Math.round((trim / 1000) - k);
}
return h + "h. " + m + "m. " + s + "s.";
}
@SuppressWarnings("resource")
public static void loadCurrentMap()
{
Connection con = null;
try
{
con = ConnectionFactory.getInstance().getConnection();
PreparedStatement stmt = con.prepareStatement("SELECT mapId,map_name FROM faction_maps WHERE current=1");
ResultSet rset = stmt.executeQuery();
while (rset.next())
{
_mapId = rset.getInt("mapId");
_mapName = rset.getString("map_name");
}
rset.close();
stmt.close();
// Put all maps in FastMap
PreparedStatement stmt_all = con.prepareStatement("SELECT mapId,map_name FROM faction_maps");
ResultSet rset_all = stmt_all.executeQuery();
while (rset_all.next())
{
_all_maps.put(rset_all.getInt("mapId"), rset_all.getString("map_name"));
}
rset_all.close();
stmt_all.close();
}
catch (Exception e)
{
_log.warning("Load current map: " + e);
}
finally
{
try
{
con.close();
}
catch (Exception e)
{
}
}
ThreadPoolManager.getInstance().scheduleGeneral(() -> endVoting(true), 1000);
}
public static void beginVoting()
{
for (L2TpFlagInstance flag : L2FactTeleporterInstance._tpBlueFlags)
{
flag.deleteMe();
}
for (L2TpFlagInstance flag : L2FactTeleporterInstance._tpRedFlags)
{
flag.deleteMe();
}
L2FactTeleporterInstance._tpBlueFlags.clear();
L2FactTeleporterInstance._tpRedFlags.clear();
for (L2PcInstance player : L2World.getInstance().getAllPlayers().values())
{
player.setVotedForMap(false);
}
Broadcast.toAllOnlinePlayers("Voting for next faction map has begun. It will end in 60 seconds.");
_voting = true;
NpcHtmlMessage html = new NpcHtmlMessage(1);
final StringBuilder tb = StringUtil.startAppend(3500, "<html><title>Faction Maps</title><body><center>");
tb.append("<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32 align=left><br>");
Connection con = null;
try
{
con = ConnectionFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement("SELECT * FROM faction_maps WHERE current=0");
ResultSet rset = statement.executeQuery();
for (int r = 0; r < _mapVotes.length; r++)
{
_mapVotes[r] = 0;
}
while (rset.next())
{
tb.append("<button value=\"" + rset.getString("map_name") + "\" action=\"bypass -h voteformap_" + rset.getInt("mapId") + "\" width=170 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
_mapNames[rset.getInt("mapId")] = rset.getString("map_name");
}
rset.close();
statement.close();
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
con.close();
}
catch (Exception e)
{
_log.info("Couldn't set player faction:" + " " + e);
}
}
tb.append("<img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32 align=left></center></body></html>");
html.setHtml(tb.toString());
for (L2PcInstance player : L2World.getInstance().getAllPlayers().values())
{
player.sendPacket(html);
}
try
{
Thread.sleep(60000);
}
catch (Exception e)
{
}
endVoting(false);
}
@SuppressWarnings("resource")
public static void endVoting(boolean onLoad)
{
_nextMapIn = Calendar.getInstance().getTimeInMillis() + 250000;
if (!onLoad)
{
_voting = false;
int mostVotes = 0;
int mostMapId = 0;
for (int i = 0; i < _mapVotes.length; i++)
{
if (_mapVotes[i] > mostVotes)
{
mostVotes = _mapVotes[i];
mostMapId = i;
}
}
if (mostVotes == 0)
{
mostMapId = 2;
}
_mapName = _mapNames[mostMapId];
_mapId = mostMapId;
Broadcast.toAllOnlinePlayers("Voting for faction maps has ended.");
Broadcast.toAllOnlinePlayers("The next map will be: " + _mapName);
L2TpFlagInstance.spawnFlags();
@SuppressWarnings("resource")
Connection con = null;
try
{
con = ConnectionFactory.getInstance().getConnection();
PreparedStatement statement = null;
statement = con.prepareStatement("UPDATE faction_maps SET current=0");
statement.execute();
statement = con.prepareStatement("UPDATE faction_maps SET current=1 WHERE mapId=?");
statement.setInt(1, _mapId);
statement.execute();
statement.close();
}
catch (Exception e)
{
_log.warning("End voting: " + e);
}
finally
{
try
{
con.close();
}
catch (Exception e)
{
}
}
}
int durat = 4 * 60 * 1000;
try
{
Thread.sleep(durat);
}
catch (Exception e)
{
}
beginVoting();
}
public static int getNextMap(int mapid)
{
if (_mapId < _maps_count)
{
return _mapId + 1;
}
return 1;
}
public static class ValueComparator implements Comparator<Object>
{
Map<L2PcInstance, Integer> base;
public ValueComparator(Map<L2PcInstance, Integer> base1)
{
this.base = base1;
}
@Override
public int compare(Object a, Object b)
{
if (base.get(a) < base.get(b))
{
return 1;
}
else if (base.get(a) == base.get(b))
{
return 0;
}
else
{
return -1;
}
}
}
public static void voteForMap(int mapId)
{
_mapVotes[mapId] = _mapVotes[mapId] + 1;
}
}
.So im trying to adapt DarthVaders script for factionmap,l2factteleporter and l2tpflaginstance on h5 l2j.So far everything work perfect except voting.The window as you can see is working but when i press any button window just close and nothing happen.When voting ends and next map load it seems to be the same so i believe is something wrong with bypass,but i cant figured out .Any help/idea?
Some new features that we added:
- 2 new quests
- PvP Arena (to get hero status) Olympiad is disabled
- Love Event
- Dressme for armor/weapons/accessories
- HWID Protection
- More monsters
- New farm zone
- New autofarm system (works almost like adrenaline)
- Auto enchant
- Auto augment
- 3 levels of armors
- 3 levels of weapons
- Anti KS System
- Rebirth Manager
- 30 days checking rewards
- Small event (daily checking with small reward for all online players)
Added FloodProtector utility to prevent packet flooding for actions like item use and dice rolling.
Integrated flood protection checks in relevant client packet handlers and registered/removal hooks in player lifecycle.
Updated movement logic in L2PcInstance for improved position synchronization and geodata handling.
Minor fixes and refactoring in attack logic, private store handling, and admin NPC editing.
Refactored AI classes to enhance movement, attack, and skill usage logic for characters and mobs.
Improved distance checks, attack range calculations, and skill casting conditions.
Removed unused intention command logic from L2CharacterAI.
Updated configuration to enable CellPathFinding.
Minor code cleanups and bug fixes for more reliable AI behavior.
Enhanced GeoPathFinding with detailed debug and error messages for region loading, including success/failure counts and file checks.
Refactored L2AttackableAI and L2CharacterAI to improve attack range tolerance, immediate attack behavior, and added safety checks for missing targets.
Updated configuration to disable CellPathFinding by default and added a new ShowRedName option for aggressive mobs.
Minor config and log updates included.
Applied TCP socket optimizations (e.g., TCP_NODELAY, buffer sizes, keepalive) in ClientThread, Connection, and SelectorThread to reduce latency and improve throughput. Enhanced L2AttackableAI with better random walk, aggro, and attack logic, including silent move checks, quest monster handling, and improved faction/raid/minion behavior.
Added silent move support to L2PlayableInstance and quest monster flag to L2NpcTemplate/L2NpcInstance.
These changes aim to improve server responsiveness, AI realism, and overall stability.
I’ve been using this Escape from Tarkov Hack for about a week now with no issues at all. ESP works great without any lag, and the aimbot is smooth and doesn't feel obvious. Had a quick setup with the loader, and support answered my questions right away. The HWID spoofer also did its job without messing with my system. So far, the cheat's staying undetected on my side.
Question
misterelax
hello mates
.So im trying to adapt DarthVaders script for factionmap,l2factteleporter and l2tpflaginstance on h5 l2j.So far everything work perfect except voting.The window as you can see is working but when i press any button window just close and nothing happen.When voting ends and next map load it seems to be the same so i believe is something wrong with bypass,but i cant figured out .Any help/idea?
7 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now