Jump to content

Recommended Posts

Posted (edited)

Nothing special but... huh anyway!
 

Support : Interlude

Tested : aCis & Frozen

  • net/sf/l2j/gameserver/GameServer.java
 import net.sf.l2j.gameserver.datatables.HerbDropTable;
+import net.sf.l2j.gameserver.datatables.IconsTable;
 import net.sf.l2j.gameserver.datatables.ItemTable;

 	StringUtil.printSection("Items");
 	ItemTable.getInstance();
+	IconsTable.getInstance();
 	SummonItemsData.getInstance();
  • net/sf/l2j/gameserver/datatables/IconsTable.java
+package net.sf.l2j.gameserver.datatables;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import net.sf.l2j.gameserver.GameServer;
+import net.sf.l2j.gameserver.xmlfactory.XMLDocumentFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+
+public class IconsTable
+{
+    public static final Map<Integer, String> Icons = new HashMap<>();
+    private static int count;
+    private static long t0;
+    private static double t;
+
+    private static final Logger _log = Logger.getLogger(GameServer.class.getName());
+
+    public void reload()
+    {
+        Icons.clear();
+        parseData();
+    }
+
+    public static void parseData()
+    {
+        count=0;
+        t0 = System.currentTimeMillis();
+        try
+        {
+            File f = new File("./data/xml/icons.xml");
+            Document doc = XMLDocumentFactory.getInstance().loadDocument(f);
+
+            for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
+            {
+                if ("list".equalsIgnoreCase(n.getNodeName()))
+                {
+                    for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
+                    {
+                        if (d.getNodeName().equalsIgnoreCase("icon"))
+                        {
+                            count++;
+                            NamedNodeMap attrs = d.getAttributes();
+                            Node att = attrs.getNamedItem("Id");
+                            Node att2 = attrs.getNamedItem("value");
+                            Icons.put(Integer.valueOf(att.getNodeValue()), String.valueOf(att2.getNodeValue()));
+                        }
+                    }
+                }
+            }
+            t = System.currentTimeMillis() - t0;
+            _log.config("IconsTable: Succesfully loaded "+count+" icons, in "+t+" Milliseconds.");
+        }
+        catch (Exception e)
+        {
+            _log.config("IconsTable: Failed loading IconsTable. Possible error: "+e.getMessage());
+        }
+    }
+
+    public static String getIcon(int id)
+    {
+
+        if (Icons.get(id)==null)
+        {
+            _log.config("IconsTable: Invalid Icon request: "+id+", or it doesn't exist, Ignoring ...");
+            return "null";
+        }
+        return Icons.get(id);
+    }
+
+    public static final IconsTable getInstance()
+    {
+        parseData();
+        return SingletonHolder._instance;
+    }
+
+    private static class SingletonHolder
+    {
+        protected static final IconsTable _instance = new IconsTable();
+    }
+}
  • data/xml/icons.xml
http://pastebin.com/KMyYJND2

Please no hate... i'm too lazy to make diff.  :poker face:

 

Credits : Me and xxdem

Edited by newChar.needHelp()
Posted

Nothing special but... huh anyway!

 

  • net/sf/l2j/gameserver/GameServer.java
 import net.sf.l2j.gameserver.datatables.HerbDropTable;
+import net.sf.l2j.gameserver.datatables.IconsTable;
 import net.sf.l2j.gameserver.datatables.ItemTable;

 	StringUtil.printSection("Items");
 	ItemTable.getInstance();
+	IconsTable.getInstance();
 	SummonItemsData.getInstance();
  • net/sf/l2j/gameserver/datatables/IconsTable.java
