Bläddra i källkod

BETA: Removing TvT Manager from core.

Reviewed by: Nos, UnAfraid, St3eT
Zoey76 11 år sedan
förälder
incheckning
cc53f12c11

+ 22 - 5
L2J_Server_BETA/dist/game/config/L2JMods.properties

@@ -132,44 +132,61 @@ WeddingDivorceCosts = 20
 # CustomNpcTable = True in General.properties
 # ---------------------------------------------------------------------------
 # Enable/Disable TvTEvent System
+# Default: False
 TvTEventEnabled = False
 
 # TvT in instance
+# Default: False
 TvTEventInInstance = False
 
 # Name of the instance file for TvT
+# Default: coliseum.xml
 TvTEventInstanceFile = coliseum.xml
 
 # Times TvT will occur (24h format).
+# Default: 9:00,15:00,21:00,3:00
 TvTEventInterval = 9:00,15:00,21:00,3:00
 
 # Registration timer from start of event (in minutes).
-TvTEventParticipationTime = 60
+# Default: 30
+TvTEventParticipationTime = 30
 
 # Event running time (in minutes).
+# Default: 20
 TvTEventRunningTime = 20
 
 # TvT Event NPC (create a custom npc of type L2TvTEventNpc).
+# Default: 70010
 TvTEventParticipationNpcId = 70010
 
 # TvT Event Participation Fee (itemId, number). Fee is not returned.
 # Example: 57,100000
-# Default = none
+# Default: 0,0
 TvTEventParticipationFee = 0,0
 
 # Location for TvTEvent NPC to spawn in form x,y,z[,heading]
+# Default: 83425,148585,-3406
 TvTEventParticipationNpcCoordinates = 83425,148585,-3406
 
-# Min/Max amount of players allowed in each team.
+# Minimum amount of players allowed in each team.
+# Default: 1
 TvTEventMinPlayersInTeams = 1
+# Maximum amount of players allowed in each team.
+# Default: 20
 TvTEventMaxPlayersInTeams = 20
 
-# Min/Max level of players that may join the event.
+# Minimum level of players that may join the event.
+# Default: 1
 TvTEventMinPlayerLevel = 1
+# Maximum level of players that may join the event.
+# Default: 85
 TvTEventMaxPlayerLevel = 85
 
-# Repsawn and exit delay timers (in seconds).
+# Respawn delay timer (in seconds).
+# Default: 10
 TvTEventRespawnTeleportDelay = 10
+# Exit delay timer (in seconds).
+# Default: 10
 TvTEventStartLeaveTeleportDelay = 10
 
 # First Team - Name, Start/Death x,y,z location.

+ 0 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/enums/InstanceType.java

@@ -107,7 +107,6 @@ public enum InstanceType
 	// Custom
 	L2ClassMasterInstance(L2NpcInstance),
 	L2NpcBufferInstance(L2Npc),
-	L2TvTEventNpcInstance(L2Npc),
 	L2WeddingManagerInstance(L2Npc),
 	L2EventMobInstance(L2Npc);
 	

+ 0 - 112
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2TvTEventNpcInstance.java

@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server 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.
- * 
- * L2J Server 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.l2jserver.gameserver.model.actor.instance;
-
-import com.l2jserver.Config;
-import com.l2jserver.gameserver.cache.HtmCache;
-import com.l2jserver.gameserver.enums.InstanceType;
-import com.l2jserver.gameserver.model.actor.L2Npc;
-import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
-import com.l2jserver.gameserver.model.entity.TvTEvent;
-import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
-import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
-
-public class L2TvTEventNpcInstance extends L2Npc
-{
-	private static final String htmlPath = "data/html/mods/TvTEvent/";
-	
-	public L2TvTEventNpcInstance(int objectId, L2NpcTemplate template)
-	{
-		super(objectId, template);
-		setInstanceType(InstanceType.L2TvTEventNpcInstance);
-	}
-	
-	@Override
-	public void onBypassFeedback(L2PcInstance playerInstance, String command)
-	{
-		TvTEvent.onBypass(command, playerInstance);
-	}
-	
-	@Override
-	public void showChatWindow(L2PcInstance playerInstance, int val)
-	{
-		if (playerInstance == null)
-		{
-			return;
-		}
-		
-		if (TvTEvent.isParticipating())
-		{
-			final boolean isParticipant = TvTEvent.isPlayerParticipant(playerInstance.getObjectId());
-			final String htmContent;
-			
-			if (!isParticipant)
-			{
-				htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "Participation.htm");
-			}
-			else
-			{
-				htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "RemoveParticipation.htm");
-			}
-			
-			if (htmContent != null)
-			{
-				int[] teamsPlayerCounts = TvTEvent.getTeamsPlayerCounts();
-				final NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(getObjectId());
-				
-				npcHtmlMessage.setHtml(htmContent);
-				npcHtmlMessage.replace("%objectId%", String.valueOf(getObjectId()));
-				npcHtmlMessage.replace("%team1name%", Config.TVT_EVENT_TEAM_1_NAME);
-				npcHtmlMessage.replace("%team1playercount%", String.valueOf(teamsPlayerCounts[0]));
-				npcHtmlMessage.replace("%team2name%", Config.TVT_EVENT_TEAM_2_NAME);
-				npcHtmlMessage.replace("%team2playercount%", String.valueOf(teamsPlayerCounts[1]));
-				npcHtmlMessage.replace("%playercount%", String.valueOf(teamsPlayerCounts[0] + teamsPlayerCounts[1]));
-				if (!isParticipant)
-				{
-					npcHtmlMessage.replace("%fee%", TvTEvent.getParticipationFee());
-				}
-				
-				playerInstance.sendPacket(npcHtmlMessage);
-			}
-		}
-		else if (TvTEvent.isStarting() || TvTEvent.isStarted())
-		{
-			final String htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "Status.htm");
-			
-			if (htmContent != null)
-			{
-				int[] teamsPlayerCounts = TvTEvent.getTeamsPlayerCounts();
-				int[] teamsPointsCounts = TvTEvent.getTeamsPoints();
-				final NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(getObjectId());
-				
-				npcHtmlMessage.setHtml(htmContent);
-				// npcHtmlMessage.replace("%objectId%", String.valueOf(getObjectId()));
-				npcHtmlMessage.replace("%team1name%", Config.TVT_EVENT_TEAM_1_NAME);
-				npcHtmlMessage.replace("%team1playercount%", String.valueOf(teamsPlayerCounts[0]));
-				npcHtmlMessage.replace("%team1points%", String.valueOf(teamsPointsCounts[0]));
-				npcHtmlMessage.replace("%team2name%", Config.TVT_EVENT_TEAM_2_NAME);
-				npcHtmlMessage.replace("%team2playercount%", String.valueOf(teamsPlayerCounts[1]));
-				npcHtmlMessage.replace("%team2points%", String.valueOf(teamsPointsCounts[1])); // <---- array index from 0 to 1 thx DaRkRaGe
-				playerInstance.sendPacket(npcHtmlMessage);
-			}
-		}
-		
-		playerInstance.sendPacket(ActionFailed.STATIC_PACKET);
-	}
-}

