Add item via line code

  • Автор темы Автор темы Horyon
  • Дата начала Дата начала
Статус
В этой теме нельзя размещать новые ответы.

Horyon

Знающий
Участник
Сообщения
220
Розыгрыши
0
Решения
4
Репутация
53
Реакции
78
Баллы
423
Хроники
  1. Shadow of the Kamael
Исходники
Присутствуют
Сборка
L2jMobius Master class ch2
Java:
 {
                player.destroyItemByItemId("CB_Premium", Config.COMMUNITY_PREMIUM_COIN_ID, Config.COMMUNITY_PREMIUM_PRICE_PER_DAY * premiumDays, player, true);
                PremiumManager.getInstance().addPremiumTime(player.getAccountName(), premiumDays * 30, TimeUnit.DAYS);
                player.sendMessage("Your account will now have premium status until " + new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumExpiration(player.getAccountName())) + ".");
                returnHtml = HtmCache.getInstance().getHtm(player, "data/html/CommunityBoard/Custom/premium/thankyou.html");
}

Hi guys... i need some info to custom this code part.

I want after add the time of premium, i add a line to send a item to inventory.

Ty in advance for any help.
 
Решение
Java:
player.destroyItemByItemId("CB_Premium", Config.COMMUNITY_PREMIUM_COIN_ID, Config.COMMUNITY_PREMIUM_PRICE_PER_DAY * premiumDays, player, true);
                PremiumManager.getInstance().addPremiumTime(player.getAccountName(), premiumDays * 30, TimeUnit.DAYS);
                player.addItem("CB_Premium", 74999, 1, player, true);
                player.sendMessage("Your account will now have premium status until " + new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumExpiration(player.getAccountName())) + ".");
                returnHtml = HtmCache.getInstance().getHtm(player, "data/html/CommunityBoard/Custom/premium/thankyou.html");

Worked ;)

player.addItem("CB_Premium", this is the item...
Java:
player.destroyItemByItemId("CB_Premium", Config.COMMUNITY_PREMIUM_COIN_ID, Config.COMMUNITY_PREMIUM_PRICE_PER_DAY * premiumDays, player, true);
                PremiumManager.getInstance().addPremiumTime(player.getAccountName(), premiumDays * 30, TimeUnit.DAYS);
                player.addItem("CB_Premium", 74999, 1, player, true);
                player.sendMessage("Your account will now have premium status until " + new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumExpiration(player.getAccountName())) + ".");
                returnHtml = HtmCache.getInstance().getHtm(player, "data/html/CommunityBoard/Custom/premium/thankyou.html");

Worked ;)

player.addItem("CB_Premium", this is the item ID, item amount, player, true);
 
Решение
Статус
В этой теме нельзя размещать новые ответы.

Похожие темы

Назад
Сверху Снизу