NumL0ck Posted August 4, 2012 Posted August 4, 2012 # Min Player Level. # Default: 20 PcBangPointMinLevel = 1 # Min Count. # Default: 20 PcBangPointMinCount = 1 # Max Count. # Default: 1000000 PcBangPointMaxCount = 1 # Chance of get Double points. # Default: 20 PcBangPointDualChance = 0 # Event Time Stamp. # Default: 900 PcBangPointTimeStamp = 6000 PcBangPointTimeStamp = 6000 this means every 1 hour? or not? because i need every 1 hour people gain 1 pc bang point
0 NumL0ck Posted August 4, 2012 Author Posted August 4, 2012 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?
0 NumL0ck Posted August 4, 2012 Author Posted August 4, 2012 i prefet to be pvp lord in 16:17 but nothing i wait 10 minutes BUT NOTHING... :((
0 vampir Posted August 4, 2012 Posted August 4, 2012 u will need to show more than just getValidationTime(), coz it just returns time, nothing more :)
0 NumL0ck Posted August 4, 2012 Author Posted August 4, 2012 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; } }
0 NumL0ck Posted August 4, 2012 Author Posted August 4, 2012 pc bang point event fixed, thanks, you can lock it, and i create new topic to pvp lord engine.
Question
NumL0ck
PcBangPointTimeStamp = 6000 this means every 1 hour? or not?
because i need every 1 hour people gain 1 pc bang point
21 answers to this question
Recommended Posts