/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package handlers.voicedcommandhandlers; import java.text.SimpleDateFormat; import com.l2jmobius.Config; import com.l2jmobius.gameserver.handler.IVoicedCommandHandler; import com.l2jmobius.gameserver.instancemanager.PremiumManager; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; public class Premium implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = { "premium" }; @Override public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (command.startsWith("premium") && Config.PREMIUM_SYSTEM_ENABLED) { final SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm"); final long endDate = PremiumManager.getInstance().getPremiumEndDate(activeChar.getAccountName()); if (endDate == 0) { final NpcHtmlMessage msg = new NpcHtmlMessage(5); final StringBuilder html = new StringBuilder("Account Details
"); html.append(""); html.append(""); html.append(""); html.append(""); html.append("
"); html.append("
"); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append("
Account Status: Normal
Rate XP: x" + Config.RATE_XP + "
Rate SP: x" + Config.RATE_SP + "
Drop Chance: x" + Config.RATE_DEATH_DROP_CHANCE_MULTIPLIER + "
Drop Amount: x" + Config.RATE_DEATH_DROP_AMOUNT_MULTIPLIER + "
Premium Info & Rules
Rate XP: x" + (Config.RATE_XP * Config.PREMIUM_RATE_XP) + "
Rate SP: x" + (Config.RATE_SP * Config.PREMIUM_RATE_SP) + "
Drop Chance: x" + (Config.RATE_DEATH_DROP_CHANCE_MULTIPLIER * Config.RATE_DEATH_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_DROP_CHANCE) + "
Drop Amount: x" + (Config.RATE_DEATH_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_DROP_AMOUNT) + "
1. Premium benefits CAN NOT BE TRANSFERED.
2. Premium does not effect party members.
3. Premium benefits effect ALL characters in same account.
"); html.append("
"); msg.setHtml(html.toString()); activeChar.sendPacket(msg); } else { final NpcHtmlMessage msg = new NpcHtmlMessage(5); final StringBuilder html = new StringBuilder("Premium Account Details
"); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append(""); html.append("
Account Status: Premium
Rate XP: x" + (Config.RATE_XP * Config.PREMIUM_RATE_XP) + "
Rate SP: x" + (Config.RATE_SP * Config.PREMIUM_RATE_SP) + "
Drop Chance: x" + (Config.RATE_DEATH_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_DROP_CHANCE) + "
Drop Amount: x" + (Config.RATE_DEATH_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_DROP_AMOUNT) + "
Expires: " + String.valueOf(format.format(endDate)) + "
Current Date: " + String.valueOf(format.format(System.currentTimeMillis())) + "

Premium Info & Rules
1. Premium accounts CAN NOT BE TRANSFERED.
2. Premium does not effect party members.
3. Premium account effects ALL characters in same account.


Thank you for supporting our server.
"); html.append("
"); msg.setHtml(html.toString()); activeChar.sendPacket(msg); } } else { return false; } return true; } @Override public String[] getVoicedCommandList() { return VOICED_COMMANDS; } }