Jump to content
  • 0

l2j Dp Ctf problem.


Question

Posted

Ctf is my main problem, i cannot get rid of the errors , after i thought i fixed everything, it had to come up on the log.

 

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

import com.l2jserver.gameserver.Announcements;
import com.l2jserver.gameserver.datatables.ItemTable;
import com.l2jserver.gameserver.datatables.NpcTable;
import com.l2jserver.gameserver.instancemanager.ZoneManager;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.MultilingualAnnounce;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.effects.L2Effect;
import com.l2jserver.gameserver.model.effects.L2EffectType;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
import com.l2jserver.gameserver.model.quest.Event;
import com.l2jserver.gameserver.model.zone.L2ZoneType;
import com.l2jserver.gameserver.model.zone.form.ZoneCylinder;
import com.l2jserver.gameserver.model.zone.type.L2ScriptZone;
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jserver.gameserver.network.serverpackets.PlaySound;
import com.l2jserver.gameserver.util.ParseNumbers;
import com.l2jserver.gameserver.util.Util;

import gnu.trove.map.hash.TIntIntHashMap;
import gnu.trove.iterator.TIntIntIterator;

import java.util.Arrays;
/**
* 
* @author SqueezeD & Darki699 (idea by FBIAgent), GKR
* 
*/

public class CTF extends Event
{
private static final String QN	= "CTF";

private int _flagHoldTime;
private int _teamsCount;

private int _eventZoneId;
private int _zoneHeight;
private int _zoneWidthModifier;
private int _zoneEnterDelayTime;
private int _zoneLeaveDelayTime;

private int THRONE;
private int FLAG;
private int FLAG_IN_HAND;

private boolean _allowStrangers;

private int[][] _teamSpawnPoints;
private int[][] _teamFlagSpawnPoints;
private String[] _teamNames;

private TIntIntHashMap _spawnedFlags;
private TIntIntHashMap _flagOwners;
private TIntIntHashMap _scores;
private TIntIntHashMap _timers;

/** Constructor Part **/
public CTF(int questId, String name, String descr)
{
	super(questId, name, descr);

	if (isEnabled())
	{
		_eventZoneId = createEventZone(); 
		addFirstTalkId(FLAG);
		addEnterZoneId(_eventZoneId);
		addExitZoneId(_eventZoneId);
	}
}

/** Overriden methods from Quest class **/
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
	if (event.equalsIgnoreCase("hold_check"))
	{
		if (player != null)
		{
			if (_timers.containsKey(player.getObjectId()) && _flagOwners.containsKey(player.getObjectId()))
			{
				int remainedTime = _timers.get(player.getObjectId());

				if (remainedTime >= 60)
				{
					String msg = getMessage(player, "YOU_HAVE_$S1_MINUTES_TO_RETURN");
					msg = msg.replaceFirst("%.*?%", Integer.toString(remainedTime / 60));
					ExShowScreenMessage sm = new ExShowScreenMessage(msg, 5000);
					remainedTime -= 60;
					player.sendPacket(sm);
					_timers.put(player.getObjectId(), remainedTime);
					startQuestTimer("hold_check", 60000, null, player);
				}
				else
				{
					int flagTeamId = removeFlagFromPlayer(player);
					MultilingualAnnounce ma = getAnnounce("S1_EVENT_PLAYER_$S2_HOLDS_$3_TEAM_FLAG_TOO_LONG_FLAG_HAS_RETURNED_TO_BASE");

					if (ma != null)
					{
						addEventName(ma);
						ma.addCommonStringParameter(player.getName());
						ma.addCommonStringParameter(_teamNames[flagTeamId - 1]);
						announce(ma);
					}
					_timers.remove(player.getObjectId());
				}
			}
		}
	}

	else if (event.equalsIgnoreCase("zone_enter"))
	{
		L2ScriptZone eventZone = (L2ScriptZone) ZoneManager.getInstance().getZoneById(_eventZoneId);

		if (eventZone.isInsideZone(player))
			player.teleToLocation(Event.DEFAULT_RETURN_LOC[0], Event.DEFAULT_RETURN_LOC[1], Event.DEFAULT_RETURN_LOC[2]);
	}

