Você não é registrado, por favor registre-se para ter acesso ao conteúdo completo.
Caso seja registrado, efetue login.
Esqueceu sua senha? Clique aqui
Recomendamos o uso do Mozilla Firefox para uma melhor visualização.    


Início Postados Hoje Marcar Fóruns Como Lidos Álbums Banidos SE Team Medalhas
Voltar   Secret Experience > Área L2J > [L2J] Downloads > [Lineage] Java Mods
Registrar Loteria VIPStaff SERegras do fórum Comunidade Arcade Postados Hoje Pesquisar Experience
   

Secret Experience.NET   Secret Experience Corporation - Welcome To The Real World
     Anúncios SE

 
 
LinkBack Ferramentas do Tópico Modos de Exibição
Prev Post Anterior   Próximo Post Next
Antigo 10-08-2010, 12:23 PM   #1 (permalink)
Membro - Karma
 
Avatar de B1Z4R0
 
Registrado em: Sep 2009
Localização: Rio Verde GO
Posts: 383
Agradeceu: 265
Agradecido 274 Vezes em 113 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Meu Sistema
Meu Estado:
Enviar mensagem via Windows Live Messenger para B1Z4R0
Nome Real: Paulo Eduardo Ferreira

Inventório de B1Z4R0

Padrão TvT Observer Mode

esse Mod Funciona como nas olympiads, para observar o event^^

Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
Index: D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java
===================================================================
--- D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java	(revision 4402)
+++ D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java	(working copy)
@@ -15,6 +15,7 @@
 package com.l2jserver.gameserver.network.clientpackets;
 
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.entity.TvTEvent;
 
 /**
  * format ch
@@ -44,7 +45,14 @@
 		L2PcInstance activeChar = getClient().getActiveChar();
 		if (activeChar == null)
 			return;
-		if (activeChar.inObserverMode()) activeChar.leaveOlympiadObserverMode();
+		//if (activeChar.inObserverMode()) activeChar.leaveOlympiadObserverMode();
+		if (activeChar.inObserverMode())
+		{
+			activeChar.leaveOlympiadObserverMode();
+
+			if (TvTEvent.isStarted())
+				TvTEvent.removeSpectator(activeChar);
+		}
 	}
 
 	/* (non-Javadoc)
Index: D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2TvTEventNpcInstance.java
===================================================================
--- D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2TvTEventNpcInstance.java	(revision 4402)
+++ D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2TvTEventNpcInstance.java	(working copy)
@@ -69,6 +69,9 @@
 				if (!isParticipant)
 					npcHtmlMessage.replace("%fee%", TvTEvent.getParticipationFee());
 
+				npcHtmlMessage.replace("%objectId%", String.valueOf(getObjectId()));
+				npcHtmlMessage.replace("%spectators%", String.valueOf(TvTEvent.getSpectatorCount()));
+
 				playerInstance.sendPacket(npcHtmlMessage);
 	    	}
 		}
Index: D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(revision 4402)
+++ D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -9986,6 +9986,24 @@
 		sendPacket(SystemMessage.sendString(message));
 	}
 
+	public void enterTvTObserverMode(int x, int y, int z)
+	{
+		_obsX = getX();
+		_obsY = getY();
+		_obsZ = getZ();
+
+        setTarget(null);
+        setIsInvul(true);
+		getAppearance().setInvisible();
+		sendPacket(new GMHide(1));
+
+		teleToLocation(x, y, z, false);
+		sendPacket(new ExOlympiadMode(3));
+
+		_observerMode = true;
+		broadcastUserInfo();
+	}
+	
 	public void enterObserverMode(int x, int y, int z)
 	{
 		_obsX = getX();
Index: D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/entity/TvTEvent.java
===================================================================
--- D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/entity/TvTEvent.java	(revision 4402)
+++ D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/entity/TvTEvent.java	(working copy)
@@ -50,7 +50,10 @@
 import com.l2jserver.util.StringUtil;
 
 import javolution.util.FastMap;
+import java.util.StringTokenizer;
 
+import com.l2jserver.util.L2FastList;
+
 /**
  * @author FBIagent
  */
@@ -80,6 +83,8 @@
 	/** Instance id<br> */
 	private static int _TvTEventInstance = 0;
 	
+	private static L2FastList<L2PcInstance> _spectators;
+	
 	/**
 	 * No instance of this class!<br>
 	 */
