Jump to content

Question

Posted
there is no prob with consoles....

i want give reward every 5 votes at hopzone and topzone .. can some1 help me? :)

 

 

 

 

 

 

 

package vortextengine;

 

import java.io.BufferedReader;

import java.io.InputStream;

import java.io.InputStreamReader;

import java.net.URL;

import java.net.URLConnection;

 

import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;

import com.l2jfrozen.gameserver.network.clientpackets.Say2;

import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;

import com.l2jfrozen.gameserver.thread.ThreadPoolManager;

 

import vortextengine.datatables.PlayerTable;

import vortextengine.tasks.HopzoneVoteDelay;

import vortextengine.tasks.MonthlyResetTask;

import vortextengine.tasks.TopzoneVoteDelay;

import vortextengine.tasks.TriesResetTask;

 

import javolution.util.FastList;

 

 

public class VoteMain

{

public static FastList<String> voterList = new FastList<String>();

private static boolean isVoting;

public static int firstvoteshop;

public static int firstvotestop;

public static long lastVoteCheck = 0L;

public static long voteDelay = 43200000L;

 

public VoteMain()

{

}

 

public static void load()

{

System.out.println("Vote Reward System Started Successfully.");

VoteConfig.loadConfigs();

TriesResetTask.getInstance();

MonthlyResetTask.getInstance();

}

 

public static int getHopZoneVotes()

{

int votes = -1;

URL url = null;

URLConnection con = null;

InputStream is = null;

InputStreamReader isr = null;

BufferedReader in = null;

try

{

url = new URL(VoteConfig.VOTE_LINK_HOPZONE);

con = url.openConnection();

con.addRequestProperty("User-Agent", "Mozilla/4.76");

is = con.getInputStream();

isr = new InputStreamReader(is);

in = new BufferedReader(isr);

String inputLine;

while ((inputLine = in.readLine()) != null)

{

if (inputLine.contains("rank anonymous tooltip"))

{

votes = Integer.valueOf(inputLine.split(">")[2].replace("</span", ""));

break;

}

}

}

catch (Exception e)

{

System.out.println("VortexEngine: Server HOPZONE is offline or something is wrong in link.");

}

return votes;

}

 

public 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(VoteConfig.VOTE_LINK_TOPZONE);

con = url.openConnection();

con.addRequestProperty("User-Agent", "Mozilla/4.76");

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)

{

System.out.println("VortexEngine: Server TOPZONE is offline or something is wrong in link.");

}

 

return votes;

}

 

public static void hopvote(final L2PcInstance player)

{

if (isVoting())

{

player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Someone is already voting.Wait for your turn please!"));

return;

}

 

if (VoteConfig.ENABLE_TRIES)

{

if (PlayerTable.getTries(player) <= 0)

{

player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Due to your multiple failures in voting you lost your chance to vote today"));

return;

}

}

 

setFirstvoteshop(getHopZoneVotes());

PlayerTable.loadLastVoteHopzone(player);

 

if ((getLastVoteCheck() + getVoteDelay()) < System.currentTimeMillis())

{

activateVoting(player, "hopzone");

ThreadPoolManager.getInstance().scheduleGeneral(new HopzoneVoteDelay(player), VoteConfig.SECS_TO_VOTE * 1000);

}

else

{

player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "12 hours have to pass till you are able to vote again."));

}

}

 

public static void topvote(final L2PcInstance player)

{

if (isVoting())

{

player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Someone is already voting.Wait for your turn please!"));

return;

}

 

if (VoteConfig.ENABLE_TRIES)

{

if (PlayerTable.getTries(player) <= 0)

{

player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Due to your multiple failures in voting you lost your chance to vote today"));

return;

}

}

 

setFirstvotestop(getTopZoneVotes());

PlayerTable.loadLastVoteTopzone(player);

 

if ((getLastVoteCheck() + getVoteDelay()) < System.currentTimeMillis())

{

activateVoting(player, "topzone");

ThreadPoolManager.getInstance().scheduleGeneral(new TopzoneVoteDelay(player), VoteConfig.SECS_TO_VOTE * 1000);

}

else

{

player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "12 hours have to pass till you are able to vote again."));

}

}

 

public static String whosVoting()

{

String voterName = "None";

if (!voterList.isEmpty())

{

voterName = voterList.getFirst();

}

return voterName;

}

 

private static void activateVoting(L2PcInstance player, String banner)