	else if (event.equalsIgnoreCase("zone_leave"))
	{
		if (player != null)
		{
			L2ScriptZone eventZone = (L2ScriptZone) ZoneManager.getInstance().getZoneById(_eventZoneId);
			if (!eventZone.isInsideZone(player) || !player.isOnline())
			{
				int flagTeamId = removeFlagFromPlayer(player);

				MultilingualAnnounce ma;

				if (player.isOnline())
				{
					ma = getAnnounce("$S1_EVENT_PLAYER_$S2_LEAVES_EVENT_ZONE_WITH_$3_TEAM_FLAG_FLAG_HAS_RETURNED_TO_BASE");
				}
				else
				{
					ma = getAnnounce("$S1_EVENT_PLAYER_$S2_GOES_OFFLINE_WITH_$3_TEAM_FLAG_FLAG_HAS_RETURNED_TO_BASE");
				}

				if (ma != null)
				{
					addEventName(ma);
					ma.addCommonStringParameter(player.getName());
					ma.addCommonStringParameter(_teamNames[flagTeamId - 1]);
					announce(ma);
				}
			}
		}
		else
		{
			revalidateTakenFlags();
		}
	}

	return "";
}

@Override
public String onFirstTalk (L2Npc npc, L2PcInstance player)
{
	if (npc.getNpcId() == FLAG && _spawnedFlags.containsKey(npc.getObjectId()))
	{
		int playerTeamId = getPlayerTeamId(player);
		int flagTeamId = _spawnedFlags.get(npc.getObjectId());

		if (playerTeamId < 0)
			return "not_registered.htm";

		if (!isChallengePeriod())
			return "not_active.htm";

		// Own flag
		if (playerTeamId == flagTeamId)
		{
			// Player carries enemy flag
			if (npc.isInsideRadius(player, 100, true, true) && _flagOwners.containsKey(player.getObjectId()))
			{
				player.broadcastSocialAction(16); // amazing glow
				player.broadcastUserInfo();
				player.broadcastSocialAction(3); // Victory
				player.broadcastUserInfo();
				player.broadcastPacket(new PlaySound(0, "ItemSound.quest_finish", 1, player.getObjectId(), player.getX(), player.getY(), player.getZ()));
				player.broadcastUserInfo();

				int enemyflagTeamId = removeFlagFromPlayer(player);
				increaseScore(playerTeamId);

				MultilingualAnnounce ma = getAnnounce("$S1_EVENT_$2_TEAM_HAVE_BROUGHT_$3_TEAM_FLAG_TO_BASE");
				if (ma != null)
				{
					addEventName(ma);
					ma.addCommonStringParameter(_teamNames[playerTeamId - 1]);
					ma.addCommonStringParameter(_teamNames[enemyflagTeamId - 1]);
					announce(ma);
					String left = "";
					String right = "";

					for (int i = 0; i < _teamNames.length; i++)
					{
						left += (_teamNames[i] + " " + ":" + " ");
						int score = _scores.containsKey(i + 1) ? _scores.get(i + 1) : 0;
						right += (Integer.toString(score) + " " + ":" + " ");  
					}

					left = left.substring(0, left.length() - 2);
					right = right.substring(0, right.length() - 2);
					Announcements.getInstance().announceToEventPlayers(left + " - " + right, this);
				}
			} 
			else
			{
				return "your_flag.htm";
			}
		}
		// Player "talks" with enemy flag - take it!
		else
		{
			if (npc.isInsideRadius(player, 100, true, true) && !_flagOwners.containsValue(flagTeamId))
			{
				addFlagToPlayer(player, npc);
				unspawnFlag(npc);

				MultilingualAnnounce ma = getAnnounce("$S1_EVENT_$2_TEAM_HAVE_TAKEN_$3_TEAM_FLAG");
				if (ma != null)
				{
					addEventName(ma);
					ma.addCommonStringParameter(_teamNames[playerTeamId - 1]);
					ma.addCommonStringParameter(_teamNames[flagTeamId - 1]);
					announce(ma);
				}
			}
		}
	}

	return "";
}

@Override
public void onKill(L2Character killer, L2PcInstance victim)
{
	if (isChallengePeriod())
	{
		if (_flagOwners.containsKey(victim.getObjectId()))
		{
			int flagTeamId = removeFlagFromPlayer(victim);

			MultilingualAnnounce ma = killer.getActingPlayer() == null ? getAnnounce("S1_EVENT_PLAYER_$2_WAS_KILLED_BY_MONSTER_TEAM_$3_FLAG_WAS_RETURNED") : getAnnounce("$S1_EVENT_PLAYER_$2_WAS_KILLED_BY_$3_TEAM_$4_FLAG_WAS_RETURNED");

			addEventName(ma);
			if (ma != null)
			{
				ma.addCommonStringParameter(victim.getName());
				if (killer.getActingPlayer() != null)
					ma.addCommonStringParameter(killer.getActingPlayer().getName());
				ma.addCommonStringParameter(_teamNames[flagTeamId - 1]);
				announce(ma);				
			}
		}
	}
}

