Jump to content

Question

Posted (edited)

hello there can u make this code check works for hopzone

/*
 * 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 Extensions.Vote;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;

import Extensions.Vote.Tasks.MonthlyResetTask;
import Extensions.Vote.Tasks.TriesResetTask;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.util.database.L2DatabaseFactory;

public class VoteManager
{
	protected static final Logger _log = Logger.getLogger(VoteManager.class.getName());

	private static boolean hasVotedHop;
	private static boolean hasVotedTop;

	public VoteManager()
	{
	}

	public static void load()
	{
		_log.log(Level.INFO, "VoteManager: initialized.");
		TriesResetTask.getInstance();
		MonthlyResetTask.getInstance();
	}

	protected static int getHopZoneVotes()
	{
		int votes = -1;
		String Hopzonelink = Config.VOTE_LINK_HOPZONE;
		InputStreamReader isr = null;
		BufferedReader br = null;
		
		try
		{
			URLConnection con = new URL(Hopzonelink).openConnection();
			con.addRequestProperty("User-Agent", "Mozilla/4.76");
			isr = new InputStreamReader(con.getInputStream());
			br = new BufferedReader(isr);
			
			String line;
			while ((line = br.readLine()) != null)
			{
				if (line.contains("rank anonymous tooltip"))
				{
					votes = Integer.valueOf(line.split(">")[2].replace("</span", ""));
					break;
				}
			}
			
			br.close();
			isr.close();
		}
		catch (Exception e)
		{
			if (Config.DEVELOPER)
			{
				e.printStackTrace();
			}
		}
		return votes;
	}

	protected static int getTopZoneVotes()
	{
		int votes = -1;
		URL url = null;
		URLConnection con = null;
		InputStream is = null;
		InputStreamReader isr = null;
		BufferedReader in = null;
		try
		{
			url = new URL(Config.VOTE_LINK_TOPZONE);
			con = url.openConnection();
			con.addRequestProperty("User-Agent", "L2TopZone");
			is = con.getInputStream();
			isr = new InputStreamReader(is);
			in = new BufferedReader(isr);
			String inputLine;
			while ((inputLine = in.readLine()) != null)
			{
				if (inputLine.contains("Votes"))
				{
					String votesLine = inputLine;
					
					votes = Integer.valueOf(votesLine.split(">")[3].replace("</div", ""));
					break;
				}
			}
		}
		catch (Exception e)
		{
			if (Config.DEVELOPER)
			{
				e.printStackTrace();
			}
		}
		return votes;
	}

	public static String hopCd(L2PcInstance player)
	{
		long hopCdMs = 0;
		long voteDelay = 43200000L;
		PreparedStatement statement = null;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			statement = con.prepareStatement("SELECT lastVoteHopzone FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				hopCdMs = rset.getLong("lastVoteHopzone");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		 
		SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy HH:mm");

		Date resultdate = new Date(hopCdMs + voteDelay);
		return sdf.format(resultdate);
	}

	public static String topCd(L2PcInstance player)
	{
		long topCdMs = 0;
		long voteDelay = 43200000L;
		PreparedStatement statement = null;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			statement = con.prepareStatement("SELECT lastVoteTopzone FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				topCdMs = rset.getLong("lastVoteTopzone");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		 
		SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy HH:mm");

		Date resultdate = new Date(topCdMs + voteDelay);
		return sdf.format(resultdate);
	}

	public static String whosVoting()
	{
		for (L2PcInstance voter : L2World.getInstance().getAllPlayers())
		{
			if (voter.isVoting())
			{
				return voter.getName();
			}
		}
		return "None";
	}

	public static void hopvote(final L2PcInstance player)
	{
		long lastVoteHopzone = 0L;
		long voteDelay = 43200000L;
		final int firstvoteshop;

		firstvoteshop = getHopZoneVotes();

		class hopvotetask implements Runnable
		{
			private final L2PcInstance p;

			public hopvotetask(L2PcInstance player)
			{
				p = player;
			}

			@Override
			public void run()
			{
				if (firstvoteshop < getHopZoneVotes())
				{
					p.setIsVoting(false);
					p.setIsImobilised(false);
					VoteManager.setHasVotedHop(player);
					p.sendMessage("Thank you for voting for us!");
					VoteManager.updateLastVoteHopzone(p);
					VoteManager.updateVotes(p);
				}
				else
				{
					p.setIsVoting(false);
					p.setIsImobilised(false);
					p.sendMessage("You did not vote.Please try again.");
					VoteManager.setTries(player, VoteManager.getTries(p) - 1);
				}
			}

		}

		PreparedStatement statement = null;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			statement = con.prepareStatement("SELECT lastVoteHopzone FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				lastVoteHopzone = rset.getLong("lastVoteHopzone");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }

		if (getTries(player) <= 0)
		{
			player.sendMessage("Due to your multiple failures in voting you lost your chance to vote today");
		}
		else if (((lastVoteHopzone + voteDelay) < System.currentTimeMillis()) && (getTries(player) > 0))
		{
			for (L2PcInstance j : L2World.getInstance().getAllPlayers())
			{
				if (j.isVoting())
				{
					player.sendMessage("Someone is already voting.Wait for your turn please!");
					return;
				}
			}

			player.setIsVoting(true);
			player.setIsImobilised(true);
			player.sendMessage("Go fast on the site and vote on the hopzone banner!");
			player.sendMessage("You have " + Config.SECS_TO_VOTE + " seconds.Hurry!");
			ThreadPoolManager.getInstance().scheduleGeneral(new hopvotetask(player), Config.SECS_TO_VOTE * 1000);
		}
		else if ((getTries(player) <= 0) && ((lastVoteHopzone + voteDelay) < System.currentTimeMillis()))
		{
			for (L2PcInstance j : L2World.getInstance().getAllPlayers())
			{
				if (j.isVoting())
				{
					player.sendMessage("Someone is already voting.Wait for your turn please!");
					return;
				}
			}

			player.setIsVoting(true);
			player.setIsImobilised(true);
			player.sendMessage("Go fast on the site and vote on the hopzone banner!");
			player.sendMessage("You have " + Config.SECS_TO_VOTE + " seconds.Hurry!");
			ThreadPoolManager.getInstance().scheduleGeneral(new hopvotetask(player), Config.SECS_TO_VOTE * 1000);

		}
		else
		{
			player.sendMessage("12 hours have to pass till you are able to vote again.");
		}

	}

	public static void topvote(final L2PcInstance player)
	{
		long lastVoteTopzone = 0L;
		long voteDelay = 43200000L;
		final int firstvotestop;

		firstvotestop = getTopZoneVotes();

		class topvotetask implements Runnable
		{
			private final L2PcInstance p;

			public topvotetask(L2PcInstance player)
			{
				p = player;
			}

			@Override
			public void run()
			{
				if (firstvotestop < getTopZoneVotes())
				{
					p.setIsVoting(false);
					p.setIsImobilised(false);
					VoteManager.setHasVotedTop(p);
					p.sendMessage("Thank you for voting for us!");
					VoteManager.updateLastVoteTopzone(p);
					VoteManager.updateVotes(p);
				}
				else
				{
					p.setIsVoting(false);
					p.setIsImobilised(false);
					p.sendMessage("You did not vote.Please try again.");
					VoteManager.setTries(p, VoteManager.getTries(p) - 1);
				}
			}

		}

		PreparedStatement statement = null;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			statement = con.prepareStatement("SELECT lastVoteTopzone FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				lastVoteTopzone = rset.getLong("lastVoteTopzone");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }

		if (getTries(player) <= 0)
		{
			player.sendMessage("Due to your multiple failures in voting you lost your chance to vote today");
		}
		else if ((getTries(player) <= 0) && ((lastVoteTopzone + voteDelay) < System.currentTimeMillis()))
		{
			for (L2PcInstance j : L2World.getInstance().getAllPlayers())
			{
				if (j.isVoting())
				{
					player.sendMessage("Someone is already voting.Wait for your turn please!");
					return;
				}
			}
			player.setIsVoting(true);
			player.setIsImobilised(true);
			player.sendMessage("Go fast on the site and vote on the topzone banner!");
			player.sendMessage((new StringBuilder()).append("You have ").append(Config.SECS_TO_VOTE).append(" seconds.Hurry!").toString());
			ThreadPoolManager.getInstance().scheduleGeneral(new topvotetask(player), Config.SECS_TO_VOTE * 1000);
		}
		else if (((lastVoteTopzone + voteDelay) < System.currentTimeMillis()) && (getTries(player) > 0))
		{
			for (L2PcInstance j : L2World.getInstance().getAllPlayers())
			{
				if (j.isVoting())
				{
					player.sendMessage("Someone is already voting.Wait for your turn please!");
					return;
				}
			}
			player.setIsVoting(true);
			player.setIsImobilised(true);
			player.sendMessage("Go fast on the site and vote on the topzone banner!");
			player.sendMessage((new StringBuilder()).append("You have ").append(Config.SECS_TO_VOTE).append(" seconds.Hurry!").toString());
			ThreadPoolManager.getInstance().scheduleGeneral(new topvotetask(player), Config.SECS_TO_VOTE * 1000);
		}
		else
		{
			player.sendMessage("12 hours have to pass till you are able to vote again.");
		}

	}

	public static void hasVotedHop(L2PcInstance player)
	{
		int hasVotedHop = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT hasVotedHop FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				hasVotedHop = rset.getInt("hasVotedHop");
			}

			if (hasVotedHop == 1)
			{
				setHasVotedHop(true);
			}
			else if (hasVotedHop == 0)
			{
				setHasVotedHop(false);
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void hasVotedTop(L2PcInstance player)
	{
		int hasVotedTop = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT hasVotedTop FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());

			ResultSet rset = statement.executeQuery();

			while (rset.next())
			{
				hasVotedTop = rset.getInt("hasVotedTop");
			}

			if (hasVotedTop == 1)
			{
				setHasVotedTop(true);
			}
			else if (hasVotedTop == 0)
			{
				setHasVotedTop(false);
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void updateVotes(L2PcInstance activeChar)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET monthVotes=?, totalVotes=? WHERE obj_Id=?");

			statement.setInt(1, getMonthVotes(activeChar) + 1);
			statement.setInt(2, getTotalVotes(activeChar) + 1);
			statement.setInt(3, activeChar.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void setHasVotedHop(L2PcInstance activeChar)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedHop=? WHERE obj_Id=?");

			statement.setInt(1, 1);
			statement.setInt(2, activeChar.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void setHasVotedTop(L2PcInstance activeChar)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedTop=? WHERE obj_Id=?");

			statement.setInt(1, 1);
			statement.setInt(2, activeChar.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void setHasNotVotedHop(L2PcInstance activeChar)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedHop=? WHERE obj_Id=?");

			statement.setInt(1, 0);
			statement.setInt(2, activeChar.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void setHasNotVotedTop(L2PcInstance activeChar)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedTop=? WHERE obj_Id=?");

			statement.setInt(1, 0);
			statement.setInt(2, activeChar.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static int getTries(L2PcInstance player)
	{
		int tries = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT tries FROM characters WHERE obj_Id=?");
			statement.setInt(1, player.getObjectId());
			for (ResultSet rset = statement.executeQuery(); rset.next();)
			{
				tries = rset.getInt("tries");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		return tries;
	}

	public static void setTries(L2PcInstance player, int tries)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET tries=? WHERE obj_Id=?");

			statement.setInt(1, tries);
			statement.setInt(2, player.getObjectId());
			statement.execute();
			statement.close();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static int getMonthVotes(L2PcInstance player)
	{
		int monthVotes = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT monthVotes FROM characters WHERE obj_Id=?");

			statement.setInt(1, player.getObjectId());
			for (ResultSet rset = statement.executeQuery(); rset.next();)
			{
				monthVotes = rset.getInt("monthVotes");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		return monthVotes;
	}

	public static int getTotalVotes(L2PcInstance player)
	{
		int totalVotes = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT totalVotes FROM characters WHERE obj_Id=?");

			statement.setInt(1, player.getObjectId());
			for (ResultSet rset = statement.executeQuery(); rset.next();)
			{
				totalVotes = rset.getInt("totalVotes");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		return totalVotes;
	}

	public static int getBigTotalVotes(L2PcInstance player)
	{
		int bigTotalVotes = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT SUM(totalVotes) FROM characters");

			for (ResultSet rset = statement.executeQuery(); rset.next();)
			{
				bigTotalVotes = rset.getInt("SUM(totalVotes)");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		return bigTotalVotes;
	}

	public static int getBigMonthVotes(L2PcInstance player)
	{
		int bigMonthVotes = -1;
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("SELECT SUM(monthVotes) FROM characters");

			for (ResultSet rset = statement.executeQuery(); rset.next();)
			{
				bigMonthVotes = rset.getInt("SUM(monthVotes)");
			}
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
		return bigMonthVotes;
	}

	public static void updateLastVoteHopzone(L2PcInstance player)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET lastVoteHopzone=? WHERE obj_Id=?");
			statement.setLong(1, System.currentTimeMillis());
			statement.setInt(2, player.getObjectId());
			statement.execute();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	public static void updateLastVoteTopzone(L2PcInstance player)
	{
		Connection con = null;
		try
		{
		con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement statement = con.prepareStatement("UPDATE characters SET lastVoteTopzone=? WHERE obj_Id=?");
			statement.setLong(1, System.currentTimeMillis());
			statement.setInt(2, player.getObjectId());
			statement.execute();
		}
		 catch (Exception e)
		 {
		 _log.warning(" ");
		 }
		 finally
		 {
		 try
		 {
		 if (con != null)
		 con.close();
		 }
		 catch (SQLException e)
		 {
		 _log.warning("Failed to close database connection!");
		 }
		 }
	}

	// Getters and Setters
	public static boolean hasVotedHop()
	{
		return hasVotedHop;
	}

	public static void setHasVotedHop(boolean hasVotedHop)
	{
		VoteManager.hasVotedHop = hasVotedHop;
	}

	public static boolean hasVotedTop()
	{
		return hasVotedTop;
	}

	public static void setHasVotedTop(boolean hasVotedTop)
	{
		VoteManager.hasVotedTop = hasVotedTop;
	}
}
Edited by haskovo

Recommended Posts

  • 0
Posted

avoid such topics.

 

 

provide more informations

:O

what more u need?

asking for a working hopzone vote reading(individual vote manager)

  • 0
Posted
  • 0
Posted

it doesnt work for the individual vote manager.

  • 0
Posted

thats the vortex npc from elfocrash? if yes you have to redesign it a little to work maybe ask him but i dont know if he still supports it, or you can buy from the market from sweets he have a good code but i dont know if he will install it on the npc you dont know if you dont ask ofc :)

  • 0
Posted

thats the vortex npc from elfocrash? if yes you have to redesign it a little to work maybe ask him but i dont know if he still supports it, or you can buy from the market from sweets he have a good code but i dont know if he will install it on the npc you dont know if you dont ask ofc :)

It is actually :P

  • 0
Posted

network is a copy paste lol i would count more on http://www.topbrasil100.com.br/instead of a copy of a copy...

network is going really good as i know and they are saying is the feature since the hopzone is dying. also as i saw they are partners with mxc so why not xD

  • 0
Posted

you propably want to say future not feature :P

and i disagree 101% sorry :D

op yes future ^^ my english is bad xD

  • 0
Posted (edited)

yeap but i cant adapt it to work for my server :C i dont understand you put codes but dont say where to put it its so confusing

 

if you can help me with this where i give

Edited by haskovo
Guest
This topic is now closed to further replies.


  • Posts

    • Five More Days Left for the 50% Discount in all our video services! 
    • Good afternoon, gentlemen. I’d like to ask a question to those who know their stuff — and just get some advice. Let me start with the main point. I want to try learning Java. Just for myself — I simply like programming, and it’s a small hobby of mine. Though, perhaps it’s too early to say I really like Java, since I don’t actually know it well yet. I’ll get straight to the point. Back in my youth, like many others, I played Lineage 2. Later, I became interested in creating servers and even made my own — we had around 70 players, all schoolkids like me. I learned how to install builds, add NPCs and various add-ons “from the internet” back then. But my attempts to create my own Lineage 2 additions in Java almost always failed. At best, I could slightly modify ready-made code, but not write anything from scratch. My interest in Lineage 2 and Java has stayed with me to this day. For me, it’s a creative process — a favorite game where you can build your own “sandbox.” I’d really like to hear from the community about where you started. In your opinion, what’s the best way to learn Java using Lineage 2 as an example? I don’t have a clear learning plan — and that’s probably the problem. I’ve tried reading Schildt’s book, and I’ve also tried studying Java source codes of various server builds by poking around to understand how the server works and how programs are written. I can’t say I understand nothing — I do get some things, and I believe I have a knack for it. But it’s not systematic. Maybe I really do need advice from more experienced people, to find a strategy that’s both effective for learning Java and interesting because it’s connected to Lineage 2 — not just writing abstract programs “for nothing.” In Lineage 2, you can see the result right away — and I get genuinely happy even from small successes. So here’s the main point: I’d like to know where you started. Is it even worth combining Java and Lineage 2? Recently, ChatGPT has been a huge help — thanks to it, I’ve made some progress and started to understand the server structure at least a little. But there’s one issue: if I just copy and paste, the result works — but without ChatGPT, I can’t reproduce it on my own. I’ve been working with PwSoft source files — I think many people know them. Why exactly them? I can’t really say — probably because there are lots of ready-made add-ons for this build online, and I originally focused more on modifying existing code than writing my own. I worked with PwSoft for a long time. Then, on ChatGPT’s advice, I switched to aCis — it’s cleaner, more minimalistic, without unnecessary “clutter.” It’s easier to understand where everything is located. I installed the aCis sources, everything compiles fine, but… if in PwSoft I could at least navigate the code and write simple methods, in aCis I couldn’t even make a basic NPC that gives noblesse for adena. That’s why I decided to write this post — just to talk about learning Java through Lineage 2, to hear your opinions, your stories, your approaches. Maybe someone will say: “Don’t bother, it’s a waste of time.” I’ll accept those answers too. But I’d still like to hear different perspectives. If you can, please recommend good video courses on Java that would help me learn faster and in a more structured way. To repeat: this is something from my childhood that I never finished. My job is stable now, and I have time — at least sometimes. I can work on this calmly, as long as my learning goes in the right direction. I think you get it: this is something “for the soul,” and I really want to grow in it. Thanks to everyone who read to the end. I really appreciate any advice. And if someone is open to chatting privately or by voice — I’d gladly talk, and I’m happy to “buy a beer” for a constructive conversation. Peace to everyone!       Добрый день, господа. Я хотел бы задать вопрос тем, кто знает свое дело — и просто получить совет. Начну с главного. Я хочу попробовать изучить Java. Только для себя — мне просто нравится программирование, и это мое маленькое хобби. Хотя, возможно, еще слишком рано говорить, что мне действительно нравится Java, так как я еще не очень хорошо ее знаю. Я сразу перейду к делу. В юности, как и многие другие, я играл в Lineage 2. Позже я увлекся созданием серверов и даже сделал свой — у нас было около 70 игроков, все школьники, как и я. Я научился устанавливать сборки, добавлять NPC и различные дополнения "из интернета" еще тогда. Но мои попытки создать свои собственные дополнения Lineage 2 на Java почти всегда терпели неудачу. В лучшем случае я мог бы немного доработать готовый код, но не писать ничего с нуля. Мой интерес к Lineage 2 и Java не покидает меня и по сей день. Для меня это творческий процесс — любимая игра, в которой можно построить свою «песочницу». Мне очень хотелось бы услышать от сообщества о том, с чего вы начали. На ваш взгляд, как лучше всего изучать Java на примере Lineage 2? У меня нет четкого плана обучения — и, вероятно, в этом проблема. Я пробовал читать книгу Герберта Шилдта, а также пытался изучать исходные коды Java различных серверных сборок, копаясь вокруг, чтобы понять, как работает сервер и как пишутся программы. Не могу сказать, что я ничего не понимаю — я кое-что понимаю, и я верю, что у меня есть к этому способности. Но это не систематично. Возможно, мне действительно нужен совет от более опытных людей, чтобы найти стратегию, которая была бы одновременно эффективной для изучения Java и интересной, потому что она связана с Lineage 2, а не просто писать абстрактные программы «впустую». В Lineage 2 результат виден сразу — и я искренне радуюсь даже от маленьких успехов. Итак, вот главное: я хотел бы знать, с чего вы начали. Стоит ли вообще совмещать Java и Lineage 2? В последнее время ChatGPT очень помог — благодаря ему я добился некоторого прогресса и начал хотя бы немного разбираться в структуре сервера. Но есть одна проблема: если я просто скопирую и вставлю, результат работает, но без ChatGPT я не могу воспроизвести его самостоятельно. Я работал с исходными файлами PwSoft — думаю, многие их знают. Почему именно они? Я не могу точно сказать — вероятно, потому что в сети есть много готовых дополнений для этой сборки, и я изначально больше сосредоточился на модификации существующего кода, чем на написании своего. Я долгое время работал с PwSoft. Потом, по совету ChatGPT, я перешел на aCis — он чище, минималистичнее, без лишнего «беспорядка». Так проще понять, где что находится. Я установил исходники aCis, все нормально компилируется, но... Если в PwSoft я мог хотя бы ориентироваться в коде и писать простые методы, то в aCis я не смог сделать даже базового NPC, который дает благородство для adena. Вот почему я решил написать этот пост — просто чтобы поговорить об изучении Java через Lineage 2, услышать ваши мнения, ваши истории, ваши подходы. Может быть, кто-то скажет: «Не заморачивайтесь, это пустая трата времени». Я тоже приму эти ответы. Но я все же хотел бы услышать разные точки зрения. Если можете, пожалуйста, порекомендуйте хорошие видеокурсы по Java, которые помогут мне учиться быстрее и более структурированно. Повторюсь: это что-то из моего детства, которое я так и не закончил. Моя работа сейчас стабильна, и у меня есть время — хотя бы иногда. Я могу спокойно работать над этим, пока мое обучение идет в правильном направлении. Думаю, вы поняли: это что-то «для души», и я очень хочу в этом расти. Спасибо всем, кто дочитал до конца. Я очень ценю любой совет. А если кто-то открыт для личного общения или голосом — я с удовольствием поговорю, и с удовольствием «куплю пиво» для конструктивного разговора. Всем мира!😀🤝
    • 亲爱的朋友们,我们很高兴地宣布一个好消息—— 我们正式推出我们的新机器人,用于购买和租用虚拟号码以接收来自任何服务的短信!您是否已经厌倦了其他平台上重复使用或转售的号码? 试试我们的解决方案! 我们的服务允许您接收来自任何主流热门服务的短信。 服务列表包含超过 200 个项目! 短信接收国家:美国 (+1)。我们使用真实的美国实体号码——从未在其他平台上使用过! 目前仅提供短期租用。每个电话号码的租用时长会在购买时显示。 每个号码的价格也会在购买前显示在对应的服务旁。 您还可以为所选服务的号码接收额外短信(接收额外短信无需额外费用)。 若要快速找到所需服务,可使用便捷的搜索功能——只需输入您所需服务的名称即可获得激活号码。 可用支付方式:加密货币、银行卡,以及从我们其他机器人转移余额。 感谢您的信任! 有效链接: 虚拟号码服务:前往 数字商品商店(网站):前往 商店 Telegram 机器人:前往 – 通过 Telegram 信使方便地访问商店。 Telegram 星星购买机器人:前往 – 在 Telegram 中快速且优惠地购买星星。 SMM 面板:前往 – 推广您的社交媒体账户。 我们向您展示当前的促销与特别优惠,用于购买我们平台的商品和服务: 1. 使用促销码 OCTOBER2025(8% 折扣)在十月份于我们的商店(网站、机器人)购物!您也可以使用首次购买促销码:SOCNET(15% 折扣) 2. 获得 $1 商店余额或 10–20% 折扣 —— 注册后在我们网站按以下格式发布用户名:"SEND ME BONUS, MY USERNAME IS..." —— 并将其发布在我们的论坛主题中! 3. 获取 SMM 面板首个试用奖励 $1 —— 只需在我们网站(支持)提交标题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道和星星购买机器人中赠送 Telegram 星星! 新闻: ➡ Telegram 频道:https://t.me/accsforyou_shop ➡ WhatsApp 频道:https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器:https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram:https://t.me/socnet_support ➡ WhatsApp:https://wa.me/79051904467 ➡ Discord:socnet_support ➡ ✉ 邮箱:solomonbog@socnet.store
    • 亲爱的朋友们,我们很高兴地宣布一个好消息—— 我们正式推出我们的新机器人,用于购买和租用虚拟号码以接收来自任何服务的短信!您是否已经厌倦了其他平台上重复使用或转售的号码? 试试我们的解决方案! 我们的服务允许您接收来自任何主流热门服务的短信。 服务列表包含超过 200 个项目! 短信接收国家:美国 (+1)。我们使用真实的美国实体号码——从未在其他平台上使用过! 目前仅提供短期租用。每个电话号码的租用时长会在购买时显示。 每个号码的价格也会在购买前显示在对应的服务旁。 您还可以为所选服务的号码接收额外短信(接收额外短信无需额外费用)。 若要快速找到所需服务,可使用便捷的搜索功能——只需输入您所需服务的名称即可获得激活号码。 可用支付方式:加密货币、银行卡,以及从我们其他机器人转移余额。 感谢您的信任! 有效链接: 虚拟号码服务:前往 数字商品商店(网站):前往 商店 Telegram 机器人:前往 – 通过 Telegram 信使方便地访问商店。 Telegram 星星购买机器人:前往 – 在 Telegram 中快速且优惠地购买星星。 SMM 面板:前往 – 推广您的社交媒体账户。 我们向您展示当前的促销与特别优惠,用于购买我们平台的商品和服务: 1. 使用促销码 OCTOBER2025(8% 折扣)在十月份于我们的商店(网站、机器人)购物!您也可以使用首次购买促销码:SOCNET(15% 折扣) 2. 获得 $1 商店余额或 10–20% 折扣 —— 注册后在我们网站按以下格式发布用户名:"SEND ME BONUS, MY USERNAME IS..." —— 并将其发布在我们的论坛主题中! 3. 获取 SMM 面板首个试用奖励 $1 —— 只需在我们网站(支持)提交标题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道和星星购买机器人中赠送 Telegram 星星! 新闻: ➡ Telegram 频道:https://t.me/accsforyou_shop ➡ WhatsApp 频道:https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器:https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram:https://t.me/socnet_support ➡ WhatsApp:https://wa.me/79051904467 ➡ Discord:socnet_support ➡ ✉ 邮箱:solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock