Посмотрите видео ниже, чтобы узнать, как установить наш сайт в виде веб-приложения на главном экране.
Примечание: Эта функция может быть недоступна в некоторых браузерах.
private void sendRewardMail(Player receiver)
{
Mail mail = new Mail();
mail.setSenderId(receiver.getObjectId());
mail.setSenderName(receiver.getName());
mail.setReceiverId(receiver.getObjectId());
mail.setReceiverName(receiver.getName());
mail.setTopic("SOME_HEADLINE");
mail.setBody("SOME_MESSAGE");
mail.setPrice(0L);
mail.setUnread(true);
mail.setType(Mail.SenderType.NEWS_INFORMER);
mail.setExpireTime((int) (TimeUnit.DAYS.toSeconds(365) + (System.currentTimeMillis() / 1000L)));
mail.setSystemTopic(SystemMsg.SOME_SYSTEM_MESSAGE); //change to something else
mail.setSystemBody(SystemMsg.SOME_SYSTEM_MESSAGE); //change to something else
ItemInstance rewardItem = ItemFunctions.createItem(ItemTemplate.ITEM_ID_ADENA); // change to whatever you need. this example is for adena
Objects.requireNonNull(rewardItem);
rewardItem.setOwnerId(receiver.getObjectId());
rewardItem.setCount(5_000_000); // amount of the rewardItem
rewardItem.setLocation(ItemInstance.ItemLocation.MAIL);
rewardItem.setJdbcState(JdbcEntityState.UPDATED);
rewardItem.update();
mail.addAttachment(rewardItem);
mail.save();
receiver.sendPacket(ExNoticePostArrived.STATIC_TRUE);
receiver.sendPacket(new ExUnReadMailCount(receiver));
receiver.sendPacket(SystemMsg.THE_MAIL_HAS_ARRIVED);
}
Because they don't know how to compile the source into a jar.Here's another question: did it mean a new player or character)
I don’t understand why these extra body movements) Give it to the character when creating)
Тут конечно зависит от того будут ли предметы утилизированны сразу или через некоторое время. Например возмем адену, она просто добавляется и сразу используется. Но если взять soulshot или более тяжелые предметы, то будет не так удобно. Конечно, все зависит от того сколько и кому.Тут ещё вопрос имел ввиду оно нового игрока или персонажа )
Зачем эти лишние телодвижения не пойму) Выдайте персонажу при создании )
I think message got lost in translation. It is not a question why bother with all these options, but rather why not just give items when player is created. After all does it matter if player gets it right away or he needs to do a bit more work clicking things?Because they don't know how to compile the source into a jar.
Тут конечно зависит от того будут ли предметы утилизированны сразу или через некоторое время. Например возмем адену, она просто добавляется и сразу используется. Но если взять soulshot или более тяжелые предметы, то будет не так удобно. Конечно, все зависит от того сколько и кому.
I think message got lost in translation. It is not a question why bother with all these options, but rather why not just give items when player is created. After all does it matter if player gets it right away or he needs to do a bit more work clicking things?
Oh I agree. If there is another way then maybe it is preferred after understanding that they can just do simpler things.Here's another question, why bother with writing a whole quest, when you can just add the item IDs to the list of "Starting Items", which already exists on L2Scripts sources?
I hope you catch my drift here.
There are many approaches that would lead to the same result, but the person asked about mail in particular, so how to do MAIL is what he got in response. Maybe he would like to use that Mail Reward System down the road for something else, such as MASS Rewards and stuff like that. You never know.