{

setisVoting(true);

player.sendPacket(new CreatureSay(0, Say2.TELL, "Server", "Go fast on the site and vote on the " + banner + " banner!"));

}

 

// Getters and Setters

public static boolean isVoting()

{

return isVoting;

}

 

public static void setisVoting(boolean _isVoting)

{

VoteMain.isVoting = _isVoting;

}

 

public static int getFirstvoteshop()

{

return firstvoteshop;

}

 

public static void setFirstvoteshop(int firstvoteshop)

{

VoteMain.firstvoteshop = firstvoteshop;

}

 

public static int getFirstvotestop()

{

return firstvotestop;

}

 

public static void setFirstvotestop(int firstvotestop)

{

VoteMain.firstvotestop = firstvotestop;

}

 

public static long getLastVoteCheck()

{

return lastVoteCheck;

}

 

public static void setLastVoteCheck(long lastVoteCheck)

{

VoteMain.lastVoteCheck = lastVoteCheck;

}

 

public static long getVoteDelay()

{

return voteDelay;

}

12 answers to this question

Recommended Posts

  • 0
Posted

 

there is no prob with consoles....
i want give reward every 5 votes at hopzone and topzone .. can some1 help me? :)

I guess is on your config....

Take a look there...

  • 0
Posted (edited)

u mean here? :)

 

 

 

I guess is on your config....

Take a look there...

package vortextengine;
 
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
 
public class VoteConfig
{
public static boolean ENABLE_TRIES;
public static String VOTE_LINK_HOPZONE;
public static String VOTE_LINK_TOPZONE;
public static int SERVER_ID;
public static int VOTE_REWARD_ID1;
public static int VOTE_REWARD_AMOUNT1;
public static int SECS_TO_VOTE;
public static int EXTRA_REW_VOTE_AM;
 
public static void loadConfigs()
{
try
{
Properties prop = new Properties();
prop.load(new FileInputStream(new File("config/custom/VortexEngine.properties")));
 
ENABLE_TRIES = Boolean.parseBoolean(prop.getProperty("EnableTries", "true"));
VOTE_LINK_HOPZONE = prop.getProperty("HopzoneUrl", "null");
VOTE_LINK_TOPZONE = prop.getProperty("TopzoneUrl", "null");
SERVER_ID = Integer.parseInt(prop.getProperty("ServerId", "1"));
VOTE_REWARD_ID1 = Integer.parseInt(prop.getProperty("VoteRewardId1", "300"));
VOTE_REWARD_AMOUNT1 = Integer.parseInt(prop.getProperty("VoteRewardAmount1", "300"));
SECS_TO_VOTE = Integer.parseInt(prop.getProperty("SecondsToVote", "60"));
EXTRA_REW_VOTE_AM = Integer.parseInt(prop.getProperty("ExtraRewVoteAm", "20"));
}
catch (Exception e)
{
System.out.println("Error while loading Vortex Engine settings!");
}
}
}
Edited by blademarios
  • 0
Posted (edited)

You must to edit this from gameserver files/config
No inside on eclipse..

 

Also, this is the amount of vote. But you have to change it from config of gameserver files.

VOTE_REWARD_AMOUNT1 = Integer.parseInt(prop.getProperty("VoteRewardAmount1", "300"));

 

Go at Workspace/Your server name/gameserver/config and find the vote property.

You had already this code in your pack?

If you put this code, then you have to pass and config.

Edited by 'Baggos'
  • 0
Posted

You must to edit this from gameserver files/config

No inside on eclipse..

 

Also, this is the amount of vote. But you have to change it from config of gameserver files.

VOTE_REWARD_AMOUNT1 = Integer.parseInt(prop.getProperty("VoteRewardAmount1", "300"));

 

Go at Workspace/Your server name/gameserver/config and find the vote property.

You had already this code in your pack?

If you put this code, then you have to pass and config.

 

maybe you can add me one min at skype to help me? xristosmpou@hotmail.com

  • 0
Posted

maybe you can add me one min at skype to help me? xristosmpou@hotmail.com

I can't to give you help for something like this... Because this is not problem.. You just must to understand some things...

It is easy... I'll talk you in greek..

 

[GR]

Τι project χρησιμοποιείς?

Επίσης, ο κώδικας ήταν ήδη στο project σου ή εσύ τον πέρασες?

Αν ήταν ήδη, τότε θα πρέπει να υπάρχει κάποιο config με το όνομα "prob".

