Jump to content
  • 0

[Help] TvT and more...


Question

6 answers to this question

Recommended Posts

  • 0
Posted

I made this without Eclipse so I might have forgotten a thing or two but thats the basic.

 

/*
* 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 com.l2jfree.gameserver;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.l2jfree.gameserver.model.L2World;
import com.l2jfree.gameserver.model.entity.events.CTF;
import com.l2jfree.gameserver.model.entity.events.TvT;
import com.l2jfree.tools.random.Rnd;


/**
* @author Horus
*
*/

public class EventManager
{
private static EventManager	_instance;
private final static Log		_log					= LogFactory.getLog(EventManager.class.getName());

class StartEvent implements Runnable
{
	public void run()
	{
		if(L2World.getInstance().getAllPlayers().size() >= 10)
		{
			int _chance = Rnd.get(0, 100);
			if(_chance >= 0 && _chance <50)
			{
				TvT.loadData();
				TvT.autoEvent();
			}
			else if(_chance >= 50 && _chance < 101)
			{
				CTF.loadData();
				CTF.autoEvent();
			}
		}
		else
			_log.warn("Event Manager: Event Startup Failed due to lack of Players.");
	}
}

public static EventManager getInstance()
{
	if (_instance == null)
		_instance = new EventManager();
	return _instance;
}

private EventManager()
{
	ThreadPoolManager.getInstance().scheduleGeneral(new StartEvent(), 16000);
}
}

 

About the NPC just make an NPC with the Type "L2EventManager"

  • 0
Posted

Guide about tvt,ctf and dm on L2JFree files is already shared , so use search option and you will find this .

 

Btw , press //tvt , or //ctf or //dmevent and it will show you very simple configuration window .

  • 0
Posted

i need the htm codes for tvt and ctf events

They are already there ? Just make an NPC with the type L2EventManager

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • 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