Сообщений: 1,053
Тем: 33
Зарегистрирован: Sep 2011
Репутация:
12,172
А при чем тут байпас и оплата? Оо
Байпас ведет к определенному методу в скрипте где и описана оплата.
Скрипт в студию.
Сообщений: 4
Тем: 0
Зарегистрирован: Dec 2013
Репутация:
0
private void addPremium(L2PcInstance player, int days) {
Integer price = Config.PREMIUM_DAY_PRICES.get(days);
if (price == null) {
price = Config.PREMIUM_PRICE * days;
}
L2ItemInstance coins = player.getInventory().getItemByItemId(Config.PREMIUM_COIN);
if (coins == null || coins.getCount() < price) {
player.sendHtmlMessage("Стоимость премиум " + price + " " + Config.PREMIUM_COINNAME + ".");
return;
}
player.destroyItemByItemId("Donate Shop", Config.PREMIUM_COIN, price, player, true);
player.storePremium(days);
}
public void listBonus(L2PcInstance player) {
String html;
NpcHtmlMessage page = new NpcHtmlMessage(getObjectId());
if (!Config.SERVICES_RATE_BONUS_ENABLED) {
html = HtmCache.getInstance().getHtm("data/html/Service/RateBonusNo.htm");
page.setHtml(html);
} else if (player.isBonus()) {
html = HtmCache.getInstance().getHtm("data/html/Service/RateBonusAlready.htm").replace("%endtime%", new Date(player.getBonusExpire() * 1000L).toString());
page.setHtml(html);
} else {
html = HtmCache.getInstance().getHtm("data/html/Service/RateBonus.htm");
page.setHtml(html);
String add = "";
for (int i = 0; i < Config.SERVICES_RATE_BONUS_DAYS.length; i++) {
add += "<a action=\"bypass -h npc_" + String.valueOf(getObjectId()) + "_getBonus " + i + "\">" //
+ (int) (Config.SERVICES_RATE_BONUS_VALUE[i] * 100 - 100) + //
"% for " + Config.SERVICES_RATE_BONUS_DAYS[i] + //
" days - " + Config.SERVICES_RATE_BONUS_PRICE[i] + //
" " + ItemTable.getInstance().getTemplate(Config.SERVICES_RATE_BONUS_ITEM[i]).getName() + "</a><br>";
}
page.replace("%toreplace%", add);
}
player.sendPacket(page);
player.sendPacket(ActionFailed.STATIC_PACKET);
}
public void getBonus(int i, L2PcInstance player) {
if (player.getInventory().getInventoryItemCount(Config.SERVICES_RATE_BONUS_ITEM[i], 0) < Config.SERVICES_RATE_BONUS_PRICE[i]) {
if (Config.SERVICES_RATE_BONUS_ITEM[i] == 57) {
player.sendPacket(new SystemMessage(SystemMessageId.YOU_NOT_ENOUGH_ADENA));
} else {
player.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));
}
return;
}
player.getInventory().destroyItemByItemId("RateBonus", Config.SERVICES_RATE_BONUS_ITEM[i], Config.SERVICES_RATE_BONUS_PRICE[i], player, player);
float bonus = Config.SERVICES_RATE_BONUS_VALUE[i];
int bonusExpire = (int) (System.currentTimeMillis() / 1000L) + Config.SERVICES_RATE_BONUS_DAYS[i] * 24 * 60 * 60;
player.setBonusExpire(bonusExpire);
player.setBonusAll(bonus, true);
player.stopBonusTask();
player.startBonusTask(bonusExpire);
NpcHtmlMessage page = new NpcHtmlMessage(getObjectId());
String html = HtmCache.getInstance().getHtm("data/html/Service/RateBonusGet.htm");
page.setHtml(html);
player.sendPacket(page);
player.sendPacket(ActionFailed.STATIC_PACKET);
}
public void bindingpage(L2PcInstance player) {
NpcHtmlMessage page = new NpcHtmlMessage(getObjectId());
String html = HtmCache.getInstance().getHtm("data/html/Service/Bindings.htm");
page.setHtml(html)