Εκεί μέσα θα υπάρχει το "VoteRewardAmount1". Απλά βάλε τα πόσα Votes θες να δίνει...

  • 0
Posted

I can't to give you help for something like this... Because this is not problem.. You just must to understand some things...

It is easy... I'll talk you in greek..

 

[GR]

Τι project χρησιμοποιείς?

Επίσης, ο κώδικας ήταν ήδη στο project σου ή εσύ τον πέρασες?

Αν ήταν ήδη, τότε θα πρέπει να υπάρχει κάποιο config με το όνομα "prob".

Εκεί μέσα θα υπάρχει το "VoteRewardAmount1". Απλά βάλε τα πόσα Votes θες να δίνει...

 

 

ekana oti mou eipes  alla den douleuei :) an mporouses ligo na me kaneis add sto skype na mou deikseis na ma8w kai egw tha sou eixa upoxrewsei :)

  • 0
Posted

ma pos na dulepsi? :O oute to code tou hopzone oute t topzone dn ine sosto pia.. exoun allaksi.

 

dokimase afto

package vortextengine;
 
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
 
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.clientpackets.Say2;
import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
 
import vortextengine.datatables.PlayerTable;
import vortextengine.tasks.HopzoneVoteDelay;
import vortextengine.tasks.MonthlyResetTask;
import vortextengine.tasks.TopzoneVoteDelay;
import vortextengine.tasks.TriesResetTask;
 
import javolution.util.FastList;
 
 
public class VoteMain
{
public static FastList<String> voterList = new FastList<String>();
private static boolean isVoting;
public static int firstvoteshop;
public static int firstvotestop;
public static long lastVoteCheck = 0L;
public static long voteDelay = 43200000L;
 
public VoteMain()
{
}
 
public static void load()
{
System.out.println("Vote Reward System Started Successfully.");
VoteConfig.loadConfigs();
TriesResetTask.getInstance();
MonthlyResetTask.getInstance();
}
 
public static int getHopZoneVotes()
{
InputStreamReader isr = null;
BufferedReader br = null;

try
{
if(!VoteConfig.VOTE_LINK_HOPZONE.endsWith(".html"))
VoteConfig.VOTE_LINK_HOPZONE+=".html";

URLConnection con = new URL(VoteConfig.VOTE_LINK_HOPZONE).openConnection();


con.addRequestProperty("User-L2Hopzone", "Mozilla/4.76");
isr = new InputStreamReader(con.getInputStream());
br = new BufferedReader(isr);

String line;
while ((line = br.readLine()) != null)
{
if (line.contains("no steal make love")||line.contains("no votes here")||line.contains("bang, you don't have votes")|| line.contains("la vita e bella"))
{
int votes = Integer.valueOf(line.split(">")[2].replace("</span", ""));

return votes;
}
}

br.close();
isr.close();
}
catch (Exception e)
{
System.out.println("[VoteRewardManager]: Problem occured while getting Hopzone votes. Error Trace: " + e.getMessage());
}
return -1;
}
 
public 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(VoteConfig.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)
{
System.out.println("VortexEngine: Server TOPZONE is offline or something is wrong in link.");
}
 
return votes;
}
 
public static void hopvote(final L2PcInstance player)
{
if (isVoting())
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Someone is already voting.Wait for your turn please!"));
return;
}
 
if (VoteConfig.ENABLE_TRIES)
{
if (PlayerTable.getTries(player) <= 0)
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Due to your multiple failures in voting you lost your chance to vote today"));
return;
}
}
 
setFirstvoteshop(getHopZoneVotes());
PlayerTable.loadLastVoteHopzone(player);
 
if ((getLastVoteCheck() + getVoteDelay()) < System.currentTimeMillis())
{
activateVoting(player, "hopzone");
ThreadPoolManager.getInstance().scheduleGeneral(new HopzoneVoteDelay(player), VoteConfig.SECS_TO_VOTE * 1000);
}
else
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "12 hours have to pass till you are able to vote again."));
}
}
 
public static void topvote(final L2PcInstance player)
{
if (isVoting())
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Someone is already voting.Wait for your turn please!"));
return;
}
 
if (VoteConfig.ENABLE_TRIES)
{
if (PlayerTable.getTries(player) <= 0)
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Due to your multiple failures in voting you lost your chance to vote today"));
return;
}
}
 
setFirstvotestop(getTopZoneVotes());
PlayerTable.loadLastVoteTopzone(player);
 
if ((getLastVoteCheck() + getVoteDelay()) < System.currentTimeMillis())
{
activateVoting(player, "topzone");
ThreadPoolManager.getInstance().scheduleGeneral(new TopzoneVoteDelay(player), VoteConfig.SECS_TO_VOTE * 1000);
}
else
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "12 hours have to pass till you are able to vote again."));
}
}
 
public static String whosVoting()
{
String voterName = "None";
if (!voterList.isEmpty())
{
voterName = voterList.getFirst();
}
return voterName;
}
 
private static void activateVoting(L2PcInstance player, String banner)
{
setisVoting(true);
player.sendPacket(new CreatureSay(0, Say2.TELL, "Server", "Go fast on the site and vote on the " + banner + " banner!"));
}
 
// Getters and Setters
public static boolean isVoting()
{
return isVoting;
}
 
public static void setisVoting(boolean _isVoting)
{
VoteMain.isVoting = _isVoting;
}
 
public static int getFirstvoteshop()
{
return firstvoteshop;
}
 
public static void setFirstvoteshop(int firstvoteshop)
{
VoteMain.firstvoteshop = firstvoteshop;
}
 
public static int getFirstvotestop()
{
return firstvotestop;
}
 
public static void setFirstvotestop(int firstvotestop)
{
VoteMain.firstvotestop = firstvotestop;
}
 
public static long getLastVoteCheck()
{
return lastVoteCheck;
}
 
public static void setLastVoteCheck(long lastVoteCheck)
{
VoteMain.lastVoteCheck = lastVoteCheck;
}
 
public static long getVoteDelay()
{
return voteDelay;
}

  • 0
Posted

re c se pio java na to perasw eksigise mou ligo gt eimai new ston xwro :)



package vortextengine;
 
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
 
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.clientpackets.Say2;
import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
 
import vortextengine.datatables.PlayerTable;
import vortextengine.tasks.HopzoneVoteDelay;
import vortextengine.tasks.MonthlyResetTask;
import vortextengine.tasks.TopzoneVoteDelay;
import vortextengine.tasks.TriesResetTask;
 
import javolution.util.FastList;
 
 
public class VoteMain
{
public static FastList<String> voterList = new FastList<String>();
private static boolean isVoting;
public static int firstvoteshop;
public static int firstvotestop;
public static long lastVoteCheck = 0L;
public static long voteDelay = 43200000L;
 
public VoteMain()
{
}
 
public static void load()
{
System.out.println("Vote Reward System Started Successfully.");
VoteConfig.loadConfigs();
TriesResetTask.getInstance();
MonthlyResetTask.getInstance();
}
 
public static int getHopZoneVotes()
{
InputStreamReader isr = null;
BufferedReader br = null;

try
{
if(!VoteConfig.VOTE_LINK_HOPZONE.endsWith(".html"))
VoteConfig.VOTE_LINK_HOPZONE+=".html";

URLConnection con = new URL(VoteConfig.VOTE_LINK_HOPZONE).openConnection();


con.addRequestProperty("User-L2Hopzone", "Mozilla/4.76");
isr = new InputStreamReader(con.getInputStream());
br = new BufferedReader(isr);

String line;
while ((line = br.readLine()) != null)
{
if (line.contains("no steal make love")||line.contains("no votes here")||line.contains("bang, you don't have votes")|| line.contains("la vita e bella"))
{
int votes = Integer.valueOf(line.split(">")[2].replace("</span", ""));

return votes;
}
}

br.close();
isr.close();
}
catch (Exception e)
{
System.out.println("[VoteRewardManager]: Problem occured while getting Hopzone votes. Error Trace: " + e.getMessage());
}
return -1;
}
 
public 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(VoteConfig.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)
{
System.out.println("VortexEngine: Server TOPZONE is offline or something is wrong in link.");
}
 
return votes;
}
 
public static void hopvote(final L2PcInstance player)
{
if (isVoting())
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Someone is already voting.Wait for your turn please!"));
return;
}
 
if (VoteConfig.ENABLE_TRIES)
{
if (PlayerTable.getTries(player) <= 0)
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Due to your multiple failures in voting you lost your chance to vote today"));
return;
}
}
 
setFirstvoteshop(getHopZoneVotes());
PlayerTable.loadLastVoteHopzone(player);
 
if ((getLastVoteCheck() + getVoteDelay()) < System.currentTimeMillis())
{
activateVoting(player, "hopzone");
ThreadPoolManager.getInstance().scheduleGeneral(new HopzoneVoteDelay(player), VoteConfig.SECS_TO_VOTE * 1000);
}
else
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "12 hours have to pass till you are able to vote again."));
}
}
 
public static void topvote(final L2PcInstance player)
{
if (isVoting())
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Someone is already voting.Wait for your turn please!"));
return;
}
 
if (VoteConfig.ENABLE_TRIES)
{
if (PlayerTable.getTries(player) <= 0)
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Due to your multiple failures in voting you lost your chance to vote today"));
return;
}
}
 
setFirstvotestop(getTopZoneVotes());
PlayerTable.loadLastVoteTopzone(player);
 
if ((getLastVoteCheck() + getVoteDelay()) < System.currentTimeMillis())
{
activateVoting(player, "topzone");
ThreadPoolManager.getInstance().scheduleGeneral(new TopzoneVoteDelay(player), VoteConfig.SECS_TO_VOTE * 1000);
}
else
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "12 hours have to pass till you are able to vote again."));
}
}
 
public static String whosVoting()
{
String voterName = "None";
if (!voterList.isEmpty())
{
voterName = voterList.getFirst();
}
return voterName;
}
 
private static void activateVoting(L2PcInstance player, String banner)
{
setisVoting(true);
player.sendPacket(new CreatureSay(0, Say2.TELL, "Server", "Go fast on the site and vote on the " + banner + " banner!"));
}
 
// Getters and Setters
public static boolean isVoting()
{
return isVoting;
}
 
public static void setisVoting(boolean _isVoting)
{
VoteMain.isVoting = _isVoting;
}
 
public static int getFirstvoteshop()
{
return firstvoteshop;
}
 
public static void setFirstvoteshop(int firstvoteshop)
{
VoteMain.firstvoteshop = firstvoteshop;
}
 
public static int getFirstvotestop()
{
return firstvotestop;
}
 
public static void setFirstvotestop(int firstvotestop)
{
VoteMain.firstvotestop = firstvotestop;
}
 
public static long getLastVoteCheck()
{
return lastVoteCheck;
}
 
public static void setLastVoteCheck(long lastVoteCheck)
{
VoteMain.lastVoteCheck = lastVoteCheck;
}
 
public static long getVoteDelay()
{
return voteDelay;
}

  • 0
Posted

 

re c se pio java na to perasw eksigise mou ligo gt eimai new ston xwro :)

 

package vortextengine;
 
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
 
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.clientpackets.Say2;
import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
 
import vortextengine.datatables.PlayerTable;
import vortextengine.tasks.HopzoneVoteDelay;
import vortextengine.tasks.MonthlyResetTask;
import vortextengine.tasks.TopzoneVoteDelay;
import vortextengine.tasks.TriesResetTask;
 
import javolution.util.FastList;
 
 
public class VoteMain
{
public static FastList<String> voterList = new FastList<String>();
private static boolean isVoting;
public static int firstvoteshop;
public static int firstvotestop;
public static long lastVoteCheck = 0L;
public static long voteDelay = 43200000L;
 
public VoteMain()
{
}
 
public static void load()
{
System.out.println("Vote Reward System Started Successfully.");
VoteConfig.loadConfigs();
TriesResetTask.getInstance();
MonthlyResetTask.getInstance();
}
 
public static int getHopZoneVotes()
{
InputStreamReader isr = null;
BufferedReader br = null;

try
{
if(!VoteConfig.VOTE_LINK_HOPZONE.endsWith(".html"))
VoteConfig.VOTE_LINK_HOPZONE+=".html";

URLConnection con = new URL(VoteConfig.VOTE_LINK_HOPZONE).openConnection();


con.addRequestProperty("User-L2Hopzone", "Mozilla/4.76");
isr = new InputStreamReader(con.getInputStream());
br = new BufferedReader(isr);

String line;
while ((line = br.readLine()) != null)
{
if (line.contains("no steal make love")||line.contains("no votes here")||line.contains("bang, you don't have votes")|| line.contains("la vita e bella"))
{
int votes = Integer.valueOf(line.split(">")[2].replace("</span", ""));

return votes;
}
}

br.close();
isr.close();
}
catch (Exception e)
{
System.out.println("[VoteRewardManager]: Problem occured while getting Hopzone votes. Error Trace: " + e.getMessage());
}
return -1;
}
 
public 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(VoteConfig.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)
{
System.out.println("VortexEngine: Server TOPZONE is offline or something is wrong in link.");
}
 
return votes;
}
 
public static void hopvote(final L2PcInstance player)
{
if (isVoting())
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Someone is already voting.Wait for your turn please!"));
return;
}
 
if (VoteConfig.ENABLE_TRIES)
{
if (PlayerTable.getTries(player) <= 0)
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Due to your multiple failures in voting you lost your chance to vote today"));
return;
}
}
 
setFirstvoteshop(getHopZoneVotes());
PlayerTable.loadLastVoteHopzone(player);
 
if ((getLastVoteCheck() + getVoteDelay()) < System.currentTimeMillis())
{
activateVoting(player, "hopzone");
ThreadPoolManager.getInstance().scheduleGeneral(new HopzoneVoteDelay(player), VoteConfig.SECS_TO_VOTE * 1000);
}
else
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "12 hours have to pass till you are able to vote again."));
}
}
 
public static void topvote(final L2PcInstance player)
{
if (isVoting())
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Someone is already voting.Wait for your turn please!"));
return;
}
 
if (VoteConfig.ENABLE_TRIES)
{
if (PlayerTable.getTries(player) <= 0)
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "Due to your multiple failures in voting you lost your chance to vote today"));
return;
}
}
 
setFirstvotestop(getTopZoneVotes());
PlayerTable.loadLastVoteTopzone(player);
 
if ((getLastVoteCheck() + getVoteDelay()) < System.currentTimeMillis())
{
activateVoting(player, "topzone");
ThreadPoolManager.getInstance().scheduleGeneral(new TopzoneVoteDelay(player), VoteConfig.SECS_TO_VOTE * 1000);
}
else
{
player.sendPacket(new CreatureSay(0, Say2.ALLIANCE, "Server", "12 hours have to pass till you are able to vote again."));
}
}
 
public static String whosVoting()
{
String voterName = "None";
if (!voterList.isEmpty())
{
voterName = voterList.getFirst();
}
return voterName;
}
 
private static void activateVoting(L2PcInstance player, String banner)
{
setisVoting(true);
player.sendPacket(new CreatureSay(0, Say2.TELL, "Server", "Go fast on the site and vote on the " + banner + " banner!"));
}
 
// Getters and Setters
public static boolean isVoting()
{
return isVoting;
}
 
public static void setisVoting(boolean _isVoting)
{
VoteMain.isVoting = _isVoting;
}
 
public static int getFirstvoteshop()
{
return firstvoteshop;
}
 
public static void setFirstvoteshop(int firstvoteshop)
{
VoteMain.firstvoteshop = firstvoteshop;
}
 
public static int getFirstvotestop()
{
return firstvotestop;
}
 
public static void setFirstvotestop(int firstvotestop)
{
VoteMain.firstvotestop = firstvotestop;
}
 
public static long getLastVoteCheck()
{
return lastVoteCheck;
}
 
public static void setLastVoteCheck(long lastVoteCheck)
{
VoteMain.lastVoteCheck = lastVoteCheck;
}
 
public static long getVoteDelay()
{
return voteDelay;
}

 

ti na s po dn ksero pos ine to code s..

diegrapse to file p mas anevases emas k perase afto

  • 0
Posted

 

re c se pio java na to perasw eksigise mou ligo gt eimai new ston xwro :)

 

Τον κώδικα που ανέβασες εδώ, τον έχεις περάσει? ή απλά θέλεις να τον περάσεις?

Επίσης, μήπως χρησιμοποιείς l2jfrozen? Επειδή έχει ήδη μέσα Vote reward system.

  • 0
Posted

Τον κώδικα που ανέβασες εδώ, τον έχεις περάσει? ή απλά θέλεις να τον περάσεις?

Επίσης, μήπως χρησιμοποιείς l2jfrozen? Επειδή έχει ήδη μέσα Vote reward system.

l2jfrozen einai to pack alla den kserw akrivws pos na to kanw to vote system :)

  • 0
Posted

l2jfrozen einai to pack alla den kserw akrivws pos na to kanw to vote system :)

Πήγαινε gameserver/config/powerpak και άνοιξε με επεξεργασία το powerpak.properties

Εκεί μέσα θα δεις:

 

# Automatic Vote Reward System
VoteRewardSystem= False
VotesRequiredForReward = 50
VotesSystemInitialDelay= 60000
VotesSystemStepDelay= 1800000
VotesRewards= 6392,20;

