sirreaven Posted October 6, 2015 Posted October 6, 2015 (edited) Hi everybody, i try at the moment to add some items for newbies. But it doesnt work and i think i do something wroung. It tried this: ItemTable.getInstance(); L2Item[] items = template.getItems(); for (L2Item item2 : items) { L2ItemInstance item = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null); L2ItemInstance item1 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null); L2ItemInstance item11 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null); if (item.getItemId() == 5588) { if (item1.getItemId() == 3470) { if (item11.getItemId() == 5134) { } } But it dont know what i need to do exactly. Thanks in advance. sir Edited October 6, 2015 by sirreaven Quote
0 DrenepiaWorld Posted October 6, 2015 Posted October 6, 2015 go to CharacterCreate.java and add this } } + /** Custom Starting Items */ + if (Config.ENABLE_NEWCHAR_ITEMS) + { + newChar.getInventory().addItem("New Item", Config.STARTING_ITEM_ID , Config.STARTING_ITEM_COUNT, newChar, null); + } for (L2SkillLearn skill : SkillTreeTable.getInstance().getAvailableSkills(newChar, newChar.getClassId())) { and the configs /** New Char Items */ public static boolean ENABLE_NEWCHAR_ITEMS; public static int STARTING_ITEM_ID; public static int STARTING_ITEM_COUNT; /** New Char Items */ ENABLE_NEWCHAR_ITEMS = Boolean.parseBoolean(customstarting.getProperty("EnableNewcharItems", "False")); STARTING_ITEM_ID = Integer.parseInt(customstarting.getProperty("StartingItemId", "50000")); STARTING_ITEM_COUNT = Integer.parseInt(customstarting.getProperty("StartingItemCount", "1")); # ---------------------------------- # Custom Starting Item # ---------------------------------- # Enable Custom Starting Item? # Default: False EnableNewcharItems = True StartingItemId = 50005 StartingItemCount = 1 Quote
0 Reborn12 Posted October 6, 2015 Posted October 6, 2015 (edited) Hi everybody, i try at the moment to add some items for newbies. But it doesnt work and i think i do something wroung. It tried this: ItemTable.getInstance(); L2Item[] items = template.getItems(); for (L2Item item2 : items) { L2ItemInstance item = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null); L2ItemInstance item1 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null); L2ItemInstance item11 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null); if (item.getItemId() == 5588) { if (item1.getItemId() == 3470) { if (item11.getItemId() == 5134) { } } But it dont know what i need to do exactly. Thanks in advance. sir bist du deutcher oder?? and you can add items with xml's Edited October 7, 2015 by Reborn12 Quote
0 Tryskell Posted October 6, 2015 Posted October 6, 2015 (edited) First line is useless, then you decide to iterate over template items, and for each item you decide to add 3 items on player inventory. if (item.getItemId() == 5588) { if (item1.getItemId() == 3470) { if (item11.getItemId() == 5134) { } is a logcial nonsense, because if your item got 5588, it can't be 3470, and if it's 3470, it can't be 5134. You also have to refer to item2, as it's the current name you give on the for loop to iterate over the template items. So you probably meant : if (item2.getItemId() == X) doSomething(); else if (item2.getItemId() == Y) doAnotherThing(); else if (item2.getItemId() == Z) doCrappyThing(); I also guess you misunderstand the use of for loop. Maybe it's time to read about it...? Edited October 6, 2015 by Tryskell Quote
0 sirreaven Posted October 7, 2015 Author Posted October 7, 2015 bist du deutcher oder?? and you can add items with xml's Guten Abend, genau das bin ich :) Wie kann ich Newbie Items mit ner simplen xml hinzufügen? Thank you all for the help :) Im happy no flame or trash :) Just some helpful comments :) Quote
0 bistabil Posted October 7, 2015 Posted October 7, 2015 go to CharacterCreate.java and add this } } + /** Custom Starting Items */ + if (Config.ENABLE_NEWCHAR_ITEMS) + { + newChar.getInventory().addItem("New Item", Config.STARTING_ITEM_ID , Config.STARTING_ITEM_COUNT, newChar, null); + } for (L2SkillLearn skill : SkillTreeTable.getInstance().getAvailableSkills(newChar, newChar.getClassId())) { and the configs /** New Char Items */ public static boolean ENABLE_NEWCHAR_ITEMS; public static int STARTING_ITEM_ID; public static int STARTING_ITEM_COUNT; /** New Char Items */ ENABLE_NEWCHAR_ITEMS = Boolean.parseBoolean(customstarting.getProperty("EnableNewcharItems", "False")); STARTING_ITEM_ID = Integer.parseInt(customstarting.getProperty("StartingItemId", "50000")); STARTING_ITEM_COUNT = Integer.parseInt(customstarting.getProperty("StartingItemCount", "1")); # ---------------------------------- # Custom Starting Item # ---------------------------------- # Enable Custom Starting Item? # Default: False EnableNewcharItems = True StartingItemId = 50005 StartingItemCount = 1 this will add item not items Quote
0 Rootware Posted October 7, 2015 Posted October 7, 2015 L2ItemInstance item = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null); L2ItemInstance item1 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null); L2ItemInstance item11 = newChar.getInventory().addItem("Init", item2.getItemId(), 1, newChar, null); if (item.getItemId() == 5588) { if (item1.getItemId() == 3470) { if (item11.getItemId() == 5134) { } } It's dead code because item == item1 == item11. Quote
Question
sirreaven
Hi everybody,
i try at the moment to add some items for newbies.
But it doesnt work and i think i do something wroung.
It tried this:
But it dont know what i need to do exactly.
Thanks in advance.
sir
Edited by sirreaven6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.