Advertisement
Guest User

Dance System by NeverMore [Updated]

a guest
Oct 18th, 2012
1,095
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 8.33 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2J_DataPack
  3. Index: dist/game/data/scripts/handlers/MasterHandler.java
  4. ===================================================================
  5. --- dist/game/data/scripts/handlers/MasterHandler.java  (revision 9024)
  6. +++ dist/game/data/scripts/handlers/MasterHandler.java  (working copy)
  7. @@ -42,6 +42,7 @@
  8.  import handlers.admincommandhandlers.AdminClan;
  9.  import handlers.admincommandhandlers.AdminCreateItem;
  10.  import handlers.admincommandhandlers.AdminCursedWeapons;
  11. +import handlers.admincommandhandlers.AdminDanceSystem;
  12.  import handlers.admincommandhandlers.AdminDebug;
  13.  import handlers.admincommandhandlers.AdminDelete;
  14.  import handlers.admincommandhandlers.AdminDisconnect;
  15. @@ -431,6 +450,8 @@
  16.                         AdminUnblockIp.class,
  17.                         AdminVitality.class,
  18.                         AdminZone.class,
  19. +                       AdminDanceSystem.class,
  20.                 },
  21.                 {
  22.                         // Bypass Handlers
  23. Index: dist/game/data/html/admin/dancesystem.htm
  24. ===================================================================
  25. --- dist/game/data/html/admin/dancesystem.htm   (revision 0)
  26. +++ dist/game/data/html/admin/dancesystem.htm   (revision 0)
  27. @@ -0,0 +1,17 @@
  28. +<html><head><title>Dance Panel</title></head><body>
  29. +<center><br><center><font color="3399ff">Infos:</font></center><br>
  30. +<table width="270" cellpadding="5" bgcolor=444444>
  31. +<tr>
  32. +<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>!
  33. +</tr>
  34. +</table>
  35. +</center>
  36. +<br><br>
  37. +<center><font color="3399ff">Songs List:</font></center><br>
  38. +<center>
  39. +<table width=125 border=0 bgcolor=444444><tr><br><br><br><br>
  40. +<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>
  41. +<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>
  42. +</tr></table><br>
  43. +<br><br><br>by <font color="3399ff">NeverMore</font>
  44. +</center></body></html>
  45. \ No newline at end of file
  46. Index: dist/game/data/scripts/handlers/admincommandhandlers/AdminDanceSystem.java
  47. ===================================================================
  48. --- dist/game/data/scripts/handlers/admincommandhandlers/AdminDanceSystem.java  (revision 0)
  49. +++ dist/game/data/scripts/handlers/admincommandhandlers/AdminDanceSystem.java  (revision 0)
  50. @@ -0,0 +1,148 @@
  51. +package handlers.admincommandhandlers;
  52. +
  53. +import com.l2jserver.gameserver.ThreadPoolManager;
  54. +import com.l2jserver.gameserver.handler.IAdminCommandHandler;
  55. +import com.l2jserver.gameserver.model.L2World;
  56. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  57. +import com.l2jserver.gameserver.model.effects.AbnormalEffect;
  58. +import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
  59. +import com.l2jserver.gameserver.network.serverpackets.PlaySound;
  60. +
  61. +/**
  62. + *
  63. + * @author  NeverMore
  64. + */
  65. +public class AdminDanceSystem implements IAdminCommandHandler
  66. +{
  67. +   boolean _temp = false;
  68. +  
  69. +   private static final String[] ADMIN_COMMANDS = { "admin_dance" , "admin_gangnam", "admin_sexi"};
  70. +  
  71. +   @Override
  72. +   public boolean useAdminCommand(String command, L2PcInstance activeChar)
  73. +   {
  74. +       if (command.equals("admin_dance"))
  75. +       {      
  76. +           AdminHelpPage.showHelpPage(activeChar, "dancesystem.htm");
  77. +       }    
  78. +      
  79. +       if (command.equals("admin_gangnam"))
  80. +       {      
  81. +           if (_temp == true)
  82. +           {
  83. +               ExShowScreenMessage message1 = new ExShowScreenMessage("There is already a dancing event running! Try later!", 4000);  
  84. +               activeChar.sendPacket(message1);
  85. +               return false;
  86. +           }
  87. +           _temp = true;
  88. +           ExShowScreenMessage message1 = new ExShowScreenMessage("Lets have some fun ! In 30 sec's dance event begins !", 4000);
  89. +           activeChar.sendPacket(message1);
  90. +           ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
  91. +           {
  92. +               @Override
  93. +               public void run()
  94. +               {
  95. +                   try
  96. +                   {
  97. +                       for(L2PcInstance player : L2World.getInstance().getAllPlayersArray())
  98. +                       {
  99. +                           PlaySound _song = new PlaySound(1, "Gangnam", 0, 0, 0, 0, 0);
  100. +                           player.sendPacket(_song);
  101. +                           ExShowScreenMessage message1 = new ExShowScreenMessage( "Show me what you got , lets shake it baby !", 8000);
  102. +                           player.sendPacket(message1);
  103. +                           player.setIsParalyzed(true);
  104. +                           player.setIsInvul(true);
  105. +                           player.broadcastSocialAction(10);
  106. +                           player.startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
  107. +                           ThreadPoolManager.getInstance().scheduleGeneral(new MyTask(), 3500);
  108. +                           ThreadPoolManager.getInstance().scheduleGeneral(new MyTask2(), 40000);
  109. +                       }
  110. +                   }
  111. +                   catch (Exception e)
  112. +                   {
  113. +                   }
  114. +               }
  115. +           }, (30000));
  116. +       }    
  117. +
  118. +       if (command.equals("admin_sexi"))
  119. +       {  
  120. +           if (_temp == true)
  121. +           {
  122. +               ExShowScreenMessage message1 = new ExShowScreenMessage("There is already a dancing event running! Try later!", 4000);  
  123. +               activeChar.sendPacket(message1);
  124. +               return false;
  125. +           }
  126. +           _temp = true;
  127. +           ExShowScreenMessage message1 = new ExShowScreenMessage("Lets have some fun ! In 30 sec's dance event begins !", 4000);
  128. +           activeChar.sendPacket(message1);
  129. +           ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
  130. +           {
  131. +               @Override
  132. +               public void run()
  133. +               {
  134. +                   try
  135. +                   {
  136. +                       for(L2PcInstance player : L2World.getInstance().getAllPlayersArray())
  137. +                       {
  138. +                          PlaySound _song = new PlaySound(1, "sexi", 0, 0, 0, 0, 0);
  139. +                          player.sendPacket(_song);
  140. +                          ExShowScreenMessage message1 = new ExShowScreenMessage( "Show me what you got , lets shake it baby !", 8000);
  141. +                          player.sendPacket(message1);
  142. +                          player.setIsParalyzed(true);
  143. +                          player.setIsInvul(true);
  144. +                          player.broadcastSocialAction(10);
  145. +                          player.startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
  146. +                          ThreadPoolManager.getInstance().scheduleGeneral(new MyTask(), 3500);
  147. +                          ThreadPoolManager.getInstance().scheduleGeneral(new MyTask2(), 43000);
  148. +                       }
  149. +                   }
  150. +                   catch (Exception e)
  151. +                   {
  152. +                   }
  153. +               }
  154. +           }, (30000));           
  155. +       }    
  156. +
  157. +       return false;
  158. +   }
  159. +  
  160. +   class MyTask implements Runnable
  161. +   {
  162. +       @Override
  163. +       public void run()
  164. +       {
  165. +           if(_temp == true)
  166. +           {
  167. +               for(L2PcInstance player : L2World.getInstance().getAllPlayersArray())
  168. +               {
  169. +                   player.broadcastSocialAction(18);
  170. +               }
  171. +               ThreadPoolManager.getInstance().scheduleGeneral(new MyTask(), 18000);
  172. +           }
  173. +       }
  174. +   }
  175. +   class MyTask2 implements Runnable
  176. +   {
  177. +
  178. +       @Override
  179. +       public void run()
  180. +       {
  181. +           for(L2PcInstance player : L2World.getInstance().getAllPlayersArray())
  182. +           {
  183. +              _temp = false;
  184. +              player.setIsParalyzed(false);
  185. +              player.setIsInvul(false);
  186. +              player.broadcastSocialAction(10);
  187. +              player.broadcastSocialAction(11);
  188. +              player.stopAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);
  189. +           }
  190. +       }
  191. +   }
  192. +
  193. +   @Override
  194. +   public String[] getAdminCommandList()
  195. +       {
  196. +               return ADMIN_COMMANDS;
  197. +       }
  198. +}
  199. \ No newline at end of file
  200. Index: dist/game/config/adminCommands.xml
  201. ===================================================================
  202. --- dist/game/config/adminCommands.xml  (revision 9024)
  203. +++ dist/game/config/adminCommands.xml  (working copy)
  204. @@ -26,6 +26,11 @@
  205.         <admin command="admin_config_server" accessLevel="7" />
  206.         <admin command="admin_gmon" accessLevel="7" />
  207.  
  208. +       <!-- ADMIN DANCE SYSTEM -->
  209. +       <admin command="admin_gangnam" accessLevel="7" />
  210. +       <admin command="admin_dance" accessLevel="7" />
  211. +       <admin command="admin_sexi" accessLevel="7" />
  212. +      
  213.         <!-- ADMIN ANNOUNCEMENTS -->
  214.         <admin command="admin_list_announcements" accessLevel="7" />
  215.         <admin command="admin_list_critannouncements" accessLevel="7" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement