/* * Copyright (C) 2004-2015 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack 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. * * L2J DataPack 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.l2jserver.Config; import com.l2jserver.gameserver.handler.IVoicedCommandHandler; import com.l2jserver.gameserver.instancemanager.PremiumManager; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.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) { SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm"); long endDate = PremiumManager.getInstance().getPremiumEndDate(activeChar.getAccountName()); if (endDate == 0) { NpcHtmlMessage msg = new NpcHtmlMessage(5); 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(""); 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 + "
Spoil Chance: x" + Config.RATE_CORPSE_DROP_CHANCE_MULTIPLIER + "
Spoil Amount: x" + Config.RATE_CORPSE_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) + "
Spoil Chance: x" + (Config.RATE_CORPSE_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + "
Spoil Amount: x" + (Config.RATE_CORPSE_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_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 { NpcHtmlMessage msg = new NpcHtmlMessage(5); 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(""); 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) + "
Spoil Chance: x" + (Config.RATE_CORPSE_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + "
Spoil Amount: x" + (Config.RATE_CORPSE_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_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; } }