Hello tou trying to create a feanor with the droplist of the game so you do not have to do with a frozen type lib is able to work? I do not know how to create from 0 so I copied the drop list and removed the parts of npcs and left only the part of the drope someone can help me I know not to be right but I do not know what to do right anymore.
/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/package net.sf.l2j.gameserver.datatables;import java.io.File;import java.util.ArrayList;import java.util.Collection;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.function.Predicate;import java.util.logging.Level;import java.util.logging.Logger;import java.util.stream.Collectors;import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;import net.sf.l2j.gameserver.model.item.DropCategory;import net.sf.l2j.gameserver.model.item.DropData;import net.sf.l2j.gameserver.templates.StatsSet;import net.sf.l2j.gameserver.xmlfactory.XMLDocumentFactory;import org.w3c.dom.Document;import org.w3c.dom.NamedNodeMap;import org.w3c.dom.Node;/**
* @author williams
*
*/publicclassFeanorTable{privatestaticfinalLogger _log =Logger.getLogger(FeanorTable.class.getName());privatefinalMap<Integer,NpcTemplate> _feanor =newHashMap<>();protectedFeanorTable(){
load();}publicvoid reloadAllNpc(){
_feanor.clear();
load();}privatevoid load(){try{finalFile dir =newFile("./data/xml/feanor.xml");finalStatsSetset=newStatsSet();for(File file : dir.listFiles()){finalDocument doc =XMLDocumentFactory.getInstance().loadDocument(file);Node list = doc.getFirstChild();for(Node feanor = list.getFirstChild(); feanor !=null; feanor = feanor.getNextSibling()){NamedNodeMap attrs = feanor.getAttributes();if("drops".equalsIgnoreCase(feanor.getNodeName())){finalString type =set.getString("type");finalboolean isRaid = type.equalsIgnoreCase("L2RaidBoss")|| type.equalsIgnoreCase("L2GrandBoss");finalList<DropCategory> drops =newArrayList<>();for(Node dropCat = feanor.getFirstChild(); dropCat !=null; dropCat = dropCat.getNextSibling()){if("category".equalsIgnoreCase(dropCat.getNodeName())){
attrs = dropCat.getAttributes();finalDropCategory category =newDropCategory(Integer.parseInt(attrs.getNamedItem("id").getNodeValue()));for(Node item = dropCat.getFirstChild(); item !=null; item = item.getNextSibling()){if("drop".equalsIgnoreCase(item.getNodeName())){
attrs = item.getAttributes();finalDropData data =newDropData();
data.setItemId(Integer.parseInt(attrs.getNamedItem("itemid").getNodeValue()));
data.setMinDrop(Integer.parseInt(attrs.getNamedItem("min").getNodeValue()));
data.setMaxDrop(Integer.parseInt(attrs.getNamedItem("max").getNodeValue()));
data.setChance(Integer.parseInt(attrs.getNamedItem("chance").getNodeValue()));if(ItemTable.getInstance().getTemplate(data.getItemId())==null){
_log.warning("Droplist data for undefined itemId: "+ data.getItemId());continue;}
category.addDropData(data, isRaid);}}
drops.add(category);}}set.set("drops", drops);}elseif("teachTo".equalsIgnoreCase(feanor.getNodeName()))set.set("teachTo", feanor.getAttributes().getNamedItem("classes").getNodeValue());}}}catch(Exception e){
_log.log(Level.SEVERE,"FeanorTable: Error parsing Feanor Table : ", e);}
_log.info("FeanorTable: Loaded "+ _feanor.size()+" Feanor Table.");}publicNpcTemplate getTemplate(int id){return _feanor.get(id);}/**
* @param name to search.
* @return the template list of NPCs for a given name.
*/publicNpcTemplate getTemplateByName(String name){for(NpcTemplate npcTemplate : _feanor.values()){if(npcTemplate.getName().equalsIgnoreCase(name))return npcTemplate;}returnnull;}/**
* Gets all templates matching the filter.
* @param filter
* @return the template list for the given filter
*/publicList<NpcTemplate> getTemplates(Predicate<NpcTemplate> filter){return _feanor.values().stream().filter(filter).collect(Collectors.toList());}publicCollection<NpcTemplate> getAllNpcs(){return _feanor.values();}publicstaticFeanorTable getInstance(){returnSingletonHolder._instance;}privatestaticclassSingletonHolder{protectedstaticfinalFeanorTable _instance =newFeanorTable();}}
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.
The Time Has Come!
Tomorrow, L2DoubleDamage officially launches! Get ready for epic PvP battles, legendary rewards, and tons of action-packed features!
Opening Date:
February 28, 2025
Opening Time by Country:
Greece: 20:00
Brazil: 15:00
Russia (Moscow): 21:00
Argentina: 15:00
Important Note:
The donation weapons, armors, and jewelry will be closed for 2 days for the donors.
Key Features:
100% PvP Full Balance – No Pay to Win!
Ultra Stable – No Wipes, Long-Term Project!
Siege Castles: Giran, Aden, Rune
Giran Siege Reward: 100€ Real Money! (Every week after: 50€)
VIP Autofarm: x2 Drop & Name Color Change
6 Grand Bosses & 6 Special Grand Bosses!
Casino – Try Your Luck & Win Big!
Daily PvP Events – Show off your skills!
Enchant Rates: Safe +6, Max +25
JOIN NOW and prepare for the ultimate PvP experience!
Check out the official links below:
Website: L2DoubleDamage
Discord: Join Here
Instagram: Follow Us
YouTube: Watch the Trailer
Facebook: Like Our Page
Get ready! The adventure begins tomorrow!
🚀 JOIN NOW & Experience the Best PvP Gameplay Ever! 🚀
🌐 Website: http://www.l2doubledamage.com/
💬 Discord: https://discord.gg/l2doubledamage
📷 Instagram: https://www.instagram.com/l2doubledamage/
📘 Facebook: https://www.facebook.com/profile.php?id=61573159438765&sk=about_contact_and_basic_info
📺 YouTube:
🔥 L2Custom.com - FRESH START/WIPE! 🔥
🗓️ Wipe/Open Date: 2025-03-01, 18:00 GMT+2
⚔️ Chronicle: Interlude | Rates: High
🌟 Key Features:
✅ Custom Items – Enhanced PvP Experience
✅ Full Buffer – No Hassle, Just Action
✅ Olympiad (A-Grade Only) – Every Week
✅ Castle Sieges – Every Week
🚀 Fresh Start – Dominate from Day 1!
Gather your clan, forge alliances, and prove your strength on the battlefield!
🌐 Join Now: www.l2custom.com
💥 Don’t miss out on the ultimate PvP experience! 💥
Question
l2jkain
Hello tou trying to create a feanor with the droplist of the game so you do not have to do with a frozen type lib is able to work? I do not know how to create from 0 so I copied the drop list and removed the parts of npcs and left only the part of the drope someone can help me I know not to be right but I do not know what to do right anymore.
1 answer 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.