@Override
public String onEnterZone(L2Character character, L2ZoneType zone)
{
	if (character instanceof L2PcInstance && !_allowStrangers && isChallengePeriod() && !atEvent(character.getActingPlayer()))
	{
		ExShowScreenMessage sm = new ExShowScreenMessage(getMessage(character.getActingPlayer(), "YOU_HAVE_ENTERED_INTO_EVENT_ZONE"), 10000);
		character.getActingPlayer().sendPacket(sm);		

		if (getQuestTimer("zone_enter", null, character.getActingPlayer()) == null)
			startQuestTimer("zone_enter", _zoneEnterDelayTime * 1000, null, character.getActingPlayer());
	}

	return super.onEnterZone(character, zone);
}

@Override
public String onExitZone(L2Character character, L2ZoneType zone)
{
	if (character instanceof L2PcInstance && isChallengePeriod() && _flagOwners.containsKey(character.getObjectId()))
	{
		ExShowScreenMessage sm = new ExShowScreenMessage(getMessage(character.getActingPlayer(), "YOU_HAVE_LEFT_EVENT_ZONE"), 10000);
		character.getActingPlayer().sendPacket(sm);

		if (getQuestTimer("zone_leave", null, character.getActingPlayer()) == null)
		{
			int delay = character.getActingPlayer().isOnline() ? _zoneLeaveDelayTime * 1000 : 100;
			startQuestTimer("zone_leave", delay, null, character.getActingPlayer());
		}
	}

	return super.onExitZone(character, zone);
}

/** Overriden methods from Quest class end**/

/** Overriden methods from Event class **/
@Override
public boolean eventStart()
{
	if (isEnabled() && !isActive())
	{
		clearRegisteredPlayersList(false);
		clearTeams(false);
		setEventActive(true);
		startRegistrationTimer();
		return true;
	}

	return false;
}

@Override
public boolean eventBypass(L2PcInstance activeChar, String bypass)
{
	return false;
}

@Override
protected void startChallenge()
{
	// Check count, offline players will be removed, dead players will be teleported
	if (getRegisteredPlayersCount(true, false) < getMinPlayersLimit())
	{
		cancelEvent();
	}
	else
	{
		// Split players into 2 equal teams, unregister odd players
		splitTeams(2);

		for (int teamId : getTeamsIds())
		{
			// Spawn NPC's
			// Throne
			L2Npc npc = addSpawn(THRONE, _teamFlagSpawnPoints[teamId - 1][0], _teamFlagSpawnPoints[teamId - 1][1], _teamFlagSpawnPoints[teamId - 1][2] - 10, 0, false, 0);
			npc.setTitle("Team " + _teamNames[teamId - 1] + " Throne");

			spawnFlag(teamId);
		}

		// Teleport
		teleportPlayers();

		// Start timer to challenge finish
		startChallengeTimer();
	}
}

@Override
protected void finishChallenge(boolean forcedStop)
{
	// Set event status to inactive
	setEventActive(false);

	int[] scores = _scores.values();
	Arrays.sort(scores);

	// Tie
	if (scores.length == 0 || (scores.length > 1 && scores[0] == scores[scores.length - 1]))
	{
		MultilingualAnnounce ma = getAnnounce("$S1_EVENT_TIE");
		addEventName(ma);
		Announcements.getInstance().announceToAll(ma);
	}
	else
	{
		int maxScore = scores[scores.length - 1];

		for (int teamId : _scores.keys())
		{
			if (_scores.get(teamId) == maxScore)
			{
				rewardTeam(teamId);
				MultilingualAnnounce ma = getAnnounce("$S1_EVENT_TEAM_$S2_WINS");
				if (ma != null)
				{
					addEventName(ma);
					ma.addCommonStringParameter(_teamNames[teamId - 1]);
					Announcements.getInstance().announceToAll(ma);
				}
			}
		}
	}

	teleportPlayers();

	// Free memory
	clear();
}

