Jump to content

Recommended Posts

Posted

Hello people :D i present you a very nice event engine by Intrepid

 

Some features:

 

separated times for initial delay(start time after server boot)

delay beetwen 2 events(automated)

registration time

preparation time

fight time

(all these are in milisec)

 

revive on by default

lots of checks for the event

cancel transform cancel cubic

unsummon pet

CW owner join Hero join config

saved disconnected players

2 spawn where players teleported on event start

and 2 spawn where player teleported on revive

(random)

and on kill reward

(each kill = reward)

/*
* 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.azaria.events;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import java.util.logging.Logger;

import javolution.util.FastMap;

import com.l2jserver.Config;
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.gameserver.Announcements;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.model.L2ItemInstance;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2CubicInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.util.Broadcast;
import com.l2jserver.tools.random.Rnd;

/**
* @author Intrepid
*
*/
public class DeathMatch
{
// declare logger
private static final Logger _log = Logger.getLogger(DeathMatch.class.getName());

// event name
private static final String _eventName = "DeathMatch";

// event finished and not started yet
private static final int STATUS_NOT_IN_PROGRESS = 0;

// event registration allowed
private static final int STATUS_REGISTRATION = 1;

// event registration ended and combat not started yet
private static final int STATUS_PREPARATION = 2;

// event players teleported to the event and combat starter
private static final int STATUS_COMBAT = 3;

// event combat ended wait setup for next event
private static final int STATUS_NEXT_EVENT = 4;

private static final String REMOVE_DISCONNECTED = "UPDATE characters SET heading=?,x=?,y=?,z=? WHERE charId=?";

/**
 * Initialize new/Returns the one and only instance<br><br>
 *
 * @return DeathMatch<br>
 */
public static DeathMatch getInstance()
{
	return SingletonHolder._instance;
}

private static class SingletonHolder
{
	protected static final DeathMatch _instance = new DeathMatch();
}

private final ThreadPoolManager				tpm;

private final autoEventTask					task;
private final reviveTask					taskDuring;
private ScheduledFuture<?>					reviver;
private ScheduledFuture<?>					event;
private int									announced;

private static FastMap<Integer,L2PcInstance>	players;

private volatile int						status;
private volatile boolean					active;

/**
 * private constructor
 */
private DeathMatch()
{
	tpm = ThreadPoolManager.getInstance();
	status = STATUS_NOT_IN_PROGRESS;
	announced = 0;
	players = new FastMap<Integer,L2PcInstance>(Config.DM_MAX_PARTICIPANT);
	task = new autoEventTask();
	taskDuring = new reviveTask();
	reviver = null;
	active = Config.DM_ALLOWED;
	if (active)
	{
		tpm.scheduleGeneral(task, Config.DM_DELAY_INITIAL_REGISTRATION);
		_log.info("DeathMatch: Initialized event enabled.");
	}
	else
		_log.info("DeathMatch: Initialized but not enabled.");
}

private class autoEventTask implements Runnable
{
	@Override
	public void run()
	{
		switch (status)
		{
			case STATUS_NOT_IN_PROGRESS:
				if (Config.DM_ALLOWED)
					registrationStart();
				else
					active = false;
				break;
			case STATUS_REGISTRATION:
				if (announced < (Config.DM_REGISTRATION_ANNOUNCEMENT_COUNT + 2))
					registrationAnnounce();
				else
					registrationEnd();
				break;
			case STATUS_PREPARATION:
				startEvent();
				break;
			case STATUS_COMBAT:
				endEvent();
				break;
			case STATUS_NEXT_EVENT:
				status = STATUS_NOT_IN_PROGRESS;
				tpm.scheduleGeneral(task, Config.DM_DELAY_BETWEEN_EVENTS);
				break;
			default:
				_log.severe("Incorrect status set in Automated " + _eventName + ", terminating the event!");
		}
	}
}

private class reviveTask implements Runnable
{
	@Override
	public void run()
	{
		L2PcInstance player;
		for (L2PcInstance p : players.values())
		{
			player = p.getActingPlayer();
			if (player != null && player.isDead())
				revive(player);
		}
	}
}


public void registerPlayer(L2PcInstance player)
{
	if (!active)
		return;

	if (status != STATUS_REGISTRATION || players.size() >= Config.DM_MAX_PARTICIPANT)
		player.sendPacket(SystemMessageId.REGISTRATION_PERIOD_OVER);
	else if(!players.containsValue(player))
	{
		if (!canJoin(player))
		{
			player.sendMessage("You can't join to the" + _eventName + " because you dont meet with the requirements!");
			return;
		}
		players.put(player.getObjectId(), player);
		player.sendMessage("You are successfully registered to: " + _eventName);
		if (Config.DM_REG_CANCEL)
			player.sendMessage("If you decide to cancel your registration use .leavedm!");
	}
	else
		player.sendMessage("You are alredy registered");
}

public void cancelRegistration(L2PcInstance player)
{
	if (!active)
		return;

	if (status != STATUS_REGISTRATION)
		player.sendPacket(SystemMessageId.REGISTRATION_PERIOD_OVER);
	else if (players.containsValue(player))
	{
		players.remove(player);
		player.sendMessage("You successfully cancelled your registration in " + _eventName);
	}
	else
		player.sendMessage("You are not a participant in" + _eventName);
}

public void registrationStart()
{
	status = STATUS_REGISTRATION;
	Announcements.getInstance().announceToAll(new SystemMessage(SystemMessageId.REGISTRATION_PERIOD));
	SystemMessage time = new SystemMessage(SystemMessageId.REGISTRATION_TIME_S1_S2_S3);
	long timeLeft = Config.DM_REGISTRATION_LENGHT/ 1000;
	time.addNumber((int) (timeLeft / 3600));
	time.addNumber((int) (timeLeft % 3600 / 60));
	time.addNumber((int) (timeLeft % 3600 % 60));
	Broadcast.toAllOnlinePlayers(time);
	Announcements.getInstance().announceToAll("To join the " + _eventName + " you must type .joindm");
	tpm.scheduleGeneral(task, Config.DM_REGISTRATION_LENGHT / (Config.DM_REGISTRATION_ANNOUNCEMENT_COUNT + 2));
}

public void registrationAnnounce()
{
	SystemMessage time = new SystemMessage(SystemMessageId.REGISTRATION_TIME_S1_S2_S3);
	long timeLeft = Config.DM_REGISTRATION_LENGHT;
	long elapsed = timeLeft / (Config.DM_REGISTRATION_ANNOUNCEMENT_COUNT + 2) * announced;
	timeLeft -= elapsed;
	timeLeft /= 1000;
	time.addNumber((int) (timeLeft / 3600));
	time.addNumber((int) (timeLeft % 3600 / 60));
	time.addNumber((int) (timeLeft % 3600 % 60));
	Broadcast.toAllOnlinePlayers(time);
	Announcements.getInstance().announceToAll("To join the " + _eventName + " you must type .joindm");
	announced++;
	tpm.scheduleGeneral(task, Config.DM_REGISTRATION_LENGHT / (Config.DM_REGISTRATION_ANNOUNCEMENT_COUNT + 2));
}

public void registrationEnd()
{
	announced = 0;
	status = STATUS_PREPARATION;

	for (L2PcInstance p : players.values())
	{
		if (p == null)
			continue;
		if (!canJoin(p))
		{
			p.sendMessage("You can't join to the" + _eventName + " because you dont meet with the requirements!");
			players.remove(p);
		}
	}

	if (players.size() <= Config.DM_MIN_PLAYER)
	{
		Announcements.getInstance().announceToAll(_eventName + "aborted not enough players!");
		players.clear();
		status = STATUS_NOT_IN_PROGRESS;
		tpm.scheduleGeneral(task, Config.DM_DELAY_BETWEEN_EVENTS);
		return;
	}

	SystemMessage time = new SystemMessage(SystemMessageId.BATTLE_BEGINS_S1_S2_S3);
	long timeLeft = Config.DM_PREPARATION_LENGHT / 1000;
	time.addNumber((int) (timeLeft / 3600));
	time.addNumber((int) (timeLeft % 3600 / 60));
	time.addNumber((int) (timeLeft % 3600 % 60));

	for (L2PcInstance p : players.values())
	{
		if (p == null)
			continue;

		p.setIsParalyzed(true);
		p.sendPacket(time);
		checkEquipment(p);
		if (Config.DM_CANCEL_PARTY_ONSTART && p.getParty() != null)
			p.getParty().removePartyMember(p);
		if (Config.DM_CANCEL_BUFF_ONSTART)
			p.stopAllEffects();
		if (Config.DM_CANCEL_CUBIC_ONSTART && !p.getCubics().isEmpty())
		{
			for (L2CubicInstance cubic : p.getCubics().values())
			{
				cubic.stopAction();
				cubic.cancelDisappear();
			}
			p.getCubics().clear();
		}
		if (Config.DM_UNSUMMON_PET_ONSTART && p.getPet() != null)
			p.getPet().unSummon(p);
		if (Config.DM_CANCEL_TRANSFORM_ONSTART && p.isTransformed())
			p.untransform();
		if (p.isDead())
			p.setIsPendingRevive(true);

		int spawn = Rnd.get(2);
		if (spawn == 0)
			p.teleToLocation(Config.DM_LOCX1,Config.DM_LOCY1,Config.DM_LOCZ1);
		if (spawn == 1)
			p.teleToLocation(Config.DM_LOCX2,Config.DM_LOCY2,Config.DM_LOCZ2);

		if (Config.DM_RECOVER_ONSTART && p.getCurrentCp() != p.getMaxCp() || p.getCurrentHp() != p.getMaxHp() || p.getCurrentMp() != p.getMaxMp())
		{
			p.getStatus().setCurrentCp(p.getMaxCp());
			p.getStatus().setCurrentHpMp(p.getMaxHp(), p.getMaxMp());
		}
	}
	tpm.scheduleGeneral(task, Config.DM_PREPARATION_LENGHT);
}

public void startEvent()
{
	status = STATUS_COMBAT;
	SystemMessage time = new SystemMessage(SystemMessageId.BATTLE_ENDS_S1_S2_S3);
	long timeLeft = Config.DM_EVENT_LENGHT / 1000;
	time.addNumber((int) (timeLeft / 3600));
	time.addNumber((int) (timeLeft % 3600 / 60));
	time.addNumber((int) (timeLeft % 3600 % 60));
	L2PcInstance player;
	for (L2PcInstance p : players.values())
	{
		player = p.getActingPlayer();
		if (player == null)
			continue;
		player.setIsParalyzed(false);
		player.sendPacket(time);
	}
	reviver = tpm.scheduleGeneralAtFixedRate(taskDuring, Config.DM_REVIVE_DELAY, Config.DM_REVIVE_DELAY);
	event = tpm.scheduleGeneral(task, Config.DM_EVENT_LENGHT);
}

public void endEvent()
{
	if (status != STATUS_COMBAT)
		return;
	status = STATUS_NEXT_EVENT;
	reviver.cancel(true);
	if (!event.cancel(false))
		return;

	Announcements.getInstance().announceToAll(_eventName + " is finished!");

	L2PcInstance player;
	for (L2PcInstance p : players.values())
	{
		player = p.getActingPlayer();
		if (player == null)
		{
			removeDisconnected(p.getObjectId(), p);
			continue;
		}
		removeFromEvent(player);
	}
	players.clear();
	tpm.scheduleGeneral(task, Config.DM_ENDING_LENGHT);
}

private void revive(L2PcInstance player)
{
	player.setIsPendingRevive(true);
	int teleTo = Rnd.get(1);
	if (teleTo == 1)
		player.teleToLocation(Config.DM_RANDOM_RESPAWN1_X, Config.DM_RANDOM_RESPAWN1_Y, Config.DM_RANDOM_RESPAWN1_Z);
	if (teleTo == 2)
		player.teleToLocation(Config.DM_RANDOM_RESPAWN2_X, Config.DM_RANDOM_RESPAWN2_Y, Config.DM_RANDOM_RESPAWN2_Z);
}

private boolean canJoin(L2PcInstance player)
{
	// level restriction
	boolean can = player.getLevel() <= Config.DM_MAX_LVL;
	can &= player.getLevel() >= Config.DM_MIN_LVL;
	// hero restriction
	if (!Config.DM_HERO_JOIN)
		can &= !player.isHero();
	// cw owner restriction
	if (Config.DM_CWOWNER_JOIN)
		can &= !player.isCursedWeaponEquipped();
	return can;
}

private final void checkEquipment(L2PcInstance player)
{
	L2ItemInstance item;
	for (int i = 0; i < 25; i++)
	{
		synchronized (player.getInventory())
		{
			item = player.getInventory().getPaperdollItem(i);
			if (item != null && !canUse(item.getItemId()))
				player.useEquippableItem(item, true);
		}
	}
}

public static final boolean canUse(int itemId)
{
	for (int id : Config.DM_DISALLOWED_ITEMS)
		if (itemId == id)
			return false;
	return true;
}

private void removeFromEvent(L2PcInstance player)
{
	if (!player.isDead())
	{
		player.getStatus().setCurrentCp(player.getMaxCp());
		player.getStatus().setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
	}
	else
		player.setIsPendingRevive(true);
	player.teleToLocation(Config.DM_TELE_BACK_X, Config.DM_TELE_BACK_Y, Config.DM_TELE_BACK_Z);
}

public final void removeDisconnected(int objID,L2PcInstance player)
{
	Connection con = null;
	try
	{
		con = L2DatabaseFactory.getInstance().getConnection();
		PreparedStatement ps = con.prepareStatement(REMOVE_DISCONNECTED);
		ps.setInt(1, player.getHeading());
		ps.setInt(2, Config.DM_TELE_BACK_X);
		ps.setInt(3, Config.DM_TELE_BACK_Y);
		ps.setInt(4, Config.DM_TELE_BACK_Z);
		ps.setInt(5, objID);
		ps.executeUpdate();
		ps.close();
	}
	catch (SQLException e)
	{
		_log.log(Level.WARNING,"Could not remove a disconnected DM player!", e);
	}
	finally
	{
		L2DatabaseFactory.close(con);
	}
}

public final void addDisconnected(L2PcInstance participant)
{
	switch (status)
	{
		case STATUS_REGISTRATION:
			if (Config.DM_REGISTER_AFTER_RELOG && !players.containsValue(participant))
				registerPlayer(participant);
			break;
		case STATUS_COMBAT:
			L2PcInstance p = players.get(participant.getObjectId());
			if (p == null)
				break;
			players.put(participant.getObjectId(), participant);
			checkEquipment(participant);
			int spawn = Rnd.get(2);
			if (spawn == 0)
				participant.teleToLocation(Config.DM_LOCX1,Config.DM_LOCY1,Config.DM_LOCZ1);
			if (spawn == 1)
				participant.teleToLocation(Config.DM_LOCX2,Config.DM_LOCY2,Config.DM_LOCZ2);
			break;
	}
}

public final void onKill(L2Character killer,L2PcInstance killed)
{
	if (status != STATUS_COMBAT)
		return;

	((L2PcInstance) killer).addItem("DEATHMACH", Config.DM_REWARD_ID, Config.DM_REWARD_COUNT, killer, false);
	killer.sendMessage(killer + "killed: " + killed);
	killed.sendMessage(killed + "killed by: " + killer);
}


public static final boolean isInProgress()
{
	switch (getInstance().status)
	{
	case STATUS_PREPARATION:
	case STATUS_COMBAT:
		return true;
	default:
		return false;
	}
}

public static final boolean isPlaying(L2PcInstance player)
{
	return isInProgress() && isMember(player);
}

public static final boolean isMember(L2PcInstance player)
{
	if (player == null)
		return false;

	switch (getInstance().status)
	{
		case STATUS_NOT_IN_PROGRESS:
			return false;
		case STATUS_REGISTRATION:
			return players.containsValue(player);
		case STATUS_PREPARATION:
			return players.containsValue(player) || isMember(player.getObjectId());
		case STATUS_COMBAT:
		case STATUS_NEXT_EVENT:
			return isMember(player.getObjectId());
		default:
			return false;
	}
}

private final static boolean isMember(int oID)
{
	return players.get(oID) != null;
}
}

 

 

Credits to: Intrepid and L2Azaria for the creation of the event

 

 

Posted

Well config is missing.

 

Not all shares need configs.

I have previously explained what configs are, it is just matter of help while controling the server.

And this engine is complete.

Posted

I made some 'config" files and applied to a fresh build epilogue...but no success to work :D. Actually nothing happen after starting server and am on lvl 0,1 on java so don't laugh to much about my config files :).If anyone have time to remake what is wrong or to help a little will be very nice for all of newbie out here :P...:

 

\ No newline at end of file
Index: java/com/l2jserver/Config.java
===================================================================
--- java/com/l2jserver/Config.java	(revision 4059)
+++ java/com/l2jserver/Config.java	(working copy)
@@ -583,6 +572,51 @@
	//--------------------------------------------------
	// L2JMods Settings
	//--------------------------------------------------
+	
+	public static boolean       DM_ALLOWED;
+	public static int           DM_MIN_PLAYER;
+	public static int           DM_MAX_PARTICIPANT;
+	public static int           DM_MIN_LVL;
+	public static int           DM_MAX_LVL;
+	public static int           DM_REWARD_ID;
+	public static int           DM_REWARD_COUNT;
+	public static long          DM_DELAY_INITIAL_REGISTRATION;
+	public static int           DM_REGISTRATION_ANNOUNCEMENT_COUNT;
+	public static long          DM_REGISTRATION_LENGHT;
+	public static long          DM_PREPARATION_LENGHT;
+	public static long          DM_EVENT_LENGHT;
+	public static long          DM_ENDING_LENGHT;
+	public static long          DM_DELAY_BETWEEN_EVENTS;
+	public static boolean       DM_RECOVER_ONSTART;
+	public static int           DM_REVIVE_DELAY;
+	public static boolean       DM_REGISTER_AFTER_RELOG;
+	public static boolean       DM_REG_CANCEL;
+	public static boolean       DM_HERO_JOIN;
+	public static boolean       DM_CWOWNER_JOIN;
+	public static String        DISALLOWED_ITEMS;
+	public static List<Integer> DM_DISALLOWED_ITEMS = new ArrayList<Integer>();
+	public static boolean       DM_CANCEL_PARTY_ONSTART;
+	public static boolean       DM_CANCEL_BUFF_ONSTART;
+	public static boolean       DM_CANCEL_CUBIC_ONSTART;
+	public static boolean       DM_UNSUMMON_PET_ONSTART;
+	public static boolean       DM_CANCEL_TRANSFORM_ONSTART;
+	public static int           DM_LOCX1;
+	public static int           DM_LOCY1;
+	public static int           DM_LOCZ1;
+	public static int           DM_LOCX2;
+	public static int           DM_LOCY2;
+	public static int           DM_LOCZ2;
+	public static int           DM_RANDOM_RESPAWN1_X;
+	public static int           DM_RANDOM_RESPAWN1_Y;
+	public static int           DM_RANDOM_RESPAWN1_Z;
+	public static int           DM_RANDOM_RESPAWN2_X;
+	public static int           DM_RANDOM_RESPAWN2_Y;
+	public static int           DM_RANDOM_RESPAWN2_Z;
+	public static int           DM_TELE_BACK_X;
+	public static int           DM_TELE_BACK_Y;
+	public static int           DM_TELE_BACK_Z;
+	
+	
	public static boolean L2JMOD_CHAMPION_ENABLE;
	public static boolean L2JMOD_CHAMPION_PASSIVE;
	public static int L2JMOD_CHAMPION_FREQUENCY;
