Jump to content
  • 0

Drop List Acis


l2jkain

Question

Hello, I'm trying to create a custom drop system, does anyone give me an idea? That's how it looks! Even registering in Gameserve.java is not running the drops

 

 

 

/*
 * 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.Level;
import java.util.logging.Logger;
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
 *
 */
public class FeanorTable
{
private static Logger _log = Logger.getLogger(FeanorTable.class.getName());
 
private final Map<Integer, NpcTemplate> _feanor = new HashMap<>();
 
protected FeanorTable()
{
loadFeanorTable();
}
 
public void reloadAllNpc()
{
_feanor.clear();
loadFeanorTable();
}
 
private void loadFeanorTable()
{
try
{
final File dir = new File("./data/xml/feanorTable");
final StatsSet set = new StatsSet();
 
for (File file : dir.listFiles())
{
final Document doc = XMLDocumentFactory.getInstance().loadDocument(file);
 
Node list = doc.getFirstChild();
for (Node npc = list.getFirstChild(); npc != null; npc = npc.getNextSibling())
{
NamedNodeMap attrs = npc.getAttributes();
 
for (Node cat = npc.getFirstChild(); cat != null; cat = cat.getNextSibling())
 
if ("drops".equalsIgnoreCase(cat.getNodeName()))
{
final List<DropCategory> drops = new ArrayList<>();
 
for (Node dropCat = cat.getFirstChild(); dropCat != null; dropCat = dropCat.getNextSibling())
{
if ("category".equalsIgnoreCase(dropCat.getNodeName()))
{
attrs = dropCat.getAttributes();
 
final DropCategory category = new DropCategory(Integer.parseInt(attrs.getNamedItem("id").getNodeValue()));
 
for (Node item = dropCat.getFirstChild(); item != null; item = item.getNextSibling())
{
if ("drop".equalsIgnoreCase(item.getNodeName()))
{
attrs = item.getAttributes();
 
final DropData data = new DropData();
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, true);
}
}
drops.add(category);
}
}
set.set("drops", drops);
}
 
else if ("set".equalsIgnoreCase(cat.getNodeName()))
{
attrs = cat.getAttributes();
 
set.set(attrs.getNamedItem("name").getNodeValue(), attrs.getNamedItem("val").getNodeValue());
}
 
else if ("teachTo".equalsIgnoreCase(cat.getNodeName()))
set.set("teachTo", cat.getAttributes().getNamedItem("classes").getNodeValue());
} 
}
set.clear(); 
}
catch (Exception e)
{
_log.log(Level.SEVERE, "NpcTable: Error parsing NPC templates : ", e);
}
_log.info("NpcTable: Loaded " + _feanor.size() + " NPC templates.");
}
 
public NpcTemplate getTemplate(int id)
{
return _feanor.get(id);
}
 
/**
* @param name to search.
* @return the template list of NPCs for a given name.
*/
public NpcTemplate getTemplateByName(String name)
{
for (NpcTemplate npcTemplate : _feanor.values())
{
if (npcTemplate.getName().equalsIgnoreCase(name))
return npcTemplate;
}
return null;
}
 
public static FeanorTable getInstance()
{
return SingletonHolder._instance;
}
 
private static class SingletonHolder
{
protected static final FeanorTable _instance = new FeanorTable();
}
}
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

 

Hello, I'm trying to create a custom drop system, does anyone give me an idea? That's how it looks! Even registering in Gameserve.java is not running the drops

 

trying more :) :) :) :) :) :)

 

gl  8)

Link to comment
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Yes, it is, it's not hard to do (if you know what you're doing); just time consuming.   To make some things clear: 1. You can not create .ukx files with animated skeletalmeshes inside, by using any of the freeshared L2Editors (basically, no support for .psa files) 2. You need a patched UT2003/UT2004. You can either get your own ut2004 and download Gildor's patch from his web, or use any of these: When you use these, you should be able to import both .psk and .psa animations > link the skeletalmesh to the psa > save as .ukx > use ut2down to convert the file to l2 format > encrypt the .ukx with standard l2 encryption (you can use mxc encdec, you can find it in the folder of the l2editor i shared). Your best bet is to use pawnviewer (aka dev mode) to test that. If you have troubles with that process then leave a reply here, otherwise, if it works correctly, you can move on to adding missing animnotify classes to you unrealed, then proper animnotifies, sounds, effects or w/e is missing from your .ukx files. Keep in mind that this is overall not difficult but a huge amount of work (unless you're good at scripting/macros) since you'd need to manually re-create every single animnotify, by hand. If you have doubts or i wasn't clear enough let me know here. (in case you don't know what an animnotify is: UDN - Two - AnimNotifies (unrealengine.com) )  
    • Welcome to JewStor Service!!!   ❖Ready-made verified wallets, exchanges, business banks and to order accounts. ❖EU/UK/US/DE Stuff: 100% Verified! Reliable financial tools for your business. ❖Popular items available include: Stripe business + Payoneer, Deutshce Bank, BBVA ES, Xapo Bank, Revolut business / personal, Santander Bank, Wallester business, Bitsa EU, Binance EU, Qonto Business, Blackcatcard EU, Shopify Payments, ICard EU, N26 EU, Naga Pay EU, Paysera EU, Mistertango Business and many others.
    • Custom = everything that is not part of my H5 client, such as Aegis skin, Death Knight skin, Constructor skin, Golden Valakas skin, an example is the pack containing 3 Golden Valakas skins+cloaks, to give you an idea, this pack consumes almost 200MB within the system, another example of custom is the Hunter Head set made by Asuki, almost 100MB within the system, every custom item added to the client, specifically within the system folder will increase the consumption of your client's virtual ram memory, the more custom added there, the faster your client will close due to critical. Around 4 to 5 custom packs that I removed from the system and made my client reach the ram virtual limit only after more than 40 hours online, in other words; It is only worth adding custom items to the system folder if it is very well compressed, maximum up to 10MB per custom pack (This pack below in the photo, only it inside your client - system consumes almost 200MB, when I removed this pack inside the system it increased the game's lifespan by almost 4h during my tests)
    • ready pack for sale with lucera files made from scratch price is 350 euros without the license the server is x30 rate the server is there to see everything test ie.. there have been several changes everything works there will be support for everything for as long as possible please, can you send me a message here, there is complete transparency in everything
    • The author has been using an alternate account under the name @project166 to promote their services, which violates our RULES. Additionally, the author does not adhere to our guidelines regarding the inclusion of pricing information.     Topic Locked.
  • Topics

×
×
  • Create New...