Noticias:

No tienes permiso para ver los enlaces. Para poder verlos Registrate o Conectate.

Menú Principal

Custom Dance System

Iniciado por Swarlog, Ago 03, 2025, 01:04 AM

Tema anterior - Siguiente tema

Swarlog

No tienes permiso para ver los enlaces. Para poder verlos Registrate o Conectate.



No tienes permiso para ver los enlaces. Para poder verlos Registrate o Conectate.

Sonidos (añadir en el cliente):
No tienes permiso para ver los enlaces. Para poder verlos Registrate o Conectate.?

### Eclipse Workspace Patch 1.0
#P L2J_DataPack
Index: dist/game/data/scripts/handlers/MasterHandler.java
===================================================================
--- dist/game/data/scripts/handlers/MasterHandler.java  (revision 9024)
+++ dist/game/data/scripts/handlers/MasterHandler.java  (working copy)
@@ -42,6 +42,7 @@
 import handlers.admincommandhandlers.AdminClan;
 import handlers.admincommandhandlers.AdminCreateItem;
 import handlers.admincommandhandlers.AdminCursedWeapons;
+import handlers.admincommandhandlers.AdminDanceSystem;
 import handlers.admincommandhandlers.AdminDebug;
 import handlers.admincommandhandlers.AdminDelete;
 import handlers.admincommandhandlers.AdminDisconnect;
@@ -431,6 +450,8 @@
                        AdminUnblockIp.class,
                        AdminVitality.class,
                        AdminZone.class,
