Advertisement
VANPER

ViP Buffer Menu

Apr 8th, 2020
1,135
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 12.01 KB | None | 1 0
  1. Index: Dev.HeroPainel;VipMenu.java
  2. ===================================================================
  3. --- Dev.HeroPainel;VipMenu.java (revision 384)
  4. +++ Dev.HeroPainel;VipMenu.java (working copy)
  5.  
  6. +   import java.text.SimpleDateFormat;
  7. +   import java.util.Calendar;
  8. +   import java.util.Date;
  9. +   import java.util.StringTokenizer;
  10. +   import java.util.concurrent.TimeUnit;
  11. +  
  12. +   import net.sf.l2j.gameserver.handler.IUserCommandHandler;
  13. +   import net.sf.l2j.gameserver.model.World;
  14. +   import net.sf.l2j.gameserver.model.actor.Player;
  15. +   import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  16. +   import net.sf.l2j.gameserver.taskmanager.GameTimeTaskManager;
  17. +  
  18. +   public class VipMenu implements IUserCommandHandler
  19. +   {
  20. +       private static final int[] COMMAND_IDS =
  21. +       {
  22. +           303
  23. +       };
  24. +      
  25. +       @Override
  26. +      
  27. +       public void useUserCommand(int command, Player activeChar)
  28. +       {
  29. +           mainHtml(activeChar, 0);
  30. +           return;
  31. +       }
  32. +      
  33. +      
  34. +       public static void mainHtml(Player activeChar, int time)
  35. +       {
  36. +          
  37. +           if (activeChar.isVip())
  38. +           {
  39. +               final NpcHtmlMessage html = new NpcHtmlMessage(0);
  40. +               html.setFile("data/html/mods/VipMenu.htm");
  41. +               html.replace("%name%", activeChar.getName());
  42. +               html.replace("%TimeServer%", GameTimeTaskManager.getInstance().getGameTimeFormated());
  43. +               html.replace("%online%", World.getInstance().getPlayers().size());
  44. +               html.replace("%time%", new SimpleDateFormat("MMM dd, yyyy HH:mm").format(new Date(activeChar.getMemos().getLong("vipTime", 0))));
  45. +               long now = Calendar.getInstance().getTimeInMillis();
  46. +               long endDay = activeChar.getMemos().getLong("vipTime");
  47. +              
  48. +               if (now > endDay)
  49. +                   activeChar.setVip(false);
  50. +               else
  51. +               {
  52. +                   activeChar.setVip(true);
  53. +               }
  54. +               activeChar.sendPacket(html);
  55. +           }else{
  56. +               NpcHtmlMessage nhm = new NpcHtmlMessage(5);
  57. +               StringBuilder html1 = new StringBuilder("");
  58. +               html1.append("<html><head><title>Vip Menu</title></head><body><center>");
  59. +               html1.append("<img src=\"SS_l2jNetwork.lineo\" width=300 height=3>");
  60. +               html1.append("<table width=305 height=20 bgcolor=000000>");
  61. +               html1.append("<tr>");
  62. +               html1.append("<td align=center>Personal Vip Options</td>");
  63. +               html1.append("</tr>");
  64. +               html1.append("</table>");
  65. +               html1.append("<img src=\"SS_l2jNetwork.lineo\" width=300 height=3>");
  66. +               html1.append("<br>");
  67. +               html1.append("Your character Isn't Vip.");
  68. +              
  69. +               html1.append("</center>");
  70. +               html1.append("</body></html>");
  71. +               nhm.setHtml(html1.toString());
  72. +               activeChar.sendPacket(nhm);
  73. +           }
  74. +          
  75. +       }
  76. +      
  77. +       public static void Time(Player player, int time)
  78. +       {
  79. +           player.getMemos().set("vipEndTime", System.currentTimeMillis() + TimeUnit.DAYS.toMillis(time));
  80. +          
  81. +          
  82. +       }
  83. +      
  84. +       public static void bypass(Player activeChar, String command, StringTokenizer st)
  85. +       {
  86. +          
  87. +           if (activeChar.isVip())
  88. +           {
  89. +               final NpcHtmlMessage html = new NpcHtmlMessage(0);
  90. +               html.setFile("data/html/mods/VipMenu.htm");
  91. +               html.replace("%name%", activeChar.getName());
  92. +               html.replace("%TimeServer%", GameTimeTaskManager.getInstance().getGameTimeFormated());
  93. +               html.replace("%online%", World.getInstance().getPlayers().size());
  94. +               html.replace("%time%", new SimpleDateFormat("MMM dd, yyyy HH:mm").format(new Date(activeChar.getMemos().getLong("vipTime", 0))));
  95. +               long now = Calendar.getInstance().getTimeInMillis();
  96. +               long endDay = activeChar.getMemos().getLong("vipTime");
  97. +              
  98. +               if (now > endDay)
  99. +                   activeChar.setVip(false);
  100. +               else
  101. +               {
  102. +                   activeChar.setVip(true);
  103. +               }
  104. +               activeChar.sendPacket(html);
  105. +           }else{
  106. +               NpcHtmlMessage nhm = new NpcHtmlMessage(5);
  107. +               StringBuilder html1 = new StringBuilder("");
  108. +               html1.append("<html><head><title>Vip Menu</title></head><body><center>");
  109. +               html1.append("<img src=\"SS_l2jNetwork.lineo\" width=300 height=3>");
  110. +               html1.append("<table width=305 height=20 bgcolor=000000>");
  111. +               html1.append("<tr>");
  112. +               html1.append("<td align=center>Personal Vip Options</td>");
  113. +               html1.append("</tr>");
  114. +               html1.append("</table>");
  115. +               html1.append("<img src=\"SS_l2jNetwork.lineo\" width=300 height=3>");
  116. +               html1.append("<br>");
  117. +               html1.append("Your character Isn't Vip.");
  118. +              
  119. +               html1.append("</center>");
  120. +               html1.append("</body></html>");
  121. +               nhm.setHtml(html1.toString());
  122. +               activeChar.sendPacket(nhm);
  123. +           }
  124. +          
  125. +          
  126. +       }
  127. +      
  128. +       @Override
  129. +       public int[] getUserCommandList()
  130. +       {
  131. +           return COMMAND_IDS;
  132. +       }
  133. +   }
  134. +
  135.  
  136. Index: net.sf.l2j.gameserver.handler;UserCommandHandler.java
  137. ===================================================================
  138. --- data/html/mods/VipMenu.htm (revision 384)
  139. +++ data/html/mods/VipMenu.htm (working copy)
  140.  
  141. +import Dev.HeroPainel;VipMenu
  142.  
  143.  
  144. protected UserCommandHandler()
  145. {
  146. +registerHandler(new VipMenu());
  147.  
  148.  
  149.  
  150. Index: net.sf.l2j.gameserver.network.clientpackets;RequestBypassToServer.java
  151. ===================================================================
  152. --- net.sf.l2j.gameserver.network.clientpackets;RequestBypassToServer.java (revision 384)
  153. +++ net.sf.l2j.gameserver.network.clientpackets;RequestBypassToServer.java (working copy)
  154.  
  155.  
  156. +import Dev.HeroPainel;VipMenu
  157.  
  158.  
  159.  
  160.  
  161. +           if (_command.startsWith("Heroic_Valor"))
  162. +           {
  163. +              
  164. +              
  165. +               L2Skill skill = SkillTable.getInstance().getInfo(1374, 1);
  166. +               skill.getEffects(player, player);
  167. +              
  168. +               player.broadcastUserInfo();
  169. +               player.sendMessage("Felicitaciones, use buff Heroic Valor!");
  170. +              
  171. +               VipMenu.bypass(player, null, null);
  172. +           }
  173. +          
  174. +           if (_command.startsWith("P_Attak"))
  175. +           {
  176. +              
  177. +               L2Skill skill = SkillTable.getInstance().getInfo(5154, 10);
  178. +               skill.getEffects(player, player);
  179. +               player.broadcastUserInfo();
  180. +               player.sendMessage("Felicitaciones, use buff Might Argument!");
  181. +               VipMenu.bypass(player, null, null);
  182. +           }
  183. +          
  184. +           if (_command.startsWith("M_Attak"))
  185. +           {
  186. +               L2Skill skill = SkillTable.getInstance().getInfo(5156, 10);
  187. +               skill.getEffects(player, player);
  188. +              
  189. +               player.broadcastUserInfo();
  190. +               player.sendMessage("Felicitaciones, use buff Empower Valor!");
  191. +               VipMenu.bypass(player, null, null);
  192. +           }
  193. +          
  194. +           if (_command.startsWith("P_Def"))
  195. +           {
  196. +              
  197. +               L2Skill skill = SkillTable.getInstance().getInfo(5158, 10);
  198. +               skill.getEffects(player, player);
  199. +              
  200. +               player.broadcastUserInfo();
  201. +               player.sendMessage("Felicitaciones, use buff Shield Argument!");
  202. +               VipMenu.bypass(player, null, null);
  203. +           }
  204. +          
  205. +           if (_command.startsWith("M_Def"))
  206. +           {
  207. +              
  208. +               L2Skill skill = SkillTable.getInstance().getInfo(5159, 10);
  209. +               skill.getEffects(player, player);
  210. +              
  211. +               player.broadcastUserInfo();
  212. +               player.sendMessage("Felicitaciones, use buff Magic Barrier Argument!");
  213. +               VipMenu.bypass(player, null, null);
  214. +           }
  215. +          
  216. +           if (_command.startsWith("Malaria"))
  217. +           {
  218. +              
  219. +               L2Skill skill = SkillTable.getInstance().getInfo(4554, 4);
  220. +               skill.getEffects(player, player);
  221. +              
  222. +               player.broadcastUserInfo();
  223. +               player.sendMessage("Felicitaciones, use buff Malaria!");
  224. +               VipMenu.bypass(player, null, null);
  225. +           }
  226. +          
  227. +           if (_command.startsWith("Flu"))
  228. +           {
  229. +              
  230. +               L2Skill skill = SkillTable.getInstance().getInfo(4553, 4);
  231. +               skill.getEffects(player, player);
  232. +               player.broadcastUserInfo();
  233. +               player.sendMessage("Felicitaciones, use buff Flu!");
  234. +               VipMenu.bypass(player, null, null);
  235. +           }
  236. +          
  237. +           if (_command.startsWith("Cholera"))
  238. +           {
  239. +              
  240. +               L2Skill skill = SkillTable.getInstance().getInfo(4552, 4);
  241. +               skill.getEffects(player, player);
  242. +               player.broadcastUserInfo();
  243. +               player.sendMessage("Felicitaciones, use buff Cholera!");
  244. +               VipMenu.bypass(player, null, null);
  245. +           }
  246. +          
  247. +           if (_command.startsWith("Salvation"))
  248. +           {
  249. +              
  250. +               L2Skill skill = SkillTable.getInstance().getInfo(1410, 1);
  251. +               skill.getEffects(player, player);
  252. +               player.broadcastUserInfo();
  253. +               player.sendMessage("Felicitaciones, use buff Salvation!");
  254. +               VipMenu.bypass(player, null, null);
  255. +           }
  256. +          
  257.  
  258.  
  259.  
  260. Index: data/html/mods/VipMenu.htm
  261. ===================================================================
  262. --- data/html/mods/VipMenu.htm (revision 384)
  263. +++ data/html/mods/VipMenu.htm (working copy)
  264.  
  265. +   <html>
  266. +   <title>Vip Pessoal</title>
  267. +   <body>
  268. +  
  269. +   <center>
  270. +   <table width=224>
  271. +       <tr>
  272. +           <td width=32><img src=Icon.etc_alphabet_l_i00 height=32 width=32></td>
  273. +           <td width=32><img src=Icon.etc_alphabet_i_i00 height=32 width=32></td>
  274. +           <td width=32><img src=Icon.etc_alphabet_n_i00 height=32 width=32></td>
  275. +           <td width=32><img src=Icon.etc_alphabet_e_i00 height=32 width=32></td>
  276. +           <td width=32><img src=Icon.etc_alphabet_a_i00 height=32 width=32></td>
  277. +           <td width=32><img src=Icon.etc_alphabet_g_i00 height=32 width=32></td>
  278. +           <td width=32><img src=Icon.etc_alphabet_e_i00 height=32 width=32></td>
  279. +       </tr>
  280. +   </table>
  281. +   <br>
  282. +   <br>
  283. +   Player(s) online: <font color="00FF00">%online%</font></center>
  284. +   <br1>
  285. +  
  286. +   <center><font color="LEVEL">Lineage II Dev</font></center>
  287. +   <img src="L2UI.SquareGray" width=270 height=1>
  288. +   <table bgcolor="000000">
  289. +   <tr>
  290. +   <td width=5></td>
  291. +   <td width=105>Buffer</td>
  292. +   <td width=100>     </td>
  293. +   <td width=50>Teleport</td>
  294. +   </tr>
  295. +   </table>
  296. +   <img src="L2UI.SquareGray" width=270 height=1>
  297. +  
  298. +   <br>
  299. +  
  300. +   <center>
  301. +   <table width="256">
  302. +   <tr>
  303. +   <td align="center">
  304. +   <img src="icon.skill3080" width="32" height="32">
  305. +   <button action="bypass -h M_Attak" value="M.Attak" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
  306. +   </td>
  307. +  
  308. +   <td align="center">
  309. +   <img src="icon.skill3080" width="32" height="32">
  310. +   <button action="bypass -h P_Attak" value="P.Attak" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
  311. +   </td>
  312. +   <td align="center">
  313. +   <img src="icon.skill1374" width="32" height="32">
  314. +   <button action="bypass -h Heroic_Valor" value="Heroic Valor" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
  315. +   </td>
  316. +   </tr>
  317. +   </table>
  318. +   </center>
  319. +  
  320. +   <br>
  321. +  
  322. +   <center>
  323. +   <table width="256">
  324. +   <tr>
  325. +   <td align="center">
  326. +   <img src="icon.skill3080" width="32" height="32">
  327. +   <button action="bypass -h P_Def" value="P.Def" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
  328. +   </td>
  329. +   <td align="center">
  330. +   <img src="icon.skill3080" width="32" height="32">
  331. +   <button action="bypass -h M_Def" value="M.Def" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
  332. +   </td>
  333. +   <td align="center">
  334. +   <img src="icon.skill1164" width="32" height="32">
  335. +   <button action="bypass -h Malaria" value="Malaria" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
  336. +   </td>
  337. +   </tr>
  338. +   </table>
  339. +   </center>
  340. +   <br>
  341. +   <center>
  342. +   <table width="256">
  343. +   <tr>
  344. +   <td align="center">
  345. +   <img src="icon.skill1164" width="32" height="32">
  346. +   <button action="bypass -h Flu" value="Flu" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
  347. +   </td>
  348. +   <td align="center">
  349. +   <img src="icon.skill1164" width="32" height="32">
  350. +   <button action="bypass -h Cholera" value="Cholera" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
  351. +   </td>
  352. +   <td align="center">
  353. +   <img src="icon.skill1410" width="32" height="32">
  354. +   <button action="bypass -h Salvation" value="Salvation" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
  355. +   </td>
  356. +   </tr>
  357. +   </table>
  358. +   </center>
  359. +   <br>
  360. +   <center>Vip End Time : <font color="LEVEL">%time%</font></center>
  361. +   <br>
  362. +  
  363. +   <center>Game Time : <font color="LEVEL">%TimeServer%</font></center>
  364. +   <br>
  365. +  
  366. +   <center>
  367. +   <img src="L2UI.SquareGray" width=160 height=1><br>
  368. +   </center>
  369. +   <br>
  370. +   <center>
  371. +  
  372. +   </body>
  373. +   </html>
  374.  
  375. Index: system;commandname-e.dat
  376. ===================================================================
  377. --- system;commandname-e.dat (revision 384)
  378. +++ system;commandname-e.dat (working copy)
  379.  
  380. +118    303 vip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement