Jump to content

NumL0ck

Banned
  • Posts

    296
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by NumL0ck

  1. omg i do it my self:D all working, i set player.setPvpLord(false); in 23:59 and after that in 00:00 i maked L2PcInstance nPvpLord = L2World.getInstance().getPlayer(newPvpLord); if (nPvpLord == null || nPvpLord.isOnline() == 0) etc... big thanks to you and all who help me:D can lock this!
  2. and one problem:) if player with more todaypvps not online no one is pvp lord... and then player which is pvp lord is online and have 1 todaypvps but is player who have 100 but this player is offline set pvp lord player who is pvp lord... my english is bad, please say to me you understand me:D
  3. omg man its working big thanks to ^Wyatt and to you vampir you help me every time:D to not create new topic one question its simple:D i have max_poly and i need my npc to dance in max_poly is abnormalEffect i now is danceStun but which id or something like that i need put in abnormalEffect? because if i put danceStun i have error:D column row = 1 etc.
  4. omg man its working but its only clean pvp lord:(
  5. state = con.prepareStatement("UPDATE characters SET todaypvps=0,todaypks=0,todaydeaths=0 WHERE obj_Id=?"); state.setInt(1, masterId); state.execute(); state.close(); p.setTodayPvps(0); p.setTodayPks(0); p.setTodayDeaths(0); } Announcements.getInstance().announceToAll("PvP Lord is : "+p.getName()); Announcements.getInstance().announceToAll("Today PvPs: "+topTodayPvps); } } yes?
  6. http://maxcheaters.com/forum/index.php?topic=237353.0 if you help to me, you will be best:D
  7. its like pvpkills and pkkills
  8. ^Wyatt, For the problem of server restart... create a boolean alreadycleaned = false, set it to true when the pvplord comes, and then in the task that save the values when restarting the server, if that boolean is true don't save. i don't understand this, because i'm newbie on coding, i use eclipse only one week, so please explain better, thanks.
  9. and pvplord fields are not cleaned, yes should be cleaned of all ppl. because as i say in my server is command .getstats which show todaypvps,etc. and every day 24h then olympiad ends its cleaning, but code not working.:(
  10. i maked then olympiad end to open this code, and search player with most todaypvps, this is working code make me pvp lord but don't clear todaypvps,todaypks,todaydeaths...
  11. Hello all! It's a mission help to me:D How can i make only todaypvps,todaypks,todaydeaths clear to 0? because this code is not working correctly. It's only make in navicat everywhere 0 but! after server restart points are back:( package com.l2jfrozen.gameserver.model.entity; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Calendar; import java.sql.SQLException; import com.l2jfrozen.util.database.L2DatabaseFactory; import com.l2jfrozen.gameserver.model.entity.Announcements; import com.l2jfrozen.gameserver.thread.ThreadPoolManager; import com.l2jfrozen.gameserver.model.L2World; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; public class PvpLordTask { public static void newPvpLord(){ int masterId = 0; int topTodayPvps = 0; Connection con = null; PreparedStatement state = null; ResultSet rset = null; try{ con = L2DatabaseFactory.getInstance().getConnection(); state = con.prepareStatement("SELECT obj_Id,todaypvps FROM characters ORDER BY todaypvps DESC LIMIT 1;"); rset = state.executeQuery(); if(rset.next()) masterId = rset.getInt(1); if(masterId == 0) return; topTodayPvps = rset.getInt("todaypvps"); state.close(); rset.close(); for(L2PcInstance p : L2World.getInstance().getAllPlayers()){ if(p.getObjectId() == masterId) { p.sendMessage("You are the PvP Lord!"); p.setPvpLord(true); p.broadcastUserInfo(); state = con.prepareStatement("UPDATE characters SET pvplord=1 WHERE obj_Id=?"); state.setInt(1, masterId); state.execute(); state.close(); state = con.prepareStatement("UPDATE characters SET todaypvps=0,todaypks=0,todaydeaths=0 WHERE obj_Id=?"); state.setInt(1, masterId); state.execute(); state.close(); } Announcements.getInstance().announceToAll("PvP Lord is : "+p.getName()); Announcements.getInstance().announceToAll("Today PvPs: "+topTodayPvps); } } catch(Exception e){ e.printStackTrace(); } finally{ try { con.close(); } catch (SQLException e) { e.printStackTrace(); } } } }
  12. lock it, i create new topic with more explain.
  13. now i use this code, and made after olympiad end is new pvp lord, but then made new pvp lord i need todaypvps,todaypks,todaydeaths clear, then is new pvp lord in navicat set todaypvps,todaypks,todaydeaths 0 but in game i have command getstats, then i wrote it, it show to me real todaypvps,todaypks,todaydeaths and after server restart in navicat back real points, how make that after new pvp lord todaypvps,todaypks,todaydeaths set to 0 and then made new pvp lord, old pvp lord in navicat set pvplord 0 package com.l2jfrozen.gameserver.model.entity; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Calendar; import java.sql.SQLException; import com.l2jfrozen.util.database.L2DatabaseFactory; import com.l2jfrozen.gameserver.model.entity.Announcements; import com.l2jfrozen.gameserver.thread.ThreadPoolManager; import com.l2jfrozen.gameserver.model.L2World; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; public class PvpLordTask { public static void newPvpLord(){ int masterId = 0; int topTodayPvps = 0; Connection con = null; PreparedStatement state = null; ResultSet rset = null; try{ con = L2DatabaseFactory.getInstance().getConnection(); state = con.prepareStatement("SELECT obj_Id,todaypvps FROM characters ORDER BY todaypvps DESC LIMIT 1;"); rset = state.executeQuery(); if(rset.next()) masterId = rset.getInt(1); if(masterId == 0) return; topTodayPvps = rset.getInt("todaypvps"); state.close(); rset.close(); for(L2PcInstance p : L2World.getInstance().getAllPlayers()){ if(p.getObjectId() == masterId) { p.sendMessage("You are the PvP Lord!"); p.setPvpLord(true); p.broadcastUserInfo(); state = con.prepareStatement("UPDATE characters SET pvplord=1 WHERE obj_Id=?"); state.setInt(1, masterId); state.execute(); state.close(); state = con.prepareStatement("UPDATE characters SET todaypvps=0,todaypks=0,todaydeaths=0 WHERE obj_Id!=?"); state.setInt(1, masterId); state.execute(); state.close(); } Announcements.getInstance().announceToAll("PvP Lord is : "+p.getName()); Announcements.getInstance().announceToAll("Today PvPs: "+topTodayPvps); } } catch(Exception e){ e.printStackTrace(); } finally{ try { con.close(); } catch (SQLException e) { e.printStackTrace(); } } } }
  14. vampir, i'm to newbie, after 1 week i use eclipse, but with your help i understand this more and more, so please help to me. in gameserver.java i maked PvpLordTask.getInstance(); _log.info("!!!PvpLordTask: loaded!!!"); this is working, then loading gameserver i see it
  15. all working, but i don't understand why in my set time don't set pvp lord and clean todaypvps, todaypks, todaydeaths as i say i wait 10 minutes, but nothing, i change time, but nothing, no errors, so vampir please help to me, because in this situation i'm 0, if i have money i pay to you, i swear, if you help to me i share this to all, PLEASE!!!
  16. but if i now what i check, i'm to newbie, please vampir help me, last time...
  17. sorry... where put this System.out.println("write something in console") everywhere?
  18. pc bang point event fixed, thanks, you can lock it, and i create new topic to pvp lord engine.
  19. i prefet to be pvp lord in 16:17 but nothing i wait 10 minutes BUT NOTHING... :(( this is code... package com.l2jfrozen.gameserver.model.entity; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Calendar; import com.l2jfrozen.util.database.L2DatabaseFactory; import com.l2jfrozen.gameserver.model.entity.Announcements; import com.l2jfrozen.gameserver.thread.ThreadPoolManager; import com.l2jfrozen.gameserver.model.L2World; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; /** + * + * @author Fanky + */ public class PvpLordTask { public static void getInstance() { ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() { public void run() { String currentPvpLord = null, newPvpLord = null; int topTodayPvps = 0; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement stm = con.prepareStatement("SELECT char_name FROM characters WHERE pvplord=? AND accesslevel=?"); stm.setInt(1, 1); stm.setInt(2, 1); ResultSet rSet = stm.executeQuery(); if (rSet.next()) { currentPvpLord = rSet.getString("char_name"); } rSet.close(); stm.close(); if (currentPvpLord != null) { boolean cont = false; L2PcInstance cPvpLord = L2World.getInstance().getPlayer(currentPvpLord); if (cPvpLord == null || cPvpLord.isOnline() == 0) { cont = true; } else { cPvpLord.setPvpLord(false); cPvpLord.broadcastUserInfo(); } if (cont) { stm = con.prepareStatement("UPDATE characters SET pvplord=? WHERE char_name=?"); stm.setInt(1, 0); stm.setString(2, currentPvpLord); stm.execute(); stm.close(); } } stm = con.prepareStatement("SELECT todaypvps,char_name FROM characters WHERE accesslevel=? ORDER BY todaypvps DESC LIMIT 1"); stm.setInt(1, 0); rSet = stm.executeQuery(); if (rSet.next()) { newPvpLord = rSet.getString("char_name"); topTodayPvps = rSet.getInt("todaypvps"); } rSet.close(); stm.close(); boolean cont = false; L2PcInstance nPvpLord = L2World.getInstance().getPlayer(newPvpLord); if (nPvpLord == null || nPvpLord.isOnline() == 0) { cont = true; } else { nPvpLord.setPvpLord(true); nPvpLord.broadcastUserInfo(); } if (cont) { stm = con.prepareStatement("UPDATE characters SET pvplord=? WHERE char_name=?"); stm.setInt(1, 1); stm.setString(2, newPvpLord); stm.execute(); stm.close(); } stm = con.prepareStatement("UPDATE characters SET todaypvps=?,todaypks=?,todaydeaths=?"); stm.setInt(1, 0); stm.execute(); stm.close(); Announcements.getInstance().announceToAll("New PvP Lord: "+newPvpLord); Announcements.getInstance().announceToAll(newPvpLord+", Today PvPs: "+topTodayPvps); } catch (Exception e) { } finally { try { con.close(); } catch (Exception e) { } } } } , getValidationTime()); } private static long getValidationTime() { Calendar cld = Calendar.getInstance(); cld.set(Calendar.HOUR_OF_DAY, 16); cld.set(Calendar.MINUTE, 17); long time = cld.getTimeInMillis(); if (System.currentTimeMillis()-time <= 0) { return time; } return 0; } }
  20. package com.l2jfrozen.gameserver.model.entity; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Calendar; import com.l2jfrozen.util.database.L2DatabaseFactory; import com.l2jfrozen.gameserver.model.entity.Announcements; import com.l2jfrozen.gameserver.thread.ThreadPoolManager; import com.l2jfrozen.gameserver.model.L2World; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; /** + * + * @author Fanky + */ public class PvpLordTask { public static void getInstance() { ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() { public void run() { String currentPvpLord = null, newPvpLord = null; int topTodayPvps = 0; Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement stm = con.prepareStatement("SELECT char_name FROM characters WHERE pvplord=? AND accesslevel=?"); stm.setInt(1, 1); stm.setInt(2, 1); ResultSet rSet = stm.executeQuery(); if (rSet.next()) { currentPvpLord = rSet.getString("char_name"); } rSet.close(); stm.close(); if (currentPvpLord != null) { boolean cont = false; L2PcInstance cPvpLord = L2World.getInstance().getPlayer(currentPvpLord); if (cPvpLord == null || cPvpLord.isOnline() == 0) { cont = true; } else { cPvpLord.setPvpLord(false); cPvpLord.broadcastUserInfo(); } if (cont) { stm = con.prepareStatement("UPDATE characters SET pvplord=? WHERE char_name=?"); stm.setInt(1, 0); stm.setString(2, currentPvpLord); stm.execute(); stm.close(); } } stm = con.prepareStatement("SELECT todaypvps,char_name FROM characters WHERE accesslevel=? ORDER BY todaypvps DESC LIMIT 1"); stm.setInt(1, 0); rSet = stm.executeQuery(); if (rSet.next()) { newPvpLord = rSet.getString("char_name"); topTodayPvps = rSet.getInt("todaypvps"); } rSet.close(); stm.close(); boolean cont = false; L2PcInstance nPvpLord = L2World.getInstance().getPlayer(newPvpLord); if (nPvpLord == null || nPvpLord.isOnline() == 0) { cont = true; } else { nPvpLord.setPvpLord(true); nPvpLord.broadcastUserInfo(); } if (cont) { stm = con.prepareStatement("UPDATE characters SET pvplord=? WHERE char_name=?"); stm.setInt(1, 1); stm.setString(2, newPvpLord); stm.execute(); stm.close(); } stm = con.prepareStatement("UPDATE characters SET todaypvps=?,todaypks=?,todaydeaths=?"); stm.setInt(1, 0); stm.execute(); stm.close(); Announcements.getInstance().announceToAll("New PvP Lord: "+newPvpLord); Announcements.getInstance().announceToAll(newPvpLord+", Today PvPs: "+topTodayPvps); } catch (Exception e) { } finally { try { con.close(); } catch (Exception e) { } } } } , getValidationTime()); } private static long getValidationTime() { Calendar cld = Calendar.getInstance(); cld.set(Calendar.HOUR_OF_DAY, 16); cld.set(Calendar.MINUTE, 17); long time = cld.getTimeInMillis(); if (System.currentTimeMillis()-time <= 0) { return time; } return 0; } }
  21. i prefet to be pvp lord in 16:17 but nothing i wait 10 minutes BUT NOTHING... :((
  22. to not create new topic, vampir i need your help, i made on this http://maxcheaters.com/forum/index.php?topic=238056.msg2145283#msg2145283 - pvp lord engine private static long getValidationTime() { Calendar cld = Calendar.getInstance(); cld.set(Calendar.HOUR_OF_DAY, 16); cld.set(Calendar.MINUTE, 17); long time = cld.getTimeInMillis(); if (System.currentTimeMillis()-time <= 0) { return time; } return 0; } } but don't working in 16:17 I had become pvp lord but didn't become, why?
  23. i fixed it my self, but thanks for helping, lock it:)
  24. # Event Time Stamp. # Default: 900 PcBangPointTimeStamp = 6000 so if i make 3600 pc bang points every 1 hour will be add?
×
×
  • Create New...