Jump to content

GameBlonD

Members
  • Posts

    553
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by GameBlonD

  1. Hello , i am trying to make a code in order if a player has one Item in inventory to get one active/passive skill without equip the item. What i should put in enterworld? if (activeChar.getInventory().getItemByItemId(example) ??????
  2. else if (actualCommand.equalsIgnoreCase("CalcRewards")) { int territoryId = Integer.parseInt(st.nextToken()); int[] reward = TerritoryWarManager.getInstance().calcReward(activeChar); NpcHtmlMessage html = new NpcHtmlMessage(mercman.getObjectId()); if (TerritoryWarManager.getInstance().isTWInProgress() || reward[0] == 0) html.setFile(activeChar.getHtmlPrefix(), "data/html/mercmanager/reward-0a.htm"); else if (reward[0] != territoryId) { html.setFile(activeChar.getHtmlPrefix(), "data/html/mercmanager/reward-0b.htm"); html.replace("%castle%", CastleManager.getInstance().getCastleById(reward[0] - 80).getName()); } else if (reward[1] == 0) html.setFile(activeChar.getHtmlPrefix(), "data/html/mercmanager/reward-0a.htm"); else { html.setFile(activeChar.getHtmlPrefix(), "data/html/mercmanager/reward-1.htm"); html.replace("%castle%", CastleManager.getInstance().getCastleById(reward[0] - 80).getName()); html.replace("%badge%", String.valueOf(reward[1])); html.replace("%adena%", String.valueOf(reward[1] * 5000)); } html.replace("%territoryId%", String.valueOf(territoryId)); html.replace("%objectId%", String.valueOf(mercman.getObjectId())); activeChar.sendPacket(html); activeChar.sendPacket(ActionFailed.STATIC_PACKET); } else if (actualCommand.equalsIgnoreCase("ReceiveRewards")) { int territoryId = Integer.parseInt(st.nextToken()); int badgeId = 57; if (TerritoryWarManager.getInstance().TERRITORY_ITEM_IDS.containsKey(territoryId)) badgeId = TerritoryWarManager.getInstance().TERRITORY_ITEM_IDS.get(territoryId); int[] reward = TerritoryWarManager.getInstance().calcReward(activeChar); NpcHtmlMessage html = new NpcHtmlMessage(mercman.getObjectId()); if (TerritoryWarManager.getInstance().isTWInProgress() || reward[0] == 0) html.setFile(activeChar.getHtmlPrefix(), "data/html/mercmanager/reward-0a.htm"); else if (reward[0] != territoryId) { html.setFile(activeChar.getHtmlPrefix(), "data/html/mercmanager/reward-0b.htm"); html.replace("%castle%", CastleManager.getInstance().getCastleById(reward[0] - 80).getName()); } else if (reward[1] == 0) html.setFile(activeChar.getHtmlPrefix(), "data/html/mercmanager/reward-0a.htm"); else { html.setFile(activeChar.getHtmlPrefix(), "data/html/mercmanager/reward-2.htm"); activeChar.addItem("QUEST", badgeId, reward[1], mercman, true); activeChar.addAdena("QUEST", reward[1] * 5000, mercman, true); TerritoryWarManager.getInstance().resetReward(activeChar); } html.replace("%objectId%", String.valueOf(mercman.getObjectId())); activeChar.sendPacket(html); activeChar.sendPacket(ActionFailed.STATIC_PACKET); } return true; } catch (Exception e) { _log.info("Exception in " + getClass().getSimpleName()); } return false; } Territory manager in game pop up this : reward-0b.htm (can't read the correct siegeSide) Maybe this is wrong? int territoryId = Integer.parseInt(st.nextToken()); and should be something like this? int territoryId = Integer.parseInt(command.substring(_command.length() + 1).trim());
  3. Tryskell Thanks for your answer , about improvements etc but i am looking for a quick fix to existing code : I can't understand why Territory Manager can't read siegeSide - Example on what happening: DB table: CREATE TABLE `character_territorywar` ( `charId` int(10) unsigned NOT NULL DEFAULT '0', `siegeSide` smallint(3) NOT NULL DEFAULT '0', `points1` smallint(4) NOT NULL DEFAULT '0', `points2` smallint(4) NOT NULL DEFAULT '0', `points3` smallint(4) NOT NULL DEFAULT '0', `points4` smallint(4) NOT NULL DEFAULT '0', `points5` smallint(4) NOT NULL DEFAULT '0', `onlineTime` smallint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`charId`), CONSTRAINT `character_territorywar_ibfk_1` FOREIGN KEY (`charId`) REFERENCES `characters` (`charId`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records -- ---------------------------- INSERT INTO `character_territorywar` VALUES ('268482384', '87', '7', '1', '0', '0', '0', '18'); INSERT INTO `character_territorywar` VALUES ('269823770', '85', '5', '1', '0', '0', '0', '18'); INSERT INTO `character_territorywar` VALUES ('270590661', '82', '17', '1', '0', '0', '0', '18'); So if i speak to npc with charid: 268482384 instead of giving me reward of 87 its say to speak to Dion (82) for some reason it always choose the MIN Territory ID. private void restoreParticipantsPoints() { Connection con = null; PreparedStatement statement = null; ResultSet rset = null; Integer[] data = new Integer[7]; try { con = L2DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("SELECT * FROM character_territorywar"); rset = statement.executeQuery(); while (rset.next()) { data[0] = rset.getInt("siegeSide"); data[1] = rset.getInt("points1"); data[2] = rset.getInt("points2"); data[3] = rset.getInt("points3"); data[4] = rset.getInt("points4"); data[5] = rset.getInt("points5"); data[6] = rset.getInt("onlineTime"); _participantPoints.put(rset.getInt("charId"), data); } } catch (Exception e) { } finally { ResourceUtil.closeResultSet(rset); ResourceUtil.closeStatement(statement); ResourceUtil.closeConnection(con); } }
  4. Hello i added this code private void storeParticipantsPoints(Map<Integer,Integer[]> points) { Connection con = null; PreparedStatement statement = null; Integer[] reward; int count = 0; try { con = L2DatabaseFactory.getInstance().getConnection(); for (int playerId : points.keySet()) { reward = points.get(playerId); if (reward[6] < 10 || (reward[1] + reward[2] + reward[3] + reward[4] + reward[5]) == 0) continue; statement = con.prepareStatement("INSERT INTO character_territorywar VALUES (?,?,?,?,?,?,?,?)"); statement.setInt(1, playerId); statement.setInt(2, reward[0]); statement.setInt(3, reward[1]); statement.setInt(4, reward[2]); statement.setInt(5, reward[3]); statement.setInt(6, reward[4]); statement.setInt(7, reward[5]); statement.setInt(8, reward[6]); statement.execute(); ResourceUtil.closeStatement(statement); count++; } } catch (Exception e) { } finally { ResourceUtil.closeStatement(statement); ResourceUtil.closeConnection(con); } } private void restoreParticipantsPoints() { Connection con = null; PreparedStatement statement = null; ResultSet rset = null; Integer[] data = new Integer[7]; try { con = L2DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("SELECT * FROM character_territorywar"); rset = statement.executeQuery(); while (rset.next()) { data[0] = rset.getInt("siegeSide"); data[1] = rset.getInt("points1"); data[2] = rset.getInt("points2"); data[3] = rset.getInt("points3"); data[4] = rset.getInt("points4"); data[5] = rset.getInt("points5"); data[6] = rset.getInt("onlineTime"); _participantPoints.put(rset.getInt("charId"), data); } } catch (Exception e) { } finally { ResourceUtil.closeResultSet(rset); ResourceUtil.closeStatement(statement); ResourceUtil.closeConnection(con); } } private void truncateParticipantsPoints() { Connection con = null; PreparedStatement statement = null; try { con = L2DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("TRUNCATE TABLE character_territorywar"); statement.execute(); } catch (Exception e) { } finally { ResourceUtil.closeStatement(statement); ResourceUtil.closeConnection(con); } } private void removeParticipantPoints(int playerId) { Connection con = null; PreparedStatement statement = null; try { con = L2DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("DELETE FROM character_territorywar WHERE charId = ?"); statement.setInt(1, playerId); statement.execute(); } catch (Exception e) { } finally { ResourceUtil.closeStatement(statement); ResourceUtil.closeConnection(con); } } All works fine and data saved into database but when i speak to Territory manager Npc says That i work in Dion but character was registered in Goddard For some reason the code can't read siegeSide from database and always choose the Min Territory ID Also if i talk to Territory manager before server restart it works fine the issue is after server restart that trying to read the data from the database. Any ideas to where to look in order to fix it? Thanks.
  5. Ean doulevei to bug pou anafereis kalo tha htan na alaksete pack to sintometero. Ean doulevei ayto pou einai to pio aplo na ftiaxtei tote.....
  6. Mporeis na sindethis sto mysql tou server sou apo to navicat tou PC sou. To command gia na deis ta account sou : (isws xriasti na to alaksis ligo analoga to pack sou) select login,accessLevel from accounts;
  7. Ginete ews 20 - 30 max online , ean sou kanoun ddos o owner tou net cafe sigoura tha klisei ton server sou.
  8. Dedicated server me Linux xreiazese. google: ovh, hetzner, server4you Ean den ksereis na stineis server se linux me ta aparaitita firewall - software ktl kalitera na to afiseis gia kapia ali stigmi.
  9. [javac] The system is out of resources. [javac] Consult the following stack trace for details. [javac] java.lang.OutOfMemoryError: Java heap space [javac] at com.sun.tools.javac.util.Log.useSource(Log.java:211) [javac] at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:959) [javac] at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386) [javac] at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:758) [javac] at com.sun.tools.javac.comp.Enter.complete(Enter.java:451) [javac] at com.sun.tools.javac.comp.Enter.main(Enter.java:429) [javac] at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819) [javac] at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727) [javac] at com.sun.tools.javac.main.Main.compile(Main.java:353) [javac] at com.sun.tools.javac.main.Main.compile(Main.java:279) [javac] at com.sun.tools.javac.main.Main.compile(Main.java:270) [javac] at com.sun.tools.javac.Main.compile(Main.java:69) [javac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [javac] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [javac] at java.lang.reflect.Method.invoke(Method.java:597) [javac] at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56) [javac] at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1065) [javac] at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:882) [javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) [javac] at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) [javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [javac] at java.lang.reflect.Method.invoke(Method.java:597) [javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [javac] at org.apache.tools.ant.Task.perform(Task.java:348) [javac] at org.apache.tools.ant.Target.execute(Target.java:357) [javac] at org.apache.tools.ant.Target.performTasks(Target.java:385) [javac] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) [javac] at org.apache.tools.ant.Project.executeTarget(Project.java:1306) [javac] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) [javac] at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32) [javac] at org.apache.tools.ant.Project.executeTargets(Project.java:1189) BUILD FAILED Is there any way to fix this?
  10. Hi , i am looking for a pathnode generator (from my geodata files) where i can find this program?
  11. Gia tous 2 apo pano, Eidate pouthena na leei to palikari oti tha aniksei server me files tou 2000?
  12. Kaneis den asxolite me to Lineage 2 eidika low rate kai eidika INTERLUDE opios psaxnei gia ellhniko server google: lineage 2 greek low rate sigoura tha vreite kati. Episis mono gia anti - ddos thes 200+ euro to mina.
  13. Hello , I have a problem regarding olympiad The problem is that if player 1 logout before moved into olympiad arena player 1 and player 2 can't register - unregister from olympiad matchs. They get message already registered but they never moved into olympiad after this error. Code: protected boolean checkDefaulted() { _game._playerOne = L2World.getInstance().getPlayer(_game._playerOneName); _game._players.set(0, _game._playerOne); _game._playerTwo = L2World.getInstance().getPlayer(_game._playerTwoName); _game._players.set(1, _game._playerTwo); for (int i = 0; i < 2; i++) { boolean defaulted = false; L2PcInstance player = _game._players.get(i); if (player != null) player.getOlympiadManagement().setOlympiadGameId(_game._stadiumID); L2PcInstance otherPlayer = _game._players.get(i ^ 1); SystemMessage sm = null; if (player == null) { defaulted = true; } else if (player.isDead()) { sm = new SystemMessage(SystemMessageId.C1_CANNOT_PARTICIPATE_OLYMPIAD_WHILE_DEAD); sm.addPcName(player); defaulted = true; } else if (player.isSubClassActive()) { sm = new SystemMessage(SystemMessageId.C1_CANNOT_PARTICIPATE_IN_OLYMPIAD_WHILE_CHANGED_TO_SUB_CLASS); sm.addPcName(player); defaulted = true; } else if (player.isCursedWeaponEquipped()) { sm = new SystemMessage(SystemMessageId.C1_CANNOT_JOIN_OLYMPIAD_POSSESSING_S2); sm.addPcName(player); sm.addItemName(player.getCursedWeaponEquippedId()); defaulted = true; } else if (player.getInventoryLimit() * 0.8 <= player.getInventory().getSize()) { sm = new SystemMessage(SystemMessageId.C1_CANNOT_PARTICIPATE_IN_OLYMPIAD_INVENTORY_SLOT_EXCEEDS_80_PERCENT); sm.addPcName(player); defaulted = true; } if (defaulted) { if (player != null) player.sendPacket(sm); if (otherPlayer != null) otherPlayer.sendPacket(SystemMessageId.THE_GAME_CANCELLED_DUE_TO_OPPONENT); if (i == 0) _game._playerOneDefaulted = true; else _game._playerTwoDefaulted = true; } } return _game._playerOneDefaulted || _game._playerTwoDefaulted; } public void run() { _started = true; if (_game != null) { if (_game._playerOne == null || _game._playerTwo == null) { return; } if (teleportCountdown()) runGame(); _game._competitionStarted = false; _terminated = true; _game.validateWinner(); _game.PlayersStatusBack(); _game.cleanEffects(); if (_game._gamestarted) { _game._gamestarted = false; OlympiadManager.STADIUMS[_game._stadiumID].closeDoors(); try { _game.portPlayersBack(); } catch (final Exception e) { _log.log(Level.SEVERE, "Problem occured while porting " + "players back from oly", e); } } if (OlympiadManager.STADIUMS[_game._stadiumID].getSpectators() != null) { for (L2PcInstance spec : OlympiadManager.STADIUMS[_game._stadiumID].getSpectators()) { if (spec != null) spec.sendPacket(new ExOlympiadMatchEnd()); } } if (_game._spawnOne != null) { _game._spawnOne.getLastSpawn().deleteMe(); _game._spawnOne = null; } if (_game._spawnTwo != null) { _game._spawnTwo.getLastSpawn().deleteMe(); _game._spawnTwo = null; } _game.clearPlayers(); OlympiadManager.getInstance().removeOlympiadGame(_game); _game = null; } } I tried to add _game.clearPlayers(); after _game._playerTwoDefaulted = true; This fixed the problem with register but player that make force logout before game start don't loose any points. Thanks for your time.
  14. Hello guys i have one issue with a quest that gives vitality when its complete In java it is like this and works: player.getVitalityManagement().setVitalityPoints(20000, true); So in python that i have it like this: player.getVitalityManagement().setVitalityPoints(20000,true) I get error when a player click to npc to complete one quest error: Traceback (innermost last): File "__init__.py", line 140, in onTalk NameError: true at org.python.core.Py.NameError(Unknown Source) at org.python.core.PyFrame.getglobal(Unknown Source) at org.python.pycode.serializable._pyx1365247187573.onTalk$5(__init__.p at org.python.pycode.serializable._pyx1365247187573.call_function(__ini at org.python.core.PyTableCode.call(Unknown Source) at org.python.core.PyTableCode.call(Unknown Source) at org.python.core.PyTableCode.call(Unknown Source) at org.python.core.PyFunction.__call__(Unknown Source) at org.python.core.PyMethod.__call__(Unknown Source) at org.python.core.PyObject.__call__(Unknown Source) at org.python.core.PyObject._jcallexc(Unknown Source)
  15. Hope server will raise more players to be more fun I am playing from start what i notice -Some ppl report bugs and they fixed fast -Gm's are active almost all day and answer to pms -Its low rate and they don't sell anything with euros only hats.
  16. Good luck with your server its difficult to start on low rate but i will give it a try because its seems like old good times. And about your shop i think that will help a lot of ppl its an update from High Five, good that you didn't add weapons.
  17. Hello guys after leveling hellbound to lvl 6 [EnchantedMegaliths mobs spawn then] and to level 7 [Chimera spawn then] I get this error in my gameserver with huge spam and server must shutdown to fix this. _log.warning("respawn delay is negative for spawn:"+this); if i remember says for ID0 So i gone to Leveling_System and remove this line: if newLevel == 6: changeBoxesSpawnState(1) This fixed my problem for lvl 6 (but ofc need restart server to spawn EnchantedMegaliths mobs. If anyone knows what means respawn delay is negative for spawn ID0 or why i get this message infinity times in gameserver i will appreciate any help Tnx.
  18. Guys seems like linux command was wrong i run the 3 sql files that i wanted with this command .\ accounts.sql From mysql it finds the location auto and execute it.
  19. I am trying to excute l2jdb.sql to my linux server , running for 5 hours and still not finish is this suppose to be so many hours? I run this command: mysql -u user -p data_base_name_here < l2jdb.sql From ps -A i see one process 7 ? 05:28:58 migration/1 . Thanks.
  20. Still sin eater stuck at 85lvl and 99,99% experience
×
×
  • Create New...