Jump to content
  • 0

[Help] PC Bang Points Event


NumL0ck

Question

# 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

Link to comment
Share on other sites

Recommended Posts

  • 0

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?

Link to comment
Share on other sites

  • 0
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;
}
}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...