Jump to content

Legend™

Members
  • Posts

    596
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Legend™

  1. just dl latest rev H5 and i get multiple errors com.l2jserver.gsregistering/RegisterDialog.java "combo can not be resolved" //edit: fixed
  2. well i tried it at H5 but got errors,and gave up, will post them here and hope you can help me with them
  3. i was going to report him too,
  4. why are you all spaming you cant even see the post
  5. i get "player can not be resolved", maybe i have to import something
  6. krash i am not good at java tried to put the lines but i get errors could you please use this and put the lines were needed package com.l2jserver.gameserver.instancemanager; import java.io.BufferedReader; import java.io.IOException; 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.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import com.l2jserver.Config; import com.l2jserver.L2DatabaseFactory; import com.l2jserver.gameserver.Announcements; import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; public class AutoVoteRewardManager { private static Logger _log = Logger.getLogger(AutoVoteRewardManager.class.getName()); private static final String http = "http://l2.hopzone.net/lineage2/moreinfo/L2Empire/88729.html"; private static final int initialCheck = 1 * 1000; private static final int delayForCheck = 900 * 1000; private static final int[] itemId = { 14721, 3794 }; private static final int[] itemCount = { 50, 250 }; private static final int votesRequiredForReward = 30; private static List<String> _ips = new ArrayList<String>(); private static int lastVoteCount = 0; private AutoVoteRewardManager() { _log.info("AutoVoteRewardManager: Vote reward system initiated."); if (Config.L2JMOD_VOTE_ENGINE_SAVE) load(); ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), initialCheck, delayForCheck); } private class AutoReward implements Runnable { public void run() { int votes = getVotes(); _log.info("AutoVoteRewardManager: We now have " + votes + "/"+(getLastVoteCount()+votesRequiredForReward)+" vote(s). Next check in "+(delayForCheck/1000)+" sec."); Announcements.getInstance().announceToAll("Vote on http://l2.gamesempire.ro/"); if (votes >= getLastVoteCount() + votesRequiredForReward) { Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values(); { for (L2PcInstance onlinePlayer : pls) { if (onlinePlayer.isOnline() && !onlinePlayer.getClient().isDetached() && !_ips.contains(onlinePlayer.getClient().getConnection().getInetAddress().getHostAddress())) { for (int i = 0; i < itemId.length; i++) { onlinePlayer.addItem("vote_reward", itemId[i], itemCount[i], onlinePlayer, true); } _ips.add(onlinePlayer.getClient().getConnection().getInetAddress().getHostAddress()); } } } _log.info("AutoVoteRewardManager: Reward for votes now!"); Announcements.getInstance().announceToAll("Reward for players! Thanks for Vote."); setLastVoteCount(getLastVoteCount() + votesRequiredForReward); } if (getLastVoteCount() == 0) { setLastVoteCount(votes); } else if ((getLastVoteCount() + votesRequiredForReward) - votes > votesRequiredForReward || votes > (getLastVoteCount() + votesRequiredForReward)) { setLastVoteCount(votes); } Announcements.getInstance().announceToAll("We have " + votes + " vote(s). Next reward on " + (getLastVoteCount()+votesRequiredForReward) + " vote."); _ips.clear(); } } private int getVotes() { URL url = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(http); URLConnection con = url.openConnection(); con.addRequestProperty("User-Agent", "Mozilla/4.76"); isr = new InputStreamReader(con.getInputStream()); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { // for top-zone //if (inputLine.contains("<tr><td><div align=\"center\"><b><font style=\"font-size:14px;color:#018BC1;\"")) //{ //return Integer.valueOf(inputLine.split(">")[5].replace("</font", "")); //} //for hopzone if (inputLine.contains("moreinfo_total_rank_text")) return Integer.valueOf(inputLine.split(">")[2].replace("</div", "")); } } catch (IOException e) { _log.warning("AutoVoteRewardHandler: "+e); } 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; } private void load() { int votes = 0; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT vote FROM votes LIMIT 1"); ResultSet rset = statement.executeQuery(); while (rset.next()) { votes = rset.getInt("vote"); } rset.close(); statement.close(); } catch (Exception e) { _log.log(Level.WARNING, "data error on vote: ", e); } finally { L2DatabaseFactory.close(con); } setLastVoteCount(votes); } public void save() { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE votes SET vote = ? WHERE id=1"); statement.setInt(1, getLastVoteCount()); statement.execute(); statement.close(); } catch (Exception e) { _log.log(Level.WARNING, "data error on vote: ", e); } finally { L2DatabaseFactory.close(con); } } public static AutoVoteRewardManager getInstance() { return SingletonHolder._instance; } @SuppressWarnings("synthetic-access") private static class SingletonHolder { protected static final AutoVoteRewardManager _instance = new AutoVoteRewardManager(); } }
  7. ok then ty. offtopic// is it possible instead of anouncements how many votes left to get reward ,to have a message in big letters on screen,an exshowscreenmessage,like most servers have?and what has to be replaced.
  8. well i dont know, I cant even try hopzone my browser just will not open/load(looks like i got an ip ban or something) the page so i cant try this, there
  9. i get this and im using H5 l2topzone votes not counting am using rizells patch
  10. /* * 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 handlers.usercommandhandlers; import java.util.logging.Level; import com.l2jserver.Config; import com.l2jserver.gameserver.GameTimeController; import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.ai.CtrlIntention; import com.l2jserver.gameserver.datatables.SkillTable; import com.l2jserver.gameserver.datatables.MapRegionTable; import com.l2jserver.gameserver.handler.IUserCommandHandler; import com.l2jserver.gameserver.instancemanager.GrandBossManager; import com.l2jserver.gameserver.model.L2Skill; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.TvTEvent; import com.l2jserver.gameserver.network.serverpackets.ActionFailed; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.network.serverpackets.SetupGauge; import com.l2jserver.gameserver.util.Broadcast; /** * * */ public class Escape implements IUserCommandHandler { private static final int[] COMMAND_IDS = { 52 }; /** * * @see com.l2jserver.gameserver.handler.IUserCommandHandler#useUserCommand(int, com.l2jserver.gameserver.model.actor.instance.L2PcInstance) */ public boolean useUserCommand(int id, L2PcInstance activeChar) { // Thanks nbd if (!TvTEvent.onEscapeUse(activeChar.getObjectId())) { activeChar.sendPacket(ActionFailed.STATIC_PACKET); return false; } int unstuckTimer = (activeChar.getAccessLevel().isGm() ? 1000 : Config.UNSTUCK_INTERVAL * 1000); // Check to see if the player is in a festival. if (activeChar.isFestivalParticipant()) { activeChar.sendMessage("You may not use an escape command in a festival."); return false; } // Check to see if player is in jail if (activeChar.isInJail()) { activeChar.sendMessage("You can not escape from jail."); return false; } if (GrandBossManager.getInstance().getZone(activeChar) != null && !activeChar.isGM()) { activeChar.sendMessage("You may not use an escape command in a Boss Zone."); return false; } if (activeChar.isCastingNow() || activeChar.isMovementDisabled() || activeChar.isMuted() || activeChar.isAlikeDead() || activeChar.isInOlympiadMode() || activeChar.inObserverMode() || activeChar.isCombatFlagEquipped()) return false; activeChar.forceIsCasting(GameTimeController.getGameTicks() + unstuckTimer / GameTimeController.MILLIS_IN_TICK); L2Skill escape = SkillTable.getInstance().getInfo(2099, 1); // 5 minutes escape L2Skill GM_escape = SkillTable.getInstance().getInfo(2100, 1); // 1 second escape if (activeChar.getAccessLevel().isGm()) { if (GM_escape != null) { activeChar.doCast(GM_escape); return true; } activeChar.sendMessage("You use Escape: 1 second."); } else if (Config.UNSTUCK_INTERVAL == 300 && escape != null) { activeChar.doCast(escape); return true; } else { if (Config.UNSTUCK_INTERVAL > 100) { activeChar.sendMessage("You use Escape: " + unstuckTimer / 60000 + " minutes."); } else activeChar.sendMessage("You use Escape: " + unstuckTimer / 1000 + " seconds."); } activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); //SoE Animation section activeChar.setTarget(activeChar); activeChar.disableAllSkills(); MagicSkillUse msk = new MagicSkillUse(activeChar, 1050, 1, unstuckTimer, 0); Broadcast.toSelfAndKnownPlayersInRadius(activeChar, msk, 810000/*900*/); SetupGauge sg = new SetupGauge(0, unstuckTimer); activeChar.sendPacket(sg); //End SoE Animation section EscapeFinalizer ef = new EscapeFinalizer(activeChar); // continue execution later activeChar.setSkillCast(ThreadPoolManager.getInstance().scheduleGeneral(ef, unstuckTimer)); return true; } static class EscapeFinalizer implements Runnable { private L2PcInstance _activeChar; EscapeFinalizer(L2PcInstance activeChar) { _activeChar = activeChar; } public void run() { if (_activeChar.isDead()) return; _activeChar.setIsIn7sDungeon(false); _activeChar.enableAllSkills(); _activeChar.setIsCastingNow(false); _activeChar.setInstanceId(0); try { _activeChar.teleToLocation(147463, 25798, -2039); } catch (Exception e) { _log.log(Level.SEVERE, "", e); } } } /** * * @see com.l2jserver.gameserver.handler.IUserCommandHandler#getUserCommandList() */ public int[] getUserCommandList() { return COMMAND_IDS; } }
  11. usercommandhandlers\Escape.java (at line 24) import com.l2jserver.gameserver.datatables.MapRegionTable; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The import com.l2jserver.gameserver.datatables.MapRegionTable is never used trying to add a custom /unstuck and in gameserver i get this error i deleted the import but when i use unstuck i get ported to nearest village i used this code _activeChar.teleToLocation(147463, 25798, -2039);any suggestions?
  12. i made a walker npc(walking in giran saying "vote" but in anouncements instead of showing its name it shows "none" any clues guys how to fix
  13. yes it works but what has happened?
  14. I recently have a problem loading hopzone from my home pc it will not open the only thing i get is a blank page with :Hello Mansoor: writen on it iI try to open the same page from another pc, elsewhere than my home, and all work great any suggestions how to fix or what has happend are wellcome
  15. I am trying to use this event but it just wont start some help will be apreciated <Event ID="Medals Event" Active="26 Dec 2004-21 Dec 2015"> <Droplist> <AllDrop Items="6392" Count="1,1" Chance="60%" /> </Droplist> <Droplist> <AllDrop Items="6393" Count="1,1" Chance="15%" /> </Droplist> <Message Type="OnJoin" Msg="Glittering Medals Event: You can collect medals from all mobs and trade them for potions/enchants/sealed items and even Party Mask!" /> <EventEnd> <Take From="AllPlayers"> <Item ItemID="6392-6393"></Item> </Take> </EventEnd> </Event> i know it goes in data/faenor as a zip but maybe the date is wrong or i have to add some more info?
  16. looking for a freya vote system,i tied 1 or 2 from here, but i want one that the votes count is displayed on screen,and not as anannouncement,if someone knows of one plz point me to the corect topic
  17. Was sensus,bc i know the admin he sold sensus and opened this one
  18. thanks for share , //offtopic :does anyone know how to change to the 4th class (wakening class) and the ids of new armor
  19. maybe it is ,maybe its not i didnt make it i found it at a forum l2jbrasil it works like all fileedits
  20. nice, put one more fileedit for GOD http://www.4shared.com/get/IUtVZvDt/L2_File_Edit_GoD.html
  21. also try fixing your buffs 1minute only???
  22. now its ok but as soon as you press on gm shop game freezes
×
×
  • 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