+ 0 - 109
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/TvTEvent.java

@@ -48,7 +48,6 @@ import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
 import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
 import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
-import com.l2jserver.gameserver.model.olympiad.OlympiadManager;
 import com.l2jserver.gameserver.model.skills.Skill;
 import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.clientpackets.Say2;
@@ -688,114 +687,6 @@ public class TvTEvent
 		}
 	}
 	
-	/**
-	 * Called on every bypass by npc of type L2TvTEventNpc<br>
-	 * Needs synchronization cause of the max player check<br>
-	 * <br>
-	 * @param command as String<br>
-	 * @param playerInstance as L2PcInstance<br>
-	 */
-	public static synchronized void onBypass(String command, L2PcInstance playerInstance)
-	{
-		if ((playerInstance == null) || !isParticipating())
-		{
-			return;
-		}
-		
-		final String htmContent;
-		
-		if (command.equals("tvt_event_participation"))
-		{
-			final NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage();
-			int playerLevel = playerInstance.getLevel();
-			
-			if (playerInstance.isCursedWeaponEquipped())
-			{
-				htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "CursedWeaponEquipped.htm");
-				if (htmContent != null)
-				{
-					npcHtmlMessage.setHtml(htmContent);
-				}
-			}
-			else if (OlympiadManager.getInstance().isRegistered(playerInstance))
-			{
-				htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "Olympiad.htm");
-				if (htmContent != null)
-				{
-					npcHtmlMessage.setHtml(htmContent);
-				}
-			}
-			else if (playerInstance.getKarma() > 0)
-			{
-				htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "Karma.htm");
-				if (htmContent != null)
-				{
-					npcHtmlMessage.setHtml(htmContent);
-				}
-			}
-			else if ((playerLevel < Config.TVT_EVENT_MIN_LVL) || (playerLevel > Config.TVT_EVENT_MAX_LVL))
-			{
-				htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "Level.htm");
-				if (htmContent != null)
-				{
-					npcHtmlMessage.setHtml(htmContent);
-					npcHtmlMessage.replace("%min%", String.valueOf(Config.TVT_EVENT_MIN_LVL));
-					npcHtmlMessage.replace("%max%", String.valueOf(Config.TVT_EVENT_MAX_LVL));
-				}
-			}
-			else if ((_teams[0].getParticipatedPlayerCount() == Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS) && (_teams[1].getParticipatedPlayerCount() == Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS))
-			{
-				htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "TeamsFull.htm");
-				if (htmContent != null)
-				{
-					npcHtmlMessage.setHtml(htmContent);
-					npcHtmlMessage.replace("%max%", String.valueOf(Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS));
-				}
-			}
-			else if ((Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP > 0) && !AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.TVT_ID, playerInstance, Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP))
-			{
-				htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "IPRestriction.htm");
-				if (htmContent != null)
-				{
-					npcHtmlMessage.setHtml(htmContent);
-					npcHtmlMessage.replace("%max%", String.valueOf(AntiFeedManager.getInstance().getLimit(playerInstance, Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP)));
-				}
-			}
-			else if (needParticipationFee() && !hasParticipationFee(playerInstance))
-			{
-				htmContent = HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "ParticipationFee.htm");
-				if (htmContent != null)
-				{
-					npcHtmlMessage.setHtml(htmContent);
-					npcHtmlMessage.replace("%fee%", getParticipationFee());
-				}
-			}
-			else if (addParticipant(playerInstance))
-			{
-				npcHtmlMessage.setHtml(HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "Registered.htm"));
-			}
-			else
-			{
-				return;
-			}
-			
-			playerInstance.sendPacket(npcHtmlMessage);
-		}
-		else if (command.equals("tvt_event_remove_participation"))
-		{
-			removeParticipant(playerInstance.getObjectId());
-			if (Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP > 0)
-			{
-				AntiFeedManager.getInstance().removePlayer(AntiFeedManager.TVT_ID, playerInstance);
-			}
-			
-			final NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage();
-			
-			npcHtmlMessage.setHtml(HtmCache.getInstance().getHtm(playerInstance.getHtmlPrefix(), htmlPath + "Unregistered.htm"));
-			playerInstance.sendPacket(npcHtmlMessage);
-		}
-	}
-	
 	/**
 	 * Called on every onAction in L2PcIstance<br>
 	 * <br>