@Override
public void onEnter(L2PcInstance player)
{
	if (!_flagOwners.contains(player.getObjectId()))
		removeFlag(player);

	if (_teamsCount == 2)
		player.setTeam(getPlayerTeamId(player));
}

/** Original methods of this class **/
private void addFlagToPlayer(L2PcInstance player, L2Npc flag)
{
	if (player == null || getPlayerTeamId(player) < 0)
		return;

	//add the flag in his hands
	L2ItemInstance flagItem = ItemTable.getInstance().createItem("CTF Event Flag", FLAG_IN_HAND, 1, player, null);
	player.getInventory().equipItem(flagItem);
	_flagOwners.put(player.getObjectId(), _spawnedFlags.get(flag.getObjectId()));
	player.broadcastSocialAction(16); //amazing glow
	player.broadcastUserInfo();
	ExShowScreenMessage sm = new ExShowScreenMessage(getMessage(player, "YOU_GOT_IT_RETURN_TO_BASE"), 5000);
	player.sendPacket(sm);

	// If player is invisible, make them visible
	if (player.getAppearance().getInvisible())
	{
		@SuppressWarnings("unused")
		L2Effect eInvisible = player.getFirstEffect(L2EffectType.HIDE);
	}

	disallowWeaponChange(player);
	registerEventItem(flagItem);

	// Start hold timer, and store remaining time
	startQuestTimer("hold_check", 5000, null, player);
	_timers.put(player.getObjectId(), _flagHoldTime);
}

private void increaseScore(int teamId)
{
	int score = _scores.containsKey(teamId) ? _scores.get(teamId) : 0;
	_scores.put(teamId, score + 1);
}

private int createEventZone()
{
	// Calculate furthest points - slowest, but simplest :)
	double maxRange = 0;
	int[] point1 = new int[2];
	int[] point2 = new int[2];
	for (int[] teamSpawnPoint : _teamSpawnPoints)
	{
		for (int[] testSpawnPoint : _teamSpawnPoints)
		{
			double range = Util.calculateDistance(teamSpawnPoint[0], teamSpawnPoint[1], testSpawnPoint[0], testSpawnPoint[1]);
			if (range > maxRange)
			{
				maxRange = range;
				point1 = teamSpawnPoint;
				point2 = testSpawnPoint;
			}
		}
		for (int testSpawnPoint[] : _teamFlagSpawnPoints)
		{
			double range = Util.calculateDistance(teamSpawnPoint[0], teamSpawnPoint[1], testSpawnPoint[0], testSpawnPoint[1]);
			if (range > maxRange)
			{
				maxRange = range;
				point1 = teamSpawnPoint;
				point2 = testSpawnPoint;
			}
		}
	}
	for (int[] teamFlagSpawnPoint : _teamFlagSpawnPoints)
	{
		for (int testSpawnPoint[] : _teamFlagSpawnPoints)
		{
			double range = Util.calculateDistance(teamFlagSpawnPoint[0], teamFlagSpawnPoint[1], testSpawnPoint[0], testSpawnPoint[1]);
			if (range > maxRange)
			{
				maxRange = range;
				point1 = teamFlagSpawnPoint;
				point2 = testSpawnPoint;
			}
		}
	}

	// Calculate zone center
	int zoneCenterX = (point1[0] + point2[0]) / 2;
	int zoneCenterY = (point1[1] + point2[1]) / 2;
	int zoneCenterZ = (point1[2] + point2[2]) / 2;

	int zoneId = ZoneManager.getInstance().getNextZoneId();
	L2ScriptZone eventZone = new L2ScriptZone(zoneId);
	eventZone.setZone(new ZoneCylinder(zoneCenterX, zoneCenterY, zoneCenterZ - _zoneHeight / 2, zoneCenterZ + _zoneHeight / 2, (int) (maxRange / 2) + _zoneWidthModifier));
	ZoneManager.getInstance().addZone(zoneId, eventZone, L2World.getInstance().getAllWorldRegions());

	return zoneId; 
}

private int removeFlagFromPlayer(L2PcInstance player)
{
	int flagTeamId = -1;
	if (_flagOwners.containsKey(player.getObjectId()))
		flagTeamId = _flagOwners.get(player.getObjectId());

	if (flagTeamId > 0)
	{
		_flagOwners.remove(player.getObjectId());
		spawnFlag(flagTeamId);
	}

	removeFlag(player);

	return flagTeamId; 
}

private void removeFlag(L2PcInstance player)
{
	L2ItemInstance wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);

	if (wpn == null)
		wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);

	if (wpn != null && wpn.getItemId() == FLAG_IN_HAND)
	{
		int slot = player.getInventory().getSlotFromItem(wpn);
		player.getInventory().unEquipItemInBodySlot(slot);
		unregisterEventItem(wpn);
		player.destroyItem("CTF Event Flag", wpn, null, true);
		player.broadcastUserInfo();

		allowWeaponChange(player);

		// Cancel return message timer timer
		cancelQuestTimer("ret_message", null, player);
		_timers.remove(player.getObjectId());
	}
}

private void spawnFlag(int teamId)
{
	L2Npc npc = addSpawn(FLAG, _teamFlagSpawnPoints[teamId - 1][0], _teamFlagSpawnPoints[teamId - 1][1 ], _teamFlagSpawnPoints[teamId - 1][2], 0, false, 0);
	npc.setTitle("Team " + _teamNames[teamId - 1] + " Flag");
	_spawnedFlags.put(npc.getObjectId(), teamId);
}

private void unspawnFlag(L2Npc flag)
{
	flag.deleteMe();
	_spawnedFlags.remove(flag.getObjectId());
}

private void revalidateTakenFlags()
{
	for ( TIntIntIterator it = _flagOwners.iterator(); it.hasNext(); ) 
	{
		it.advance();

		if ( L2World.getInstance().getPlayer(it.key()) == null) 
		{
			MultilingualAnnounce ma = getAnnounce("$S1_EVENT_PLAYER_GOES_OFFLINE_WITH_$2_TEAM_FLAG_FLAG_HAS_RETURNED_TO_BASE");
			if (ma != null)
			{
				addEventName(ma);
				ma.addCommonStringParameter(_teamNames[it.value() - 1]);
				announce(ma);
			}
			spawnFlag(it.value());
			it.remove();
		}
	}
}

@Override
protected void clear()
{
	super.clear();

	// Clear info maps
	_spawnedFlags.clear();
	_flagOwners.clear();
	_scores.clear();
	_timers.clear();
}

protected void teleportPlayers()
{
	for (int teamId : getTeamsIds())
	{
		for (L2PcInstance pl : getTeamPlayers(teamId))
		{
			if (isActive())
			{
				moveToEvent(pl, _teamSpawnPoints[teamId - 1]);
				if (_teamsCount == 2)
					pl.setTeam(teamId);
			}
			else
			{
				// Check for taken flags
				if (_flagOwners.containsKey(pl.getObjectId()))
				{
					removeFlag(pl);
				}

				pl.setTeam(0);
				returnFromEvent(pl);
			}
		}
	}
}
/** Original methods of this class - end **/	

@Override
protected boolean checkParameters()
{
	String parsedParameter = "";
	try
	{
		// Count of the teams
		parsedParameter = "teamsCount";
		_teamsCount = getParameters().getInteger(parsedParameter);

		parsedParameter = "throneId";
		THRONE = getParameters().getInteger(parsedParameter);

		if (NpcTable.getInstance().getTemplate(THRONE) == null)
		{
			_log.warning("Event " + getScriptName() + ": Invalid Throne ID in config? Disabling event...");
			return false;
		}

		parsedParameter = "flagId";
		FLAG = getParameters().getInteger(parsedParameter);

		if (NpcTable.getInstance().getTemplate(FLAG) == null)
		{
			_log.warning("Event " + getScriptName() + ": Invalid Flag ID in config? Disabling event...");
			return false;
		}

		parsedParameter = "flagInHandId";
		FLAG_IN_HAND = getParameters().getInteger(parsedParameter);
		if (ItemTable.getInstance().getTemplate(FLAG_IN_HAND) == null)
		{
			_log.warning("Event " + getScriptName() + ": Invalid flag in hand item ID in config? Disabling event...");
			return false;
		}

		// Spawn Points for teams
		//_teamSpawnPoints = new int[_teamsCount][4];
		parsedParameter = "teamSpawnPoints";
		_teamSpawnPoints = ParseNumbers.parseCoordinatesList(getParameters().getString(parsedParameter), getScriptName(), parsedParameter);

		if (_teamSpawnPoints == null)
		{
			_log.warning("Event " + getScriptName() + ": Invalid spawn point for team in config? Disabling event...");
			return false;
		}

		if (_teamSpawnPoints.length < _teamsCount)
		{
			_log.warning("Event " + getScriptName() + ": Spawn coordinates count is lesser, than teams count? Disabling event...");
			return false;
		}

		// Spawn points for flags
		//_teamFlagSpawnPoints = new int[_teamsCount][4];
		parsedParameter = "teamFlagSpawnPoints";
		_teamFlagSpawnPoints = ParseNumbers.parseCoordinatesList(getParameters().getString(parsedParameter), getScriptName(), parsedParameter);

		if (_teamFlagSpawnPoints == null)
		{
			_log.warning("Event " + getScriptName() + ": Invalid spawn point for team flag in config? Disabling event...");
			return false;
		}

		if (_teamFlagSpawnPoints.length < _teamsCount)
		{
			_log.warning("Event " + getScriptName() + ": Spawn coordinates count is lesser, than team flags count? Disabling event...");
			return false;
		}


		// Team names
		parsedParameter = "teamNames";
		_teamNames = getParameters().getString(parsedParameter).split(",");

		if (_teamNames == null)
		{
			_log.warning("Event " + getScriptName() + ": Invalid \"teamNames\" record in config? Disabling event...");
			return false;
		}

		if (_teamNames.length < _teamsCount)
		{
			_log.warning("Event " + getScriptName() + ": Team names count is lesser, than teams count? Disabling event...");
			return false;
		}

		// Flag holding time
		parsedParameter = "flagHoldTime";
		_flagHoldTime = getParameters().getInteger(parsedParameter);

		parsedParameter = "zoneHeight";
		_zoneHeight = getParameters().getInteger(parsedParameter);

		parsedParameter = "zoneAdditionalRadius";
		_zoneWidthModifier = getParameters().getInteger(parsedParameter);

		parsedParameter = "allowStrangers";
		_allowStrangers	 = getParameters().getBool(parsedParameter);

		parsedParameter = "zoneEnterDelayTime";
		_zoneEnterDelayTime = getParameters().getInteger(parsedParameter);

		parsedParameter = "zoneLeaveDelayTime";
		_zoneLeaveDelayTime = getParameters().getInteger(parsedParameter);

		// Init data arrays
		_spawnedFlags = new TIntIntHashMap(_teamsCount);
		_flagOwners = new TIntIntHashMap(_teamsCount);
		_scores = new TIntIntHashMap(_teamsCount);
		_timers = new TIntIntHashMap();

		return true;

	}
	catch (NumberFormatException nfe)
	{
		_log.warning("Event " + getScriptName() + ": error in parameter format: " + parsedParameter + ". Disabling event...");
	}
	catch (IllegalArgumentException e)
	{
		_log.warning("Event " + getScriptName() + ": error in parameter " + parsedParameter + ". Disabling event...");
	}

	return false;

}

public static void main(String[] args)
{
	new CTF(-1, QN, "events");
}
}

 

No idea what is wrong, but i get loads of errors

 

scores- error

_timers-error

flagOwners- error

TIntIntHashMap- error

_spawnedFlags- error

 

so on so forth.

10 answers to this question

Recommended Posts

  • 0
Posted

the Ctf , is within an event engine that i have made, would i have to import it differently, or can i just update the current ctf file?

 

I do not want to mess with any other files, would you be kind enough to check it via skype or something?

  • 0
Posted

I added it to core side, just to look at these errors.. and the funny thing is, I don't have a single error from the list that you mentioned :P

 

So dunno what's the case, but I experienced like 2 or 3 times weird thing, Eclipse underline me ALL sayin' there is error.. Looks like Eclipse mess :o

  • 0
Posted

well , I think i found the core problem , it is because TintHashMap etc. doesnt exist in the new hi5 stable pack, this means that i would have to rewrite the codes entirly in order to suit the new codes improved by l2j

  • 0
Posted

Try using FastMap instead of TIntHashMap.

 

You have to do it like this though: FastMap<Integer(this is the id), Object(this is the object that responds to the corresponding id)>

  • 0
Posted

Yes i did interprid, and an4chy i already tried your solution, no help, well what i did is just delete my current engine, and refurbished the phoenix engine instead

  • 0
Posted

Yes i did interprid, and an4chy i already tried your solution, no help, well what i did is just delete my current engine, and refurbished the phoenix engine instead

 

well...i dont really know who tweeked this CTF you shared here, but thats the l2jfree CTF renamed. I suggest take a look into the 1 on the svn and you'll get your fix since l2jfree rarely use trove :)

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