Jump to content

donek21

Members
  • Posts

    10
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

About donek21

Profile Information

  • Gender
    Not Telling

donek21's Achievements

Newbie

Newbie (1/16)

0

Reputation

  1. So this will not work anyway.. what should i do?
  2. Hello MxC! I add a java code about VoteReward System from Hopzone....and i get a error on GameServer Console.. I am using L2j interlude..Hope someone tell me what did i am doing wrong.. Here is the Game server Console Vote Count Check. java.io.IOException: Server returned HTTP response code: 403 for URL: http://l2. hopzone.net/lineage2/moreinfo/L2-aeron/94362.html at sun.net.[url=http://www.protocol.http.HttpURLConnection.getInputStream(Unknown]www.protocol.http.HttpURLConnection.getInputStream(Unknown[/url] So urce) at java.net.URL.openStream(Unknown Source) at net.sf.l2j.gameserver.model.AutoVoteRewardHandler.getVotes(AutoVoteRe wardHandler.java:105) at net.sf.l2j.gameserver.model.AutoVoteRewardHandler.access$100(AutoVote RewardHandler.java:40) at net.sf.l2j.gameserver.model.AutoVoteRewardHandler$AutoReward.run(Auto VoteRewardHandler.java:64) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask. access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask. run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) And here is the code that i'd use! Index: config/custom/L2JXtreme.ini =================================================================== --- config/custom/L2JXtreme.ini (revision 98) +++ config/custom/L2JXtreme.ini (working copy) @@ -139,3 +139,15 @@ # --------------------------------------- #Limit gm to enchant player item GMOverEnchant = 0 + +#------------------------------------# +# Vote System Config # +#------------------------------------# +# Html Patch for Your Vote Site +# Works with HopZone/HopZones/TopZone and other HopZone Like +# Sample: +VoteHtmlPatch = http://l2.hopzone.net/lineage2/moreinfo/RaidFightLowRatePvPServers/69262.html +VoteReward1Count = 1000 +VoteReward2Count = 1000 +VoteReward1Id = 57 +VoteReward2Id = 57 Index: java/net/sf/l2j/gameserver/model/AutoVoteRewardHandler.java =================================================================== --- java/net/sf/l2j/gameserver/model/AutoVoteRewardHandler.java (revision 0) +++ java/net/sf/l2j/gameserver/model/AutoVoteRewardHandler.java (revision 0) @@ -0,0 +1,181 @@ +/* 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 2, 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * http://www.gnu.org/copyleft/gpl.html + */ + +package net.sf.l2j.gameserver.model; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.Collection; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.Announcements; +import net.sf.l2j.gameserver.GmListTable; +import net.sf.l2j.gameserver.ThreadPoolManager; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.L2World; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; + +/** + * + * @author eXtr3me + * + */ +public class AutoVoteRewardHandler +{ + private int lastVoteCount = 0; + private int initialCheck = 60 * 1000; + private int delayForCheck = 300 * 1000; + private int votesForReward = 10; + private int maxRewardStack = 5; + + private AutoVoteRewardHandler() + { + System.out.println("Vote Reward System activated."); + ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), initialCheck, delayForCheck); + } + + private class AutoReward implements Runnable + { + public void run() + { + System.out.println("Vote Count Check."); + if (Config.VOTE_REWARD1_ID == 0 || Config.VOTE_REWARD1_COUNT == 0 || Config.VOTE_REWARD2_ID == 0 || Config.VOTE_REWARD2_COUNT == 0) + { + GmListTable.broadcastMessageToGMs("The rewards aren't Identified. Please take a look."); + return; + } + int newVoteCount = getVotes(Config.VOTE_HTML_PATCH); + System.out.println("newVoteCount:"+newVoteCount); + System.out.println("getLastVoteCount:"+getLastVoteCount()); + if (newVoteCount != 0 && getLastVoteCount() != 0 && newVoteCount >= getLastVoteCount() + votesForReward) + { + + Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); + for (L2PcInstance player : pls) + { + if (player != null) + { + L2ItemInstance item1 = player.getInventory().getItemByItemId(Config.VOTE_REWARD1_ID); + if (item1 == null || item1.getCount() < maxRewardStack) + { + player.addItem("reward", Config.VOTE_REWARD1_ID, Config.VOTE_REWARD1_COUNT, player, true); + } + L2ItemInstance item2 = player.getInventory().getItemByItemId(Config.VOTE_REWARD2_ID); + if (item2 == null || item2.getCount() < maxRewardStack) + { + player.addItem("reward", Config.VOTE_REWARD2_ID, Config.VOTE_REWARD2_COUNT, player, true); + } + } + } + setLastVoteCount(getLastVoteCount()+ votesForReward); + } + Announcements.getInstance().announceToAll("Our Current vote count is: " + newVoteCount); + Announcements.getInstance().announceToAll("The next reward will be given at " + (getLastVoteCount()+ votesForReward) + " Votes."); + if (getLastVoteCount() == 0) + { + setLastVoteCount(newVoteCount); + } + } + } + + private int getVotes(String urlString) + { + InputStreamReader isr = null; + BufferedReader in = null; + try + { + URL url = new URL(urlString); + isr = new InputStreamReader(url.openStream()); + in = new BufferedReader(isr); + String inputLine; + int voteCount = 0; + while ((inputLine = in.readLine()) != null) + { + if (inputLine.contains("rank anonymous tooltip")) + { + int Sub = 12; + switch (inputLine.length()) + { + case 116: + Sub = 13; + break; + case 117: + Sub = 14; + break; + case 118: + Sub = 15; + break; + case 119: + Sub = 16; + break; + } + voteCount = Integer.valueOf(inputLine.split(">")[2].replace("</span", "")); + break; + } + } + return voteCount; + } + catch (IOException e) + { + e.printStackTrace(); + return 0; + } + finally + { + try + { + in.close(); + } + catch (IOException e) + { + + } + try + { + isr.close(); + } + catch (IOException e) + { + + } + } + } + + private void setLastVoteCount(int voteCount) + { + lastVoteCount = voteCount; + } + + private int getLastVoteCount() + { + return lastVoteCount; + } + + public static AutoVoteRewardHandler getInstance() + { + return SingletonHolder._instance; + } + + @SuppressWarnings("synthetic-access") + private static class SingletonHolder + { + protected static final AutoVoteRewardHandler _instance = new AutoVoteRewardHandler(); + } +} Index: java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- java/net/sf/l2j/gameserver/GameServer.java (revision 104) +++ java/net/sf/l2j/gameserver/GameServer.java (working copy) @@ -93,6 +93,7 @@ import net.sf.l2j.gameserver.instancemanager.SiegeManager; import net.sf.l2j.gameserver.model.AutoChatHandler; import net.sf.l2j.gameserver.model.AutoSpawnHandler; +import net.sf.l2j.gameserver.model.AutoVoteRewardHandler; import net.sf.l2j.gameserver.model.L2Manor; import net.sf.l2j.gameserver.model.L2PetDataTable; import net.sf.l2j.gameserver.model.L2World; @@ -378,6 +379,7 @@ SkillHandlerRegister.getInstance().loadHandlers(); UserCommandHandlerRegister.getInstance().loadHandlers(); VoiceCommandHandlerRegister.getInstance().loadHandlers(); + AutoVoteRewardHandler.getInstance(); if(Config.L2JMOD_ALLOW_WEDDING) CoupleManager.getInstance(); Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 99) +++ java/net/sf/l2j/Config.java (working copy) @@ -111,6 +111,13 @@ public static int CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN = 1; // default 1 public static int CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN = 5; // default 5 + //Vote Reward + public static String VOTE_HTML_PATCH; + public static int VOTE_REWARD1_ID; + public static int VOTE_REWARD2_ID; + public static int VOTE_REWARD1_COUNT; + public static int VOTE_REWARD2_COUNT; + /** Debug/release mode */ public static boolean DEBUG; /** Enable/disable assertions */ @@ -1645,6 +1652,11 @@ OLYMPIAD_GIVE_HASTE_FIGHTERS = Boolean.parseBoolean(L2JXtremeSettings.getProperty("OlympiadGiveHasteFighters","true")); OLYMPIAD_ACUMEN_LVL = Integer.parseInt(L2JXtremeSettings.getProperty("OlympiadAcumenLvl", "1")); OLYMPIAD_HASTE_LVL = Integer.parseInt(L2JXtremeSettings.getProperty("OlympiadHasteLvl", "2")); + VOTE_HTML_PATCH = L2JXtremeSettings.getProperty("VoteHtmlPatch", "Null"); + VOTE_REWARD1_COUNT = Integer.parseInt(L2JXtremeSettings.getProperty("VoteReward1Count", "1000")); + VOTE_REWARD2_COUNT = Integer.parseInt(L2JXtremeSettings.getProperty("VoteReward2Count", "1000")); + VOTE_REWARD1_ID = Integer.parseInt(L2JXtremeSettings.getProperty("VoteReward1Id", "57")); + VOTE_REWARD2_ID = Integer.parseInt(L2JXtremeSettings.getProperty("VoteReward2Id", "57")); } catch (Exception e) { *Just want to mention that the link that i use for L2-aeron is just for test...i have no business with this server!
  3. Kalispera MxC! Perasa ena java code gia VoteReward kai mou bgazei auto p tha deite parakato stin eikona sto Gameserver Console..an borei kapoios na m pei ti lathos kanw... Xrhsimopiw L2j Interlude! Vote Count Check. java.io.IOException: Server returned HTTP response code: 403 for URL: http://l2. hopzone.net/lineage2/moreinfo/L2-aeron/94362.html at sun.net.[url=http://www.protocol.http.HttpURLConnection.getInputStream(Unknown]www.protocol.http.HttpURLConnection.getInputStream(Unknown[/url] So urce) at java.net.URL.openStream(Unknown Source) at net.sf.l2j.gameserver.model.AutoVoteRewardHandler.getVotes(AutoVoteRe wardHandler.java:105) at net.sf.l2j.gameserver.model.AutoVoteRewardHandler.access$100(AutoVote RewardHandler.java:40) at net.sf.l2j.gameserver.model.AutoVoteRewardHandler$AutoReward.run(Auto VoteRewardHandler.java:64) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask. access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask. run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) O kodikos pou perasa einai o parakato... Index: config/custom/L2JXtreme.ini =================================================================== --- config/custom/L2JXtreme.ini (revision 98) +++ config/custom/L2JXtreme.ini (working copy) @@ -139,3 +139,15 @@ # --------------------------------------- #Limit gm to enchant player item GMOverEnchant = 0 + +#------------------------------------# +# Vote System Config # +#------------------------------------# +# Html Patch for Your Vote Site +# Works with HopZone/HopZones/TopZone and other HopZone Like +# Sample: +VoteHtmlPatch = http://l2.hopzone.net/lineage2/moreinfo/RaidFightLowRatePvPServers/69262.html +VoteReward1Count = 1000 +VoteReward2Count = 1000 +VoteReward1Id = 57 +VoteReward2Id = 57 Index: java/net/sf/l2j/gameserver/model/AutoVoteRewardHandler.java =================================================================== --- java/net/sf/l2j/gameserver/model/AutoVoteRewardHandler.java (revision 0) +++ java/net/sf/l2j/gameserver/model/AutoVoteRewardHandler.java (revision 0) @@ -0,0 +1,181 @@ +/* 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 2, 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * http://www.gnu.org/copyleft/gpl.html + */ + +package net.sf.l2j.gameserver.model; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.Collection; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.Announcements; +import net.sf.l2j.gameserver.GmListTable; +import net.sf.l2j.gameserver.ThreadPoolManager; +import net.sf.l2j.gameserver.model.L2ItemInstance; +import net.sf.l2j.gameserver.model.L2World; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; + +/** + * + * @author eXtr3me + * + */ +public class AutoVoteRewardHandler +{ + private int lastVoteCount = 0; + private int initialCheck = 60 * 1000; + private int delayForCheck = 300 * 1000; + private int votesForReward = 10; + private int maxRewardStack = 5; + + private AutoVoteRewardHandler() + { + System.out.println("Vote Reward System activated."); + ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), initialCheck, delayForCheck); + } + + private class AutoReward implements Runnable + { + public void run() + { + System.out.println("Vote Count Check."); + if (Config.VOTE_REWARD1_ID == 0 || Config.VOTE_REWARD1_COUNT == 0 || Config.VOTE_REWARD2_ID == 0 || Config.VOTE_REWARD2_COUNT == 0) + { + GmListTable.broadcastMessageToGMs("The rewards aren't Identified. Please take a look."); + return; + } + int newVoteCount = getVotes(Config.VOTE_HTML_PATCH); + System.out.println("newVoteCount:"+newVoteCount); + System.out.println("getLastVoteCount:"+getLastVoteCount()); + if (newVoteCount != 0 && getLastVoteCount() != 0 && newVoteCount >= getLastVoteCount() + votesForReward) + { + + Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); + for (L2PcInstance player : pls) + { + if (player != null) + { + L2ItemInstance item1 = player.getInventory().getItemByItemId(Config.VOTE_REWARD1_ID); + if (item1 == null || item1.getCount() < maxRewardStack) + { + player.addItem("reward", Config.VOTE_REWARD1_ID, Config.VOTE_REWARD1_COUNT, player, true); + } + L2ItemInstance item2 = player.getInventory().getItemByItemId(Config.VOTE_REWARD2_ID); + if (item2 == null || item2.getCount() < maxRewardStack) + { + player.addItem("reward", Config.VOTE_REWARD2_ID, Config.VOTE_REWARD2_COUNT, player, true); + } + } + } + setLastVoteCount(getLastVoteCount()+ votesForReward); + } + Announcements.getInstance().announceToAll("Our Current vote count is: " + newVoteCount); + Announcements.getInstance().announceToAll("The next reward will be given at " + (getLastVoteCount()+ votesForReward) + " Votes."); + if (getLastVoteCount() == 0) + { + setLastVoteCount(newVoteCount); + } + } + } + + private int getVotes(String urlString) + { + InputStreamReader isr = null; + BufferedReader in = null; + try + { + URL url = new URL(urlString); + isr = new InputStreamReader(url.openStream()); + in = new BufferedReader(isr); + String inputLine; + int voteCount = 0; + while ((inputLine = in.readLine()) != null) + { + if (inputLine.contains("rank anonymous tooltip")) + { + int Sub = 12; + switch (inputLine.length()) + { + case 116: + Sub = 13; + break; + case 117: + Sub = 14; + break; + case 118: + Sub = 15; + break; + case 119: + Sub = 16; + break; + } + voteCount = Integer.valueOf(inputLine.split(">")[2].replace("</span", "")); + break; + } + } + return voteCount; + } + catch (IOException e) + { + e.printStackTrace(); + return 0; + } + finally + { + try + { + in.close(); + } + catch (IOException e) + { + + } + try + { + isr.close(); + } + catch (IOException e) + { + + } + } + } + + private void setLastVoteCount(int voteCount) + { + lastVoteCount = voteCount; + } + + private int getLastVoteCount() + { + return lastVoteCount; + } + + public static AutoVoteRewardHandler getInstance() + { + return SingletonHolder._instance; + } + + @SuppressWarnings("synthetic-access") + private static class SingletonHolder + { + protected static final AutoVoteRewardHandler _instance = new AutoVoteRewardHandler(); + } +} Index: java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- java/net/sf/l2j/gameserver/GameServer.java (revision 104) +++ java/net/sf/l2j/gameserver/GameServer.java (working copy) @@ -93,6 +93,7 @@ import net.sf.l2j.gameserver.instancemanager.SiegeManager; import net.sf.l2j.gameserver.model.AutoChatHandler; import net.sf.l2j.gameserver.model.AutoSpawnHandler; +import net.sf.l2j.gameserver.model.AutoVoteRewardHandler; import net.sf.l2j.gameserver.model.L2Manor; import net.sf.l2j.gameserver.model.L2PetDataTable; import net.sf.l2j.gameserver.model.L2World; @@ -378,6 +379,7 @@ SkillHandlerRegister.getInstance().loadHandlers(); UserCommandHandlerRegister.getInstance().loadHandlers(); VoiceCommandHandlerRegister.getInstance().loadHandlers(); + AutoVoteRewardHandler.getInstance(); if(Config.L2JMOD_ALLOW_WEDDING) CoupleManager.getInstance(); Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 99) +++ java/net/sf/l2j/Config.java (working copy) @@ -111,6 +111,13 @@ public static int CLIENT_PACKET_QUEUE_MAX_UNDERFLOWS_PER_MIN = 1; // default 1 public static int CLIENT_PACKET_QUEUE_MAX_UNKNOWN_PER_MIN = 5; // default 5 + //Vote Reward + public static String VOTE_HTML_PATCH; + public static int VOTE_REWARD1_ID; + public static int VOTE_REWARD2_ID; + public static int VOTE_REWARD1_COUNT; + public static int VOTE_REWARD2_COUNT; + /** Debug/release mode */ public static boolean DEBUG; /** Enable/disable assertions */ @@ -1645,6 +1652,11 @@ OLYMPIAD_GIVE_HASTE_FIGHTERS = Boolean.parseBoolean(L2JXtremeSettings.getProperty("OlympiadGiveHasteFighters","true")); OLYMPIAD_ACUMEN_LVL = Integer.parseInt(L2JXtremeSettings.getProperty("OlympiadAcumenLvl", "1")); OLYMPIAD_HASTE_LVL = Integer.parseInt(L2JXtremeSettings.getProperty("OlympiadHasteLvl", "2")); + VOTE_HTML_PATCH = L2JXtremeSettings.getProperty("VoteHtmlPatch", "Null"); + VOTE_REWARD1_COUNT = Integer.parseInt(L2JXtremeSettings.getProperty("VoteReward1Count", "1000")); + VOTE_REWARD2_COUNT = Integer.parseInt(L2JXtremeSettings.getProperty("VoteReward2Count", "1000")); + VOTE_REWARD1_ID = Integer.parseInt(L2JXtremeSettings.getProperty("VoteReward1Id", "57")); + VOTE_REWARD2_ID = Integer.parseInt(L2JXtremeSettings.getProperty("VoteReward2Id", "57")); } catch (Exception e) { *na episimano to link p ehw valei gia to L2-aeron einai apla gia test..dn ehw kamia shesh me ton server! Euxaristw polu!
  4. Kalispera,eimai oloi mera sto search kai dn katafera na brw lish sto probilma mou....eida episis pos polu ehoun to idio provlima.. Prospathw na ftiaksw ena multisell pou p.x. na deis ena Draconic Bow+5 kai na perneis ena Draconic Bow - Focus +5 dld na mn xaneis to enchant sou. Otan paw kai bazw maintainEnchantment = true apla mou leei Incorrect item count..... to pack mou einai L2j Interlude.. eyxaristw.
  5. to AM-beep- to ehw aferesei apo pantou gt mou ebgaze error.. to pack einai L2j.. etci to ehw perasei.. Index: I:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- I:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 3645) +++ I:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -5656,6 +5656,96 @@ //PvP counts as xp after level 80. public void increaseLevelFromPvPs(int pvpKills) { if (getLevel() <= 80) return; { if (Config.ALLOW_PVP_LEVEL_SYSTEM && getLevel() >= 81 && getLevel() < 86) { if ((getLevel() == 80 && pvpKills >= (Config.PVP_LEVEL_T1)) && (pvpKills < (Config.PVP_LEVEL_T2))) { addExpAndSp(Experience.LEVEL[getLevel() + 1], 0); sendMessage("You reached " + Config.PVP_LEVEL_T1 +" pvps and leveled up!"); } else if ((getLevel() == 81 && pvpKills >= (Config.PVP_LEVEL_T2)) && (pvpKills < (Config.PVP_LEVEL_T3))) { addExpAndSp(Experience.LEVEL[getLevel() + 1], 0); sendMessage("You reached " + Config.PVP_LEVEL_T2 +" pvps and leveled up!"); } else if ((getLevel() == 82 && pvpKills >= (Config.PVP_LEVEL_T3)) && (pvpKills < (Config.PVP_LEVEL_T4))) { addExpAndSp(Experience.LEVEL[getLevel() + 1], 0); sendMessage("You reached " + Config.PVP_LEVEL_T3 +" pvps and leveled up!"); } else if ((getLevel() == 83 && pvpKills >= (Config.PVP_LEVEL_T4)) && (pvpKills < (Config.PVP_LEVEL_T5))) { addExpAndSp(Experience.LEVEL[getLevel() + 1], 0); sendMessage("You reached " + Config.PVP_LEVEL_T4 +" pvps and leveled up!"); } else if ((getLevel() == 84 && pvpKills >= (Config.PVP_LEVEL_T5)) && (pvpKills < (Config.PVP_LEVEL_T6))) { addExpAndSp(Experience.LEVEL[getLevel() + 1], 0); sendMessage("You reached " + Config.PVP_LEVEL_T5 +" pvps and leveled up!"); } } } } /** //Increase level from pvp increaseLevelFromPvPs(getPvpKills()); broadcastUserInfo();
  6. Kalispera pedia..pira enan code apo edw tis proales o opios sta 80 lvl..afou pareis p.x. 100 pvp sou dinei level up dld se paei 81 kai meta p.x. sta 200 pvp pas 82lv v ktlp.. ton perasa ola kala...paw na ton dokimasw to game..kai apla dn ginete tpt.. an borei kapios na me boithisei... o server einai Iterlude...ala ehw anevasei ta level mehri 85. Index: I:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- I:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 3645) +++ I:/workspace/L2_GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -5656,6 +5656,96 @@ } /** + * PvP counts as xp after level 80. + * + */ + public void increaseLevelFromPvPs(int pvpKills) + { + if (getLevel() <= 80) + return; + { + if (Config.ALLOW_PVP_LEVEL_SYSTEM && getLevel() >= 81 && getLevel() < 86) + { + if ((getLevel() == 81 && pvpKills >= (Config.PVP_LEVEL_AM-beep-T1)) && (pvpKills < (Config.PVP_LEVEL_AM-beep-T2))) + { + addExpAndSp(Experience.LEVEL[getLevel() + 1], 0); + sendMessage("You reached " + Config.PVP_LEVEL_AM-beep-T1 +" pvps and leveled up!"); + } + else if ((getLevel() == 82 && pvpKills >= (Config.PVP_LEVEL_AM-beep-T2)) && (pvpKills < (Config.PVP_LEVEL_AM-beep-T3))) + { + addExpAndSp(Experience.LEVEL[getLevel() + 1], 0); + sendMessage("You reached " + Config.PVP_LEVEL_AM-beep-T2 +" pvps and leveled up!"); + } + else if ((getLevel() == 83 && pvpKills >= (Config.PVP_LEVEL_AM-beep-T3)) && (pvpKills < (Config.PVP_LEVEL_AM-beep-T4))) + { + addExpAndSp(Experience.LEVEL[getLevel() + 1], 0); + sendMessage("You reached " + Config.PVP_LEVEL_AM-beep-T3 +" pvps and leveled up!"); + } + else if ((getLevel() == 84 && pvpKills >= (Config.PVP_LEVEL_AM-beep-T4)) && (pvpKills < (Config.PVP_LEVEL_AM-beep-T5))) + { + addExpAndSp(Experience.LEVEL[getLevel() + 1], 0); + sendMessage("You reached " + Config.PVP_LEVEL_AM-beep-T4 +" pvps and leveled up!"); + } + else if ((getLevel() == 85 && pvpKills >= (Config.PVP_LEVEL_AM-beep-T5)) && (pvpKills < (Config.PVP_LEVEL_AM-beep-T6))) + { + addExpAndSp(Experience.LEVEL[getLevel() + 1], 0); + sendMessage("You reached " + Config.PVP_LEVEL_AM-beep-T5 +" pvps and leveled up!"); + } + } + } + } + + /** * Increase the pvp kills count and send the info to the player * */ @@ -5664,6 +5754,9 @@ // Add karma to attacker and increase its PK counter setPvpKills(getPvpKills() + 1); + increaseLevelFromPvPs(getPvpKills()); + broadcastUserInfo(); + // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter sendPacket(new UserInfo(this)); sendPacket(new ExBrExtraUserInfo(this)); Index: I:/workspace/L2_GameServer/java/net/sf/l2j/Config.java =================================================================== --- I:/workspace/L2_GameServer/java/net/sf/l2j/Config.java (revision 3645) +++ I:/workspace/L2_GameServer/java/net/sf/l2j/Config.java (working copy) @@ -793,6 +793,24 @@ public static String DATAPACK_VERSION; public static int PVP_NORMAL_TIME; public static int PVP_PVP_TIME; + public static boolean ALLOW_PVP_LEVEL_SYSTEM; + public static int PVP_LEVEL_AM-beep-T1; + public static int PVP_LEVEL_AM-beep-T2; + public static int PVP_LEVEL_AM-beep-T3; + public static int PVP_LEVEL_AM-beep-T4; + public static int PVP_LEVEL_AM-beep-T5; public static enum IdFactoryType { Compaction, @@ -2454,6 +2472,24 @@ else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue); else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue); + else if (pName.equalsIgnoreCase("AllowPvPLevelSystem")) ALLOW_PVP_LEVEL_SYSTEM = Boolean.parseBoolean(pValue); + else if (pName.equalsIgnoreCase("PvPLevelAm-beep-t1")) PVP_LEVEL_AM-beep-T1 = Integer.parseInt(pValue); + else if (pName.equalsIgnoreCase("PvPLevelAm-beep-t2")) PVP_LEVEL_AM-beep-T2 = Integer.parseInt(pValue); + else if (pName.equalsIgnoreCase("PvPLevelAm-beep-t3")) PVP_LEVEL_AM-beep-T3 = Integer.parseInt(pValue); + else if (pName.equalsIgnoreCase("PvPLevelAm-beep-t4")) PVP_LEVEL_AM-beep-T4 = Integer.parseInt(pValue); + else if (pName.equalsIgnoreCase("PvPLevelAm-beep-t5")) PVP_LEVEL_AM-beep-T5 = Integer.parseInt(pValue); else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue; else if (pName.equalsIgnoreCase("TradeChat")) DEFAULT_TRADE_CHAT = pValue; else if (pName.equalsIgnoreCase("GMAdminMenuStyle")) GM_ADMIN_MENU_STYLE = pValue;
  7. auto pou theleis esi einai na alakseis ta patch..dn ehei shesi me ton server auto..mesa sto system the breis programataki pou kanei edit ta DAT an dn kanw lathos..tha breis to ID tou oplou pou thes kai dipla stin sinehia leei pio kato pio ikonidio einai..apla ta alazeis
  8. Kalispera...perasa enan java code pou brika edw ston Mxc gia tin olympiada,oste an boun 2 atoma me to idio IP na dinei "tie".. Ton perasa ola kala..bika na to dokimasw kai molis telionei o agonas leei "Matches from same Ip are forbidden" ala o nikitis pernei kanonika tou pontous,kai o xamenos tous xanei...an borei kapios na boithisei..Euxaristw! Index: /config/altsettings.properties =================================================================== --- /config/altsettings.properties (revision 5149) +++ /config/altsettings.properties (working copy) @@ -324,6 +324,10 @@ # Olympiad Validation Period, Default 24 Hours. AltOlyVperiod = 86400000 +# Olympiad allow matches from same ip +AltOlySameIp = True + + #------------------------------------------------------------- # Npc Crafter #------------------------------------------------------------- Index: /src/main/java/net/sf/l2j/gameserver/Olympiad.java =================================================================== --- /src/main/java/net/sf/l2j/gameserver/Olympiad.java (revision 5149) +++ /src/main/java/net/sf/l2j/gameserver/Olympiad.java (working copy) @@ -1819,6 +1819,19 @@ _sm3 = new SystemMessage(SystemMessageId.S1_HAS_LOST_S2_OLYMPIAD_POINTS); String result = ""; + + String ip1 = ""; + String ip2 = ""; + + if(ip1.equals(ip2) && !Config.ALT_OLY_SAME_IP) + { + _log.warn("Match from same ip " + _playerOneName + " vs " + _playerTwoName); + result = " tie"; + _sm = new SystemMessage(SystemMessageId.THE_GAME_ENDED_IN_A_TIE); + broadcastMessage(_sm, true); + _playerOne.sendMessage("Matches from same Ip are forbidden."); + _playerTwo.sendMessage("Matches from same Ip are forbidden."); + } if (playerTwoHp==0 || hpDiffOne < hpDiffTwo) { Index: /src/main/java/net/sf/l2j/Config.java =================================================================== --- /src/main/java/net/sf/l2j/Config.java (revision 5149) +++ /src/main/java/net/sf/l2j/Config.java (working copy) @@ -1353,6 +1353,7 @@ public static int ALT_OLY_IWAIT; // Olympiad Inital Wait public static int ALT_OLY_WPERIOD; // Olympaid Weekly Period public static int ALT_OLY_VPERIOD; // Olympaid Validation Period + public static boolean ALT_OLY_SAME_IP; public static float ALT_GAME_SUMMON_PENALTY_RATE; // Alternative game summon penalty public static int ALT_MANOR_REFRESH_TIME; // Manor Refresh Starting time public static int ALT_MANOR_REFRESH_MIN; // Manor Refresh Min @@ -1495,7 +1496,8 @@ ALT_OLY_IWAIT = Integer.parseInt(altSettings.getProperty("AltOlyPwait","300000")); ALT_OLY_WPERIOD = Integer.parseInt(altSettings.getProperty("AltOlyWperiod","604800000")); ALT_OLY_VPERIOD = Integer.parseInt(altSettings.getProperty("AltOlyVperiod","86400000")); - + ALT_OLY_SAME_IP = Boolean.parseBoolean(altSettings.getProperty("AltOlySameIp", "true")); + ALT_MANOR_REFRESH_TIME = Integer.parseInt(altSettings.getProperty("AltManorRefreshTime","20")); ALT_MANOR_REFRESH_MIN = Integer.parseInt(altSettings.getProperty("AltManorRefreshMin","00")); ALT_MANOR_APPROVE_TIME = Integer.parseInt(altSettings.getProperty("AltManorApproveTime","6"));
×
×
  • Create New...