<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.terramonmod.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AItem</id>
	<title>Module:Item - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.terramonmod.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AItem"/>
	<link rel="alternate" type="text/html" href="https://wiki.terramonmod.com/index.php?title=Module:Item&amp;action=history"/>
	<updated>2026-07-13T08:11:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.terramonmod.com/index.php?title=Module:Item&amp;diff=17&amp;oldid=prev</id>
		<title>JamzOJamz: Created page with &quot;------- l10n info -------------- local l10n_info = { 	[&#039;en&#039;] = { 		[&#039;id_text_item&#039;] = &#039;Internal Item ID: &#039;, 		[&#039;id_text_tile&#039;] = &#039;Internal Tile ID: &#039;, 		[&#039;id_text_wall&#039;] = &#039;Internal Wall ID: &#039;, 		[&#039;id_text_npc&#039;] = &#039;Internal NPC ID: &#039;, 		[&#039;id_text_mount&#039;] = &#039;Internal Mount ID: &#039;, 		[&#039;id_text_buff&#039;] = &#039;Internal Buff ID: &#039;, 		[&#039;id_text_projectile&#039;] = &#039;Internal Projectile ID: &#039;,...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.terramonmod.com/index.php?title=Module:Item&amp;diff=17&amp;oldid=prev"/>
		<updated>2025-11-23T20:00:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;------- l10n info -------------- local l10n_info = { 	[&amp;#039;en&amp;#039;] = { 		[&amp;#039;id_text_item&amp;#039;] = &amp;#039;Internal &lt;a href=&quot;/index.php?title=Item_IDs&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Item IDs (page does not exist)&quot;&gt;Item ID&lt;/a&gt;: &amp;#039;, 		[&amp;#039;id_text_tile&amp;#039;] = &amp;#039;Internal &lt;a href=&quot;/index.php?title=Tile_IDs&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Tile IDs (page does not exist)&quot;&gt;Tile ID&lt;/a&gt;: &amp;#039;, 		[&amp;#039;id_text_wall&amp;#039;] = &amp;#039;Internal &lt;a href=&quot;/index.php?title=Wall_IDs&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Wall IDs (page does not exist)&quot;&gt;Wall ID&lt;/a&gt;: &amp;#039;, 		[&amp;#039;id_text_npc&amp;#039;] = &amp;#039;Internal &lt;a href=&quot;/index.php?title=NPC_IDs&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;NPC IDs (page does not exist)&quot;&gt;NPC ID&lt;/a&gt;: &amp;#039;, 		[&amp;#039;id_text_mount&amp;#039;] = &amp;#039;Internal &lt;a href=&quot;/index.php?title=Mount_IDs&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Mount IDs (page does not exist)&quot;&gt;Mount ID&lt;/a&gt;: &amp;#039;, 		[&amp;#039;id_text_buff&amp;#039;] = &amp;#039;Internal &lt;a href=&quot;/index.php?title=Buff_IDs&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Buff IDs (page does not exist)&quot;&gt;Buff ID&lt;/a&gt;: &amp;#039;, 		[&amp;#039;id_text_projectile&amp;#039;] = &amp;#039;Internal &lt;a href=&quot;/index.php?title=Projectile_IDs&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Projectile IDs (page does not exist)&quot;&gt;Projectile ID&lt;/a&gt;: &amp;#039;,...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;------- l10n info --------------&lt;br /&gt;
local l10n_info = {&lt;br /&gt;
	[&amp;#039;en&amp;#039;] = {&lt;br /&gt;
		[&amp;#039;id_text_item&amp;#039;] = &amp;#039;Internal [[Item IDs|Item ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_tile&amp;#039;] = &amp;#039;Internal [[Tile IDs|Tile ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_wall&amp;#039;] = &amp;#039;Internal [[Wall IDs|Wall ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_npc&amp;#039;] = &amp;#039;Internal [[NPC IDs|NPC ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_mount&amp;#039;] = &amp;#039;Internal [[Mount IDs|Mount ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_buff&amp;#039;] = &amp;#039;Internal [[Buff IDs|Buff ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_projectile&amp;#039;] = &amp;#039;Internal [[Projectile IDs|Projectile ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_armor&amp;#039;] = &amp;#039;Internal [[Armor IDs|Armor ID]]: &amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
	[&amp;#039;de&amp;#039;] = {&lt;br /&gt;
		[&amp;#039;id_text_item&amp;#039;] = &amp;#039;Interne [[Gegenstands-IDs|Gegenstands-ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_tile&amp;#039;] = &amp;#039;Interne [[Feld-IDs|Feld-ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_wall&amp;#039;] = &amp;#039;Interne [[Wand-IDs|Wand-ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_npc&amp;#039;] = &amp;#039;Interne [[NPC-IDs|NPC-ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_mount&amp;#039;] = &amp;#039;Interne [[Reittier-IDs|Reittier-ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_buff&amp;#039;] = &amp;#039;Interne [[Statuseffekt-IDs|Statuseffekt-ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_projectile&amp;#039;] = &amp;#039;Interne [[Projektil-IDs|Projektil-ID]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_armor&amp;#039;] = &amp;#039;Interne [[Projektil-IDs|Projektil-ID]]: &amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
	[&amp;#039;fr&amp;#039;] = {&lt;br /&gt;
		[&amp;#039;id_text_item&amp;#039;] = &amp;#039;[[Item IDs|ID interne de l\&amp;#039;objet]]&amp;amp;#32;: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_tile&amp;#039;] = &amp;#039;[[Tile IDs|ID interne de la tuile]]&amp;amp;#32;: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_wall&amp;#039;] = &amp;#039;[[Wall IDs|ID interne du mur]]&amp;amp;#32;: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_npc&amp;#039;] = &amp;#039;[[NPC IDs|ID interne du PNJ]]&amp;amp;#32;: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_mount&amp;#039;] = &amp;#039;[[Mount IDs|ID interne de la monture]]&amp;amp;#32;: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_buff&amp;#039;] = &amp;#039;[[Buff IDs|ID interne du buff]]&amp;amp;#32;: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_projectile&amp;#039;] = &amp;#039;[[Projectile IDs|ID interne du projectile]]&amp;amp;#32;: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_armor&amp;#039;] = &amp;#039;[[Armor IDs|ID interne de l\&amp;#039;armure]]&amp;amp;#32;: &amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
	[&amp;#039;hu&amp;#039;] = {&lt;br /&gt;
		[&amp;#039;id_text_item&amp;#039;] = &amp;#039;[[Tárgyi adatértékek|Tárgyi]] adatértéke: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_tile&amp;#039;] = &amp;#039;[[Kockabeli adatértékek|Kockabeli]] adatértéke: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_wall&amp;#039;] = &amp;#039;[[Fali adatértékek|Fali]] adatértéke: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_npc&amp;#039;] = &amp;#039;[[Ellenféli adatértékek|Ellenféli]] adatértéke: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_mount&amp;#039;] = &amp;#039;[[Hátasbeli adatértékek|Hátasbeli]] adatértéke: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_buff&amp;#039;] = &amp;#039;[[Hatásbeli adatértékek|Hatásbeli]] adatértéke: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_projectile&amp;#039;] = &amp;#039;[[Lövedéki adatértékek|Lövedéki]] adatértéke: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_armor&amp;#039;] = &amp;#039;[[Páncélbeli adatértékek|Páncélbeli]] adatértéke: &amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
	[&amp;#039;it&amp;#039;] = {&lt;br /&gt;
		[&amp;#039;id_text_item&amp;#039;] = &amp;#039;[[Item IDs/it|ID Oggetto Interno]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_tile&amp;#039;] = &amp;#039;[[Tile IDs/it|ID Tile Interno]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_wall&amp;#039;] = &amp;#039;[[Wall IDs/it|ID Muro Interno]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_npc&amp;#039;] = &amp;#039;[[NPC IDs/it|ID PNG Interno]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_mount&amp;#039;] = &amp;#039;[[Mount IDs/it|ID Montatura Interna]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_buff&amp;#039;] = &amp;#039;[[Buff IDs/it|ID Buff Interno]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_projectile&amp;#039;] = &amp;#039;[[Projectile IDs/it|ID Proiettile Interno]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_armor&amp;#039;] = &amp;#039;[[Armor IDs/it|ID Armatura Interna]]: &amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
	[&amp;#039;ru&amp;#039;] = {&lt;br /&gt;
		[&amp;#039;id_text_item&amp;#039;] = &amp;#039;Внутренний [[Идентификаторы предметов|ID предмета]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_tile&amp;#039;] = &amp;#039;Внутренний [[Идентификаторы тайлов|ID тайла]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_wall&amp;#039;] = &amp;#039;Внутренний [[Идентификаторы стен|ID стены]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_npc&amp;#039;] = &amp;#039;Внутренний [[Идентификаторы существ|ID существа]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_mount&amp;#039;] = &amp;#039;Внутренний [[Идентификаторы средств передвижения|ID сред. передвиж.]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_buff&amp;#039;] = &amp;#039;Внутренний [[Идентификаторы бафов|ID бафа]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_projectile&amp;#039;] = &amp;#039;Внутренний [[Идентификаторы снарядов|ID снаряда]]: &amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_armor&amp;#039;] = &amp;#039;Внутренний [[Идентификаторы брони|ID брони]]: &amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
	[&amp;#039;zh&amp;#039;] = {&lt;br /&gt;
		[&amp;#039;id_text_item&amp;#039;] = &amp;#039;内部[[物品 ID]]：&amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_tile&amp;#039;] = &amp;#039;内部[[图格 ID]]：&amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_wall&amp;#039;] = &amp;#039;内部[[墙 ID]]：&amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_npc&amp;#039;] = &amp;#039;内部 [[NPC ID]]：&amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_mount&amp;#039;] = &amp;#039;内部[[坐骑 ID]]：&amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_buff&amp;#039;] = &amp;#039;内部[[增益 ID]]：&amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_projectile&amp;#039;] = &amp;#039;内部[[射弹 ID]]：&amp;#039;,&lt;br /&gt;
		[&amp;#039;id_text_armor&amp;#039;] = &amp;#039;内部[[盔甲 ID]]：&amp;#039;,&lt;br /&gt;
	},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
------- The following is not related to l10n. --------------&lt;br /&gt;
&lt;br /&gt;
local trim = mw.text.trim&lt;br /&gt;
local cargo = mw.ext.cargo&lt;br /&gt;
&lt;br /&gt;
local tr = require(&amp;#039;Module:Tr&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local currentFrame&lt;br /&gt;
local args_table&lt;br /&gt;
local lang&lt;br /&gt;
local l10n_table&lt;br /&gt;
&lt;br /&gt;
local l10n = function(key)&lt;br /&gt;
	return l10n_table[key] or l10n_info[&amp;#039;en&amp;#039;][key]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local getArg = function(key)&lt;br /&gt;
	local value = args_table[key]&lt;br /&gt;
	if not value then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	value = trim(value)&lt;br /&gt;
	if value == &amp;#039;&amp;#039; then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	return value&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function parse(str)&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for s in string.gmatch(str, &amp;#039;%b@^&amp;#039;) do &lt;br /&gt;
		local k,v = string.match(s, &amp;#039;^@(.-):(.*)^$&amp;#039;)&lt;br /&gt;
		args[k] = v&lt;br /&gt;
	end&lt;br /&gt;
	args[1] = args[&amp;#039;name&amp;#039;]&lt;br /&gt;
	args[2] = args[&amp;#039;text&amp;#039;]&lt;br /&gt;
	return args&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- credit: http://richard.warburton.it&lt;br /&gt;
-- this version is with trim.&lt;br /&gt;
local function explode(div,str) &lt;br /&gt;
	if (div==&amp;#039;&amp;#039;) then return false end&lt;br /&gt;
	local pos,arr = 0,{}&lt;br /&gt;
	-- for each divider found&lt;br /&gt;
	for st,sp in function() return string.find(str,div,pos,true) end do&lt;br /&gt;
		arr[#arr + 1] = trim(string.sub(str,pos,st-1)) -- Attach chars left of current divider&lt;br /&gt;
		pos = sp + 1 -- Jump past current divider&lt;br /&gt;
	end&lt;br /&gt;
	arr[#arr + 1] = trim(string.sub(str,pos)) -- Attach chars right of last divider&lt;br /&gt;
	return arr&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function parseSize(size)&lt;br /&gt;
	if not size then return end&lt;br /&gt;
	local basescale, width, height&lt;br /&gt;
	size, basescale = unpack(explode(&amp;#039;*&amp;#039;, size))&lt;br /&gt;
	if size ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		width, height = unpack(explode(&amp;#039;x&amp;#039;, string.gsub(size, &amp;#039;px&amp;#039;, &amp;#039;&amp;#039;)))&lt;br /&gt;
		width, height = tonumber(width), tonumber(height)&lt;br /&gt;
		if width == 0 then width = nil end&lt;br /&gt;
		if height == 0 then height = nil end&lt;br /&gt;
	end&lt;br /&gt;
	return basescale, width, height&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getInfoFromCargo(image)&lt;br /&gt;
	-- try to get from cargo cache&lt;br /&gt;
	local result = mw.ext.cargo.query(&amp;#039;Imageinfo&amp;#039;, &amp;#039;width, height, cached&amp;#039;, {&lt;br /&gt;
		where = &amp;#039;image=&amp;#039;.. &amp;quot;&amp;#039;&amp;quot;..image:gsub(&amp;quot;&amp;#039;&amp;quot;, &amp;quot;\\&amp;#039;&amp;quot;):gsub(&amp;quot;&amp;amp;#39;&amp;quot;, &amp;quot;\\&amp;#039;&amp;quot;)..&amp;quot;&amp;#039;&amp;quot;,&lt;br /&gt;
		orderBy = &amp;quot;cached DESC&amp;quot;,&lt;br /&gt;
		limit = 1,&lt;br /&gt;
	})&lt;br /&gt;
	for _, row in ipairs(result) do&lt;br /&gt;
		return tonumber(row[&amp;#039;width&amp;#039;]), tonumber(row[&amp;#039;height&amp;#039;]), row[&amp;#039;cached&amp;#039;]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function storeInfoToCargo(image)&lt;br /&gt;
	local width, height&lt;br /&gt;
	width = tonumber(currentFrame:callParserFunction( &amp;#039;#imgw&amp;#039;, image))&lt;br /&gt;
	if width and width ~= 0 then -- save one expensive call when the file is not a valid image.&lt;br /&gt;
		height = tonumber(currentFrame:callParserFunction( &amp;#039;#imgh&amp;#039;, image))&lt;br /&gt;
		if height and height ~= 0 then&lt;br /&gt;
			currentFrame:callParserFunction(&amp;#039;#cargo_store:_table=Imageinfo&amp;#039;,{&lt;br /&gt;
				image = image,&lt;br /&gt;
				width = width,&lt;br /&gt;
				height = height,&lt;br /&gt;
				cached = os.time(),&lt;br /&gt;
			})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return width, height&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getSizeInfo(image)&lt;br /&gt;
	local width, height, cached = getInfoFromCargo(image)&lt;br /&gt;
	-- cache missed, init cache&lt;br /&gt;
	if not cached then&lt;br /&gt;
		width, height = storeInfoToCargo(image)&lt;br /&gt;
	end&lt;br /&gt;
	if width == 0 then width = nil end&lt;br /&gt;
	if height == 0 then height = nil end&lt;br /&gt;
	return width, height&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getImageSize(image, width, height, scale, maxwidth, maxheight)&lt;br /&gt;
	-- get size info from image file itself (may be expensive)&lt;br /&gt;
	local w, h = getSizeInfo(image) -- store data to cache&lt;br /&gt;
&lt;br /&gt;
	if not width and not height and (scale or maxwidth or maxheight) then&lt;br /&gt;
		width, height = w, h&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- apply scale to width/height if needed&lt;br /&gt;
	if scale then&lt;br /&gt;
		if width then width = width * scale end&lt;br /&gt;
		if height then height = height * scale end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- apply maxwidth/maxheight.&lt;br /&gt;
	if maxwidth then&lt;br /&gt;
		if width then&lt;br /&gt;
			if width &amp;gt; maxwidth then width = maxwidth end&lt;br /&gt;
		else&lt;br /&gt;
			if height then width = maxwidth end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if maxheight then&lt;br /&gt;
		if height then&lt;br /&gt;
			if height &amp;gt; maxheight then height = maxheight end&lt;br /&gt;
		else&lt;br /&gt;
			if width then height = maxheight end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- rounding&lt;br /&gt;
	if width then width = math.ceil(width) end&lt;br /&gt;
	if height then height = math.ceil(height) end&lt;br /&gt;
&lt;br /&gt;
	return width, height&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function parseMaxSize(maxsize)&lt;br /&gt;
	if not maxsize then return end&lt;br /&gt;
	local maxwidth, maxheight = unpack(explode(&amp;#039;x&amp;#039;, string.gsub(maxsize, &amp;#039;px&amp;#039;, &amp;#039;&amp;#039;)))&lt;br /&gt;
	maxwidth, maxheight = tonumber(maxwidth), tonumber(maxheight)&lt;br /&gt;
	if maxwidth == 0 then maxwidth = nil end&lt;br /&gt;
	if maxheight == 0 then maxheight = nil end&lt;br /&gt;
	return maxwidth, maxheight&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function imagecode(image, link, text, size, scale, maxsize)&lt;br /&gt;
	local image_output = &amp;#039;[[File:&amp;#039; .. image .. &amp;#039;|link=&amp;#039;.. link .. &amp;#039;|&amp;#039; .. text&lt;br /&gt;
	if size or scale or maxsize then&lt;br /&gt;
		local basescale, width, height = parseSize(size) -- width,height: number or nil&lt;br /&gt;
		scale = (tonumber(scale) or 1) * (tonumber(basescale) or 1)&lt;br /&gt;
		if scale == 0 or scale == 1 then&lt;br /&gt;
			scale = nil&lt;br /&gt;
		end&lt;br /&gt;
		local maxwidth, maxheight = parseMaxSize(maxsize)&lt;br /&gt;
		width, height = getImageSize(image, width, height, scale, maxwidth, maxheight) -- can be 0&lt;br /&gt;
		if width or height then&lt;br /&gt;
			return image_output .. &amp;#039;|&amp;#039; .. (width or &amp;#039;&amp;#039;) .. &amp;#039;x&amp;#039; .. (height or &amp;#039;&amp;#039;) .. &amp;#039;px]]&amp;#039;&lt;br /&gt;
		else&lt;br /&gt;
			return image_output .. &amp;#039;]]&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return image_output .. &amp;#039;]]&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function images(image, link, text, size, scale, maxsize)&lt;br /&gt;
	&lt;br /&gt;
	if not image:find(&amp;#039;/&amp;#039;) then&lt;br /&gt;
		return imagecode(image, link, text, size, scale, maxsize)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	image = explode(&amp;#039;/&amp;#039;, image)&lt;br /&gt;
	local result = &amp;#039;&amp;#039;&lt;br /&gt;
	if size and size:find(&amp;#039;/&amp;#039;) then&lt;br /&gt;
		size = explode(&amp;#039;/&amp;#039;, size)&lt;br /&gt;
		for i, v in ipairs(image) do&lt;br /&gt;
			result = result .. imagecode(v, link, text, size[i], scale, maxsize)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		for i, v in ipairs(image) do&lt;br /&gt;
			result = result .. imagecode(v, link, text, size, scale, maxsize)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local getIdText = function(_type)&lt;br /&gt;
	local id_text&lt;br /&gt;
	if _type == &amp;#039;item&amp;#039; then -- a shortcut for faster&lt;br /&gt;
		id_text = l10n(&amp;#039;id_text_item&amp;#039;)&lt;br /&gt;
	elseif _type == &amp;#039;tile&amp;#039; then&lt;br /&gt;
		id_text = l10n(&amp;#039;id_text_tile&amp;#039;)&lt;br /&gt;
	elseif _type == &amp;#039;wall&amp;#039; then&lt;br /&gt;
		id_text = l10n(&amp;#039;id_text_wall&amp;#039;)&lt;br /&gt;
	elseif _type == &amp;#039;npc&amp;#039; then&lt;br /&gt;
		id_text = l10n(&amp;#039;id_text_npc&amp;#039;)&lt;br /&gt;
	elseif _type == &amp;#039;mount&amp;#039; then&lt;br /&gt;
		id_text = l10n(&amp;#039;id_text_mount&amp;#039;)&lt;br /&gt;
	elseif _type == &amp;#039;buff&amp;#039; or _type == &amp;#039;debuff&amp;#039; then&lt;br /&gt;
		id_text = l10n(&amp;#039;id_text_buff&amp;#039;)&lt;br /&gt;
	elseif _type == &amp;#039;projectile&amp;#039; then&lt;br /&gt;
		id_text = l10n(&amp;#039;id_text_projectile&amp;#039;)&lt;br /&gt;
	elseif _type == &amp;#039;armor&amp;#039; then&lt;br /&gt;
		id_text = l10n(&amp;#039;id_text_armor&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		id_text = l10n(&amp;#039;id_text_item&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	return id_text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------&lt;br /&gt;
-- main return object&lt;br /&gt;
return {&lt;br /&gt;
parse = parse,		&lt;br /&gt;
go = function(frame, args)&lt;br /&gt;
	-- init cache&lt;br /&gt;
	currentFrame = frame&lt;br /&gt;
	args_table = args or parse(frame.args[1])&lt;br /&gt;
	lang = getArg(&amp;#039;lang&amp;#039;) or &amp;#039;en&amp;#039;&lt;br /&gt;
	l10n_table = l10n_info[lang] or l10n_info[&amp;#039;en&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
	local _arg1 = getArg(1) or &amp;#039;&amp;#039;&lt;br /&gt;
	local _nolink = getArg(&amp;#039;nolink&amp;#039;)&lt;br /&gt;
	local _link = _nolink and &amp;#039;&amp;#039; or getArg(&amp;#039;link&amp;#039;) or tr.translateLink(_arg1, lang) -- now:  _link == &amp;#039;&amp;#039;  means nolink.&lt;br /&gt;
&lt;br /&gt;
	local text = getArg(2) or &amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
	local hovertext&lt;br /&gt;
	if _arg1 ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		hovertext = tr.translate(_arg1, lang)&lt;br /&gt;
	elseif text ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		hovertext = text&lt;br /&gt;
	else&lt;br /&gt;
		hovertext = _link&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local class = &amp;#039;i&amp;#039;&lt;br /&gt;
&lt;br /&gt;
	local output_image, output_text, output_table, output_htmltable = true, true, false, false&lt;br /&gt;
	local _mode = getArg(&amp;#039;mode&amp;#039;)&lt;br /&gt;
	if _mode then&lt;br /&gt;
		if _mode == &amp;#039;image&amp;#039; or _mode == &amp;#039;imageonly&amp;#039; or _mode ==&amp;#039;onlyimage&amp;#039; then&lt;br /&gt;
			output_text = false&lt;br /&gt;
		elseif _mode == &amp;#039;text&amp;#039; or _mode == &amp;#039;noimage&amp;#039; then&lt;br /&gt;
			output_image = false&lt;br /&gt;
		elseif _mode == &amp;#039;table&amp;#039; or _mode == &amp;#039;2-cell&amp;#039; then&lt;br /&gt;
			output_table = true&lt;br /&gt;
		elseif _mode == &amp;#039;htmltable&amp;#039; or _mode == &amp;#039;html-2-cell&amp;#039; then&lt;br /&gt;
			output_htmltable = true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local image_output, text_output&lt;br /&gt;
	if output_image then&lt;br /&gt;
		local image_arg = string.gsub(_arg1, &amp;quot;:%s*&amp;quot;, &amp;quot; &amp;quot;)&lt;br /&gt;
		if _arg1 == &amp;#039;1/2 Second Timer&amp;#039; then&lt;br /&gt;
			image_arg = &amp;#039;1 2 Second Timer&amp;#039;&lt;br /&gt;
		elseif _arg1 == &amp;#039;1/4 Second Timer&amp;#039; then&lt;br /&gt;
			image_arg = &amp;#039;1 4 Second Timer&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		image_arg = getArg(&amp;#039;image&amp;#039;) or image_arg .. &amp;#039;.&amp;#039; .. (getArg(&amp;#039;ext&amp;#039;) or &amp;#039;png&amp;#039;)&lt;br /&gt;
		image_output = images(image_arg, _link, hovertext, getArg(&amp;#039;size&amp;#039;), getArg(&amp;#039;scale&amp;#039;), getArg(&amp;#039;maxsize&amp;#039;))&lt;br /&gt;
	else&lt;br /&gt;
		image_output = &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	if output_text then&lt;br /&gt;
		local _note, _note2, _showid, _id = getArg(&amp;#039;note&amp;#039;), getArg(&amp;#039;note2&amp;#039;), getArg(&amp;#039;showid&amp;#039;), getArg(&amp;#039;id&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
		if _id and not _showid then&lt;br /&gt;
			_showid = true&lt;br /&gt;
		end&lt;br /&gt;
		if _showid and (_showid == &amp;#039;n&amp;#039; or _showid == &amp;#039;no&amp;#039;) then&lt;br /&gt;
			_showid = false&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local _wrap&lt;br /&gt;
		if _showid or _note2 then&lt;br /&gt;
			_wrap = false&lt;br /&gt;
		else&lt;br /&gt;
			_wrap = getArg(&amp;#039;wrap&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if _link ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			if text == _link then&lt;br /&gt;
				text = &amp;#039;&amp;lt;span&amp;gt;[[&amp;#039;..text..&amp;#039;]]&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
			else&lt;br /&gt;
				text = &amp;#039;&amp;lt;span&amp;gt;[[&amp;#039;.._link..&amp;#039;|&amp;#039;..text..&amp;#039;]]&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			text = &amp;#039;&amp;lt;span title=&amp;quot;&amp;#039;..hovertext..&amp;#039;&amp;quot;&amp;gt;&amp;#039;..text..&amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local content = text -- item name link text first.&lt;br /&gt;
		-- &amp;#039;-w&amp;#039; class means &amp;#039;wrapmode&amp;#039;, optimized for multiple lines of text. But it should be disabled for single line text.&lt;br /&gt;
		if _wrap then&lt;br /&gt;
			-- note in next line&lt;br /&gt;
			if _note then&lt;br /&gt;
				class = class .. &amp;#039; -w&amp;#039;&lt;br /&gt;
				content = content .. &amp;#039;&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;&amp;#039; .. _note .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			-- note first&lt;br /&gt;
			if _note then&lt;br /&gt;
				content = content .. &amp;#039;&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;&amp;#039; .. _note .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
			if _note2 then&lt;br /&gt;
				class = class .. &amp;#039; -w&amp;#039;&lt;br /&gt;
				content = content .. &amp;#039;&amp;lt;div class=&amp;quot;note&amp;quot;&amp;gt;&amp;#039; .. _note2 .. &amp;#039;&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
			if _showid then&lt;br /&gt;
				class = class .. &amp;#039; -w&amp;#039;&lt;br /&gt;
				local idtype = (getArg(&amp;#039;type&amp;#039;) or &amp;#039;item&amp;#039;):lower() &lt;br /&gt;
				if not _id then&lt;br /&gt;
					_id = frame:expandTemplate{ title = idtype .. &amp;#039;IdFromName&amp;#039;, args = {_arg1} }&lt;br /&gt;
				end&lt;br /&gt;
				local id_text = getIdText(idtype)&lt;br /&gt;
				content = content .. &amp;#039;&amp;lt;div class=&amp;quot;id&amp;quot;&amp;gt;&amp;#039; .. id_text .. _id .. &amp;#039;&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		text_output = &amp;#039;&amp;lt;span&amp;gt;&amp;#039; .. content .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		text_output = &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local _class, _css = getArg(&amp;#039;class&amp;#039;), getArg(&amp;#039;css&amp;#039;)&lt;br /&gt;
	if _class then&lt;br /&gt;
		class = class .. &amp;#039; &amp;#039; .. _class&lt;br /&gt;
	end&lt;br /&gt;
	local attr = {class = class}&lt;br /&gt;
	if _css then&lt;br /&gt;
		attr.style = _css&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local anchor = &amp;#039;&amp;#039;&lt;br /&gt;
	if getArg(&amp;#039;anchor&amp;#039;) then&lt;br /&gt;
		anchor = mw.text.tag(&amp;#039;div&amp;#039;, {id=frame:callParserFunction(&amp;#039;anchorencode&amp;#039;, _arg1), class=&amp;#039;anchor&amp;#039;}, &amp;#039;&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	if output_table then&lt;br /&gt;
		attr.class = class .. &amp;#039; block aligncenter&amp;#039;&lt;br /&gt;
		local result = mw.text.tag(&amp;#039;span&amp;#039;, attr, image_output) .. &amp;#039;||&amp;#039;&lt;br /&gt;
		attr.class = class .. &amp;#039; block alignleft&amp;#039;&lt;br /&gt;
		return result .. mw.text.tag(&amp;#039;span&amp;#039;, attr, text_output .. anchor)&lt;br /&gt;
	elseif output_htmltable then&lt;br /&gt;
		attr.class = class .. &amp;#039; block aligncenter&amp;#039;&lt;br /&gt;
		local result = mw.text.tag(&amp;#039;span&amp;#039;, attr, image_output) .. &amp;#039;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;#039;&lt;br /&gt;
		attr.class = class .. &amp;#039; block alignleft&amp;#039;&lt;br /&gt;
		return result .. mw.text.tag(&amp;#039;span&amp;#039;, attr, text_output .. anchor)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.text.tag(&amp;#039;span&amp;#039;, attr, image_output .. text_output .. anchor)&lt;br /&gt;
	end&lt;br /&gt;
end,&lt;br /&gt;
	&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>JamzOJamz</name></author>
	</entry>
</feed>