Jump to content

l2redkiller

Members
  • Posts

    200
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by l2redkiller

  1. can you import in freya and post a patch ?? really nice thanks
  2. i donno how and what becurse classed non classed and team modi so please help
  3. hey dudes i search for a example or whatever for make that every player need to pay for go into Oly battle. thanks for help sorry for my english
  4. ye try pm him maybe he will upload it once more :D
  5. Nice share thanks
  6. xD i know some but its hard to import into tvt becurse its a very big engine i dont wanna crash it
  7. ye ok but how seens the code for add him fame and pvp pk ?
  8. anyone have idea how seens the code for that and where i must import it ?
  9. hmm ok but i need it just for kill if a player kills a enemy he get pvp pk point and some fame not complete team
  10. heya all i need some help to make that the killer become reward fame points and pvp or pk points thanks for help i really have no idea with that.
  11. also just the colli is Fail in one of the java files must be anything with on.die whatever i search for it too.
  12. ok thanks i will test it :D i will report more if need :D
  13. here the error in console :http://www.ncsro.de/downloads/error.jpg and here the script : ### Eclipse Workspace Patch 1.0 #P L2_GameServer Index: java/com/l2jserver/gameserver/instancemanager/AutoVoteRewardHandler.java =================================================================== --- java/com/l2jserver/gameserver/instancemanager/AutoVoteRewardHandler.java (revision 0) +++ java/com/l2jserver/gameserver/instancemanager/AutoVoteRewardHandler.java (revision 0) @@ -0,0 +1,162 @@ +package com.l2jserver.gameserver.instancemanager; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import com.l2jserver.L2DatabaseFactory; +import com.l2jserver.gameserver.Announcements; +import com.l2jserver.gameserver.ThreadPoolManager; +import com.l2jserver.gameserver.model.L2ItemInstance; +import com.l2jserver.gameserver.model.L2World; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; + +public class AutoVoteRewardHandler +{ + private final String MAXVOTES = "http://maxvotes.com/sinfo/XXX.html"; + // 60 * 1000(1000milliseconds = 1 second) = 60seconds + private final int initialCheck = 60 * 1000; + // 1800 * 1000(1000milliseconds = 1 second) = 1800seconds = 30minutes + private final int delayForCheck = 1800 * 1000; + private final int[] itemId = { 3500, 5000, 6500 }; + private final int[] itemCount = { 1, 5, 4 }; + private final int[] maxStack = { 1, 1, 1 }; + private final int votesRequiredForReward = 10; + // do not change + private int lastVoteCount = 0; + + private AutoVoteRewardHandler() + { + System.out.println("Vote Reward System Initiated."); + ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), initialCheck, delayForCheck); + } + + private class AutoReward implements Runnable + { + public void run() + { + int votes = getVotes(); + System.out.println("Server Votes: " + votes); + if (votes != 0 && getLastVoteCount() != 0 && votes >= getLastVoteCount() + votesRequiredForReward) + { + Connection con = null; + try + { + con = L2DatabaseFactory.getInstance().getConnection(); + PreparedStatement statement = con.prepareStatement("" + + "SELECT" + + " c.charId," + + " c.char_name" + + "FROM" + + " c.characters AS c" + + "LEFT JOIN" + + " c.accounts AS a" + + "ON" + + " c.account_name = a.login" + + "WHERE" + + " c.online > 0" + + "GROUP BY" + + " a.lastIP" + + "ORDER BY" + + " c.level" + + "DESC"); + ResultSet rset = statement.executeQuery(); + L2PcInstance player = null; + L2ItemInstance item = null; + while (rset.next()) + { + player = L2World.getInstance().getPlayer(rset.getInt("charId")); + if (player != null && !player.getClient().isDetached()) + { + for (int i = 0; i < itemId.length; i++) + { + item = player.getInventory().getItemByItemId(itemId[i]); + if (item == null || item.getCount() < maxStack[i]) + player.addItem("reward", itemId[i], itemCount[i], player, true); + } + } + } + statement.close(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + finally + { + L2DatabaseFactory.close(con); + } + + setLastVoteCount(getLastVoteCount() + votesRequiredForReward); + } + Announcements.getInstance().announceToAll("Server Votes: " + votes + " | Next Reward on " + (getLastVoteCount() + votesRequiredForReward) + " Votes."); + if (getLastVoteCount() == 0) + setLastVoteCount(votes); + } + } + + private int getVotes() + { + URL url = null; + InputStreamReader isr = null; + BufferedReader in = null; + try + { + url = new URL(MAXVOTES); + isr = new InputStreamReader(url.openStream()); + in = new BufferedReader(isr); + String inputLine; + while ((inputLine = in.readLine()) != null) + { + if (inputLine.contains("moreinfo_total_rank_text")) + return Integer.valueOf(inputLine.split(">")[2].replace("</div", "")); + } + } + catch (IOException e) + { + e.printStackTrace(); + } + finally + { + try + { + in.close(); + } + catch (IOException e) + {} + try + { + isr.close(); + } + catch (IOException e) + {} + } + return 0; + } + + 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/com/l2jserver/gameserver/GameServer.java =================================================================== --- java/com/l2jserver/gameserver/GameServer.java (revision 4472) +++ java/com/l2jserver/gameserver/GameServer.java (working copy) @@ -86,6 +86,7 @@ import com.l2jserver.gameserver.instancemanager.AirShipManager; import com.l2jserver.gameserver.instancemanager.AntiFeedManager; import com.l2jserver.gameserver.instancemanager.AuctionManager; +import com.l2jserver.gameserver.instancemanager.AutoVoteRewardHandler; import com.l2jserver.gameserver.instancemanager.BoatManager; import com.l2jserver.gameserver.instancemanager.CastleManager; import com.l2jserver.gameserver.instancemanager.CastleManorManager; @@ -409,6 +410,8 @@ if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS) OfflineTradersTable.restoreOfflineTraders(); + AutoVoteRewardHandler.getInstance(); + if (Config.DEADLOCK_DETECTOR) { _deadDetectThread = new DeadLockDetector(); announce work just have problem at give item and make the sql check thanks for help
  14. my code seens like this : public boolean eventStart(L2PcInstance player) { if (character instanceof L2PcInstance) { //register yourself in a town zone player.setInsideZone(L2Character.ZONE_TOWN, true); // if event up, make the sky red for all people in this area [color=red]if [/color] eventIsInProgress; // Make Sky Red For 2 mins. ExRedSky = new ExRedSky(120); } just the second if is a problem :S need help
  15. hey guys how i can put in java redsky just for 1 town? i know just for player and all players online but how to make just for this town or region? thanks
  16. I think of Gracia Final its not too much bugged and some tricky to fix :D use L2jFree or l2j pack and you will see
  17. that use in Olympiadame.java :D search heal and you will find it :D
  18. my post before :P the code with the skills ids bla bla bla :D^^
  19. just put this code into Olympiadgame.java :D really works
  20. where put the code : Index: /trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGame.java =================================================================== --- /trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGame.java (revision 11) +++ /trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/olympiad/OlympiadGame.java (revision 111) @@ -216,4 +216,9 @@ } + // Avoid prefrenzy(and others) exploit + player.stopSkillEffects(176); + player.stopSkillEffects(139); + player.stopSkillEffects(406); + player.stopSkillEffects(420); + // Heal Player fully player.setCurrentCp(player.getMaxCp()); in freya ? dont see // Heal Player fully ?? thanks for help
  21. ye i have the same problem just i tryed in freya so anyone have a working version ?
  22. lol have over 300 posts and donno sql oO w8 when i am at home i will help you :D
  23. xD my mistake sorry for that ^^ just i come from germany we see think answer dont read perfectly ^^ just saw delete^^
  24. dudes i have every time the same problem on enterworld.java here if (activeChar.getAccessLevel() == 10) Announcements.getInstance().announceToAll((new StringBuilder()).append("Char Vip ").append(activeChar.getName()).append(" Is Currently Online.").toString());
×
×
  • Create New...