@@ -1976,6 +2010,54 @@
					L2Properties L2JModSettings = new L2Properties();
					is = new FileInputStream(new File(L2JMOD_CONFIG_FILE));
					L2JModSettings.load(is);
+					
+					
+					DM_ALLOWED = Boolean.parseBoolean(L2JModSettings.getProperty("DMAllowed", "true"));
+					DM_MIN_PLAYER = Integer.parseInt(L2JModSettings.getProperty("DMMinPlayer", "2"));
+					DM_MAX_PARTICIPANT = Integer.parseInt(L2JModSettings.getProperty("DMMaxParticipant", "80"));
+					DM_MIN_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("DMMinLevel", "85"));
+					DM_MAX_LVL = (byte)Integer.parseInt(L2JModSettings.getProperty("DMMaxLevel", "85"));
+					DM_REWARD_ID = Integer.parseInt(L2JModSettings.getProperty("DMRewardID", "6393"));
+					DM_REWARD_COUNT = Integer.parseInt(L2JModSettings.getProperty("DMRewardCount", "1"));
+					DM_DELAY_INITIAL_REGISTRATION = Integer.parseInt(L2JModSettings.getProperty("DMInitialRegistration", "3600"));
+					DM_REGISTRATION_ANNOUNCEMENT_COUNT = Integer.parseInt(L2JModSettings.getProperty("DMRegAnnCount", "3600"));
+					DM_REGISTRATION_LENGHT = Long.parseLong(L2JModSettings.getProperty("DMRegLenght","3600"));
+					DM_PREPARATION_LENGHT = Long.parseLong(L2JModSettings.getProperty("DMPrepLenght","3600"));
+					DM_EVENT_LENGHT = Long.parseLong(L2JModSettings.getProperty("DMEventLenght","3600"));
+					DM_ENDING_LENGHT = Long.parseLong(L2JModSettings.getProperty("DMEndingLenght","3600"));
+					DM_DELAY_BETWEEN_EVENTS = Long.parseLong(L2JModSettings.getProperty("DMDelayBetweenEvents","3600"));
+					DM_RECOVER_ONSTART = Boolean.parseBoolean(L2JModSettings.getProperty("DMRecover", "true"));
+					DM_REVIVE_DELAY = Integer.parseInt(L2JModSettings.getProperty("DMReviveDelay", "10"));
+					DM_REGISTER_AFTER_RELOG = Boolean.parseBoolean(L2JModSettings.getProperty("DMRegAfterRelog", "false"));
+					DM_REG_CANCEL = Boolean.parseBoolean(L2JModSettings.getProperty("DMRegCancel", "true"));
+					DM_HERO_JOIN = Boolean.parseBoolean(L2JModSettings.getProperty("DMHeroJoin", "true"));
+					DM_CWOWNER_JOIN = Boolean.parseBoolean(L2JModSettings.getProperty("DMCursedAllowed", "true"));
+					DISALLOWED_ITEMS = L2JModSettings.getProperty("DisallowedItems", "0");
+					DM_DISALLOWED_ITEMS = new FastList<Integer>();
+					for (String id : DISALLOWED_ITEMS.split(","))
+					{
+						DM_DISALLOWED_ITEMS.add(Integer.parseInt(id));
+					}
+					DM_CANCEL_PARTY_ONSTART = Boolean.parseBoolean(L2JModSettings.getProperty("DMCancelParty", "true"));
+					DM_CANCEL_BUFF_ONSTART = Boolean.parseBoolean(L2JModSettings.getProperty("DMCancelBuff", "true"));
+					DM_CANCEL_CUBIC_ONSTART = Boolean.parseBoolean(L2JModSettings.getProperty("DMCancelCubic", "true"));
+					DM_UNSUMMON_PET_ONSTART = Boolean.parseBoolean(L2JModSettings.getProperty("DMUnsummonPet", "true"));
+					DM_CANCEL_TRANSFORM_ONSTART = Boolean.parseBoolean(L2JModSettings.getProperty("DMCancelTransform", "true"));
+					DM_LOCX1 = Integer.parseInt(L2JModSettings.getProperty("LocX1", "0"));
+					DM_LOCY1 = Integer.parseInt(L2JModSettings.getProperty("LocY1", "0"));
+					DM_LOCZ1 = Integer.parseInt(L2JModSettings.getProperty("LocZ1", "0"));
+					DM_LOCX2 = Integer.parseInt(L2JModSettings.getProperty("LocX2", "0"));
+					DM_LOCY2 = Integer.parseInt(L2JModSettings.getProperty("LocY2", "0"));
+					DM_LOCZ2 = Integer.parseInt(L2JModSettings.getProperty("LocZ2", "0"));
+					DM_RANDOM_RESPAWN1_X = Integer.parseInt(L2JModSettings.getProperty("Respawn1X", "0"));
+					DM_RANDOM_RESPAWN1_Y = Integer.parseInt(L2JModSettings.getProperty("Respawn1Y", "0"));
+					DM_RANDOM_RESPAWN1_Z = Integer.parseInt(L2JModSettings.getProperty("Respawn1Z", "0"));
+					DM_RANDOM_RESPAWN2_X = Integer.parseInt(L2JModSettings.getProperty("Respawn2X", "0"));
+					DM_RANDOM_RESPAWN2_Y = Integer.parseInt(L2JModSettings.getProperty("Respawn2Y", "0"));
+					DM_RANDOM_RESPAWN2_Z = Integer.parseInt(L2JModSettings.getProperty("Respawn2Z", "0"));
+					DM_TELE_BACK_X = Integer.parseInt(L2JModSettings.getProperty("TeleBackX", "0"));
+					DM_TELE_BACK_Y = Integer.parseInt(L2JModSettings.getProperty("TeleBackY", "0"));
+					DM_TELE_BACK_Z = Integer.parseInt(L2JModSettings.getProperty("TeleBackZ", "0"));

					L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
					L2JMOD_CHAMPION_PASSIVE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionPassive", "false"));