+                       AdminDanceSystem.class,
                },
                {
                        // Bypass Handlers
Index: dist/game/data/html/admin/dancesystem.htm
===================================================================
--- dist/game/data/html/admin/dancesystem.htm	(revision 0)
+++ dist/game/data/html/admin/dancesystem.htm	(revision 0)
@@ -0,0 +1,17 @@
+<html><head><title>Dance Panel</title></head><body>
+<center><br><center><font color="3399ff">Infos:</font></center><br>
+<table width="270" cellpadding="5" bgcolor=444444>
+<tr>
+<td valign="top">From here you can start a dancing event! All players will dance untill the end of the song!<br> Just select the name of the song from the list above! During the event all players will be immortal and paralized !</td>!
+</tr>
+</table>
+</center>
+<br><br>
+<center><font color="3399ff">Songs List:</font></center><br>
+<center>
+<table width=125 border=0 bgcolor=444444><tr><br><br><br><br>
+<td><button action="bypass -h admin_gangnam" value="Gangnam Style" width=140 height=27 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
+<td><button action="bypass -h admin_sexi" value="I'm Sexy and i know it" width=140 height=27 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
+</tr></table><br>
+<br><br><br>by <font color="3399ff">NeverMore</font>
+</center></body></html>
\ No newline at end of file
Index: dist/game/data/scripts/handlers/admincommandhandlers/AdminDanceSystem.java
===================================================================
--- dist/game/data/scripts/handlers/admincommandhandlers/AdminDanceSystem.java	(revision 0)
+++ dist/game/data/scripts/handlers/admincommandhandlers/AdminDanceSystem.java	(revision 0)
@@ -0,0 +1,148 @@
+package handlers.admincommandhandlers;
+
+import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.handler.IAdminCommandHandler;
+import com.l2jserver.gameserver.model.L2World;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.effects.AbnormalEffect;
+import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
+import com.l2jserver.gameserver.network.serverpackets.PlaySound;
+
+/**
+ *
+ * @author  NeverMore
+ */
+public class AdminDanceSystem implements IAdminCommandHandler
+{
+	boolean _temp = false;
+	
+	private static final String[] ADMIN_COMMANDS = { "admin_dance" , "admin_gangnam", "admin_sexi"};
+	
+	@Override
+	public boolean useAdminCommand(String command, L2PcInstance activeChar)
+	{
+		if (command.equals("admin_dance"))
+		{		
+			AdminHelpPage.showHelpPage(activeChar, "dancesystem.htm");
+		}    
+		
+		if (command.equals("admin_gangnam"))
+		{		
+			if (_temp == true)
+			{
+				ExShowScreenMessage message1 = new ExShowScreenMessage("There is already a dancing event running! Try later!", 4000);	
+				activeChar.sendPacket(message1);
+				return false;
+			}
+			_temp = true;
+			ExShowScreenMessage message1 = new ExShowScreenMessage("Lets have some fun ! In 30 sec's dance event begins !", 4000);
+			activeChar.sendPacket(message1);
+      		ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
+      		{
+      			@Override
+      			public void run()
+      			{
+      				try
+      		        {
+      					for(L2PcInstance player : L2World.getInstance().getAllPlayersArray())
+      					{
+      						PlaySound _song = new PlaySound(1, "Gangnam", 0, 0, 0, 0, 0);
+      						player.sendPacket(_song);
+     						ExShowScreenMessage message1 = new ExShowScreenMessage( "Show me what you got , lets shake it baby !", 8000);
+      						player.sendPacket(message1);
+      						player.setIsParalyzed(true);
+      						player.setIsInvul(true);
+      						player.broadcastSocialAction(10);
+      						player.startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
+      						ThreadPoolManager.getInstance().scheduleGeneral(new MyTask(), 3500);
+      						ThreadPoolManager.getInstance().scheduleGeneral(new MyTask2(), 40000);
+      					}
+      		        }
+      				catch (Exception e)
+      				{
+      				}
+      			}
+      		}, (30000));
+		}    
+
+		if (command.equals("admin_sexi"))
+		{	
+			if (_temp == true)
+			{
+				ExShowScreenMessage message1 = new ExShowScreenMessage("There is already a dancing event running! Try later!", 4000);	
+				activeChar.sendPacket(message1);
+				return false;
+			}
+          	_temp = true;
+			ExShowScreenMessage message1 = new ExShowScreenMessage("Lets have some fun ! In 30 sec's dance event begins !", 4000);
+			activeChar.sendPacket(message1);
+      		ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
+      		{
+      		    @Override
+      		    public void run()
+      		    {
+      		        try
+      		        {
+      		            for(L2PcInstance player : L2World.getInstance().getAllPlayersArray())
+      		            {
+		      			   PlaySound _song = new PlaySound(1, "sexi", 0, 0, 0, 0, 0);
+		      			   player.sendPacket(_song);
+		      			   ExShowScreenMessage message1 = new ExShowScreenMessage( "Show me what you got , lets shake it baby !", 8000);
+		      			   player.sendPacket(message1);
+		      			   player.setIsParalyzed(true);
+		      			   player.setIsInvul(true);
+		      			   player.broadcastSocialAction(10);
+      					   player.startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
+		      			   ThreadPoolManager.getInstance().scheduleGeneral(new MyTask(), 3500);
+		      			   ThreadPoolManager.getInstance().scheduleGeneral(new MyTask2(), 43000);
+      		            }
+      		        }
+      		        catch (Exception e)
+      		        {
+      		        }
+      		    }
+      		}, (30000));			
+		}    
+
+		return false;
+	}
+	
+	class MyTask implements Runnable
+	{
+	    @Override
+		public void run()
+	    {
+	    	if(_temp == true)
+	    	{
+	    		for(L2PcInstance player : L2World.getInstance().getAllPlayersArray())
+	    		{
+	    			player.broadcastSocialAction(18);
+	    		}
+	    		ThreadPoolManager.getInstance().scheduleGeneral(new MyTask(), 18000);
+	    	}
+	    }
+	}
+	class MyTask2 implements Runnable
+	{
+
+	    @Override
+		public void run()
+	    {
+    		for(L2PcInstance player : L2World.getInstance().getAllPlayersArray())
+    		{
+ 			   _temp = false;
+			   player.setIsParalyzed(false);
+			   player.setIsInvul(false);
+ 			   player.broadcastSocialAction(10);
+ 			   player.broadcastSocialAction(11);
+ 			   player.stopAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
+    		}
+	    }
+	}
+
+	@Override
+	public String[] getAdminCommandList()
+       {
+               return ADMIN_COMMANDS;
+       }
+}
\ No newline at end of file
Index: dist/game/config/adminCommands.xml
===================================================================
--- dist/game/config/adminCommands.xml  (revision 9024)
+++ dist/game/config/adminCommands.xml  (working copy)
@@ -26,6 +26,11 @@
        <admin command="admin_config_server" accessLevel="7" />
        <admin command="admin_gmon" accessLevel="7" />
 
+       <!-- ADMIN DANCE SYSTEM -->
+       <admin command="admin_gangnam" accessLevel="7" />
+       <admin command="admin_dance" accessLevel="7" />
+       <admin command="admin_sexi" accessLevel="7" /> 
+      
        <!-- ADMIN ANNOUNCEMENTS -->
        <admin command="admin_list_announcements" accessLevel="7" />
        <admin command="admin_list_critannouncements" accessLevel="7" />