# Leave empty to disable one site
#
# Hopzone: http://l2.hopzone.net
VotesSiteHopZoneUrl =
# Topzone: http://l2topzone.com
VotesSiteTopZoneUrl =
# L2Network: http://l2network.eu
VotesSiteL2NetworkUrl =
# Put your website url
ServerWebSite = http://www.l2jfrozen.com

Και αρχίζεις,

VoteRewardSystem= False το κάνεις True

VotesRequiredForReward = 50 βάζεις στα πόσα votes θες να δίνει reward

VotesRewards= 6392,20; το id από το item που θες στην θέση του 6392 και το πόσα τέτοια να πετάει στη θέση του 20

 

# Hopzone: http://l2.hopzone.net

VotesSiteHopZoneUrl = το link σου από το hopzone

# Topzone: http://l2topzone.com

VotesSiteTopZoneUrl = το link σου από το topzone

# L2Network: http://l2network.eu

VotesSiteL2NetworkUrl = το link σου από το l2network

 

ServerWebSite = http://www.l2jfrozen.comεδώ βάζεις το link της σελίδας σου.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • @Darafamboos let him know that this is already shared
    • Selling for 35 us umodel that opens any ukx , utx and static meshes from samurai updat 542 protocol . Leave me a pm if needed. 
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • NEW HIDDENSTASH KEY SYSTEM INTRODUCED TO THE SITE   **Earn While You Spend - Introducing HS Cashback!**   Every purchase on our site now rewards you with **HS Keys cashback**   EVERY ONE WHO REGISTERS IN SITE UNTILL 15TH OF MAY GETS 2000 HS KEYS IN HES BALANE   Here's how it works:       **1 USD = 1000 HS Keys**   **Get 3% cashback** on every purchase   **Use your HS Keys to **save on your next order**   ---   ### ⚡ Why this is awesome   * Every order gives you value back   * Stack it with promos & HS usage   * Turn your spending into future discounts   ---   ### Example   Spend **$10** → Get **300 HS Keys** back   Spend **$50** → Get **1500 HS Keys** back   ---   ### Smart system (built for fairness)   * Cashback is rounded to keep things balanced   * Prevents abuse from tiny orders   * Rewards real buyers   ---   ### Start earning now   Every purchase = progress toward your next discount   Shop now and build your HS balance!   #cashback #gamingdeals #d2r #rewards #loyalty   Stay safe out there, heroes - and happy hunting! www.d2rhiddenstash.com     We just launched our new Affiliate Program — and it’s the easiest way to earn HS Keys.   Invite your friends using your personal link.   Example: If your friend spends $10 → you get 300 HS Keys No limits. No effort. Just share your link.   Get your referral link here: www.d2rhiddenstash.com/profile     Start earning today
    • It’s time for something new to rise. In a world filled with short-lived projects and empty promises, Emerge was created with a different vision — a vision built on experience, precision, and long-term commitment. This is not just another server launch. This is the beginning of something that is meant to last. 🌑 Eclipse x10 – A New Beginning Eclipse x10 is designed for players who seek more than just fast progression. It is built for those who value competition, balance, and a real Lineage II experience. From the very first day, every system has been carefully adjusted to provide a smooth and fair journey — where both solo players and clans can thrive. No shortcuts. No chaos. Only a structured and competitive world. ⚔️ What Awaits You • A balanced mid-rate environment (x10 core progression) • Stable and optimized gameplay • Fair systems with focus on long-term play • Competitive PvP and rewarding PvE • Active and dedicated administration • A project built with vision, not temporary hype 📊 Server Rates Basic: EXP/SP: x10 Adena: x5 Drop: x5 Spoil: x5 Secondary: Quests: x1 Seal Stones: x5 Life Stone Drop: x1 Enchant Scroll Drop: x1 Bosses: Raid Boss EXP/SP: x1 Raid Boss Drop: x1 Epic Boss EXP/SP: x1 Epic Boss Drop: x1 Enchant: Safe: +3 Max: +16 📅 Launch Information Grand Opening: 5 June 2026 The countdown has already begun. Clans are forming. Strategies are being prepared. The question is — will you be ready? 🔗 Join the Community Every strong server begins with a strong community. Be part of it from the very start. 💬 Discord: https://discord.gg/l2emerge 🌐 Website: https://www.l2emerge.com  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..