@@ -106,6 +111,7 @@
 	public static boolean startParticipation()
 	{
 		L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(Config.TVT_EVENT_PARTICIPATION_NPC_ID);
+		_spectators = new L2FastList<L2PcInstance>();
 		
 		if (tmpl == null)
 		{
@@ -396,6 +402,16 @@
 		// Cleanup of teams
 		_teams[0].cleanMe();
 		_teams[1].cleanMe();
+
+		for (L2PcInstance spec: _spectators)
+		{
+			if (spec != null )
+			{
+				spec.leaveOlympiadObserverMode();
+			}
+		}
+		_spectators = null;
+
 		// Set state INACTIVE
 		setState(EventState.INACTIVE);
 	}
@@ -599,9 +615,31 @@
 	 */
 	public static synchronized void onBypass(String command, L2PcInstance playerInstance)
 	{
-		if (playerInstance == null || !isParticipating())
+		//if (playerInstance == null || !isParticipating())
+		//	return;
+		if (playerInstance == null)
 			return;
-		
+
+		if (command.startsWith("watch_tvt"))
+		{
+			if (isStarted())
+			{
+				String val = command.substring(10);
+				StringTokenizer st = new StringTokenizer(val);
+				int x = Integer.parseInt(st.nextToken());
+				int y = Integer.parseInt(st.nextToken());
+				int z = Integer.parseInt(st.nextToken());
+
+				playerInstance.enterTvTObserverMode(x, y, z);
+				_spectators.add(playerInstance);
+
+			} else
+				return;
+		}
+
+		if (!isParticipating())
+			return;
+
 		final String htmContent;
 
 		if (command.equals("tvt_event_participation"))
@@ -1148,4 +1186,26 @@
 	{
 		return _TvTEventInstance;
 	}
+
+	public static int getSpectatorCount()
+	{
+		if (_spectators != null)
+			return _spectators.size();
+
+		return 0;
+	}
+
+	public static void removeSpectator(L2PcInstance spec)
+	{
+		if (_spectators != null && _spectators.contains(spec))
+			_spectators.remove(spec);
+	}
+
+	public static boolean isWatchingTvT(L2PcInstance spec)
+	{
+		if (_spectators != null && _spectators.contains(spec))
+			return true;
+
+		return false;
+	}
 }
Index: D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/olympiad/Olympiad.java
===================================================================
--- D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/olympiad/Olympiad.java	(revision 4402)
+++ D:/eclipse/workspace/l2jserver/L2_GameServer/java/com/l2jserver/gameserver/model/olympiad/Olympiad.java	(working copy)
@@ -54,6 +54,7 @@
 import com.l2jserver.util.L2FastList;
 
 import javolution.util.FastMap;
+import com.l2jserver.gameserver.model.entity.TvTEvent;
 
 public class Olympiad
 {
@@ -1580,6 +1581,9 @@
 	
 	public static void sendMatchList(L2PcInstance player)
 	{
+		if ( TvTEvent.isWatchingTvT(player) )
+			return;
+
 		NpcHtmlMessage message = new NpcHtmlMessage(0);
 		message.setFile(player.getHtmlPrefix(), Olympiad.OLYMPIAD_HTML_PATH + "olympiad_observe2.htm");
 
Index: D:/eclipse/workspace/l2jdp/data/html/mods/TvTEvent/Status.htm
===================================================================
--- D:/eclipse/workspace/l2jdp/data/html/mods/TvTEvent/Status.htm	(revision 7658)
+++ D:/eclipse/workspace/l2jdp/data/html/mods/TvTEvent/Status.htm	(working copy)
@@ -2,4 +2,12 @@
 Status:<br><br><center>
 %team1name% with %team1playercount% players and %team1points% points.<br1>
 %team2name% with %team2playercount% players and %team2points% points.<br>
+<br>
+<br>
+<br>
+Watching: %spectators%
+<br>
+<br>
+<br>
+<button value="Watch TvT" action="bypass -h npc_%objectId%_watch_tvt 149467 46716 -3413" width=90 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
 </center></body></html>
\ No newline at end of file

B1Z4R0 está offline  
Os Seguintes 7 Usuários disseram Obrigado(a) para B1Z4R0 por gostarem deste post :
gohandb (25-09-2010), Guma (13-08-2010), l2meteoro (03-05-2011), muthorat (22-08-2014), RazerNaga (06-09-2010), WebMaster_FoX (10-08-2010), {ADM}-Fenex (17-08-2010)
Links Patrocinados
 


Regras para Posts
Você não pode postar novos tópicos
Você não pode postar respostas
Você não pode postar anexos
Você não pode editar seus posts

Código [IMG] Sim
Código HTML Não
Trackbacks are Sim
Pingbacks are Sim
Refbacks are Sim



Horários baseados na GMT -3. Agora são 03:54 AM.
 



Search Engine Optimization by vBSEO 3.3.0