Page 1 of 1
++ wepons and armour
Posted: Sat Oct 31, 2009 9:56 pm
by cgiven415
ok well I have done some reading on the forums and saw that the XML no longer supports the sale of enchanted weapons and armour. I'm wondering if there is a way to mod the core or the datapack to make it support enchants again...I'm not looking for a handout but I am just looking for someone to point me in the right direction, so that I may change or make it work myself.
Re: ++ wepons and armour
Posted: Sat Oct 31, 2009 11:24 pm
by _DS_
Not a contribution, moved to support.
btw, enchanted items can be sold.
Re: ++ wepons and armour
Posted: Sat Oct 31, 2009 11:38 pm
by cgiven415
sorry about posting in the wrong spot. when I changed the xml file it didn't add it as enchanted to my AIO Npc Shop
Re: ++ wepons and armour
Posted: Sun Nov 01, 2009 3:06 am
by Charus
Re: ++ wepons and armour
Posted: Sun Nov 01, 2009 5:48 pm
by cgiven415
I'm not trying to makean enchanter npc...I'm trying to straight up sell enchanted Armors and wepons in an AIO Npc shop. Example....you go to shop and with so much currency you buy a +10 Vesper Cutter. not the individual enchants.
now if i change the multisell.java to this
Code: Select all
protected MultiSellEntry parseEntry(Node n) { int entryId = Integer.parseInt(n.getAttributes().getNamedItem("id").getNodeValue()); Node first = n.getFirstChild(); MultiSellEntry entry = new MultiSellEntry(); for (n = first; n != null; n = n.getNextSibling()) { if ("ingredient".equalsIgnoreCase(n.getNodeName())) { Node attribute; int id = Integer.parseInt(n.getAttributes().getNamedItem("id").getNodeValue()); long count = Long.parseLong(n.getAttributes().getNamedItem("count").getNodeValue()); int enchant = Integer.parseInt(n.getAttributes().getNamedItem("enchant").getNodeValue()); boolean isTaxIngredient = false, mantainIngredient = false; attribute = n.getAttributes().getNamedItem("isTaxIngredient"); if (attribute != null) isTaxIngredient = Boolean.parseBoolean(attribute.getNodeValue()); attribute = n.getAttributes().getNamedItem("mantainIngredient"); if (attribute != null) mantainIngredient = Boolean.parseBoolean(attribute.getNodeValue()); MultiSellIngredient e = new MultiSellIngredient(id, count, enchant, isTaxIngredient, mantainIngredient); entry.addIngredient(e); } else if ("production".equalsIgnoreCase(n.getNodeName())) { int id = Integer.parseInt(n.getAttributes().getNamedItem("id").getNodeValue()); long count = Long.parseLong(n.getAttributes().getNamedItem("count").getNodeValue()); int enchant = Integer.parseInt(n.getAttributes().getNamedItem("enchant").getNodeValue()); MultiSellIngredient e = new MultiSellIngredient(id, count, enchant, false, false); entry.addProduct(e); } }
when I load server though it won't load any of the multisell. I'm not sure what I need to add to the multisell files I thought they were all there.
Re: ++ wepons and armour
Posted: Sun Nov 08, 2009 3:41 am
by cgiven415
ok I got the multisell to load. I changed the clientpacket file, multisellchoose.java as well, but it still will not show a ++weapon or armor from xml
Code: Select all
// Next add the adena amount, if any if (totalAdenaCount > 0) newEntry.addIngredient(L2Multisell.getInstance().new MultiSellIngredient(57, totalAdenaCount, enchantLevel, false, false)); // Now modify the enchantment level of products, if necessary for (MultiSellIngredient ing : templateEntry.getProducts()) { // load the ingredient from the template MultiSellIngredient newIngredient = L2Multisell.getInstance().new MultiSellIngredient(ing); if (maintainEnchantment && hasIngredient) { // if it is an armor/weapon, modify the enchantment level appropriately // (note, if maintain enchantment is "false" this modification will result to a +0) L2Item tempItem = ItemTable.getInstance().createDummyItem(newIngredient.getItemId()).getItem(); if ((tempItem instanceof L2Armor) || (tempItem instanceof L2Weapon)) newIngredient.setEnchantmentLevel(enchantLevel); } newEntry.addProduct(newIngredient); } return newEntry; }
is there another part in that that I have to change for xml to allow enchanted weapons to be sold by xml. like this:
<!-- +20 Nephlim Shield -->
<item id="2">
<ingredient id="3194" count="50" enchantLevel="0"/>
<production id="5799" count="1" enchantLevel="20"/>
</item>