@@ -2815,7 +2897,30 @@
		else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH")) ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("CommonRecipeLimit")) COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);
+		
+		
+		
+		else if (pName.equalsIgnoreCase("DMAllowed")) DM_ALLOWED =	Boolean.parseBoolean(pValue);
+		else if (pName.equalsIgnoreCase("DMInitialRegistration")) DM_DELAY_INITIAL_REGISTRATION = Integer.parseInt(pValue);
+		else if (pName.equalsIgnoreCase("DMRegAnnCount")) DM_REGISTRATION_ANNOUNCEMENT_COUNT = Integer.parseInt(pValue);
+		else if (pName.equalsIgnoreCase("DMRegLenght")) DM_REGISTRATION_LENGHT = Long.parseLong(pValue);
+		else if (pName.equalsIgnoreCase("DMPrepLenght")) DM_PREPARATION_LENGHT = Long.parseLong(pValue);
+		else if (pName.equalsIgnoreCase("DMEventLenght")) DM_EVENT_LENGHT = Long.parseLong(pValue);
+		else if (pName.equalsIgnoreCase("DMEndingLenght")) DM_ENDING_LENGHT = Long.parseLong(pValue);
+		else if (pName.equalsIgnoreCase("DMDelayBetweenEvents")) DM_DELAY_BETWEEN_EVENTS = Long.parseLong(pValue);
+		else if (pName.equalsIgnoreCase("DMRecover")) DM_RECOVER_ONSTART =	Boolean.parseBoolean(pValue);
+		else if (pName.equalsIgnoreCase("DMReviveDelay")) DM_REVIVE_DELAY = Integer.parseInt(pValue);
+		else if (pName.equalsIgnoreCase("DMRegAfterRelog")) DM_REGISTER_AFTER_RELOG =	Boolean.parseBoolean(pValue);
+		else if (pName.equalsIgnoreCase("DMRegCancel")) DM_REG_CANCEL =	Boolean.parseBoolean(pValue);
+		else if (pName.equalsIgnoreCase("DMHeroJoin")) DM_HERO_JOIN =	Boolean.parseBoolean(pValue);
+		else if (pName.equalsIgnoreCase("DMCursedAllowed")) DM_CWOWNER_JOIN =	Boolean.parseBoolean(pValue);
+		else if (pName.equalsIgnoreCase("DMCancelParty")) DM_CANCEL_PARTY_ONSTART =	Boolean.parseBoolean(pValue);
+		else if (pName.equalsIgnoreCase("DMCancelBuff")) DM_CANCEL_BUFF_ONSTART =	Boolean.parseBoolean(pValue);
+		else if (pName.equalsIgnoreCase("DMCancelCubic")) DM_CANCEL_CUBIC_ONSTART =	Boolean.parseBoolean(pValue);
+		else if (pName.equalsIgnoreCase("DMUnsummonPet")) DM_UNSUMMON_PET_ONSTART =	Boolean.parseBoolean(pValue);
+		else if (pName.equalsIgnoreCase("DMCancelTransform")) DM_CANCEL_TRANSFORM_ONSTART =	Boolean.parseBoolean(pValue);

