Jump to content
  • 0

Itemtable: Highest Used Itemid : 9852 Error Cannot Create Item 0 !


Question

Posted (edited)

Hi guys i have a little problem here and really dont know what's wrong with it . So today i tried to add some custom items but in the end i get some strange error what says : Cannot create item 0 , ItemTable: Highest used itemID : 9852 .

Here is all from error.log file 

Jan 31, 2015 1:37:09 AM net.sf.l2j.gameserver.skills.DocumentItem parseDocument
WARNING: Cannot create item 0
java.lang.NullPointerException
	at net.sf.l2j.gameserver.skills.DocumentItem.parseItem(DocumentItem.java:95)
	at net.sf.l2j.gameserver.skills.DocumentItem.parseDocument(DocumentItem.java:78)
	at net.sf.l2j.gameserver.skills.DocumentBase.parse(DocumentBase.java:120)
	at net.sf.l2j.gameserver.skills.SkillsEngine.loadItems(SkillsEngine.java:107)
	at net.sf.l2j.gameserver.datatables.ItemTable.load(ItemTable.java:162)
	at net.sf.l2j.gameserver.datatables.ItemTable.<init>(ItemTable.java:155)
	at net.sf.l2j.gameserver.datatables.ItemTable$SingletonHolder.<clinit>(ItemTable.java:383)
	at net.sf.l2j.gameserver.datatables.ItemTable.getInstance(ItemTable.java:135)
	at net.sf.l2j.gameserver.GameServer.<init>(GameServer.java:160)
	at net.sf.l2j.gameserver.GameServer.main(GameServer.java:385)

package what i'm using is trace editon Based on aCis revision: 315 if that help...

 

 

Item what i tried to add was 

Tried With id=9853 the same stoory ..

<item id='23569' name="Dynasty Leather Armor">
<set name="default_action" val="equip" />
<set name="armor_type" val="light" />
<set name="bodypart" val="fullarmor" />
<set name="crystal_type" val="s" />
<set name="crystal_count" val="870" />
<set name="material" val="leather" />
<set name="weight" val="5400" />
<set name="price" val="0" />
<set name="item_skill" val="11961-1" />
  <for>
    <add val='170' order='0x10' stat='pDef'/>
    <enchant val='0' order='0x0C' stat='pDef'/>
  </for>
</item>

I really hope someone can help me with it didn't find anything near about this error in google.

 

 

and how about this code i found it in itemtable.java it looks a  bit wierd for me  :

 

	/**
	 * Returns instance of ItemTable
	 * @return ItemTable
	 */
	public static ItemTable getInstance()
	{
		return SingletonHolder._instance;
	}
	
	/**
	 * Returns a new object Item
	 * @return
	 */
	public Item newItem()
	{
		return new Item();
	}
	
	/**
	 * Constructor.
	 */
	protected ItemTable()
	{
		_armors = new HashMap<>();
		_etcItems = new HashMap<>();
		_weapons = new HashMap<>();
		load();
	}
	
	private void load()
	{
		int highest = 0;
		
		for (L2Item item : SkillsEngine.getInstance().loadItems())
		{
			if (highest < item.getItemId())
				highest = item.getItemId();
			
			if (item instanceof L2EtcItem)
				_etcItems.put(item.getItemId(), (L2EtcItem) item);
			else if (item instanceof L2Armor)
				_armors.put(item.getItemId(), (L2Armor) item);
			else
				_weapons.put(item.getItemId(), (L2Weapon) item);
		}
		buildFastLookupTable(highest);
	}
	
	/**
	 * Builds a variable in which all items are putting in in function of their ID.
	 * @param size
	 */
	private void buildFastLookupTable(int size)
	{
		// Create a FastLookUp Table called _allTemplates of size : value of the highest item ID
		_log.info("ItemTable: Highest used itemID : " + size);
		
		_allTemplates = new L2Item[size + 1];
		
		// Insert armor item in Fast Look Up Table
		for (L2Armor item : _armors.values())
			_allTemplates[item.getItemId()] = item;
		
		// Insert weapon item in Fast Look Up Table
		for (L2Weapon item : _weapons.values())
			_allTemplates[item.getItemId()] = item;
		
		// Insert etcItem item in Fast Look Up Table
		for (L2EtcItem item : _etcItems.values())
			_allTemplates[item.getItemId()] = item;
	}
	
	/**
	 * Returns the item corresponding to the item ID
	 * @param id : int designating the item
	 * @return L2Item
	 */
	public L2Item getTemplate(int id)
	{
		if (id >= _allTemplates.length)
			return null;
		
		return _allTemplates[id];
	}
	
Edited by millers

5 answers to this question

Recommended Posts

  • 0
Posted

Hi guys i have a little problem here and really dont know what's wrong with it . So today i tried to add some custom items but in the end i get some strange error what says : Cannot create item 0 , ItemTable: Highest used itemID : 9852 .

 

 

Tried With id=9853 the same stoory ..

<item id='23569' name="Dynasty Leather Armor">
<set name="default_action" val="equip" />
<set name="armor_type" val="light" />
<set name="bodypart" val="fullarmor" />
<set name="crystal_type" val="s" />
<set name="crystal_count" val="870" />
<set name="material" val="leather" />
<set name="weight" val="5400" />
<set name="price" val="0" />
<set name="item_skill" val="11961-1" />
  <for>
    <add val='170' order='0x10' stat='pDef'/>
    <enchant val='0' order='0x0C' stat='pDef'/>
  </for>
</item>

I really hope someone can help me with it didn't find anything near about this error in google.

<item id='23569' name="Dynasty Leather Armor"> why use '' and not ""

try with that

<item id="23569" name="Dynasty Leather Armor">

  • 0
Posted

<item id='23569' name="Dynasty Leather Armor"> why use '' and not ""

try with that

<item id="23569" name="Dynasty Leather Armor"> 

Same story ! 

  • 0
Posted

What's 

parseItem(DocumentItem.java:95)

 ? You probably miss a parameter. Try to copy an existing similar item, and edit the parameters accordingly.

thanks man found the problem !

Guest
This topic is now closed to further replies.


  • Posts

    • L2 PVPTOP - HTML DESIGN    
    • Do not trust this guy, he will scam you. I have sent proof to the mods, I have posted proof on another thread and I can send proof to anyone who DMs me. Avoid this guy. So not only did he scam me out of $51 USDTthen delete his messages and blocked me (I have proof) . You can see his Facebook group is constantly changing names depending on his most current scam. If you see this message and you still decide to go forward with sending your money to him, that’s on you. I can’t stress this enough. This guy is a scammer. 
    • So Goldbar thinks that deleted his side of the conversation makes it easier to claim he didn’t scam me. But I sent him $51 USDT to his ERC-20 account it was verified, he acted like it was fine but then deleted his messages and blocked me. Seriously do not trust this guy. 
    • Hi everyone, let me introduce myself—I'm Martin, a junior developer. I'm diving into the world of L2 servers, and honestly, I'm super overwhelmed about where to start learning the right way to set up, configure, and run a server. There are so many datapacks—free, private—but it's so much that my head feels like it's going to explode. I'm currently looking for someone or an active project willing to take me on as an intern. I'm not looking to make money—I'm just here to learn and grow out of pure passion for L2. I've already been working with L2jMobius H5. I managed to edit the Community Board, add a buffer, GM Shop, and teleports. I've also created custom NPCs for the GM Shop, and imported new custom weapons and armors—complete with original glow effects, like the Valakas and Antharas weapons. But there's still a lot I don't know, and it can get overwhelming. That’s why I’m looking for someone—or an active non-profit project—willing to take me on as an intern. I’m not looking to make money; I just want to learn, contribute, and grow out of pure passion for L2. If you’re working on a project and could use a motivated learner who’s eager to help, I’d love to connect!
    • Our next easy-botting project, Kain, is right around the corner! Launching tomorrow, Saturday, April 26th at 9:00 ET (UTC -4)! If you haven’t, check out the features and join our Discord to catch up on the latest drama. See you very soon! Read more about L2Toggle and Kain on our site and forum!  
  • Topics

×
×
  • Create New...