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

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

    • Hello, I'm completely sharing my first attempt of functional PvE & PvP level/gear based independed phantoms. This source is completely made by AI so no hard critisism please. The extension is in a very early stage and it's not tested properly so its NOT supposed to be used in a live server yet because it still needs stability/optimization improvements.   The architecture is already done, third class behaviors are looking good (but still needs adjustments mostly for melee classes). I am currently dealing with second occupation classes functionality (most of them are functional).   The extension will automatically create the lucera_autobots table on starting the gameserver and then you will be able to populate the table with many rows of bots manually or save them to DB through the ingame bot's panel, you can also create temporary bots by not hitting the "Save Bot" button. The clan can be added to the bots as clanID through lucera_autobots DB table, the clan has to be owned by a real player with or without alliance, the bot will be spawned with the clan or clan+ally crest.     Request for advices and ideas: At the moment i haven't figured out an easy way (other than building a full navigation system of the world) to make the bot understand the geodata, avoid all the city obstacles and walk to gatekeeper, then travel back to the farming location on foot and avoid any obstacles and town layout so at this current state the bots are doing this: on death > go to village > stay idle for 30 seconds (time delay can be configured from the bot's management panel or through the DB table) > directly teleport back to death location.   On in-game, use //autobots command and create bots normally through the panel's options. NOTE: The bots will not attack a gm character.               LATEST CHANGELOGS SINCE BUILD M28: M29: Improved the mechanics and behavior for all the second and third classes. Added/adjusted PvP skills and self-buffs for many classes. Improved Tyrant/Grand Khavatari combat and force-charge behavior. Added tank skill/auto-attack rotations. Added Bladedancer dances/debuff behavior. Added mage skills such as Silence, Curse Fear, Aura Flash, Ice Dagger and Frost Bolt with usage limits. Increased dagger Switch usage to 25%. Added obstacle escape movement when bots get stuck while RETURNING to their farm area. M30: Reduced the pause after tank and archer sidestep movements so they re-engage faster. Improved Titan/Destroyer combat recovery and added Braveheart condition. Started fixing Gladiator/Duelist charge/combat behavior. Verified all classes can use Idle, AttackFlagged, and AttackEveryone. Reinforced the rule that skills are used only when actually learned by the bot. M31: Fixed offensive mage combat-entry logic for AttackEveryone. Prevented hostile mage debuffs from being used as the initial action against peaceful players. M32: Added a farming-area watchdog so bots outside their configured farm range return instead of remaining stuck in FARMING. Fixed automatic teleport recovery so it cannot silently replace the bot's configured farm origin. M33: Removed the newer broken Gladiator/Duelist charge state-machine and restored more of the older M27-style combat logic. M34: Completely rewrote Gladiator/Duelist combat behavior Gladiator/Duelist now use the same core combat system in PvE and PvP. All skills remain level/learned-skill dependent. M43: Fixed a visual “jump/teleport” issue during PvP. Removed the extra manual position correction that was interfering with Lucera’s normal movement updates. Kept the old movement safety protections that prevent real long-distance rollback bugs. Added Vicious Stance toggle always ON for fighter classes when learned. Added Arcane Power toggle always ON for offensive mages level 78+ when learned. Improved potion usage so bots follow Lucera’s normal item cooldown behavior. Changed Warsmith weapons/shields for several level ranges. Added None as a buff package (the bot will spawn without buffs). Removed Greater CP Potions from level 1–39 bots. Reworked starter fighter equipment for levels 1–10 and 11–19. Corrected several starter class names in the autobots UI panel. Improved the Autobots panel layout. Improved spacing and descriptions on the Create Bot page. Added basic pagination to the autobots UI panel. Changed buttons toward Lucera’s native button style. Improved spacing around the bot list and search area. Added a search layout. Reworked the main page, Create Bot page, class selection and manage pages. No AI, combat, movement, inventory, or DB behavior was changed.   Next update milestone: Ensuring stability and optimization changes.  
    • ASocks.com provides residential, mobile and datacenter proxies with a pool of 7M+ IPs across 150+ locations. Built for web scraping, market research, ad verification, and automation, it offers flexible rotation, city- and ASN-level targeting, 24/7 support and transparent pricing with no traffic expiration.
    • SX.ORG is a global proxy platform offering residential, mobile,  and datacenter IPs for SEO, web scraping, ad verification and multi-account management. It provides flexible IP rotation, precise geo-targeting, HTTP(S)/SOCKS5 support, API access and pay-as-you-go pricing based only on the traffic you use.
  • 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..