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 (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

    • @Mobius, congratulations on the milestone🫡 P.S. I saw my name
    • Every commit to the L2J Mobius project since 2015 visualized as comets impacting the Mobius planet. 10+ years of development, thousands of commits, hundreds of contributors, all brought to life.    
    • new link https://www.mediafire.com/file/sspr9w96u9qln62/AvengersKamaelWings.7z/file
    • “8-PAGE CONTRACT — AND ONE SEAL DECIDES EVERYTHING.” ▪ We got a case that looked “simple”: SPA, legal entities, all data provided — just assemble and format. ▪ But the devil was in the details. ▪  An 8-page document with two parties to the deal: IE and LLC, requisites, amounts, deadlines, shipment. ▪ And a separate request: seals must look **real** — different angles, different pressure, no “stamp over text”. ▪ 🖨 This is exactly where most people fail. Identical imprints, even transparency, “perfect” insertion — and the document immediately looks like a mock-up, not a real file. ▪ We did it differently: — placed seals logically across the document — set different angles and pressure — added the signature separately — preserved the natural page structure ▪  Result: the document was accepted without any questions. ▪  Sometimes it’s not the text that matters. It’s how the seal sits. ▪  Want your file to look like a real document, not a collage? Write to us — we’ll show where even neat mock-ups usually get caught. *All data presented with the client’s consent.* › TG: https://t.me/mustang_service ( https:// t.me/ mustang_service ) › Channel: https://t.me/+JPpJCETg-xM1NjNl ( https:// t.me/ +JPpJCETg-xM1NjNl ) #documents #case #drawing #verification #contract
    • guys i got the mythras pac ... i know it is out dated://    i see in startup loads  32002 fake players from fake player table  but how  can i  summon them when i use //create_fake_players  nothing happens    
  • 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..