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 .

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...