+
		else if (pName.equalsIgnoreCase("ChampionEnable")) L2JMOD_CHAMPION_ENABLE =	Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("ChampionFrequency")) L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("ChampionMinLevel")) L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties	(revision 4059)
+++ java/config/l2jmods.properties	(working copy)
@@ -1,7 +1,52 @@
# ---------------------------------------------------------------------------
# L2JMODS - non-retail-like systems that have been integrated into the L2J project.
# Be warned that there may be no support for these mods beyond the original author's assistance.
+
# ---------------------------------------------------------------------------
+# DeathMatch Event Config
+# ---------------------------------------------------------------------------
+DMAllowed = True
+DMMinPlayer = 2
+DMMaxParticipant = 80
+DMMinLevel = 85
+DMMaxLevel = 85
+DMRewardID = 6393
+DMRewardCount = 100
+DMInitialRegistration = 3600
+DMRegAnnCount = 3600
+DMRegLenght = 3600
+DMEventLenght = 3600
+DMDelayBetweenEvents = 3600
+DMRecover = True
+DMReviveDelay = 10
+DMRegAfterRelog = True
+DMRegCancel = True
+DMHeroJoin = True
+DMCursedAllowed = True
+DisallowedItems = 0
+DMCancelParty = True
+DMCancelBuff = True
+DMCancelCubic = True
+DMUnsummonPet = True
+DMCancelTransform = True
+LocX1  = 0
+LocY1  = 0
+LocZ1  = 0
+LocX2  = 0
+LocY2  = 0
+LocZ2  = 0
+Respawn1X = 0
+Respawn1Y = 0
+Respawn1Z = 0
+Respawn2X = 0
+Respawn2Y = 0
+Respawn2Z = 0
+TeleBackX = 0
+TeleBackY = 0
+TeleBackZ = 0
+
+
+# ---------------------------------------------------------------------------
# Champion mobs - Turn random mobs into Champions
# ---------------------------------------------------------------------------
# Enable/Disable Champion Mob System.

 

 

ty for the first version..

Posted

Shame Interpid is not here to take credits for his work.

 

I will mention it to him when I speak with him on msn.

 

Good share :)

Posted

Shame Interpid is not here to take credits for his work.

 

I will mention it to him when I speak with him on msn.

 

Good share :)

 

There's no need to do so, he already knows that ;]

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
Reply to this topic...

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