Hello, I want to add an option to have the chance of 2 different masterwork items when crafting something (for example when crafting Vesper Helmet having the chance of getting the normal item, the masterwork item and the chance of getting a custom masterwork one)
I don't know much about java but I've made things by looking at others stuff that works similar and copying/adapting, this is what my RecipeData.java looks like:
Spoiler
@Overridepublicvoid parseDocument(Document doc){// TODO: Cleanup checks enforced by XSD.
final List<L2RecipeInstance> recipePartList =newArrayList<>();
final List<L2RecipeStatInstance> recipeStatUseList =newArrayList<>();
final List<L2RecipeStatInstance> recipeAltStatChangeList =newArrayList<>();for(Node n = doc.getFirstChild(); n !=null; n = n.getNextSibling()){if("list".equalsIgnoreCase(n.getNodeName())){
RECIPES_FILE:for(Node d = n.getFirstChild(); d !=null; d = d.getNextSibling()){if("item".equalsIgnoreCase(d.getNodeName())){
recipePartList.clear();
recipeStatUseList.clear();
recipeAltStatChangeList.clear();NamedNodeMap attrs = d.getAttributes();Node att;int id =-1;
boolean haveRare =false;
boolean haveRare2 =false;
boolean haveRare3 =false;StatsSetset=newStatsSet();
att = attrs.getNamedItem("id");if(att ==null){
LOG.error("{}: Missing id for recipe item, skipping!", getClass().getSimpleName());continue;}
id =Integer.parseInt(att.getNodeValue());set.set("id", id);
att = attrs.getNamedItem("recipeId");if(att ==null){
LOG.error("{}: Missing recipeId for recipe item ID: {}, skipping!", getClass().getSimpleName(), id);continue;}set.set("recipeId",Integer.parseInt(att.getNodeValue()));
att = attrs.getNamedItem("name");if(att ==null){
LOG.error("{}: Missing name for recipe item ID: {}, skipping!", getClass().getSimpleName(), id);continue;}set.set("recipeName", att.getNodeValue());
att = attrs.getNamedItem("craftLevel");if(att ==null){
LOG.error("{}: Missing level for recipe item ID: {}, skipping!", getClass().getSimpleName(), id);continue;}set.set("craftLevel",Integer.parseInt(att.getNodeValue()));
att = attrs.getNamedItem("type");if(att ==null){
LOG.error("{}: Missing type for recipe item ID: {}, skipping!", getClass().getSimpleName(), id);continue;}set.set("isDwarvenRecipe", att.getNodeValue().equalsIgnoreCase("dwarven"));
att = attrs.getNamedItem("successRate");if(att ==null){
LOG.error("{}: Missing successRate for recipe item ID: {}, skipping!", getClass().getSimpleName(), id);continue;}set.set("successRate",Integer.parseInt(att.getNodeValue()));for(Node c = d.getFirstChild(); c !=null; c = c.getNextSibling()){if("statUse".equalsIgnoreCase(c.getNodeName())){String statName = c.getAttributes().getNamedItem("name").getNodeValue();int value =Integer.parseInt(c.getAttributes().getNamedItem("value").getNodeValue());try{
recipeStatUseList.add(new L2RecipeStatInstance(statName, value));}catch(Exception e){
LOG.error("{}: Error in StatUse parameter for recipe item ID: {}, skipping!", getClass().getSimpleName(), id);continue RECIPES_FILE;}}elseif("altStatChange".equalsIgnoreCase(c.getNodeName())){String statName = c.getAttributes().getNamedItem("name").getNodeValue();int value =Integer.parseInt(c.getAttributes().getNamedItem("value").getNodeValue());try{
recipeAltStatChangeList.add(new L2RecipeStatInstance(statName, value));}catch(Exception e){
LOG.error("{}: Error in AltStatChange parameter for recipe item ID: {}, skipping!", getClass().getSimpleName(), id);continue RECIPES_FILE;}}elseif("ingredient".equalsIgnoreCase(c.getNodeName())){int ingId =Integer.parseInt(c.getAttributes().getNamedItem("id").getNodeValue());int ingCount =Integer.parseInt(c.getAttributes().getNamedItem("count").getNodeValue());
recipePartList.add(new L2RecipeInstance(ingId, ingCount));}elseif("production".equalsIgnoreCase(c.getNodeName())){set.set("itemId",Integer.parseInt(c.getAttributes().getNamedItem("id").getNodeValue()));set.set("count",Integer.parseInt(c.getAttributes().getNamedItem("count").getNodeValue()));}elseif("productionRare".equalsIgnoreCase(c.getNodeName())){set.set("rareItemId",Integer.parseInt(c.getAttributes().getNamedItem("id").getNodeValue()));set.set("rareCount",Integer.parseInt(c.getAttributes().getNamedItem("count").getNodeValue()));set.set("rarity",Integer.parseInt(c.getAttributes().getNamedItem("rarity").getNodeValue()));
haveRare =true;}elseif("productionRare2".equalsIgnoreCase(c.getNodeName())){set.set("rareItemId2",Integer.parseInt(c.getAttributes().getNamedItem("id2").getNodeValue()));set.set("rareCount",Integer.parseInt(c.getAttributes().getNamedItem("count").getNodeValue()));set.set("rarity2",Integer.parseInt(c.getAttributes().getNamedItem("rarity2").getNodeValue()));
haveRare =true;}}
L2RecipeList recipeList =new L2RecipeList(set, haveRare);for(L2RecipeInstance recipePart : recipePartList){
recipeList.addRecipe(recipePart);}for(L2RecipeStatInstance recipeStatUse : recipeStatUseList){
recipeList.addStatUse(recipeStatUse);}for(L2RecipeStatInstance recipeAltStatChange : recipeAltStatChangeList){
recipeList.addAltStatChange(recipeAltStatChange);}
_recipes.put(id, recipeList);}}}}}
But when I start the server I get the error on the pic
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.
Can someone help me disable the following emitters?
I managed to disable emitter181 but I can't find the emitter for the rest of the effect.
Information:
I use the Client: 273 Freya High Five
I view the map with Unreal Editor
Sample MAP 24_18.unr
L2PE to disable the emitter
L2SMR to get the emitter location and compare
The effects I want to disable are related to the structure of the kamael that are usually in most cities.
I only managed to disable emitter181, which corresponds to the eye and its effect:
when disable emitter181 It looks like this to me:
i need to remove the rest of the effect but I don't know how to find the number of the corresponding emitter
I hope you can help me
Thanks
I apologize for my incompetence. The ability to trade is limited only for builder 1. Ordinary characters can trade with each other, and this has nothing to do with auto loot.)
Question
Kyboi
Hello, I want to add an option to have the chance of 2 different masterwork items when crafting something (for example when crafting Vesper Helmet having the chance of getting the normal item, the masterwork item and the chance of getting a custom masterwork one)
Something like this:
I don't know much about java but I've made things by looking at others stuff that works similar and copying/adapting, this is what my RecipeData.java looks like:
But when I start the server I get the error on the pic
Any ideas of what is wrong?
8 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.