瀏覽代碼

TvT Engine: Comments, clean, onKill fix, onBypass fix, small feature, by FBIagent.
Details:
1. Changes comments in TvT files to be little bit self explaining.
2. Cleans unused code in TvTEventManager.java
3. Fixes a bug in TvTEvent.java in onKill where still was a bug where
players were not respawned on some rare situations. Also it adds a
small feature where players from your team get the message
"PlayerName: I killed TargetPlayerName!" when you kill an enemy.
4. 1 new method in L2Character named "mustFallDownOnDead()", which
is overwritten in L2PcInstance where checks can be added whatever a
player should fall down on dead or not.
5. In serverpackes Die.java changes member "_kill" to "_fallDown" which
is initialized with "mustFallDownOnDead()" from
L2Character/L2PcInstance.
6. Fixes on bypas bug where max players are not checked correctly.

Ahmed 17 年之前
父節點
當前提交
95ae05413b

+ 5 - 0
L2_GameServer_T1/java/net/sf/l2j/gameserver/model/L2Character.java

@@ -6470,4 +6470,9 @@ public abstract class L2Character extends L2Object
     {
         return (int)getStat().getElementAttributeUnholy();
     }
+
+    public boolean mustFallDownOnDeath()
+    {
+        return isDead();
+    }
 }

+ 6 - 0
L2_GameServer_T1/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

@@ -10925,4 +10925,10 @@ public final class L2PcInstance extends L2PlayableInstance
 	{
 		_forceBuff = fb;
 	}
+
+    @Override
+    public boolean mustFallDownOnDeath()
+    {
+        return super.mustFallDownOnDeath() && !TvTEvent.isPlayerParticipant(getName());
+    }
 }

+ 73 - 61
L2_GameServer_T1/java/net/sf/l2j/gameserver/model/entity/TvTEvent.java

@@ -17,6 +17,7 @@ package net.sf.l2j.gameserver.model.entity;
 import java.util.logging.Logger;
 
 import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.clientpackets.Say2;
 import net.sf.l2j.gameserver.datatables.DoorTable;
 import net.sf.l2j.gameserver.datatables.ItemTable;
 import net.sf.l2j.gameserver.datatables.NpcTable;
@@ -32,6 +33,7 @@ import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
 import net.sf.l2j.gameserver.model.actor.instance.L2SummonInstance;
 import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.serverpackets.CreatureSay;
 import net.sf.l2j.gameserver.serverpackets.MagicSkillUse;
 import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
 import net.sf.l2j.gameserver.serverpackets.StatusUpdate;
@@ -84,7 +86,7 @@ public class TvTEvent
 	 * 1. Get L2NpcTemplate by Config.TVT_EVENT_PARTICIPATION_NPC_ID<br>
 	 * 2. Try to spawn a new npc of it<br><br>
 	 *
-	 * @return boolean<br>
+	 * @return boolean: true if success, otherwise false<br>
 	 */
 	public static boolean startParticipation()
 	{
@@ -135,13 +137,13 @@ public class TvTEvent
 	 * 4. Set state EventState.STARTED<br>
 	 * 5. Teleport all participants to team spot<br><br>
 	 *
-	 * @return boolean<br>
+	 * @return boolean: true if success, otherwise false<br>
 	 */
 	public static boolean startFight()
 	{
 		setState(EventState.STARTING);
 
-		// not enought participants
+		// not enough participants
 		if (_teams[0].getParticipatedPlayerCount() < Config.TVT_EVENT_MIN_PLAYERS_IN_TEAMS || _teams[1].getParticipatedPlayerCount() < Config.TVT_EVENT_MIN_PLAYERS_IN_TEAMS)
 		{
 			setState(EventState.INACTIVE);
@@ -180,7 +182,7 @@ public class TvTEvent
 	 * 4. Reward team with more points<br>
 	 * 5. Show win html to wining team participants<br><br>
 	 *
-	 * @return String<br>
+	 * @return String: winning team name<br>
 	 */
 	public static String calculateRewards()
 	{
@@ -299,8 +301,8 @@ public class TvTEvent
 	 * 1. Calculate the id of the team in which the player should be added<br>
 	 * 2. Add the player to the calculated team<br><br>
 	 *
-	 * @param playerInstance<br>
-	 * @return boolean<br>
+	 * @param playerInstance as L2PcInstance<br>
+	 * @return boolean: true if success, otherwise false<br>
 	 */
 	public static synchronized boolean addParticipant(L2PcInstance playerInstance)
 	{
@@ -322,8 +324,8 @@ public class TvTEvent
 	 * 1. Get team id of the player<br>
 	 * 2. Remove player from it's team<br><br>
 	 *
-	 * @param playerName<br>
-	 * @return boolean<br>
+	 * @param playerName as String<br>
+	 * @return boolean: true if success, otherwise false<br>
 	 */
 	public static boolean removeParticipant(String playerName)
 	{
@@ -341,7 +343,7 @@ public class TvTEvent
 	 * 1. Send the message to all players of team number one<br>
 	 * 2. Send the message to all players of team number two<br><br>
 	 *
-	 * @param message<br>
+	 * @param message as String<br>
 	 */
 	public static void sysMsgToAllParticipants(String message)
 	{
@@ -400,7 +402,7 @@ public class TvTEvent
 	/**
 	 * Called when a player logs in<br><br>
 	 *
-	 * @param playerInstance<br>
+	 * @param playerInstance as L2PcInstance<br>
 	 */
 	public static void onLogin(L2PcInstance playerInstance)
 	{
@@ -419,7 +421,7 @@ public class TvTEvent
 	/**
 	 * Called when a player logs out<br><br>
 	 *
-	 * @param playerInstance<br>
+	 * @param playerInstance as L2PcInstance<br>
 	 */
 	public static void onLogout(L2PcInstance playerInstance)
 	{
@@ -433,8 +435,8 @@ 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<br>
-	 * @param playerInstance<br>
+	 * @param command as String<br>
+	 * @param playerInstance as L2PcInstance<br>
 	 */
 	public static synchronized void onBypass(String command, L2PcInstance playerInstance)
 	{
@@ -450,12 +452,10 @@ public class TvTEvent
 				npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>Cursed weapon owners are not allowed to participate.</body></html>");
 			else if (playerInstance.getKarma() > 0)
 				npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>Chaotic players are not allowed to participate.</body></html>");
-			else if (_teams[0].getParticipatedPlayerCount() >= Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS && _teams[1].getParticipatedPlayerCount() >= Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS)
-				npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>Sorry the event is full!</body></html>");
 			else if (playerLevel < Config.TVT_EVENT_MIN_LVL || playerLevel > Config.TVT_EVENT_MAX_LVL)
 				npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>Only players from level " + Config.TVT_EVENT_MIN_LVL + " to level " + Config.TVT_EVENT_MAX_LVL + " are allowed tro participate.</body></html>");
-			else if (_teams[0].getParticipatedPlayerCount() > 19 && _teams[1].getParticipatedPlayerCount() > 19)
-				npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>The event is full! Maximum of " + Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS + "  player are allowed in one team.</body></html>");
+			else if (_teams[0].getParticipatedPlayerCount() == Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS && _teams[1].getParticipatedPlayerCount() == Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS)
+				npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>The event is full! Only " + Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS + " players are allowed per team.</body></html>");
 			else if (addParticipant(playerInstance))
 				npcHtmlMessage.setHtml("<html><head><title>TvT Event</title></head><body>You are on the registration list now.</body></html>");
 			else // addParticipant returned false cause playerInstance == null
@@ -477,9 +477,9 @@ public class TvTEvent
 	/**
 	 * Called on every onAction in L2PcIstance<br><br>
 	 *
-	 * @param playerName<br>
-	 * @param targetPlayerName<br>
-	 * @return boolean<br>
+	 * @param playerName as String<br>
+	 * @param targetPlayerName as String<br>
+	 * @return boolean: true if player is allowed to target, otherwise false<br>
 	 */
 	public static boolean onAction(String playerName, String targetPlayerName)
 	{
@@ -510,8 +510,8 @@ public class TvTEvent
 	/**
 	 * Called on every potion use<br><br>
 	 *
-	 * @param playerName<br>
-	 * @return boolean<br>
+	 * @param playerName as String<br>
+	 * @return boolean: true if player is allowed to use potions, otherwise false<br>
 	 */
 	public static boolean onPotionUse(String playerName)
 	{
@@ -527,8 +527,8 @@ public class TvTEvent
 	/**
 	 * Called on every escape use(thanks to nbd)<br><br>
 	 *
-	 * @param playerName<br>
-	 * @return boolean<br>
+	 * @param playerName as String<br>
+	 * @return boolean: true if player is not in tvt event, otherwise false<br>
 	 */
 	public static boolean onEscapeUse(String playerName)
 	{
@@ -544,8 +544,8 @@ public class TvTEvent
 	/**
 	 * Called on every summon item use<br><br>
 	 *
-	 * @param playerName<br>
-	 * @return boolean<br>
+	 * @param playerName as String<br>
+	 * @return boolean: true if player is allowed to summon by item, otherwise false<br>
 	 */
 	public static boolean onItemSummon(String playerName)
 	{
@@ -560,18 +560,24 @@ public class TvTEvent
 
 	/**
 	 * Is called when a player is killed<br><br>
-	 *
-	 * @param killerCharacter<br>
-	 * @param killedPlayerInstance<br>
+	 * 
+	 * @param killerCharacter as L2Character<br>
+	 * @param killedPlayerInstance as L2PcInstance<br>
 	 */
 	public static void onKill(L2Character killerCharacter, L2PcInstance killedPlayerInstance)
 	{
-		if (killerCharacter == null || killedPlayerInstance == null ||
-			(!(killerCharacter instanceof L2PcInstance) &&
-			 !(killerCharacter instanceof L2PetInstance) &&
-			 !(killerCharacter instanceof L2SummonInstance)) ||
-			!isStarted())
-			return;
+	    if (!isStarted() || killedPlayerInstance == null)
+	        return;
+
+	    byte killedTeamId = getParticipantTeamId(killedPlayerInstance.getName());
+
+	    if (killedTeamId == -1)
+	        return;
+
+	    new TvTEventTeleporter(killedPlayerInstance, _teams[killedTeamId].getCoordinates(), false, false);
+
+	    if (killerCharacter == null)
+	        return;
 
 		L2PcInstance killerPlayerInstance = null;
 
@@ -582,27 +588,33 @@ public class TvTEvent
 			if (killerPlayerInstance == null)
 				return;
 		}
+		else if (killerCharacter instanceof L2PcInstance)
+		    killerPlayerInstance = (L2PcInstance)killerCharacter;
 		else
-			killerPlayerInstance = (L2PcInstance)killerCharacter;
+			return;
 
-		String playerName = killerPlayerInstance.getName();
-		byte killerTeamId = getParticipantTeamId(playerName);
+		byte killerTeamId = getParticipantTeamId(killerPlayerInstance.getName());
 
-		playerName = killedPlayerInstance.getName();
+		if (killerTeamId != -1 && killedTeamId != -1 && killerTeamId != killedTeamId)
+		{
+		    _teams[killerTeamId].increasePoints();
 
-		byte killedTeamId = getParticipantTeamId(playerName);
+		    CreatureSay cs = new CreatureSay(killerPlayerInstance.getObjectId(), Say2.TELL, killerPlayerInstance.getName(), "I have killed " + killedPlayerInstance.getName() + "!");
 
-		if (killerTeamId != -1 && killedTeamId != -1 && killerTeamId != killedTeamId)
-			_teams[killerTeamId].increasePoints();
+		    for (String playerName : _teams[killerTeamId].getParticipatedPlayers().keySet())
+		    {
+		        L2PcInstance playerInstance = _teams[killerTeamId].getParticipatedPlayers().get(playerName);
 
-		if (killedTeamId != -1)
-			new TvTEventTeleporter(killedPlayerInstance, _teams[killedTeamId].getCoordinates(), false, false);
+		        if (playerInstance != null)
+		            playerInstance.sendPacket(cs);
+		    }
+		}
 	}
 
 	/**
 	 * Sets the TvTEvent state<br><br>
 	 *
-	 * @param state<br>
+	 * @param state as EventState<br>
 	 */
 	private static void setState(EventState state)
 	{
@@ -615,7 +627,7 @@ public class TvTEvent
 	/**
 	 * Is TvTEvent inactive?<br><br>
 	 *
-	 * @return boolean<br>
+	 * @return boolean: true if event is inactive(waiting for next event cycle), otherwise false<br>
 	 */
 	public static boolean isInactive()
 	{
@@ -632,7 +644,7 @@ public class TvTEvent
 	/**
 	 * Is TvTEvent in inactivating?<br><br>
 	 *
-	 * @return boolean<br>
+	 * @return boolean: true if event is in inactivating progress, otherwise false<br>
 	 */
 	public static boolean isInactivating()
 	{
@@ -649,7 +661,7 @@ public class TvTEvent
 	/**
 	 * Is TvTEvent in participation?<br><br>
 	 *
-	 * @return boolean<br>
+	 * @return boolean: true if event is in participation progress, otherwise false<br>
 	 */
 	public static boolean isParticipating()
 	{
@@ -666,7 +678,7 @@ public class TvTEvent
 	/**
 	 * Is TvTEvent starting?<br><br>
 	 *
-	 * @return boolean<br>
+	 * @return boolean: true if event is starting up(setting up fighting spot, teleport players etc.), otherwise false<br>
 	 */
 	public static boolean isStarting()
 	{
@@ -683,7 +695,7 @@ public class TvTEvent
 	/**
 	 * Is TvTEvent started?<br><br>
 	 *
-	 * @return boolean<br>
+	 * @return boolean: true if event is started, otherwise false<br>
 	 */
 	public static boolean isStarted()
 	{
@@ -700,7 +712,7 @@ public class TvTEvent
 	/**
 	 * Is TvTEvent rewadrding?<br><br>
 	 *
-	 * @return boolean<br>
+	 * @return boolean: true if event is currently rewarding, otherwise false<br>
 	 */
 	public static boolean isRewarding()
 	{
@@ -717,8 +729,8 @@ public class TvTEvent
 	/**
 	 * Returns the team id of a player, if player is not participant it returns -1<br><br>
 	 *
-	 * @param playerName<br>
-	 * @return byte<br>
+	 * @param playerName as String<br>
+	 * @return byte: team name of the given playerName, if not in event -1<br>
 	 */
 	public static byte getParticipantTeamId(String playerName)
 	{
@@ -728,8 +740,8 @@ public class TvTEvent
 	/**
 	 * Returns the team coordinates in which the player is in, if player is not in a team return null<br><br>
 	 *
-	 * @param playerName<br>
-	 * @return int[]<br>
+	 * @param playerName as String<br>
+	 * @return int[]: coordinates of teams, 2 elements, index 0 for team 1 and index 1 for team 2<br>
 	 */
 	public static int[] getParticipantTeamCoordinates(String playerName)
 	{
@@ -740,8 +752,8 @@ public class TvTEvent
 	/**
 	 * Is given player participant of the event?<br><br>
 	 *
-	 * @param playerName<br>
-	 * @return boolean<br>
+	 * @param playerName as String<br>
+	 * @return boolean: true if player is participant, ohterwise false<br>
 	 */
 	public static boolean isPlayerParticipant(String playerName)
 	{
@@ -751,7 +763,7 @@ public class TvTEvent
 	/**
 	 * Returns participated player count<br><br>
 	 *
-	 * @return int<br>
+	 * @return int: amount of players registered in the event<br>
 	 */
 	public static int getParticipatedPlayersCount()
 	{
@@ -761,7 +773,7 @@ public class TvTEvent
 	/**
 	 * Returns teams names<br><br>
 	 *
-	 * @return String[]<br>
+	 * @return String[]: names of teams, 2 elements, index 0 for team 1 and index 1 for team 2<br>
 	 */
 	public static String[] getTeamNames()
 	{
@@ -771,7 +783,7 @@ public class TvTEvent
 	/**
 	 * Returns player count of both teams<br><br>
 	 *
-	 * @return int[]<br>
+	 * @return int[]: player count of teams, 2 elements, index 0 for team 1 and index 1 for team 2<br>
 	 */
 	public static int[] getTeamsPlayerCounts()
 	{
@@ -781,7 +793,7 @@ public class TvTEvent
 	/**
 	 * Returns points count of both teams
 	 *
-	 * @return int[]
+	 * @return int[]: points of teams, 2 elements, index 0 for team 1 and index 1 for team 2<br>
 	 */
 	public static int[] getTeamsPoints()
 	{

+ 13 - 13
L2_GameServer_T1/java/net/sf/l2j/gameserver/model/entity/TvTEventTeam.java

@@ -39,8 +39,8 @@ public class TvTEventTeam
 	/**
 	 * C'tor initialize the team<br><br>
 	 *
-	 * @param name<br>
-	 * @param coordinates<br>
+	 * @param name as String<br>
+	 * @param coordinates as int[]<br>
 	 */
 	public TvTEventTeam(String name, int[] coordinates)
 	{
@@ -52,8 +52,8 @@ public class TvTEventTeam
 	/**
 	 * Adds a player to the team<br><br>
 	 *
-	 * @param playerInstance<br>
-	 * @return boolean<br>
+	 * @param playerInstance as L2PcInstance<br>
+	 * @return boolean: true if success, otherwise false<br>
 	 */
 	public boolean addPlayer(L2PcInstance playerInstance)
 	{
@@ -76,7 +76,7 @@ public class TvTEventTeam
 	/**
 	 * Removes a player from the team<br><br>
 	 *
-	 * @param playerName<br>
+	 * @param playerName as String<br>
 	 */
 	public void removePlayer(String playerName)
 	{
@@ -110,8 +110,8 @@ public class TvTEventTeam
 	/**
 	 * Is given player in this team?<br><br>
 	 *
-	 * @param playerName<br>
-	 * @return boolean<br>
+	 * @param playerName as String<br>
+	 * @return boolean: true if player is in this team, otherwise false<br>
 	 */
 	public boolean containsPlayer(String playerName)
 	{
@@ -128,7 +128,7 @@ public class TvTEventTeam
 	/**
 	 * Returns the name of the team<br><br>
 	 *
-	 * @return String<br>
+	 * @return String: name of the team<br>
 	 */
 	public String getName()
 	{
@@ -138,7 +138,7 @@ public class TvTEventTeam
 	/**
 	 * Returns the coordinates of the team spot<br><br>
 	 *
-	 * @return int[]<br>
+	 * @return int[]: team coordinates<br>
 	 */
 	public int[] getCoordinates()
 	{
@@ -148,7 +148,7 @@ public class TvTEventTeam
 	/**
 	 * Returns the points of the team<br><br>
 	 *
-	 * @return short<br>
+	 * @return short: team points<br>
 	 */
 	public short getPoints()
 	{
@@ -158,7 +158,7 @@ public class TvTEventTeam
 	/**
 	 * Returns name and instance of all participated players in FastMap<br><br>
 	 *
-	 * @return Map<String, L2PcInstance><br>
+	 * @return Map<String, L2PcInstance>: map of players in this team<br>
 	 */
 	public Map<String, L2PcInstance> getParticipatedPlayers()
 	{
@@ -175,7 +175,7 @@ public class TvTEventTeam
 	/**
 	 * Returns name of all participated players in Vector<br><br>
 	 *
-	 * @return Vector<String><br>
+	 * @return Vector<String>: player names in vector<br>
 	 */
 	public Vector<String> getParticipatedPlayerNames()
 	{
@@ -192,7 +192,7 @@ public class TvTEventTeam
 	/**
 	 * Returns player count of this team<br><br>
 	 *
-	 * @return int<br>
+	 * @return int: number of players in team<br>
 	 */
 	public int getParticipatedPlayerCount()
 	{

+ 11 - 10
L2_GameServer_T1/java/net/sf/l2j/gameserver/model/entity/TvTEventTeleporter.java

@@ -30,11 +30,12 @@ public class TvTEventTeleporter implements Runnable
 	private boolean _adminRemove;
 
 	/**
-	 * Initialize the teleporter and start the delayed task
+	 * Initialize the teleporter and start the delayed task<br><br>
 	 *
-	 * @param playerInstance
-	 * @param coordinates
-	 * @param reAdd
+	 * @param playerInstance as L2PcInstance<br>
+	 * @param coordinates as int[]<br>
+	 * @param fastShedule as boolean<br>
+	 * @param adminRemove as boolean<br>
 	 */
 	public TvTEventTeleporter(L2PcInstance playerInstance, int[] coordinates, boolean fastSchedule, boolean adminRemove)
 	{
@@ -53,13 +54,13 @@ public class TvTEventTeleporter implements Runnable
 
 	/**
 	 * The task method to teleport the player<br>
-	 * 1. Unsummon pet if there is one
-	 * 2. Remove all effects
-	 * 3. Revive and full heal the player
-	 * 4. Teleport the player
-	 * 5. Broadcast status and user info
+	 * 1. Unsummon pet if there is one<br>
+	 * 2. Remove all effects<br>
+	 * 3. Revive and full heal the player<br>
+	 * 4. Teleport the player<br>
+	 * 5. Broadcast status and user info<br><br>
 	 *
-	 * @see java.lang.Runnable#run()
+	 * @see java.lang.Runnable#run()<br>
 	 */
 	public void run()
 	{

+ 23 - 45
L2_GameServer_T1/java/net/sf/l2j/gameserver/model/entity/TvTManager.java

@@ -23,13 +23,14 @@ import net.sf.l2j.gameserver.ThreadPoolManager;
 /**
  * @author FBIagent
  */
-public class TvTManager implements Runnable
+public class TvTManager
 {
     protected static final Logger _log = Logger.getLogger(TvTManager.class.getName());
     
 	/** The one and only instance of this class<br> */
 	private static TvTManager _instance = null;
 
+	/** Task for event cycles<br> */
     private TvTStartTask _task;
     
 	/**
@@ -57,24 +58,22 @@ public class TvTManager implements Runnable
 	 */
 	public static TvTManager getInstance()
 	{
-		if (_instance == null)
-			_instance = new TvTManager();
-
-		return _instance;
+	    return _instance == null ? ( _instance = new TvTManager() ) : _instance;
 	}
-    
+
+	/**
+	 * Starts TvTStartTask
+	 */
     public void scheduleEventStart()
     {
         _task = new TvTStartTask(System.currentTimeMillis() + Config.TVT_EVENT_INTERVAL*60*1000);
         ThreadPoolManager.getInstance().executeTask(_task);
     }
 
-	/**
-	 * The task method to handle cycles of the event<br><br>
-	 *
-	 * @see java.lang.Runnable#run()<br>
-	 */
-	public void run()
+    /**
+     * Method to start participation
+     */
+	public void startReg()
 	{
 	    if (!TvTEvent.startParticipation())
 	    {
@@ -93,6 +92,9 @@ public class TvTManager implements Runnable
 	    }
 	}
 
+	/**
+	 * Method to start the fight
+	 */
     public void startEvent()
     {
         if (!TvTEvent.startFight())
@@ -109,7 +111,10 @@ public class TvTManager implements Runnable
             ThreadPoolManager.getInstance().executeTask(_task);
         }
     }
-    
+
+    /**
+     * Method to end the event and reward
+     */
     public void endEvent()
     {
         Announcements.getInstance().announceToAll(TvTEvent.calculateRewards());
@@ -118,7 +123,10 @@ public class TvTManager implements Runnable
         
         this.scheduleEventStart();
     }
-    
+
+    /**
+     * Class for TvT cycles
+     */
     class TvTStartTask implements Runnable
     {
         private long _startTime;
@@ -183,7 +191,7 @@ public class TvTManager implements Runnable
                 // start
                 if (TvTEvent.isInactive())
                 {
-                    TvTManager.this.run();
+                    TvTManager.this.startReg();
                 }
                 else if (TvTEvent.isParticipating())
                 {
@@ -238,34 +246,4 @@ public class TvTManager implements Runnable
             }
         }
     }
-
-	/**
-	 * This method waits for a period time delay<br><br>
-	 *
-	 * @param interval<br>
-	 */
-	void waiter(int seconds)
-	{
-		while (seconds > 1)
-		{
-			seconds--; // here because we don't want to see two time announce at the same time
-
-			if (TvTEvent.isParticipating() || TvTEvent.isStarted())
-			{
-				
-			}
-
-			long oneSecWaitStart = System.currentTimeMillis();
-
-			while (oneSecWaitStart + 1000L > System.currentTimeMillis())
-			{
-				try
-				{
-					Thread.sleep(1);
-				}
-				catch (InterruptedException ie)
-				{}
-			}
-		}
-	}
 }

+ 3 - 3
L2_GameServer_T1/java/net/sf/l2j/gameserver/serverpackets/Die.java

@@ -36,7 +36,7 @@ public class Die extends L2GameServerPacket
 {
     private static final String _S__0B_DIE = "[S] 00 Die";
     private int _charObjId;
-    private boolean _fake;
+    private boolean _fallDown;
     private boolean _sweepable;
     private int _access;
     private net.sf.l2j.gameserver.model.L2Clan _clan;
@@ -56,7 +56,7 @@ public class Die extends L2GameServerPacket
 
         }
         _charObjId = cha.getObjectId();
-        _fake = !cha.isDead();
+        _fallDown = cha instanceof L2PcInstance ? ((L2PcInstance)cha).mustFallDownOnDeath() : cha.mustFallDownOnDeath();
         if (cha instanceof L2Attackable)
             _sweepable = ((L2Attackable)cha).isSweepActive();
 
@@ -65,7 +65,7 @@ public class Die extends L2GameServerPacket
     @Override
 	protected final void writeImpl()
     {
-        if (_fake)
+        if (!_fallDown)
             return;
 
         writeC(0x00);

+ 6 - 5
L2_GameServer_T1/java/net/sf/l2j/loginserver/serverpackets/L2LoginServerPacket.java

@@ -24,15 +24,16 @@ import org.mmocore.network.SendablePacket;
  */
 public abstract class L2LoginServerPacket extends SendablePacket<L2LoginClient>
 {
-
+	byte[] b = {(byte)0xFF,(byte)0xFF,(byte)0xFF};
+	
     /**
      * @see org.mmocore.network.SendablePacket#getHeaderSize()
      */
     @Override
     protected int getHeaderSize()
     {
-        return 2;
-    }
+    	return 2 + 3; // where X is the bytes u want to prepend
+    }    
 
     /**
      * @see org.mmocore.network.SendablePacket#writeHeader(int)
@@ -40,7 +41,7 @@ public abstract class L2LoginServerPacket extends SendablePacket<L2LoginClient>
     @Override
     protected void writeHeader(int dataSize)
     {
-        writeH(dataSize + this.getHeaderSize());
+    	writeB(b); // write before packet, size of this write must be X
+        writeH(dataSize + this.getHeaderSize() - 3); // dont include ur data in the L2 stuff
     }
-    
 }