Перейти к содержанию

AlexMan

Постоялец
  • Публикаций

    417
  • Зарегистрирован

  • Посещение

  • Отзывы

    0%

Весь контент AlexMan

  1. AlexMan

    Идея Для Программы

    Вот нащет первой программы (просмотр карты) добавь функцию масштаба
  2. AlexMan

    Идея Для Программы

    Можно будет еще добавить если мирная зона то обводить будет зелеными линиями если пвп красными, торговля оранжевыми, а в средине этих зон бело прозрачным шрифтом писать че это за зона или же сбоку мини справочник цветов
  3. AlexMan

    Идея Для Программы

    Было бы не плохо новичкам сделать программу с хорошим функционалом и выбором сборки для добавления статов, можно добавить еще справочник по скилам и статам от А до я типа че такое TARGET_ONE и тд
  4. AlexMan

    Идея Для Программы

    если будет возможна поддержка такого текстра это sql файл Скрытый текст(60034,74,146248,-15227),(60034,75,146227,-15246), (60034,76,146186,-15452), (60034,77,146243,-15343), (60034,78,146115,-15863), (60034,79,146126,-15776), (60034,80,146121,-16111), (60034,81,146096,-16603), (60034,82,146161,-17083), http://rghost.ru/37713440 я думаю эт реально сделать в учет будут братся знаки после двух ком
  5. AlexMan

    Идея Для Программы

    люцера http://rghost.ru/37713368 стандарт зоны http://rghost.ru/37713392
  6. AlexMan

    Идея Для Программы

    Еще программа для зон Скрытый текст <point x="-22052" y="114025"/> <point x="-14221" y="114007"/> <point x="-14197" y="116558"/> <point x="-22032" y="116566"/> <point x="-22030" y="104809"/> <point x="-20270" y="104817"/> <point x="-20266" y="113735"/> <point x="-22031" y="113732"/> <point x="-15554" y="104834"/> <point x="-13917" y="104839"/> <point x="-13914" y="113757"/> <point x="-15554" y="113757"/> а на карте показало в виде красных линий как это будет выгледить
  7. AlexMan

    Идея Для Программы

    Буду благодарен за программу различными манипуляциями текструрами!
  8. AlexMan

    Идея Для Программы

    Если так шариш, то создай программу наподобе putty ток визуальную) Или же программа (конект к базе) там будет чар, кланы, и тд наподобе старой программки для рт так же без всякого хлама
  9. Тс. ты хоч отменить сабы опще, если профа хавк то бегать можиш тока с луком и тд я так понял?
  10. Не плохая идея, но далеко она вас не заведет!
  11. Там выше я писал схему если оно заберает итем можиш попробывать на java сделать условия эт первое 2. Сразу после того как забрало итем пусть выдает новый такой же take, give на первое время сойдет пока не доделаеш скрипт Выложите ктот сборку эпоч-лайфа буду благодарен
  12. if (player.getItem() > 57) if (player.Inventory() == 57) не понмню че точно
  13. Все оч легко выше пост есть там мутиш линк на квест в квесте events = 1 Cтавиш условия take на нужные итем количество 0 Если условия выполнено то идет переход на html в твоем квесте хз какое допустим vip.html если условия не выполнено то exit.html
  14. AlexMan

    Fatal-world

    Реально смотри на вещи, щас не 2009, а давно уже 2012 и л2 за эти 3 года не стояла на мести!
  15. AlexMan

    Fatal-world

    Есть часть аналогов на сборке пв, а остальная часть тоже есть даже лучше!
  16. AlexMan

    Fatal-world

    Щас то что продашь не стоит 150 зеленых, а то что ты написал это лиш ради того что б сбарыжить хлам!
  17. AlexMan

    Fatal-world

    Эт вы так думаете что не было лучше серверов чем фатал, просто мало де играли вы я после того времени пробывал много серверов 5-ста и кое что было не чем не хуже!
  18. AlexMan

    Fatal-world

    Хорош, сам очень долго играл там) но в чем фишка все кроми сайта есть в шаре кажись
  19. AlexMan

    Подскажите

    если Аи прописано в ядре тогда пиши скрипт маленький на phyton на завпрос в базу для удаления
  20. AlexMan

    Pvp Zone

    Если в сборке есть запрет на юз скила в зоне то поставь иво (каждый итем привязан к скилу)
  21. Скрытый текст package custom.AugmentSeller; import ru.catssoftware.gameserver.model.itemcontainer.Inventory; import ru.catssoftware.gameserver.model.L2Augmentation; import ru.catssoftware.gameserver.model.L2ItemInstance; import ru.catssoftware.gameserver.model.actor.instance.L2NpcInstance; import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance; import ru.catssoftware.gameserver.model.quest.jython.QuestJython; import ru.catssoftware.gameserver.network.SystemMessageId; import ru.catssoftware.gameserver.serverpackets.ExVariationResult; import ru.catssoftware.gameserver.serverpackets.InventoryUpdate; import ru.catssoftware.gameserver.serverpackets.SystemMessage; import ru.catssoftware.tools.random.Rnd; /** * * @author Ster */ public class AugmentSeller extends QuestJython { private static final int NPC = 70014; private static final int STAT_BLOCKSIZE = 3640; private static final int STAT_SUBBLOCKSIZE = 91; public AugmentSeller(int questId, String name, String descr) { super(questId, name, descr); this.addStartNpc(NPC); this.addTalkId(NPC); //this.addEventId(NPC, QuestEventType.ON_TALK); } @Override public String onTalk(L2NpcInstance npc, L2PcInstance player) { if (npc.getNpcId() == NPC) { return "70014-main.htm"; } return null; } @Override public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player) { String htmltext = ""; if (event.startsWith("70014")) { htmltext = event + ".htm"; } else if (event.startsWith("buy_")) { System.out.println("ja ebu gusei"); String input = event.replace("buy_", ""); int id = Integer.parseInt(input.split("_")[0]); int lvl = Integer.parseInt(input.split("_")[1]); int price = Integer.parseInt(input.split("_")[2]); int priceC = Integer.parseInt(input.split("_")[3]); int augId = Integer.parseInt(input.split("_")[4]); if (player.getActiveWeaponInstance() != null) { System.out.println("ja ebu gusei1"); L2ItemInstance weapon = player.getActiveWeaponInstance(); if (weapon.isShadowItem() || weapon.isStackable()) { player.sendPacket(new SystemMessage(SystemMessageId.THIS_IS_NOT_A_SUITABLE_ITEM)); htmltext = "<html><body>Seller:<br>Неподходящие условия!</body></html>"; } else if (player.isCastingNow() || player.isAttackingNow() || player.isDead()) { player.sendMessage("Неподходящие условия!"); htmltext = "<html><body>Seller:<br>Неподходящие условия!</body></html>"; } else if (weapon.isAugmented()) { player.sendPacket(new SystemMessage(SystemMessageId.ONCE_AN_ITEM_IS_AUGMENTED_IT_CANNOT_BE_AUGMENTED_AGAIN)); htmltext = "<html><body>Seller:<br>Неподходящие условия!</body></html>"; } else if (player.getInventory().getItemByItemId(price) == null || player.getInventory().getItemByItemId(price).getCount() < priceC) { player.sendMessage("Недостаточно необходимых предметов!"); htmltext = "<html><body>Seller:<br>Неподходящие условия!</body></html>"; } else { player.disarmWeapons(); InventoryUpdate iu = new InventoryUpdate(); //================================================== int resultColor = Rnd.get(0, 100); if (getLifeStoneGrade(8762) == 3 || resultColor <= (15*getLifeStoneGrade(8762))+10) resultColor = 3; else if (getLifeStoneGrade(8762) == 2 || resultColor <= (15*getLifeStoneGrade(8762))+20) resultColor = 2; else if (getLifeStoneGrade(8762) == 1 || resultColor <= (15*getLifeStoneGrade(8762))+30) resultColor = 1; else resultColor = 0; int colorOffset = (resultColor*(STAT_SUBBLOCKSIZE*10)) +((getLifeStoneLevel(8762)-1)*STAT_SUBBLOCKSIZE); int offset = ((3-getLifeStoneGrade(8762))*STAT_BLOCKSIZE)+colorOffset; int stat12 = Rnd.get(offset, offset+STAT_SUBBLOCKSIZE); int stat34 = augId; //================================================== weapon.setAugmentation(new L2Augmentation(((stat34<<16)+stat12), id, lvl)); iu.addModifiedItem(weapon); System.out.println("ja ebu gusei2"); player.destroyItemByItemId("seller", price, priceC, null, true); player.sendPacket(iu); //removeWeapon(player); player.sendSkillList(); stat12 = 0x0000FFFF&weapon.getAugmentation().getAugmentationId(); stat34 = weapon.getAugmentation().getAugmentationId()>>16; player.sendPacket(new ExVariationResult(stat12,stat34,1)); player.sendPacket(new SystemMessage(SystemMessageId.THE_ITEM_WAS_SUCCESSFULLY_AUGMENTED)); htmltext = "<html><body>Seller:<br>Ваше оружие улучшено!</body></html>"; } } else { player.sendMessage("Наденьте оружие, которое хотите улучшить!"); htmltext = "<html><body>Seller:<br>Наденьте оружие, которое хотите улучшить!</body></html>"; } } return htmltext; } private int getLifeStoneLevel(int itemId) { itemId -= 10 * getLifeStoneGrade(itemId); itemId -= 8722; return itemId; } private int getLifeStoneGrade(int itemId) { itemId -= 8723; if (itemId < 10) return 0; // normal grade if (itemId < 20) return 1; // mid grade if (itemId < 30) return 2; // high grade return 3; // top grade } public void removeWeapon(L2PcInstance player) { L2ItemInstance wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND); if (wpn == null) wpn = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND); if (wpn != null) { L2ItemInstance[] unequiped = player.getInventory().unEquipItemInBodySlotAndRecord(wpn.getItem().getBodyPart()); InventoryUpdate iu = new InventoryUpdate(); for (int i = 0; i < unequiped.length; i++) iu.addModifiedItem(unequiped[i]); player.sendPacket(iu); player.abortAttack(); player.broadcastUserInfo(); if (unequiped.length > 0) { if (unequiped[0].isWear()) return; SystemMessage sm = null; if (unequiped[0].getEnchantLevel() > 0){ sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED); sm.addNumber(unequiped[0].getEnchantLevel()); sm.addItemName(unequiped[0].getItemId()); }else{ sm = new SystemMessage(SystemMessageId.S1_DISARMED); sm.addItemName(unequiped[0].getItemId()); } player.sendPacket(sm); } } } public static void main(String[] args) { new AugmentSeller(-1, "AugmentSeller", "special"); } } На скока я понял эт чета вставки лс в 1 клик если нет то исправьте и помогите с линками) с меня пару полезных скриптов )
  22. AlexMan

    Рецепты

    Сделай проще типа сундука нажал и получил итем из шансом вот пример скрипта: Скрытый текст package handlers; import java.util.HashMap; import java.util.Map; import ru.catssoftware.gameserver.handler.IItemHandler; import ru.catssoftware.gameserver.handler.ItemHandler; import ru.catssoftware.gameserver.model.L2ItemInstance; import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance; import ru.catssoftware.gameserver.model.actor.instance.L2PlayableInstance; import ru.catssoftware.tools.random.Rnd; import ru.catssoftware.util.ArrayUtils; public class RandomReward implements IItemHandler { private class Reward { private int [] items; private int [] counts; private int [] chances; public Reward(int [] _items, int[] _counts, int [] _chances) { items = _items; counts = _counts; chances = _chances; } } private Map<Integer, Reward> _rewards = new HashMap<Integer, Reward>(); private RandomReward() { // Добавляем атем // ИД предмета, который будет распакован награды количества шансы _rewards.put(4037,new Reward(new int [] {6579,6673,6577,7575,}, new int [] {1,1,1,1}, new int[] {2,99,2,2})); } @Override public int[] getItemIds() { int [] ids = null; for (int i : _rewards.keySet()) ids = ArrayUtils.add(ids, i); return ids; } @Override public void useItem(L2PlayableInstance cha, L2ItemInstance item) { L2PcInstance player = cha.getActingPlayer(); if(player==null) return; Reward reward =_rewards.get(item.getItemId()); if(reward==null) return; // Уничтожаем распаковываемый предмет cha.getInventory().destroyItemByItemId("use", item.getItemId(), 1, player, null); // Идем по списку наград for (int i=0;i<reward.items.length;i++) { // Если шанс нужный if(Rnd.get(100)<reward.chances[i]) { // Считаем количество. int count = Rnd.get(reward.counts[i]); // Если хотите что бы падал всегда то раскоментарьте строку ниже if (count==0) count =1; if(count>0) // Выдаем награду. Если сбой - то прекращаем if(!player.addItem("reward", reward.items[i], count, null, true)) return; } } } @Override public void useItem(L2PlayableInstance arg0, L2ItemInstance arg1, boolean arg2) { } public static void main(String [] args) { ItemHandler.getInstance().registerItemHandler(new RandomReward()); } } или же 2 скрипт Скрытый текст package handlers; import java.util.HashMap; import java.util.Map; import ru.catssoftware.gameserver.handler.IItemHandler; import ru.catssoftware.gameserver.handler.ItemHandler; import ru.catssoftware.gameserver.model.L2ItemInstance; import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance; import ru.catssoftware.gameserver.model.actor.instance.L2PlayableInstance; import ru.catssoftware.tools.random.Rnd; import ru.catssoftware.util.ArrayUtils; public class RandomReward implements IItemHandler { private class Reward { private int [] items; private int [] counts; public Reward(int [] _items, int[] _counts, int [] _chances) { items = _items; counts = _counts; chances; } } private Map<Integer, Reward> _rewards = new HashMap<Integer, Reward>(); private RandomReward() { // Добавляем атем // ИД предмета, который будет распакован награды количества шансы _rewards.put(10090,new Reward(new int [] {1341}, new int [] {1000}, new int[] {100})); _rewards.put(10091,new Reward(new int [] {1342}, new int [] {1000}, new int[] {100})); _rewards.put(10092,new Reward(new int [] {1343}, new int [] {1000}, new int[] {100})); _rewards.put(10093,new Reward(new int [] {1344}, new int [] {1000}, new int[] {100})); _rewards.put(10094,new Reward(new int [] {1345}, new int [] {1000}, new int[] {100})); _rewards.put(10095,new Reward(new int [] {6645}, new int [] {1000}, new int[] {100})); _rewards.put(10096,new Reward(new int [] {6646}, new int [] {1000}, new int[] {100})); _rewards.put(10097,new Reward(new int [] {6647}, new int [] {1000}, new int[] {100})); _rewards.put(10006,new Reward(new int [] {10075}, new int [] {10}, new int[] {100})); _rewards.put(10007,new Reward(new int [] {10079}, new int [] {10}, new int[] {100})); _rewards.put(10008,new Reward(new int [] {10076}, new int [] {10}, new int[] {100})); _rewards.put(10009,new Reward(new int [] {10085}, new int [] {10}, new int[] {100})); _rewards.put(10010,new Reward(new int [] {10078}, new int [] {10}, new int[] {100})); _rewards.put(10011,new Reward(new int [] {10072}, new int [] {10}, new int[] {100})); _rewards.put(10012,new Reward(new int [] {10089}, new int [] {10}, new int[] {100})); _rewards.put(10013,new Reward(new int [] {10076}, new int [] {10}, new int[] {100})); _rewards.put(10014,new Reward(new int [] {10075}, new int [] {10}, new int[] {100})); _rewards.put(10015,new Reward(new int [] {10078}, new int [] {10}, new int[] {100})); _rewards.put(10016,new Reward(new int [] {10084}, new int [] {10}, new int[] {100})); _rewards.put(10017,new Reward(new int [] {10077}, new int [] {10}, new int[] {100})); _rewards.put(10018,new Reward(new int [] {10078}, new int [] {10}, new int[] {100})); _rewards.put(10019,new Reward(new int [] {10080}, new int [] {10}, new int[] {100})); _rewards.put(10020,new Reward(new int [] {10069}, new int [] {10}, new int[] {100})); _rewards.put(10021,new Reward(new int [] {10089}, new int [] {10}, new int[] {100})); _rewards.put(10022,new Reward(new int [] {10071}, new int [] {10}, new int[] {100})); _rewards.put(10023,new Reward(new int [] {10078}, new int [] {10}, new int[] {100})); _rewards.put(10024,new Reward(new int [] {10081}, new int [] {10}, new int[] {100})); _rewards.put(10025,new Reward(new int [] {10080}, new int [] {10}, new int[] {100})); _rewards.put(10026,new Reward(new int [] {10076}, new int [] {10}, new int[] {100})); _rewards.put(10027,new Reward(new int [] {10086}, new int [] {10}, new int[] {100})); _rewards.put(10028,new Reward(new int [] {10089}, new int [] {10}, new int[] {100})); _rewards.put(10029,new Reward(new int [] {10076}, new int [] {10}, new int[] {100})); _rewards.put(10030,new Reward(new int [] {10088}, new int [] {10}, new int[] {100})); _rewards.put(10031,new Reward(new int [] {10069}, new int [] {10}, new int[] {100})); _rewards.put(10032,new Reward(new int [] {10070}, new int [] {10}, new int[] {100})); _rewards.put(10033,new Reward(new int [] {10080}, new int [] {10}, new int[] {100})); _rewards.put(10034,new Reward(new int [] {10075}, new int [] {10}, new int[] {100})); _rewards.put(10035,new Reward(new int [] {10079}, new int [] {10}, new int[] {100})); _rewards.put(10036,new Reward(new int [] {10078}, new int [] {10}, new int[] {100})); _rewards.put(10037,new Reward(new int [] {10089}, new int [] {10}, new int[] {100})); _rewards.put(10038,new Reward(new int [] {10076}, new int [] {10}, new int[] {100})); _rewards.put(10039,new Reward(new int [] {10076}, new int [] {10}, new int[] {100})); _rewards.put(10040,new Reward(new int [] {10089}, new int [] {10}, new int[] {100})); _rewards.put(10041,new Reward(new int [] {10071}, new int [] {10}, new int[] {100})); _rewards.put(10042,new Reward(new int [] {10089}, new int [] {10}, new int[] {100})); _rewards.put(10043,new Reward(new int [] {10083}, new int [] {10}, new int[] {100})); _rewards.put(10044,new Reward(new int [] {10073}, new int [] {10}, new int[] {100})); _rewards.put(10045,new Reward(new int [] {10082}, new int [] {10}, new int[] {100})); _rewards.put(10046,new Reward(new int [] {10073}, new int [] {10}, new int[] {100})); _rewards.put(10047,new Reward(new int [] {10077}, new int [] {10}, new int[] {100})); _rewards.put(10048,new Reward(new int [] {10080}, new int [] {10}, new int[] {100})); _rewards.put(10049,new Reward(new int [] {10075}, new int [] {10}, new int[] {100})); _rewards.put(10050,new Reward(new int [] {10087}, new int [] {10}, new int[] {100})); _rewards.put(10051,new Reward(new int [] {10089}, new int [] {10}, new int[] {100})); _rewards.put(10052,new Reward(new int [] {10074}, new int [] {10}, new int[] {100})); _rewards.put(10053,new Reward(new int [] {10071}, new int [] {10}, new int[] {100})); _rewards.put(10054,new Reward(new int [] {10079}, new int [] {10}, new int[] {100})); _rewards.put(10222,new Reward(new int [] {10065,10066,10067}, new int [] {1,1,1}, new int[] {33,33,34})); _rewards.put(10172,new Reward(new int [] {10098,10099,10100,10101,10102}, new int [] {1,1,1,1,1}, new int[] {20,20,20,20,20})); _rewards.put(10192,new Reward(new int [] {10208}, new int [] {3}, new int[] {100})); _rewards.put(10193,new Reward(new int [] {10192}, new int [] {10}, new int[] {100})); _rewards.put(10208,new Reward(new int [] {10173,10174,10175,10176,10177,10178,10179,10180,10181,10182,1870,1869,1880}, new int [] {1,1,1,1,1,1,1,1,1,1,10,10,10}, new int[] {1,1,1,1,1,1,1,1,1,1,30,30,30})); _rewards.put(10335,new Reward(new int [] {6364,6364,10231,10231,10232,10233,10234}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10336,new Reward(new int [] {6365,6365,10235,10235,10236,10237,10238}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10337,new Reward(new int [] {6366,6366,10239,10239,10240,10241,10242}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10338,new Reward(new int [] {6367,6367,10243,10243,10244,10245,10246}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10339,new Reward(new int [] {6368,6368,10247,10247,10248,10249,10250}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10340,new Reward(new int [] {6369,6369,10251,10251,10252,10253,10254}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10341,new Reward(new int [] {6370,6370,10255,10255,10256,10257,10258}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10342,new Reward(new int [] {6371,6371,10259,10259,10260,10261,10262}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10343,new Reward(new int [] {6372,6372,10263,10263,10264,10265,10266}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10344,new Reward(new int [] {6579,6579,10363,10363,10364,10365,10366}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10345,new Reward(new int [] {7575,7575,10367,10367,10368,10369,10370}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10346,new Reward(new int [] {80,80,10267,10267,10268,10269,10270}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10347,new Reward(new int [] {2500,2500,10271,10271,10272,10273,10274}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10348,new Reward(new int [] {235,235,10275,10275,10276,10277,10278}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10349,new Reward(new int [] {236,236,10279,10279,10280,10281,10282}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10350,new Reward(new int [] {269,269,10283,10283,10284,10285,10286}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10351,new Reward(new int [] {270,270,10287,10287,10288,10289,10290}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10352,new Reward(new int [] {288,288,10291,10291,10292,10293,10294}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10353,new Reward(new int [] {289,289,10295,10295,10296,10297,10298}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10354,new Reward(new int [] {98,98,10299,10299,10300,10301,10302}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10355,new Reward(new int [] {305,305,10303,10303,10304,10305,10306}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10356,new Reward(new int [] {2504,2504,10307,10307,10308,10309,10310}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10357,new Reward(new int [] {164,164,10311,10311,13012,13013,10314}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10358,new Reward(new int [] {150,150,10315,10315,10316,13017,10318}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10359,new Reward(new int [] {151,151,10319,10319,10320,10321,13022}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10360,new Reward(new int [] {212,212,10323,10323,10324,10325,10326}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10361,new Reward(new int [] {213,213,10327,10327,10328,10329,10330}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); _rewards.put(10362,new Reward(new int [] {81,81,10331,13031,10332,10333,10334}, new int [] {1,2,1,2,1,1,1}, new int[] {58,6,18,14,2,1,1})); } @Override public int[] getItemIds() { int [] ids = null; for (int i : _rewards.keySet()) ids = ArrayUtils.add(ids, i); return ids; } @Override public void useItem(L2PlayableInstance cha, L2ItemInstance item) { L2PcInstance player = cha.getActingPlayer(); if(player==null) return; Reward reward =_rewards.get(item.getItemId()); if(reward==null) return; // Уничтожаем распаковываемый предмет cha.getInventory().destroyItemByItemId("use", item.getItemId(), 1, player, null); // кароче, хуйня такая, берем массив, потом типо рандомазируем и то что рандомнетцо то и даём блеать // и еще, уже указывается в блядо награде, чо по чом. int i = Rnd.get(reward.items.length-1); //пиздим блядодлинну массива + и чтоже мы выиграли ебать // Считаем количество. int count = reward.counts[i]; // тут был Rnd.get // Если хотите что бы падал всегда то раскоментарьте строку ниже // Выдаем награду. Если сбой - то прекращаем if(!player.addItem("reward", reward.items[i], count, null, true)) return; } @Override public void useItem(L2PlayableInstance arg0, L2ItemInstance arg1, boolean arg2) { } public static void main(String [] args) { ItemHandler.getInstance().registerItemHandler(new RandomReward()); } }
×
×
  • Создать...