Jump to content
  • 0

Droplist L2Jacis


Question

Posted
Hello somebody help me to create this good code it is loading more not to getting to aggregate in all the game monsters does anyone help?

 



### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java    (revision 121)
+++ java/net/sf/l2j/gameserver/GameServer.java    (working copy)
@@ -49,6 +49,7 @@
 import net.sf.l2j.gameserver.datatables.ClanTable;
 import net.sf.l2j.gameserver.datatables.DoorTable;
 import net.sf.l2j.gameserver.datatables.EnchantTable;
+import net.sf.l2j.gameserver.datatables.FeanorTable;
 import net.sf.l2j.gameserver.datatables.FishTable;
 import net.sf.l2j.gameserver.datatables.GmListTable;
 import net.sf.l2j.gameserver.datatables.HelperBuffTable;
@@ -193,6 +194,7 @@

+ StringUtil.printSection("Feanor Drop All Mobs");
+ FeanorTable.getInstance();
+
StringUtil.printSection("System");
 
Index: java/net/sf/l2j/gameserver/datatables/FeanorTable.java
===================================================================
@@ -0,0 +1,138 @@
--- java/net/sf/l2j/gameserver/datatables/FeanorTable.java    (revision 01)
+++ java/net/sf/l2j/gameserver/datatables/FeanorTable.java    (working copy)
+/*
+ * 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.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import net.sf.l2j.gameserver.model.item.DropCategory;
+import net.sf.l2j.gameserver.model.item.DropData;
+import net.sf.l2j.gameserver.xmlfactory.XMLDocumentFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * @author williams
+ *
+ */
+public class FeanorTable
+{
+ private static Logger _log = Logger.getLogger(FeanorTable.class.getName());
+
+ private final Map<Integer, List<DropCategory>> _feanor = new HashMap<>();
+
+ protected FeanorTable()
+ {
+ try
+ {
+ File file = new File("./data/xml/feanor.xml");
+ Document doc = XMLDocumentFactory.getInstance().loadDocument(file);
+
+ Node n = doc.getFirstChild();
+ for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
+ {
+ if ("feanor".equalsIgnoreCase(d.getNodeName()))
+ {
+ NamedNodeMap attrs = d.getAttributes();
+ int feanorId = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
+
+ List<DropCategory> category;
+ if (_feanor.containsKey(feanorId))
+ category = _feanor.get(feanorId);
+ else
+ {
+ category = new ArrayList<>();
+ _feanor.put(feanorId, category);
+ }
+
+ for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
+ {
+ DropData dropDat = new DropData();
+ if ("item".equalsIgnoreCase(cd.getNodeName()))
+ {
+ attrs = cd.getAttributes();
+ int id = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
+ int categoryType = Integer.parseInt(attrs.getNamedItem("category").getNodeValue());
+ int minDrop = Integer.parseInt(attrs.getNamedItem("minDrop").getNodeValue());
+ int maxDrop = Integer.parseInt(attrs.getNamedItem("maxDrop").getNodeValue());
+ int chance = Integer.parseInt(attrs.getNamedItem("chance").getNodeValue());
+
+ dropDat.setItemId(id);
+ dropDat.setMinDrop(minDrop);
+ dropDat.setMaxDrop(maxDrop);
+ dropDat.setChance(chance);
+
+ if (ItemTable.getInstance().getTemplate(dropDat.getItemId()) == null)
+ {
+ _log.warning("FeanorTable: FeanorTable data for undefined item template! feanorId: " + feanorId + ", itemId: " + dropDat.getItemId());
+ continue;
+ }
+
+ boolean catExists = false;
+ for (DropCategory cat : category)
+ {
+ // if the category exists, add the drop to this category.
+ if (cat.getCategoryType() == categoryType)
+ {
+ cat.addDropData(dropDat, false);
+ catExists = true;
+ break;
+ }
+ }
+
+ // if the category doesn't exit, create it and add the drop
+ if (!catExists)
+ {
+ DropCategory cat = new DropCategory(categoryType);
+ cat.addDropData(dropDat, false);
+ category.add(cat);
+ }
+ }
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ _log.warning("FeanorTable: Error while creating table: " + e);
+ }
+ _log.info("FeanorTable: Loaded " + _feanor.size() + " drops feanor.");
+ }
+
+ public List<DropCategory> getTemplate(int feanorId)
+ {
+ return _feanor.get(feanorId);
+ }
+
+ public static FeanorTable getInstance()
+ {
+ return SingletonHolder._instance;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final FeanorTable _instance = new FeanorTable();
+ }
+}
### Eclipse Workspace Patch 1.0
#P aCis_datapack
Index: data/xml/feanor.xml
===================================================================
--- data/xml/feanor.xml (révision 1)
+++ data/xml/feanor.xml (révision 2)
@@ -0,564 +1,8 @@
<?xml version='1.0' encoding='utf-8'?>
<list>
<group id="1"><!-- Autor Williams -->
<item id="3470" category="7" chance="30000" />>
</group>
</list>


0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • I came out of my cave as I do once every 5 years. By now, I know nobody really cares about L2, but I still find it fun to experiment. Everything you see here will be free and open source. I have no interest in selling anything.   Long story short, I like to revisit Interlude and apply what I've learned to see how far I can push it. Here's Outerlude, a public fork of aCis for the modern age.   Video demo:   Work that has been done:   Redone the netcode from scratch to be async The NPC AI was completely redone based on Finite State Machines Moved to PostgreSQL and using some of its cool features Lots of config that should be hot reloadable has moved to the database OpenTelemetry instrumentation, where it makes sense, and a Grafana dashboard A built-in REST API for server management A built-in MCP Server for LLMs Nidrah AI, an AI Agent to make managing the server easier Real-time server map view Chat auditing and live snooping A new Fake Players Engine with a Node logic system and a new LLM planner for any behavior Just watch the video   If there is interest in this and I'm happy with it, or I get bored (which I always do), I will open-source it. Let me know what you think and if there is some feature you'd like me to implement.
    • Hello everyone!   I offer Java development services for L2-like projects.   I have been working with Java since 2015-2016. During the last years I worked on contract Lineage 2 server development and related infrastructure. My main focus is server-side Java, L2JMobius-based forks, custom systems, packets, datapack/XML, SQL/JDBC, optimization and fixing unstable logic.   Experience with: L2JMobius main/original branch; L2JMobius Essence branch; Lucera interlude; Custom L2-like packs where many things were already changed from the original codebase;   What I can help with: custom systems for your pack; skills / effects / triggers / formulas; NPC / AI / scripts; shops / services / buffer / GM shop logic; items / enchant / rewards / missions; special hunting zones, instances, spawn/zone logic; custom packets and server-side integration with existing client UI changes; server-side integration for existing client-side edits/maps/geodata; SQL/JDBC, XML/datapack, XSD, configs; porting mechanics between branches/chronicles; bug fixing, cleanup, legacy refactoring; performance fixes: memory leaks, race conditions, broadcast/task-manager bottlenecks. other server-side game mechanics;   Examples of larger systems I worked on: clan/economy systems: roles, permissions, auction, shop, warehouse, ranks, seasons, history; PvP/event-like systems: territory/conquest mechanics, rankings, rewards, schedules; hunt pass / season pass / progression systems; account panel / web API for a game project; launcher backend, token-login flow, updater tooling; parsers and analyzers for game/client data; internal testing tools for server-side validation.   I can work with Git, separate branches, commits, pull/merge requests or patches, depending on your workflow. For tasks I usually provide a short note about what was changed and what should be tested.   Format: hourly: 15-20 USD/hour, depending on the task; fixed price per task after checking the requirements/code; small task: from 15 USD; payment: USDT; no revenue share and no unpaid test tasks; a small paid task is usually the best way to check quality and communication first. Contact: Discord: @stroke_dan Telegram @castirom
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..