+package net.sf.l2j.gameserver.datatables;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import net.sf.l2j.gameserver.GameServer;
+import net.sf.l2j.gameserver.xmlfactory.XMLDocumentFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+
+public class IconsTable
+{
+    public static final Map<Integer, String> Icons = new HashMap<>();
+    private static int count;
+    private static long t0;
+    private static double t;
+
+    private static final Logger _log = Logger.getLogger(GameServer.class.getName());
+
+    public void reload()
+    {
+        Icons.clear();
+        parseData();
+    }
+
+    public static void parseData()
+    {
+        count=0;
+        t0 = System.currentTimeMillis();
+        try
+        {
+            File f = new File("./data/xml/icons.xml");
+            Document doc = XMLDocumentFactory.getInstance().loadDocument(f);
+
+            for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
+            {
+                if ("list".equalsIgnoreCase(n.getNodeName()))
+                {
+                    for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
+                    {
+                        if (d.getNodeName().equalsIgnoreCase("icon"))
+                        {
+                            count++;
+                            NamedNodeMap attrs = d.getAttributes();
+                            Node att = attrs.getNamedItem("Id");
+                            Node att2 = attrs.getNamedItem("value");
+                            Icons.put(Integer.valueOf(att.getNodeValue()), String.valueOf(att2.getNodeValue()));
+                        }
+                    }
+                }
+            }
+            t = System.currentTimeMillis() - t0;
+            _log.config("IconsTable: Succesfully loaded "+count+" icons, in "+t+" Milliseconds.");
+        }
+        catch (Exception e)
+        {
+            _log.config("IconsTable: Failed loading IconsTable. Possible error: "+e.getMessage());
+        }
+    }
+
+    public static String getIcon(int id)
+    {
+
+        if (Icons.get(id)==null)
+        {
+            _log.config("IconsTable: Invalid Icon request: "+id+", or it doesn't exist, Ignoring ...");
+            return "null";
+        }
+        return Icons.get(id);
+    }
+
+    public static final IconsTable getInstance()
+    {
+        parseData();
+        return SingletonHolder._instance;
+    }
+
+    private static class SingletonHolder
+    {
+        protected static final IconsTable _instance = new IconsTable();
+    }
+}
  • net/sf/l2j/gameserver/model/L2IconList.java
+package net.sf.l2j.gameserver.model;
+
+public class L2IconList
+{
+	private static int _icon;
+	private int _itemId;
+	
+	public void setitemId(int id)
+	{
+		_itemId = id;
+	}
+	
+	public int getitemId()
+	{
+		return _itemId;
+	}
+	
+	public void setIcon(int icon)
+	{
+		_icon = icon;
+	}
+	
+	public int getIcon()
+	{
+		return _icon;
+	}
+}
  • data/xml/icons.xml
http://pastebin.com/KMyYJND2

Please no hate... i'm too lazy to make diff.  :poker face:

Thats sexy and cute  :-[  Even tryskell won't resist in this one and he will probably write a cute comment. 

Even tho u did not add info such as "what chronicle supports" cause if those are interlude icons then its useless for freya -high5 e.t.c

 

but still good for the xml 

Posted (edited)

Thats sexy and cute  :-[  Even tryskell won't resist in this one and he will probably write a cute comment. 

Even tho u did not add info such as "what chronicle supports" cause if those are interlude icons then its useless for freya -high5 e.t.c

 

but still good for the xml 

 

Thx AccessDenied, Update chronicle support  O0

Edited by newChar.needHelp()
Posted

Thx AccessDenied, Update chronicle support  O0

Btw the code is messed up, who did the code anyway? And what's the purpose of L2IconList ? Since its not used 

Posted (edited)

Eee aaa.. All you need is a new String @ Item.java and simply read the image location from xml, from the item template, if it's in xml format :P

Edited by SweeTs
Posted

oh god, you can make a method "loadData" no need load data everytime u call instance.

You have no idea what a Singleton is do you?

Posted

Eee aaa.. All you need is a new String @ Item.java and simply read the image location from xml, from the item template, if it's in xml format :P

I did it for L2JFrozen a long time ago... :lol:

http://www.maxcheaters.com/topic/186701-please-check-here/

Posted

Why so hate guys? Just im Newbie... find the xml and i make but myself the java side :/ but im newbie...

If somebody can make the code more simple and better can send me with pm the update and i will update it...

Waiting...

 

P.S. I share this part of code because i want to share "Shift+Click" for Monster Drop list.

       Thats all.. :/

Guest
This topic is now closed to further replies.



  • Posts

    • There is a ready-made option and the possibility to work according to "Wishlist"
    • Contact me, Discord: xbaus
    • WTB GRACIA FINAL INTERFACE
    • Dear partners! At the moment we are in great need of the following positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old (brute or hacked origin, self-registered) accounts with post and comment karma from 100 to 100,000+ | Full email access included — LinkedIn old accounts with real connections | Geo: Europe/USA | Full email access + active 2FA password — Instagram old accounts (2010–2023) | Full email access (possibly with active 2FA password) — Facebook old accounts (2010–2023) | Full email access (possibly with active 2FA password) | With friends or without friends | Geo: Europe/USA/Asia — Threads accounts | Full email access (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts — Email accounts: mail.ru, yahoo.com, gazeta.pl, gmx.ch / gmx.de / gmx.net (BUT NOT gmx.com) — Google ADS Manual Farm accounts (verified via email and phone number) | GEO: USA/Europe, mostly USA. — WhatsApp OLD Accounts — Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! We are also ready to consider other partnership and collaboration options. Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock