Advertisement
Kimeraweb

Datapack //happyHour

Nov 11th, 2012
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 54.17 KB | None | 0 0
  1. Index: dist/game/data/scripts/handlers/MasterHandler.java
  2. ===================================================================
  3. --- dist/game/data/scripts/handlers/MasterHandler.java  (revision 9265)
  4. +++ dist/game/data/scripts/handlers/MasterHandler.java  (working copy)
  5. @@ -61,6 +61,7 @@
  6.  import handlers.admincommandhandlers.AdminGm;
  7.  import handlers.admincommandhandlers.AdminGmChat;
  8.  import handlers.admincommandhandlers.AdminGraciaSeeds;
  9. +import handlers.admincommandhandlers.AdminHappyHour;
  10.  import handlers.admincommandhandlers.AdminHeal;
  11.  import handlers.admincommandhandlers.AdminHellbound;
  12.  import handlers.admincommandhandlers.AdminHelpPage;
  13. @@ -290,6 +291,7 @@
  14.  import handlers.voicedcommandhandlers.Debug;
  15.  import handlers.voicedcommandhandlers.Hellbound;
  16.  import handlers.voicedcommandhandlers.Lang;
  17. +import handlers.voicedcommandhandlers.Shop;
  18.  import handlers.voicedcommandhandlers.StatsVCmd;
  19.  import handlers.voicedcommandhandlers.TvTVoicedInfo;
  20.  import handlers.voicedcommandhandlers.Wedding;
  21. @@ -431,6 +433,7 @@
  22.             AdminUnblockIp.class,
  23.             AdminVitality.class,
  24.             AdminZone.class,
  25. +           AdminHappyHour.class, // by Kimera
  26.         },
  27.         {
  28.             // Bypass Handlers
  29.  
  30. Index: dist/game/data/scripts/handlers/admincommandhandlers/AdminHappyHour.java
  31. ===================================================================
  32. --- dist/game/data/scripts/handlers/admincommandhandlers/AdminHappyHour.java    (revision 0)
  33. +++ dist/game/data/scripts/handlers/admincommandhandlers/AdminHappyHour.java    (revision 0)
  34. @@ -0,0 +1,961 @@
  35. +/*
  36. + * This program is free software: you can redistribute it and/or modify it under
  37. + * the terms of the GNU General Public License as published by the Free Software
  38. + * Foundation, either version 3 of the License, or (at your option) any later
  39. + * version.
  40. + *
  41. + * This program is distributed in the hope that it will be useful, but WITHOUT
  42. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  43. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  44. + * details.
  45. + *
  46. + * You should have received a copy of the GNU General Public License along with
  47. + * this program. If not, see <http://www.gnu.org/licenses/>.
  48. + */
  49. +package handlers.admincommandhandlers;
  50. +
  51. +import java.io.BufferedReader;
  52. +import java.io.File;
  53. +import java.io.FileNotFoundException;
  54. +import java.io.FileReader;
  55. +import java.io.FileWriter;
  56. +import java.io.IOException;
  57. +import java.sql.Connection;
  58. +import java.sql.SQLException;
  59. +import java.sql.Statement;
  60. +import java.util.logging.Logger;
  61. +
  62. +import javolution.text.TextBuilder;
  63. +
  64. +import com.l2jserver.Config;
  65. +import com.l2jserver.L2DatabaseFactory;
  66. +import com.l2jserver.gameserver.handler.IAdminCommandHandler;
  67. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  68. +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
  69. +import com.l2jserver.gameserver.taskmanager.TaskManager;
  70. +import com.l2jserver.gameserver.taskmanager.TaskTypes;
  71. +
  72. +/**
  73. + * @author Kimera
  74. + * Basado en la idea original de AbsolutePower, compartido por chuchuqui
  75. + * http://www.adminsprol2.com/t38334-doble-exp-y-sp-lo-sabados
  76. + */
  77. +public class AdminHappyHour implements IAdminCommandHandler
  78. +{
  79. +   private static Logger _log = Logger.getLogger(AdminHappyHour.class.getName());
  80. +   private static final String[] ADMIN_COMMANDS =  {
  81. +       "admin_happyhour" , "admin_happyhour_instructions" , "admin_happyhour_setXP" , "admin_happyhour_setSP", "admin_happyhour_setPartyXP",
  82. +       "admin_happyhour_setPartySP", "admin_happyhour_setIDrop", "admin_happyhour_setRDrop", "admin_happyhour_setSDrop",
  83. +       "admin_happyhour_setMDrop", "admin_happyhour_setQDrop", "admin_happyhour_setQXP", "admin_happyhour_setQSP",
  84. +       "admin_happyhour_setQAdena", "admin_happyhour_setQPotion", "admin_happyhour_setQScroll", "admin_happyhour_setQRecipe",
  85. +       "admin_happyhour_setQMaterial", "admin_happyhour_resetDefault", "admin_happyhour_saveConfig", "admin_happyhour_loadConfig",
  86. +       "admin_happyhour_schedule", "admin_happyhour_saveConfig", "admin_happyhour_nameConfig", "admin_happyhour_executeLoad",
  87. +       "admin_happyhour_setEChance", "admin_happyhour_implements"
  88. +       };
  89. +  
  90. +   @Override
  91. +   public boolean useAdminCommand(String command, L2PcInstance activeChar)
  92. +   {  
  93. +       if (command.equals("admin_happyhour"))                         
  94. +           showMenu(activeChar);                                           // Muestra el menu principal
  95. +       else if (command.equals("admin_happyhour_instructions"))           
  96. +           showInstructions(activeChar);                                   // Muestra las instrucciones
  97. +       else if (command.contains("admin_happyhour_setXP"))
  98. +           setXP(activeChar, command);                                     // XP
  99. +       else if (command.contains("admin_happyhour_setSP"))
  100. +           setSP(activeChar, command);                                     // SP
  101. +       else if (command.contains("admin_happyhour_setPartyXP"))
  102. +           setPartyXP(activeChar,command);                                 // Party XP
  103. +       else if (command.contains("admin_happyhour_setPartySP"))
  104. +           setPartySP(activeChar, command);                                // Party SP
  105. +       else if (command.contains("admin_happyhour_setIDrop"))
  106. +           setIDrop(activeChar, command);                                  // Item drop
  107. +       else if (command.contains("admin_happyhour_setRDrop"))
  108. +           setRDrop(activeChar, command);                                  // Raid drop
  109. +       else if (command.contains("admin_happyhour_setSDrop"))
  110. +           setSDrop(activeChar, command);                                  // Spoil drop
  111. +       else if (command.contains("admin_happyhour_setMDrop"))
  112. +           setMDrop(activeChar, command);                                  // Manor drop
  113. +       else if (command.contains("admin_happyhour_setQDrop"))
  114. +           setQDrop(activeChar, command);                                  // Quest drop
  115. +       else if (command.contains("admin_happyhour_setQXP"))
  116. +           setQXP(activeChar, command);                                    // Quest XP
  117. +       else if (command.contains("admin_happyhour_setQSP"))
  118. +           setQSP(activeChar, command);                                    // Quest SP
  119. +       else if (command.contains("admin_happyhour_setQAdena"))
  120. +           setQAdena(activeChar, command);                                 // Quest Adena
  121. +       else if (command.contains("admin_happyhour_setQPotion"))
  122. +           setQPotion(activeChar, command);                                // Quest Potion
  123. +       else if (command.contains("admin_happyhour_setQScroll"))
  124. +           setQScroll(activeChar, command);                                // Quest Scroll
  125. +       else if (command.contains("admin_happyhour_setQRecipe"))
  126. +           setQRecipe(activeChar, command);                                // Quest Recipe
  127. +       else if (command.contains("admin_happyhour_setQMaterial"))
  128. +           setQMaterial(activeChar,command);                               // Quest Material
  129. +       else if (command.contains("admin_happyhour_setEChance"))
  130. +           setEChance(activeChar, command);                                // Enchant Chance
  131. +       else if (command.equals("admin_happyhour_resetDefault"))
  132. +           doResetDefault(activeChar);                                     // Volver a la conf. por defecto
  133. +       else if (command.equals("admin_happyhour_saveConfig"))
  134. +           doAskingNameConfig(activeChar);                                 // Pregunta el nombre de esta configuracion
  135. +       else if (command.contains("admin_happyhour_nameConfig"))
  136. +           DoSaving(activeChar, command);                                  // Se graba el fichero con la config
  137. +       else if (command.equals("admin_happyhour_loadConfig"))
  138. +           doLoadConfig(activeChar);                                       // Muestra las configuraciones guardadas
  139. +       else if (command.contains("admin_happyhour_executeLoad"))
  140. +           admin_happyhour_executeLoad(activeChar,command);                // Carga la configuración elegida
  141. +       else if (command.equals("admin_happyhour_schedule"))
  142. +           doSchedule(activeChar);                                         // Programa el evento para ser autoejecutado en la fecha dada
  143. +       else if (command.contains("admin_happyhour_implements"))
  144. +           recordSchedule(activeChar, command);                            // Graba en global task la inicializacion y finalizacion de HappyHour
  145. +
  146. +      
  147. +       return true;
  148. +   }
  149. +
  150. +
  151. +   @Override
  152. +   public String[] getAdminCommandList()
  153. +   {
  154. +       return ADMIN_COMMANDS;
  155. +   }
  156. +  
  157. +   private void showMenu(L2PcInstance activeChar)
  158. +   {
  159. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  160. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  161. +       replyMSG.append(
  162. +           "<center>" +
  163. +           "<center><br><button value=\"Instrucciones\" action=\"bypass -h admin_happyhour_instructions\" width=100 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>" +
  164. +           "<img src=L2UI_CH3.onscrmsg_pattern01_1 width=\"300\" height=\"32\" align=\"center\">" +
  165. +           "<table width=270>" +
  166. +               "<tr>" +
  167. +                   // XP
  168. +                   "<td width=135>XP x:<edit var=\"XP\" width=\"125\">(" + Config.RATE_XP + ")(<font color =\"FF00FF\">" + OldConfig.RATE_XP.getFloatRate() + "</font>)</td>" +
  169. +                   "><td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setXP $XP\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  170. +               "</tr><tr><td><br></td></tr><tr>" +
  171. +                   // SP
  172. +                   "<td width=135>SP x:<edit var=\"SP\" width=\"125\">(" + Config.RATE_SP + ")(<font color =\"FF00FF\">" + OldConfig.RATE_SP.getFloatRate() + "</font>)</td>" +
  173. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setSP $SP\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +            
  174. +               "</tr><tr><td><br></td></tr><tr>" +
  175. +                   // Party XP
  176. +                   "<td width=135>Party XP x:<edit var=\"P_XP\" width=\"125\">(" + Config.RATE_PARTY_XP + ")(<font color =\"FF00FF\">" + OldConfig.RATE_PARTY_XP.getFloatRate() + "</font>)</td>" +
  177. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setPartyXP $P_XP\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  178. +               "</tr><tr><td><br></td></tr><tr>" +
  179. +                   // Party SP
  180. +                   "<td width=135>Party SP x:<edit var=\"P_SP\" width=\"125\">(" + Config.RATE_PARTY_SP + ")(<font color =\"FF00FF\">" + OldConfig.RATE_PARTY_SP.getFloatRate() + "</font>)</td>" +
  181. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setPartySP $P_SP\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  182. +                   // Rate ItemDrop
  183. +               "</tr><tr><td><br></td></tr><tr>" +
  184. +                   "<td width=135>Item Drop x:<edit var=\"ItemDrop\" width=\"125\">(" + Config.RATE_DROP_ITEMS + ")(<font color =\"FF00FF\">" + OldConfig.RATE_DROP_ITEMS.getFloatRate() + "</font>)</td>" +
  185. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setIDrop $ItemDrop\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  186. +                   // Rate RaidDrop
  187. +               "</tr><tr><td><br></td></tr><tr>" +
  188. +                   "<td width=135>Raid Drop x:<edit var=\"RaidDrop\" width=\"125\">(" + Config.RATE_DROP_ITEMS_BY_RAID + ")(<font color =\"FF00FF\">" + OldConfig.RATE_DROP_ITEMS_BY_RAID.getFloatRate() + "</font>)</td>" +
  189. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setRDrop $RaidDrop\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  190. +                   // Rate SpoilDrop
  191. +               "</tr><tr><td><br></td></tr><tr>" +
  192. +                   "<td width=135>Spoil Drop x:<edit var=\"SpoilDrop\" width=\"125\">(" + Config.RATE_DROP_SPOIL + ")(<font color =\"FF00FF\">" + OldConfig.RATE_DROP_SPOIL.getFloatRate() + "</font>)</td>" +
  193. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setSDrop $SpoilDrop\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  194. +                   // Rate DropManor
  195. +               "</tr><tr><td><br></td></tr><tr>" +
  196. +                   "<td width=135>Manor Drop x:<edit var=\"ManorDrop\" width=\"125\">(" + Config.RATE_DROP_MANOR + ")(<font color =\"FF00FF\">" + OldConfig.RATE_DROP_MANOR.getIntegerRate() + "</font>)</td>" +
  197. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setMDrop $ManorDrop\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  198. +                   // Rate QuestDrop
  199. +               "</tr><tr><td><br></td></tr><tr>" +
  200. +                   "<td width=135>Quest Drop x:<edit var=\"QuestDrop\" width=\"125\">(" + Config.RATE_QUEST_DROP + ")(<font color =\"FF00FF\">" + OldConfig.RATE_QUEST_DROP.getFloatRate() + "</font>)</td>" +
  201. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setQDrop $QuestDrop\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  202. +                   // Rate Quest XP
  203. +               "</tr><tr><td><br></td></tr><tr>" +
  204. +                   "<td width=135>Quest XP x:<edit var=\"Q_XP\" width=\"125\">(" + Config.RATE_QUEST_REWARD_XP + ")(<font color =\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_XP.getFloatRate() + "</font>)</td>" +
  205. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setQXP $Q_XP\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br></td><br><br>" +             
  206. +               "</tr><tr><td><br></td></tr><tr>" +
  207. +                   // Rate Quest SP
  208. +                   "<td width=135>Quest SP x:<edit var=\"Q_SP\" width=\"125\">(" + Config.RATE_QUEST_REWARD_SP + ")(<font color =\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_SP.getFloatRate() + "</font>)</td>" +
  209. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setQSP $Q_SP\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +             
  210. +               "</tr><tr><td><br></td></tr><tr>" +
  211. +                   // Rate Quest Adena
  212. +                   "<td width=135>Quest Adena x:<edit var=\"Q_Adena\" width=\"125\">(" + Config.RATE_QUEST_REWARD_ADENA + ")(<font color =\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_ADENA.getFloatRate() + "</font>)</td>" +
  213. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setQAdena $Q_Adena\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +               
  214. +               "</tr><tr><td><br></td></tr><tr>" +
  215. +                   // Rate Quest Potion
  216. +                   "<td width=135>Quest Potion x:<edit var=\"Q_Potion\" width=\"125\">(" + Config.RATE_QUEST_REWARD_POTION + ")(<font color =\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_POTION.getFloatRate() + "</font>)</td>" +
  217. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setQPotion $Q_Potion\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +             
  218. +               "</tr><tr><td><br></td></tr><tr>" +
  219. +                   // Rate Quest Scroll
  220. +                   "<td width=135>Quest Scroll x:<edit var=\"Q_Scroll\" width=\"125\">(" + Config.RATE_QUEST_REWARD_SCROLL + ")(<font color =\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_SCROLL.getFloatRate() + "</font>)</td>" +
  221. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setQScroll $Q_Scroll\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  222. +               "</tr><tr><td><br></td></tr><tr>" +
  223. +                   // Rate Quest Recipe
  224. +                   "<td width=135>Quest Recipe x:<edit var=\"Q_Recipe\" width=\"125\">(" + Config.RATE_QUEST_REWARD_RECIPE + ")(<font color =\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_RECIPE.getFloatRate() + "</font>)</td>" +
  225. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setQRecipe $Q_Recipe\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  226. +               "</tr><tr><td><br></td></tr><tr>" +
  227. +                   // Rate Quest Material
  228. +                   "<td width=135>Quest Material x:<edit var=\"Q_Material\" width=\"125\">(" + Config.RATE_QUEST_REWARD_MATERIAL + ")(<font color =\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_MATERIAL.getFloatRate() + "</font>)</td>" +
  229. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setQMaterial $Q_Material\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  230. +               "</tr><tr><td><br></td></tr><tr>" +
  231. +                   // Rate ENCHANT_CHANCE
  232. +                   "<td width=135>Enchant Chance %:<edit var=\"Enchant_Chance\" width=\"125\">(" + Config.ENCHANT_CHANCE + ")(<font color =\"FF00FF\">" + OldConfig.ENCHANT_CHANCE.getDoubleRate() + "</font>)</td>" +
  233. +                   "<td width=135><br><br><button value=\"Set\" action=\"bypass -h admin_happyhour_setEChance $Enchant_Chance\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br><br></td>" +
  234. +               "</tr>" +
  235. +           "</table></center>" +
  236. +           "<img src=L2UI_CH3.onscrmsg_pattern01_2 width=\"300\" height=\"32\" align=\"center\"><br><br>" +
  237. +           "<img src=L2UI_CH3.herotower_deco width=\"256\" height=\"32\" align=\"center\">" +
  238. +           "<center><button value=\"Resetear\" action=\"bypass -h admin_happyhour_resetDefault \" width=120 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" +
  239. +           "<center><button value=\"Guardar\" action=\"bypass -h admin_happyhour_saveConfig \" width=120 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" +
  240. +           "<center><button value=\"Cargar\" action=\"bypass -h admin_happyhour_loadConfig \" width=120 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">" +
  241. +           "<center><button value=\"Activacion periodica\" action=\"bypass -h admin_happyhour_schedule \" width=120 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">"
  242. +
  243. +       );
  244. +       adminReply.setHtml(replyMSG.toString());
  245. +       activeChar.sendPacket(adminReply);
  246. +   }
  247. +      
  248. +   private void showInstructions(L2PcInstance activeChar)
  249. +   {
  250. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  251. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  252. +       replyMSG.append("<center><font color=\"FF0000\">Atencion, el cambio de rates es inmediato!</font></center><br><br>La idea de este evento es la de subir los rates del server por un periodo determinado, animar a los jugadores a masificarse a ciertas horas en el servidor para hacerlo mas atractivo.<br><br>" +
  253. +           "En las opciones disponibles puedes dejar los rates como estan dejando el numero <font color=\"00FF00\">1</font>, ya que, al multiplicar los rates actuales del server por <font color=\"00FF00\">1</font>, pues da <font color=\"00FF00\">1</font>.<br><br>" +
  254. +           "Tambien puede interesarte subir rates, entonces a partir de <font color=\"00FF00\">1</font>, consigues subir los rates. Por ejemplo, un rate de <font color=\"#0FF00\">1.10</font> suben los rates un 10%, unos rates <font color=\"00FF00\">2</font> suben un 100% ( osea, si tu server es <font color=\"00FF00\">x8</font> y en la happy hour pones <font color=\"00FF00\">2</font>, tu server se convierte en un <font color=\"00FF00\">x16</font>).<br><br>" +
  255. +           "Para poder equilibrar la <font color=\"00FFFF\">Party hour</font>, puedes tambien bajar otros rates usando un numero menor al <font color=\"00FF00\">1</font>, por ejemplo, <font color=\"00FF00\">0.9</font> disminuye un 10% los rates de tu server.<br><br>" +
  256. +           "Puedes programar la <font color=\"00FFFF\">Party hour</font> semanalmente y activarlos manualmente, muy apropiado para pedir a los jugadores que voten al server, por ejemplo, decirles, <font color=\"FFFF00\">Si llegamos a 1000 votos, 1 hora de party Hour.</font>. Mi idea inicial era la de subir los rates una hora el sabado y el domingo, que es cuando mas afluencia tiene un servidor.<br><br>" +
  257. +           "<font color=\"FF0000\"> La ejecucion programada del evento hace que la configuracion por defecto recoja los valores del evento en lugar de los originales del servidor, asi que aconsejo que guardes una copia de los valores originales por si quieres restaurarlos cuando se haya iniciado el evento programado. </font><br><br>" +
  258. +           "El evento programado, por defecto dura maximo 23:59:59 horas. <br>" +
  259. +           "Si la programacion del evento inicial y final tienen la misma hora, se borrara el evento de la base de datos.<br>" +
  260. +           "Un evento programado solo podra ser autoejecutado despues de un restart del servidor.<br><br>" +
  261. +           "Si desprogramas un evento que se iba a ejecutar, el evento se ejecutara mientras no se haga un restart del servidor.<br><br><br>" +
  262. +           "<td width=270 align=\"center\"><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
  263. +       adminReply.setHtml(replyMSG.toString());
  264. +       activeChar.sendPacket(adminReply);     
  265. +   }
  266. +  
  267. +   private float getFloatRate(String command)
  268. +   {
  269. +       float rate = 1;
  270. +       try { rate = Float.parseFloat(command.split(" ")[1]);}
  271. +       catch (NumberFormatException e)
  272. +           {
  273. +               _log.warning("Valor ilegal para " + rate + ". El tipo introducido no pudo ser convertido a Float en AdaminHappyHour#getFloatRate, se queda en 1.");
  274. +               rate = 1;
  275. +           }
  276. +       catch (ArrayIndexOutOfBoundsException e) { _log.warning("AdminHappyHour#getFloatRate, sin parametros: " + command); }
  277. +       catch (Exception e) { e.printStackTrace(); }
  278. +       if (rate < 0) rate = 1;
  279. +       return rate;
  280. +   }
  281. +  
  282. +   private int getIntegerRate(String command)
  283. +   {
  284. +       int rate = 1;
  285. +      
  286. +       try { rate = Integer.parseInt(command.split(" ")[1]);}
  287. +       catch (NumberFormatException e)
  288. +       {
  289. +           _log.warning("Valor ilegal para " + rate + ". El tipo introducido no pudo ser convertido a Float en AdaminHappyHour#getFloatRate, se queda en 1.");
  290. +           rate = 1;
  291. +       }
  292. +       catch (ArrayIndexOutOfBoundsException e) { _log.warning("AdminHappyHour#getIntegerRate, sin parametros: " + command); }
  293. +       catch (Exception e) { e.printStackTrace(); }
  294. +       if (rate < 0) rate = 1;
  295. +       return rate;
  296. +   }
  297. +  
  298. +   private Double getDoubleRate(String command)
  299. +   {
  300. +       double rate = 1;
  301. +       try { rate = Double.parseDouble(command.split(" ")[1]);}
  302. +       catch (NumberFormatException e)
  303. +           {
  304. +               _log.warning("Valor ilegal para " + rate + ". El tipo introducido no pudo ser convertido a Double en AdaminHappyHour#getDoubleRate, se queda en 1.");
  305. +               rate = 1;
  306. +           }
  307. +       catch (ArrayIndexOutOfBoundsException e) { _log.warning("AdminHappyHour#getDoubleRate, sin parametros: " + command); }
  308. +       catch (Exception e) { e.printStackTrace(); }
  309. +       if (rate < 0) rate = 1;
  310. +       return rate;
  311. +   }
  312. +  
  313. +   private void setXP(L2PcInstance activeChar, String command)
  314. +   {
  315. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  316. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  317. +       float newRate = getFloatRate(command);
  318. +       Config.RATE_XP *= newRate;
  319. +      
  320. +       if (Config.DEBUG)
  321. +           replyMSG.append("Set " + command);
  322. +      
  323. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_XP.getFloatRate() + "</font><br>");
  324. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_XP + "</font><br><br><br><br>");
  325. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  326. +      
  327. +       adminReply.setHtml(replyMSG.toString());
  328. +       activeChar.sendPacket(adminReply);
  329. +   }
  330. +  
  331. +   private void setSP(L2PcInstance activeChar, String command)
  332. +   {
  333. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  334. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  335. +       float newRate = getFloatRate(command);
  336. +       Config.RATE_SP *= newRate;
  337. +      
  338. +       if (Config.DEBUG)
  339. +           replyMSG.append("Set " + command);
  340. +      
  341. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_SP.getFloatRate() + "</font><br>");
  342. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_SP + "</font><br><br><br><br>");
  343. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  344. +      
  345. +       adminReply.setHtml(replyMSG.toString());
  346. +       activeChar.sendPacket(adminReply);
  347. +   }
  348. +  
  349. +   private void setPartyXP(L2PcInstance activeChar, String command)
  350. +   {
  351. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  352. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  353. +       float newRate = getFloatRate(command);
  354. +       Config.RATE_PARTY_XP *= newRate;
  355. +      
  356. +       if (Config.DEBUG)
  357. +           replyMSG.append("Set " + command);
  358. +      
  359. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_PARTY_XP.getFloatRate() + "</font><br>");
  360. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_PARTY_XP + "</font><br><br><br><br>");
  361. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  362. +      
  363. +       adminReply.setHtml(replyMSG.toString());
  364. +       activeChar.sendPacket(adminReply);
  365. +   }
  366. +  
  367. +   private void setPartySP(L2PcInstance activeChar, String command)
  368. +   {
  369. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  370. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  371. +       float newRate = getFloatRate(command);
  372. +       Config.RATE_PARTY_SP *= newRate;
  373. +      
  374. +       if (Config.DEBUG)
  375. +           replyMSG.append("Set " + command);
  376. +      
  377. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_PARTY_SP.getFloatRate()+ "</font><br>");
  378. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_PARTY_SP + "</font><br><br><br><br>");
  379. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  380. +      
  381. +       adminReply.setHtml(replyMSG.toString());
  382. +       activeChar.sendPacket(adminReply);
  383. +   }
  384. +  
  385. +   private void setIDrop(L2PcInstance activeChar, String command)
  386. +   {
  387. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  388. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  389. +       float newRate = getFloatRate(command);
  390. +       Config.RATE_DROP_ITEMS *= newRate;
  391. +      
  392. +       if (Config.DEBUG)
  393. +           replyMSG.append("Set " + command);
  394. +      
  395. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_DROP_ITEMS.getFloatRate() + "</font><br>");
  396. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_DROP_ITEMS + "</font><br><br><br><br>");
  397. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  398. +      
  399. +       adminReply.setHtml(replyMSG.toString());
  400. +       activeChar.sendPacket(adminReply);
  401. +   }
  402. +  
  403. +   private void setRDrop(L2PcInstance activeChar, String command)
  404. +   {
  405. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  406. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  407. +       float newRate = getFloatRate(command);
  408. +       Config.RATE_DROP_ITEMS_BY_RAID *= newRate;
  409. +      
  410. +       if (Config.DEBUG)
  411. +           replyMSG.append("Set " + command);
  412. +      
  413. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_DROP_ITEMS_BY_RAID.getFloatRate() + "</font><br>");
  414. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_DROP_ITEMS_BY_RAID + "</font><br><br><br><br>");
  415. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  416. +      
  417. +       adminReply.setHtml(replyMSG.toString());
  418. +       activeChar.sendPacket(adminReply);
  419. +   }
  420. +  
  421. +   private void setSDrop(L2PcInstance activeChar, String command)
  422. +   {
  423. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  424. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  425. +       float newRate = getFloatRate(command);
  426. +       Config.RATE_DROP_SPOIL *= newRate;
  427. +      
  428. +       if (Config.DEBUG)
  429. +           replyMSG.append("Set " + command);
  430. +      
  431. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_DROP_SPOIL.getFloatRate() + "</font><br>");
  432. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_DROP_SPOIL + "</font><br><br><br><br>");
  433. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  434. +      
  435. +       adminReply.setHtml(replyMSG.toString());
  436. +       activeChar.sendPacket(adminReply);
  437. +   }
  438. +  
  439. +   private void setMDrop(L2PcInstance activeChar, String command)
  440. +   {
  441. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  442. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  443. +       float newRate = getIntegerRate(command);
  444. +       Config.RATE_DROP_MANOR *= newRate;
  445. +      
  446. +       if (Config.DEBUG)
  447. +           replyMSG.append("Set " + command);
  448. +      
  449. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_DROP_MANOR.getIntegerRate() + "</font><br>");
  450. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_DROP_MANOR + "</font><br><br><br><br>");
  451. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  452. +      
  453. +       adminReply.setHtml(replyMSG.toString());
  454. +       activeChar.sendPacket(adminReply);
  455. +   }
  456. +  
  457. +   private void setQDrop(L2PcInstance activeChar, String command)
  458. +   {
  459. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  460. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  461. +       float newRate = getFloatRate(command);
  462. +       Config.RATE_QUEST_DROP *= newRate;
  463. +      
  464. +       if (Config.DEBUG)
  465. +           replyMSG.append("Set " + command);
  466. +      
  467. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_QUEST_DROP.getFloatRate() + "</font><br>");
  468. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_QUEST_DROP + "</font><br><br><br><br>");
  469. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  470. +      
  471. +       adminReply.setHtml(replyMSG.toString());
  472. +       activeChar.sendPacket(adminReply);
  473. +   }
  474. +  
  475. +   private void setQXP(L2PcInstance activeChar, String command)
  476. +   {
  477. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  478. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  479. +       float newRate = getFloatRate(command);
  480. +       Config.RATE_QUEST_REWARD_XP *= newRate;
  481. +      
  482. +       if (Config.DEBUG)
  483. +           replyMSG.append("Set " + command);
  484. +      
  485. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_XP.getFloatRate() + "</font><br>");
  486. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_QUEST_REWARD_XP + "</font><br><br><br><br>");
  487. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  488. +      
  489. +       adminReply.setHtml(replyMSG.toString());
  490. +       activeChar.sendPacket(adminReply);
  491. +   }
  492. +  
  493. +   private void setQSP(L2PcInstance activeChar, String command)
  494. +   {
  495. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  496. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  497. +       float newRate = getFloatRate(command);
  498. +       Config.RATE_QUEST_REWARD_SP *= newRate;
  499. +      
  500. +       if (Config.DEBUG)
  501. +           replyMSG.append("Set " + command);
  502. +      
  503. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_SP.getFloatRate() + "</font><br>");
  504. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_QUEST_REWARD_SP + "</font><br><br><br><br>");
  505. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  506. +      
  507. +       adminReply.setHtml(replyMSG.toString());
  508. +       activeChar.sendPacket(adminReply);
  509. +   }
  510. +  
  511. +   private void setQAdena(L2PcInstance activeChar, String command)
  512. +   {
  513. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  514. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  515. +       float newRate = getFloatRate(command);
  516. +       Config.RATE_QUEST_REWARD_ADENA *= newRate;
  517. +      
  518. +       if (Config.DEBUG)
  519. +           replyMSG.append("Set " + command);
  520. +      
  521. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_ADENA.getFloatRate() + "</font><br>");
  522. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_QUEST_REWARD_ADENA + "</font><br><br><br><br>");
  523. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  524. +      
  525. +       adminReply.setHtml(replyMSG.toString());
  526. +       activeChar.sendPacket(adminReply);
  527. +   }
  528. +  
  529. +   private void setQPotion(L2PcInstance activeChar, String command)
  530. +   {
  531. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  532. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  533. +       float newRate = getFloatRate(command);
  534. +       Config.RATE_QUEST_REWARD_POTION *= newRate;
  535. +      
  536. +       if (Config.DEBUG)
  537. +           replyMSG.append("Set " + command);
  538. +      
  539. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_POTION.getFloatRate() + "</font><br>");
  540. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_QUEST_REWARD_POTION + "</font><br><br><br><br>");
  541. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  542. +      
  543. +       adminReply.setHtml(replyMSG.toString());
  544. +       activeChar.sendPacket(adminReply);
  545. +   }
  546. +  
  547. +   private void setQScroll(L2PcInstance activeChar, String command)
  548. +   {
  549. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  550. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  551. +       float newRate = getFloatRate(command);
  552. +       Config.RATE_QUEST_REWARD_SCROLL *= newRate;
  553. +      
  554. +       if (Config.DEBUG)
  555. +           replyMSG.append("Set " + command);
  556. +      
  557. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_SCROLL.getFloatRate() + "</font><br>");
  558. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_QUEST_REWARD_SCROLL + "</font><br><br><br><br>");
  559. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  560. +      
  561. +       adminReply.setHtml(replyMSG.toString());
  562. +       activeChar.sendPacket(adminReply);
  563. +   }
  564. +  
  565. +   private void setQRecipe(L2PcInstance activeChar, String command)
  566. +   {
  567. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  568. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  569. +       float newRate = getFloatRate(command);
  570. +       Config.RATE_QUEST_REWARD_RECIPE *= newRate;
  571. +      
  572. +       if (Config.DEBUG)
  573. +           replyMSG.append("Set " + command);
  574. +      
  575. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_RECIPE.getFloatRate() + "</font><br>");
  576. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_QUEST_REWARD_RECIPE + "</font><br><br><br><br>");
  577. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  578. +      
  579. +       adminReply.setHtml(replyMSG.toString());
  580. +       activeChar.sendPacket(adminReply);
  581. +   }
  582. +  
  583. +   private void setQMaterial(L2PcInstance activeChar, String command)
  584. +   {
  585. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  586. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  587. +       float newRate = getFloatRate(command);
  588. +       Config.RATE_QUEST_REWARD_MATERIAL *= newRate;
  589. +      
  590. +       if (Config.DEBUG)
  591. +           replyMSG.append("Set " + command);
  592. +      
  593. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.RATE_QUEST_REWARD_MATERIAL.getFloatRate() + "</font><br>");
  594. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.RATE_QUEST_REWARD_MATERIAL + "</font><br><br><br><br>");
  595. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  596. +      
  597. +       adminReply.setHtml(replyMSG.toString());
  598. +       activeChar.sendPacket(adminReply);
  599. +   }
  600. +  
  601. +   private void setEChance(L2PcInstance activeChar, String command)
  602. +   {
  603. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  604. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  605. +       Double newRate = getDoubleRate(command);
  606. +       Config.ENCHANT_CHANCE = newRate;
  607. +      
  608. +       if (Config.DEBUG)
  609. +           replyMSG.append("Set " + command);
  610. +      
  611. +       replyMSG.append("Antes: <font color=\"FF00FF\">" + OldConfig.ENCHANT_CHANCE.getDoubleRate() + " %</font><br>");
  612. +       replyMSG.append("Ahora: <font color=\"00FF00\">" + Config.ENCHANT_CHANCE + "%</font><br><br><br><br>");
  613. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  614. +      
  615. +       adminReply.setHtml(replyMSG.toString());
  616. +       activeChar.sendPacket(adminReply);
  617. +   }
  618. +  
  619. +   enum OldConfig
  620. +   {
  621. +       RATE_XP(Config.RATE_XP),RATE_SP(Config.RATE_SP),RATE_PARTY_XP(Config.RATE_PARTY_XP), RATE_PARTY_SP(Config.RATE_PARTY_SP),
  622. +       RATE_DROP_ITEMS(Config.RATE_DROP_ITEMS), RATE_DROP_ITEMS_BY_RAID(Config.RATE_DROP_ITEMS_BY_RAID), RATE_DROP_SPOIL(Config.RATE_DROP_SPOIL),
  623. +       RATE_DROP_MANOR(Config.RATE_DROP_MANOR), RATE_QUEST_DROP(Config.RATE_QUEST_DROP), RATE_QUEST_REWARD_XP(Config.RATE_QUEST_REWARD_XP),
  624. +       RATE_QUEST_REWARD_SP(Config.RATE_QUEST_REWARD_SP), RATE_QUEST_REWARD_ADENA(Config.RATE_QUEST_REWARD_SP),
  625. +       RATE_QUEST_REWARD_POTION(Config.RATE_QUEST_REWARD_POTION), RATE_QUEST_REWARD_SCROLL(Config.RATE_QUEST_REWARD_SCROLL),
  626. +       RATE_QUEST_REWARD_RECIPE(Config.RATE_QUEST_REWARD_RECIPE), RATE_QUEST_REWARD_MATERIAL(Config.RATE_QUEST_REWARD_MATERIAL),
  627. +       ENCHANT_CHANCE(Config.ENCHANT_CHANCE);
  628. +      
  629. +       float rateFloat;
  630. +       int rateInt;
  631. +       double rateDouble;
  632. +      
  633. +       OldConfig(float f) {
  634. +           this.rateFloat = f;
  635. +       }
  636. +      
  637. +       OldConfig(int i) {
  638. +           this.rateInt = i;
  639. +       }
  640. +      
  641. +       OldConfig(double d) {
  642. +           this.rateDouble = d;
  643. +       }
  644. +      
  645. +       float getFloatRate() { return rateFloat; }
  646. +       int getIntegerRate() { return rateInt; }        // Drop manor usa tipo int
  647. +       double getDoubleRate() { return rateDouble; }   // Enchant rate usa double
  648. +   }
  649. +  
  650. +   private void doResetDefault(L2PcInstance activeChar)
  651. +   {
  652. +       Config.RATE_XP = OldConfig.RATE_XP.getFloatRate();
  653. +       Config.RATE_SP = OldConfig.RATE_SP.getFloatRate();
  654. +       Config.RATE_PARTY_XP = OldConfig.RATE_PARTY_XP.getFloatRate();
  655. +       Config.RATE_PARTY_SP = OldConfig.RATE_PARTY_SP.getFloatRate();
  656. +       Config.RATE_DROP_ITEMS = OldConfig.RATE_DROP_ITEMS.getFloatRate();
  657. +       Config.RATE_DROP_ITEMS_BY_RAID = OldConfig.RATE_DROP_ITEMS_BY_RAID.getFloatRate();
  658. +       Config.RATE_DROP_SPOIL = OldConfig.RATE_DROP_SPOIL.getFloatRate();
  659. +       Config.RATE_DROP_MANOR = OldConfig.RATE_DROP_MANOR.getIntegerRate();
  660. +       Config.RATE_QUEST_DROP = OldConfig.RATE_QUEST_DROP.getFloatRate();
  661. +       Config.RATE_QUEST_REWARD_XP = OldConfig.RATE_QUEST_REWARD_XP.getFloatRate();
  662. +       Config.RATE_QUEST_REWARD_SP = OldConfig.RATE_QUEST_REWARD_SP.getFloatRate();
  663. +       Config.RATE_QUEST_REWARD_POTION = OldConfig.RATE_QUEST_REWARD_POTION.getFloatRate();
  664. +       Config.RATE_QUEST_REWARD_SCROLL = OldConfig.RATE_QUEST_REWARD_SCROLL.getFloatRate();
  665. +       Config.RATE_QUEST_REWARD_RECIPE = OldConfig.RATE_QUEST_REWARD_RECIPE.getFloatRate();
  666. +       Config.RATE_QUEST_REWARD_MATERIAL = OldConfig.RATE_QUEST_REWARD_MATERIAL.getFloatRate();
  667. +       Config.ENCHANT_CHANCE = OldConfig.ENCHANT_CHANCE.getDoubleRate();
  668. +      
  669. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  670. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  671. +       replyMSG.append("La configuracion original ha sido devuelta al servidor.<br><br>");
  672. +       replyMSG.append("<center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  673. +       adminReply.setHtml(replyMSG.toString());
  674. +       activeChar.sendPacket(adminReply);
  675. +   }
  676. +  
  677. +   private void doAskingNameConfig(L2PcInstance activeChar) {
  678. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  679. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  680. +       replyMSG.append("Introduce un nombre para esta configuracion (sin espacios):<br><edit var=\"nameConfig\" width=\"125\"><br><br>");
  681. +       replyMSG.append("<center><button value=\"Grabar\" action=\"bypass -h admin_happyhour_nameConfig $nameConfig\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  682. +       adminReply.setHtml(replyMSG.toString());
  683. +       activeChar.sendPacket(adminReply);
  684. +   }
  685. +  
  686. +   private void DoSaving(L2PcInstance activeChar, String command)
  687. +   {
  688. +       File HappyHourFile = new File("./config/HappyHour.properties");
  689. +       String datos = "", fileName = "NoName";
  690. +       String lineaDato = "";
  691. +      
  692. +       try {
  693. +           fileName = (command.split(" ")[1].length()>0) ? command.split(" ")[1] : "NoName";
  694. +       }
  695. +       catch (IndexOutOfBoundsException e) { fileName = "NoName"; }
  696. +      
  697. +       // HTML
  698. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  699. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  700. +      
  701. +       //Existe la fila? Si => entonces cargar la información
  702. +       if (HappyHourFile.isFile())
  703. +       {
  704. +           try (FileReader fr = new FileReader(HappyHourFile);
  705. +               BufferedReader br = new BufferedReader(fr);)
  706. +           {
  707. +               while ((lineaDato = br.readLine()) != null)
  708. +               {
  709. +                   datos += lineaDato + "\n";
  710. +               }
  711. +               replyMSG.append("Se han cargado los datos previos.<br>");
  712. +           }
  713. +           catch (Exception e) {
  714. +               _log.severe("No se pudo cargar Happyhour.properties.<br>"); e.printStackTrace();
  715. +               replyMSG.append("Error, no se ha podido leer el fichero existente.<br>");
  716. +           }
  717. +       }
  718. +      
  719. +       // Existe el fichero? No, pues creamos uno
  720. +       if (!HappyHourFile.exists())
  721. +       {
  722. +           try { HappyHourFile.createNewFile(); replyMSG.append("Se ha creado un fichero en el directorio config<br>"); }
  723. +           catch (IOException e1) { replyMSG.append("Error al crear el archivo config/HappyHour.properties<br>");_log.warning("Error de lectura, no se ha podido acceder a config/"); e1.printStackTrace(); }
  724. +       }
  725. +      
  726. +       // Montando los datos del properties
  727. +       datos += ("NAME " + fileName + "\n");
  728. +       datos += ("RATE_XP " + Config.RATE_XP + "\n");
  729. +       datos += ("RATE_SP " + Config.RATE_SP + "\n");
  730. +       datos += ("RATE_PARTY_XP " + Config.RATE_PARTY_XP + "\n");
  731. +       datos += ("RATE_PARTY_SP " + Config.RATE_PARTY_SP + "\n");
  732. +       datos += ("RATE_DROP_ITEMS " + Config.RATE_DROP_ITEMS + "\n");
  733. +       datos += ("RATE_DROP_ITEMS_BY_RAID " + Config.RATE_DROP_ITEMS_BY_RAID + "\n");
  734. +       datos += ("RATE_DROP_SPOIL " + Config.RATE_DROP_SPOIL + "\n");
  735. +       datos += ("RATE_DROP_MANOR " + Config.RATE_DROP_MANOR + "\n");
  736. +       datos += ("RATE_QUEST_DROP " + Config.RATE_QUEST_DROP + "\n");
  737. +       datos += ("RATE_QUEST_REWARD_XP " + Config.RATE_QUEST_REWARD_XP + "\n");
  738. +       datos += ("RATE_QUEST_REWARD_SP " + Config.RATE_QUEST_REWARD_SP + "\n");
  739. +       datos += ("RATE_QUEST_REWARD_POTION " + Config.RATE_QUEST_REWARD_POTION + "\n");
  740. +       datos += ("RATE_QUEST_REWARD_SCROLL " + Config.RATE_QUEST_REWARD_SCROLL + "\n");
  741. +       datos += ("RATE_QUEST_REWARD_RECIPE " + Config.RATE_QUEST_REWARD_RECIPE + "\n");
  742. +       datos += ("RATE_QUEST_REWARD_MATERIAL " + Config.RATE_QUEST_REWARD_MATERIAL + "\n");
  743. +       datos += ("ENCHANT_CHANCE " + Config.ENCHANT_CHANCE + "\n");
  744. +
  745. +       // Grabar configuración
  746. +      
  747. +       try (FileWriter fw = new FileWriter(HappyHourFile);)
  748. +       {
  749. +           fw.write(datos);
  750. +           fw.flush();
  751. +           replyMSG.append("Datos salvados");
  752. +       }
  753. +       catch (IOException e)
  754. +       {
  755. +           _log.severe("No se pudo guardar HappyHour.properties<br>"); e.printStackTrace();
  756. +           replyMSG.append("Error al salvar los datos de HappyHour.properties!<br>");
  757. +       }
  758. +       replyMSG.append("<br><br><br><center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  759. +       adminReply.setHtml(replyMSG.toString());
  760. +       activeChar.sendPacket(adminReply);
  761. +   }
  762. +  
  763. +  
  764. +   private void doLoadConfig(L2PcInstance activeChar) {
  765. +       File HappyHourFile = new File("./config/HappyHour.properties");
  766. +       String lineaDato = "", datos = "", botonName = "";
  767. +       // HTML
  768. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  769. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  770. +      
  771. +       // Averiguar cuantos datos existen
  772. +       try (FileReader fr = new FileReader(HappyHourFile); BufferedReader bf = new BufferedReader(fr); )
  773. +       {
  774. +           while ((lineaDato = bf.readLine())!=null)
  775. +           {
  776. +               datos += lineaDato + "\n";
  777. +           }
  778. +       }
  779. +       catch (FileNotFoundException e)
  780. +       {
  781. +           replyMSG.append("No existen datos previos.<br>");
  782. +           e.printStackTrace();
  783. +       }
  784. +       catch (IOException e)
  785. +       {
  786. +           replyMSG.append("Operación denegada. Vea la consola para mas informacion.<br>");
  787. +           e.printStackTrace();
  788. +       }
  789. +
  790. +       replyMSG.append("<center>Elija una de las configuraciones disponibles:</center><br><br>");
  791. +      
  792. +       String [] datosOrganizados = datos.split("\\n");
  793. +       for (String nombreConfig : datosOrganizados)
  794. +       {
  795. +           if (nombreConfig.contains("NAME"))
  796. +           {
  797. +               botonName = nombreConfig.split(" ")[1];
  798. +               replyMSG.append("<center><button value=\"" + botonName + "\" action=\"bypass -h admin_happyhour_executeLoad " + botonName + "\" width=120 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center><br>");
  799. +           }  
  800. +       }
  801. +
  802. +       // Un HTML demasiado largo crashearia el cliente
  803. +       if(datos.length() > 8192)
  804. +       {
  805. +           replyMSG.clear();
  806. +           replyMSG.append("El fichero es demasiado largo y no puede ser mostrado.<br><br>");
  807. +           replyMSG.append("<br><br><br><center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  808. +       }
  809. +      
  810. +       adminReply.setHtml(replyMSG.toString());
  811. +       activeChar.sendPacket(adminReply);
  812. +   }
  813. +  
  814. +   private void admin_happyhour_executeLoad(L2PcInstance activeChar, String command)
  815. +   {
  816. +       String lineaDatos = "";
  817. +       String regexRes[] = null;
  818. +      
  819. +       File happyHourFile = new File("./config/HappyHour.properties");
  820. +      
  821. +       // HTML
  822. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  823. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  824. +      
  825. +       try( FileReader fr = new FileReader(happyHourFile); BufferedReader br = new BufferedReader(fr); )
  826. +       {
  827. +           while ((lineaDatos = br.readLine())!=null)
  828. +           {
  829. +               if (lineaDatos.contains("NAME"))
  830. +               {
  831. +                   regexRes = lineaDatos.split(" ");
  832. +                   if (regexRes[1].equals(command.split(" ")[1]))
  833. +                   {
  834. +                       // Coincidencia, cargando configuración
  835. +                       Config.RATE_XP = Float.valueOf((br.readLine()).split(" ")[1]);
  836. +                       Config.RATE_SP = Float.valueOf((br.readLine()).split(" ")[1]);
  837. +                       Config.RATE_PARTY_XP = Float.valueOf((br.readLine()).split(" ")[1]);
  838. +                       Config.RATE_PARTY_SP = Float.valueOf((br.readLine()).split(" ")[1]);
  839. +                       Config.RATE_DROP_ITEMS = Float.valueOf((br.readLine()).split(" ")[1]);
  840. +                       Config.RATE_DROP_ITEMS_BY_RAID = Float.valueOf((br.readLine()).split(" ")[1]);
  841. +                       Config.RATE_DROP_SPOIL = Float.valueOf((br.readLine()).split(" ")[1]);
  842. +                       Config.RATE_DROP_MANOR = Integer.valueOf((br.readLine()).split(" ")[1]);
  843. +                       Config.RATE_QUEST_DROP = Float.valueOf((br.readLine()).split(" ")[1]);
  844. +                       Config.RATE_QUEST_REWARD_XP = Float.valueOf((br.readLine()).split(" ")[1]);
  845. +                       Config.RATE_QUEST_REWARD_SP = Float.valueOf((br.readLine()).split(" ")[1]);
  846. +                       Config.RATE_QUEST_REWARD_POTION = Float.valueOf((br.readLine()).split(" ")[1]);
  847. +                       Config.RATE_QUEST_REWARD_SCROLL = Float.valueOf((br.readLine()).split(" ")[1]);
  848. +                       Config.RATE_QUEST_REWARD_RECIPE = Float.valueOf((br.readLine()).split(" ")[1]);
  849. +                       Config.RATE_QUEST_REWARD_MATERIAL = Float.valueOf((br.readLine()).split(" ")[1]);
  850. +                       Config.ENCHANT_CHANCE = Double.valueOf((br.readLine()).split(" ")[1]);
  851. +                       replyMSG.append("Configuración cargada y ejecutada. <br>");
  852. +                       replyMSG.append("<br><br><br><center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  853. +                   }
  854. +               }
  855. +           }
  856. +       }
  857. +       catch (FileNotFoundException e)
  858. +       {
  859. +           // TODO Auto-generated catch block
  860. +           e.printStackTrace();
  861. +           replyMSG.append("El fichero happyHour.properties no existe.<br><br> La configuracion no ha sido cargada.<br><br>");
  862. +       }
  863. +       catch (ArrayIndexOutOfBoundsException e) { _log.warning("Outbounds: " + regexRes + "\n" + command + "\n"); e.printStackTrace(); }
  864. +       catch (IOException e)
  865. +       {
  866. +           _log.severe("Excepcion arrojada en AdminHappyHour#executeLoad");
  867. +           e.printStackTrace();
  868. +           replyMSG.append("Error desconocido.<br><br> La configuracion no ha sido cargada.<br><br>");
  869. +       }
  870. +      
  871. +      
  872. +       adminReply.setHtml(replyMSG.toString());
  873. +       activeChar.sendPacket(adminReply);
  874. +   }
  875. +  
  876. +   private void doSchedule(L2PcInstance activeChar) {
  877. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  878. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  879. +      
  880. +       File HappyHourFile = new File("./config/HappyHour.properties");
  881. +       if (HappyHourFile.exists())
  882. +       {
  883. +           // Nombre del evento que quieres programar
  884. +           replyMSG.append("<center>Introduce el nombre del evento que quieres programar:</center><br>");
  885. +           replyMSG.append("<center><font color=\"00FF00\">(Nombre sin espacios)</font></center><br>");
  886. +           replyMSG.append("<center><edit var=\"eventName\" width=\"125\"></center><br><br>");
  887. +           // Dia de la semana
  888. +           replyMSG.append("<center>Introduce un dia para programar el evento:</center><br>");
  889. +           replyMSG.append("<center><font color=\"00FF00\">(L, M, W, J, V, S, D)</font></center><br>");
  890. +           replyMSG.append("<center><edit var=\"weekDay\" width=\"125\"></center><br><br>");
  891. +           // Hora de inicio
  892. +           replyMSG.append("<center>Introduce la hora de inicio del evento:</center><br>");
  893. +           replyMSG.append("<center><font color=\"00FF00\">(Formato 24 hrs, 18:00:00, son las 6 de la tarde)</font></center><br>");
  894. +           replyMSG.append("<center><edit var=\"startHappyHour\" width=\"125\"></center><br><br>");
  895. +           // Hora de finalizacion
  896. +           replyMSG.append("<center>Introduce la hora de finalizacion del evento:</center><br>");
  897. +           replyMSG.append("<center><font color=\"00FF00\">(Formato 24 hrs, 18:30:00, son las 6:30 de la tarde)</font></center><br>");
  898. +           replyMSG.append("<center><font color=\"00DD00\">(Si la hora de inicio es la misma que la hora final, se borrara la programacion de los eventos guardados.)</font></center><br>");
  899. +           replyMSG.append("<center><edit var=\"endHappyHour\" width=\"125\"></center><br><br><br><br>");
  900. +           // Botones
  901. +           replyMSG.append("<br><br><br><center><button value=\"Grabar\" action=\"bypass -h admin_happyhour_implements $weekDay $startHappyHour $endHappyHour $eventName\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center><br>");
  902. +           replyMSG.append("<br><br><br><center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  903. +       }
  904. +       else
  905. +       {
  906. +           replyMSG.append("<center>No puedes programar un evento si no esta grabado.</center>");
  907. +           replyMSG.append("<br><br><br><center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  908. +       }
  909. +       adminReply.setHtml(replyMSG.toString());
  910. +       activeChar.sendPacket(adminReply);
  911. +   }
  912. +  
  913. +   private void recordSchedule (L2PcInstance activeChar, String command)
  914. +   {
  915. +       boolean error = false;
  916. +       // File
  917. +       File f = new File ("./config/HappyHour.properties");
  918. +       String lineaDato = "";
  919. +       boolean fileFound = false;
  920. +      
  921. +       // HTML
  922. +       NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
  923. +       TextBuilder replyMSG = new TextBuilder("<html><title>Happy Hour por Kimeraweb</title><body>");
  924. +  
  925. +       try (Connection con = L2DatabaseFactory.getInstance().getConnection();
  926. +           Statement st = con.createStatement();
  927. +           FileReader fr = new FileReader(f);
  928. +           BufferedReader bf = new BufferedReader(fr);)
  929. +           {
  930. +               final String dia = command.split(" ")[1];
  931. +               final String horaInicio = command.split(" ")[2];
  932. +               final String horaFinal = command.split(" ")[3];
  933. +               final String eventoNombre = command.split(" ")[4];
  934. +               // Existe este evento?
  935. +              
  936. +               while ((lineaDato = bf.readLine())!=null)
  937. +               {
  938. +                   if (lineaDato.contains(eventoNombre))
  939. +                   {
  940. +                       fileFound = true;
  941. +                       break;
  942. +                   }
  943. +               }
  944. +                              
  945. +               // Solo un evento activo
  946. +               final String deleteHappyHoursStart = "Delete from global_tasks where task='happyHourStart'";
  947. +               final String deleteHappyHoursEnd = "Delete from global_tasks where task='happyHourEnd'";
  948. +              
  949. +               if ((horaInicio.split(":").length!=3) || (horaFinal.split(":").length!=3) || (horaInicio.length()!=8) || (horaFinal.length()!=8))
  950. +               {
  951. +                   _log.warning("Formato horario erroneo en recordSchedule: " + horaInicio + " " + horaFinal);
  952. +                   error = true;
  953. +                   replyMSG.append("Error: Formato horario erroneo.<br>");
  954. +               }
  955. +              
  956. +               if (!dia.equals("L") && !dia.equals("M") && !dia.equals("W") &&
  957. +                   !dia.equals("J") && !dia.equals("V") && !dia.equals("S") &&
  958. +                   !dia.equals("D"))
  959. +               {
  960. +                   _log.warning("Dia incorrecto");
  961. +                   error = true;
  962. +                   replyMSG.append("Error: Dia incorrecto.<br>");
  963. +               }
  964. +              
  965. +               if (!fileFound) {
  966. +                   error = true;
  967. +                   _log.info("Se ha intentado cargar un evento happyHour que no existe.");
  968. +                   replyMSG.append("Error: El evento seleccionado no existe.<br>");
  969. +               }
  970. +              
  971. +               if (error == false)
  972. +               {
  973. +                   st.execute(deleteHappyHoursStart);
  974. +                   st.execute(deleteHappyHoursEnd);
  975. +                   if (!horaInicio.equals(horaFinal))
  976. +                   {
  977. +                       // En el 3er parámetro añado el dia y el nombre del evento
  978. +                       TaskManager.addTask("happy_hour_start", TaskTypes.TYPE_SCHEDULED_PER_DAY, "1", horaInicio, dia + " " + eventoNombre);
  979. +                       TaskManager.addTask("happy_hour_end", TaskTypes.TYPE_SCHEDULED_PER_DAY, "1", horaFinal, dia);
  980. +                       replyMSG.append("Se ha programado el evento.<br>");
  981. +                   }
  982. +               }
  983. +               con.close(); st.close();
  984. +       }
  985. +       catch (ArrayIndexOutOfBoundsException e) { _log.warning("Numero de parametros incorrecto en HappyHour#recordSchedule"); replyMSG.append("Numero de parametros incorrectos.<br>"); }
  986. +       catch (SQLException e) { _log.warning("Error de query en HappyHour#recordSchedule"); replyMSG.append("Error en la base de datos.<br>"); }
  987. +       catch (FileNotFoundException e){ _log.warning("No se ha encontrado happyHour.properties"); replyMSG.append("No se ha encontrado el fichero happyHour.properties.<br>"); }
  988. +       catch (IOException e) { _log.warning("No se ha podido leer happyHour.properties");  replyMSG.append("No se ha podido leer happyHour.properties.<br>"); }   
  989. +      
  990. +       replyMSG.append("<br><br><br><center><button value=\"Menu\" action=\"bypass -h admin_happyhour\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center>");
  991. +
  992. +       adminReply.setHtml(replyMSG.toString());
  993. +       activeChar.sendPacket(adminReply);
  994. +   }
  995. +}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement