Shared function

From Gothic 2 Online: Wiki
Jump to navigation Jump to search

This function was added in version:

Function gets item id by it's instance. Items must be registered in items.xml file, in order to be able to, for example: give item for specifc player.

NOTE! After server restart, every item does have different id. The id is the same on both sides. You should only use item id in functions, not in save eq, etc.


int instance)

Required Arguments

  • instance: The item code.


  • int: If item is registered in items.xml it will return it's id, otherwise -1.


	local itemId ="ITMI_GOLD"))
	print("ITMI_GOLD id: "+itemId); // it will print item id of ITMI_GOLD

Related functions