Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Dev.HeroPainel;VipMenu.java
- ===================================================================
- --- Dev.HeroPainel;VipMenu.java (revision 384)
- +++ Dev.HeroPainel;VipMenu.java (working copy)
- + import java.text.SimpleDateFormat;
- + import java.util.Calendar;
- + import java.util.Date;
- + import java.util.StringTokenizer;
- + import java.util.concurrent.TimeUnit;
- +
- + import net.sf.l2j.gameserver.handler.IUserCommandHandler;
- + import net.sf.l2j.gameserver.model.World;
- + import net.sf.l2j.gameserver.model.actor.Player;
- + import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- + import net.sf.l2j.gameserver.taskmanager.GameTimeTaskManager;
- +
- + public class VipMenu implements IUserCommandHandler
- + {
- + private static final int[] COMMAND_IDS =
- + {
- + 303
- + };
- +
- + @Override
- +
- + public void useUserCommand(int command, Player activeChar)
- + {
- + mainHtml(activeChar, 0);
- + return;
- + }
- +
- +
- + public static void mainHtml(Player activeChar, int time)
- + {
- +
- + if (activeChar.isVip())
- + {
- + final NpcHtmlMessage html = new NpcHtmlMessage(0);
- + html.setFile("data/html/mods/VipMenu.htm");
- + html.replace("%name%", activeChar.getName());
- + html.replace("%TimeServer%", GameTimeTaskManager.getInstance().getGameTimeFormated());
- + html.replace("%online%", World.getInstance().getPlayers().size());
- + html.replace("%time%", new SimpleDateFormat("MMM dd, yyyy HH:mm").format(new Date(activeChar.getMemos().getLong("vipTime", 0))));
- + long now = Calendar.getInstance().getTimeInMillis();
- + long endDay = activeChar.getMemos().getLong("vipTime");
- +
- + if (now > endDay)
- + activeChar.setVip(false);
- + else
- + {
- + activeChar.setVip(true);
- + }
- + activeChar.sendPacket(html);
- + }else{
- + NpcHtmlMessage nhm = new NpcHtmlMessage(5);
- + StringBuilder html1 = new StringBuilder("");
- + html1.append("<html><head><title>Vip Menu</title></head><body><center>");
- + html1.append("<img src=\"SS_l2jNetwork.lineo\" width=300 height=3>");
- + html1.append("<table width=305 height=20 bgcolor=000000>");
- + html1.append("<tr>");
- + html1.append("<td align=center>Personal Vip Options</td>");
- + html1.append("</tr>");
- + html1.append("</table>");
- + html1.append("<img src=\"SS_l2jNetwork.lineo\" width=300 height=3>");
- + html1.append("<br>");
- + html1.append("Your character Isn't Vip.");
- +
- + html1.append("</center>");
- + html1.append("</body></html>");
- + nhm.setHtml(html1.toString());
- + activeChar.sendPacket(nhm);
- + }
- +
- + }
- +
- + public static void Time(Player player, int time)
- + {
- + player.getMemos().set("vipEndTime", System.currentTimeMillis() + TimeUnit.DAYS.toMillis(time));
- +
- +
- + }
- +
- + public static void bypass(Player activeChar, String command, StringTokenizer st)
- + {
- +
- + if (activeChar.isVip())
- + {
- + final NpcHtmlMessage html = new NpcHtmlMessage(0);
- + html.setFile("data/html/mods/VipMenu.htm");
- + html.replace("%name%", activeChar.getName());
- + html.replace("%TimeServer%", GameTimeTaskManager.getInstance().getGameTimeFormated());
- + html.replace("%online%", World.getInstance().getPlayers().size());
- + html.replace("%time%", new SimpleDateFormat("MMM dd, yyyy HH:mm").format(new Date(activeChar.getMemos().getLong("vipTime", 0))));
- + long now = Calendar.getInstance().getTimeInMillis();
- + long endDay = activeChar.getMemos().getLong("vipTime");
- +
- + if (now > endDay)
- + activeChar.setVip(false);
- + else
- + {
- + activeChar.setVip(true);
- + }
- + activeChar.sendPacket(html);
- + }else{
- + NpcHtmlMessage nhm = new NpcHtmlMessage(5);
- + StringBuilder html1 = new StringBuilder("");
- + html1.append("<html><head><title>Vip Menu</title></head><body><center>");
- + html1.append("<img src=\"SS_l2jNetwork.lineo\" width=300 height=3>");
- + html1.append("<table width=305 height=20 bgcolor=000000>");
- + html1.append("<tr>");
- + html1.append("<td align=center>Personal Vip Options</td>");
- + html1.append("</tr>");
- + html1.append("</table>");
- + html1.append("<img src=\"SS_l2jNetwork.lineo\" width=300 height=3>");
- + html1.append("<br>");
- + html1.append("Your character Isn't Vip.");
- +
- + html1.append("</center>");
- + html1.append("</body></html>");
- + nhm.setHtml(html1.toString());
- + activeChar.sendPacket(nhm);
- + }
- +
- +
- + }
- +
- + @Override
- + public int[] getUserCommandList()
- + {
- + return COMMAND_IDS;
- + }
- + }
- +
- Index: net.sf.l2j.gameserver.handler;UserCommandHandler.java
- ===================================================================
- --- data/html/mods/VipMenu.htm (revision 384)
- +++ data/html/mods/VipMenu.htm (working copy)
- +import Dev.HeroPainel;VipMenu
- protected UserCommandHandler()
- {
- +registerHandler(new VipMenu());
- Index: net.sf.l2j.gameserver.network.clientpackets;RequestBypassToServer.java
- ===================================================================
- --- net.sf.l2j.gameserver.network.clientpackets;RequestBypassToServer.java (revision 384)
- +++ net.sf.l2j.gameserver.network.clientpackets;RequestBypassToServer.java (working copy)
- +import Dev.HeroPainel;VipMenu
- + if (_command.startsWith("Heroic_Valor"))
- + {
- +
- +
- + L2Skill skill = SkillTable.getInstance().getInfo(1374, 1);
- + skill.getEffects(player, player);
- +
- + player.broadcastUserInfo();
- + player.sendMessage("Felicitaciones, use buff Heroic Valor!");
- +
- + VipMenu.bypass(player, null, null);
- + }
- +
- + if (_command.startsWith("P_Attak"))
- + {
- +
- + L2Skill skill = SkillTable.getInstance().getInfo(5154, 10);
- + skill.getEffects(player, player);
- + player.broadcastUserInfo();
- + player.sendMessage("Felicitaciones, use buff Might Argument!");
- + VipMenu.bypass(player, null, null);
- + }
- +
- + if (_command.startsWith("M_Attak"))
- + {
- + L2Skill skill = SkillTable.getInstance().getInfo(5156, 10);
- + skill.getEffects(player, player);
- +
- + player.broadcastUserInfo();
- + player.sendMessage("Felicitaciones, use buff Empower Valor!");
- + VipMenu.bypass(player, null, null);
- + }
- +
- + if (_command.startsWith("P_Def"))
- + {
- +
- + L2Skill skill = SkillTable.getInstance().getInfo(5158, 10);
- + skill.getEffects(player, player);
- +
- + player.broadcastUserInfo();
- + player.sendMessage("Felicitaciones, use buff Shield Argument!");
- + VipMenu.bypass(player, null, null);
- + }
- +
- + if (_command.startsWith("M_Def"))
- + {
- +
- + L2Skill skill = SkillTable.getInstance().getInfo(5159, 10);
- + skill.getEffects(player, player);
- +
- + player.broadcastUserInfo();
- + player.sendMessage("Felicitaciones, use buff Magic Barrier Argument!");
- + VipMenu.bypass(player, null, null);
- + }
- +
- + if (_command.startsWith("Malaria"))
- + {
- +
- + L2Skill skill = SkillTable.getInstance().getInfo(4554, 4);
- + skill.getEffects(player, player);
- +
- + player.broadcastUserInfo();
- + player.sendMessage("Felicitaciones, use buff Malaria!");
- + VipMenu.bypass(player, null, null);
- + }
- +
- + if (_command.startsWith("Flu"))
- + {
- +
- + L2Skill skill = SkillTable.getInstance().getInfo(4553, 4);
- + skill.getEffects(player, player);
- + player.broadcastUserInfo();
- + player.sendMessage("Felicitaciones, use buff Flu!");
- + VipMenu.bypass(player, null, null);
- + }
- +
- + if (_command.startsWith("Cholera"))
- + {
- +
- + L2Skill skill = SkillTable.getInstance().getInfo(4552, 4);
- + skill.getEffects(player, player);
- + player.broadcastUserInfo();
- + player.sendMessage("Felicitaciones, use buff Cholera!");
- + VipMenu.bypass(player, null, null);
- + }
- +
- + if (_command.startsWith("Salvation"))
- + {
- +
- + L2Skill skill = SkillTable.getInstance().getInfo(1410, 1);
- + skill.getEffects(player, player);
- + player.broadcastUserInfo();
- + player.sendMessage("Felicitaciones, use buff Salvation!");
- + VipMenu.bypass(player, null, null);
- + }
- +
- Index: data/html/mods/VipMenu.htm
- ===================================================================
- --- data/html/mods/VipMenu.htm (revision 384)
- +++ data/html/mods/VipMenu.htm (working copy)
- + <html>
- + <title>Vip Pessoal</title>
- + <body>
- +
- + <center>
- + <table width=224>
- + <tr>
- + <td width=32><img src=Icon.etc_alphabet_l_i00 height=32 width=32></td>
- + <td width=32><img src=Icon.etc_alphabet_i_i00 height=32 width=32></td>
- + <td width=32><img src=Icon.etc_alphabet_n_i00 height=32 width=32></td>
- + <td width=32><img src=Icon.etc_alphabet_e_i00 height=32 width=32></td>
- + <td width=32><img src=Icon.etc_alphabet_a_i00 height=32 width=32></td>
- + <td width=32><img src=Icon.etc_alphabet_g_i00 height=32 width=32></td>
- + <td width=32><img src=Icon.etc_alphabet_e_i00 height=32 width=32></td>
- + </tr>
- + </table>
- + <br>
- + <br>
- + Player(s) online: <font color="00FF00">%online%</font></center>
- + <br1>
- +
- + <center><font color="LEVEL">Lineage II Dev</font></center>
- + <img src="L2UI.SquareGray" width=270 height=1>
- + <table bgcolor="000000">
- + <tr>
- + <td width=5></td>
- + <td width=105>Buffer</td>
- + <td width=100> </td>
- + <td width=50>Teleport</td>
- + </tr>
- + </table>
- + <img src="L2UI.SquareGray" width=270 height=1>
- +
- + <br>
- +
- + <center>
- + <table width="256">
- + <tr>
- + <td align="center">
- + <img src="icon.skill3080" width="32" height="32">
- + <button action="bypass -h M_Attak" value="M.Attak" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
- + </td>
- +
- + <td align="center">
- + <img src="icon.skill3080" width="32" height="32">
- + <button action="bypass -h P_Attak" value="P.Attak" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
- + </td>
- + <td align="center">
- + <img src="icon.skill1374" width="32" height="32">
- + <button action="bypass -h Heroic_Valor" value="Heroic Valor" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
- + </td>
- + </tr>
- + </table>
- + </center>
- +
- + <br>
- +
- + <center>
- + <table width="256">
- + <tr>
- + <td align="center">
- + <img src="icon.skill3080" width="32" height="32">
- + <button action="bypass -h P_Def" value="P.Def" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
- + </td>
- + <td align="center">
- + <img src="icon.skill3080" width="32" height="32">
- + <button action="bypass -h M_Def" value="M.Def" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
- + </td>
- + <td align="center">
- + <img src="icon.skill1164" width="32" height="32">
- + <button action="bypass -h Malaria" value="Malaria" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
- + </td>
- + </tr>
- + </table>
- + </center>
- + <br>
- + <center>
- + <table width="256">
- + <tr>
- + <td align="center">
- + <img src="icon.skill1164" width="32" height="32">
- + <button action="bypass -h Flu" value="Flu" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
- + </td>
- + <td align="center">
- + <img src="icon.skill1164" width="32" height="32">
- + <button action="bypass -h Cholera" value="Cholera" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
- + </td>
- + <td align="center">
- + <img src="icon.skill1410" width="32" height="32">
- + <button action="bypass -h Salvation" value="Salvation" width="75" height="21" back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
- + </td>
- + </tr>
- + </table>
- + </center>
- + <br>
- + <center>Vip End Time : <font color="LEVEL">%time%</font></center>
- + <br>
- +
- + <center>Game Time : <font color="LEVEL">%TimeServer%</font></center>
- + <br>
- +
- + <center>
- + <img src="L2UI.SquareGray" width=160 height=1><br>
- + </center>
- + <br>
- + <center>
- +
- + </body>
- + </html>
- Index: system;commandname-e.dat
- ===================================================================
- --- system;commandname-e.dat (revision 384)
- +++ system;commandname-e.dat (working copy)
- +118 303 vip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement