<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mbwiki.stairwaygames.work/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AOffering_need</id>
	<title>Module:Offering need - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mbwiki.stairwaygames.work/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AOffering_need"/>
	<link rel="alternate" type="text/html" href="https://mbwiki.stairwaygames.work/w/index.php?title=Module:Offering_need&amp;action=history"/>
	<updated>2026-04-06T15:55:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://mbwiki.stairwaygames.work/w/index.php?title=Module:Offering_need&amp;diff=6886&amp;oldid=prev</id>
		<title>Admin coral island: Created page with &quot;local p = {} local lib = require(&#039;Module:Feature&#039;) local Offering = require(&#039;Module:Offering&#039;) local Parse = require(&#039;Module:Parser&#039;).getTemplateArgs local verifyQuality = require(&#039;Module:Icon&#039;).verifyQuality  function p.main(frame) 	local args = require(&#039;Module:Arguments&#039;).getArgs(frame, { 		parentOnly = false, 		wrapper = { &#039;Template:Offering need&#039; } 	}) 	return p._main(frame.args) end  function p._main(args) 	local data = Parse(&#039;Lake Temple&#039;, { only = &#039;Offering&#039; }) 	l...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mbwiki.stairwaygames.work/w/index.php?title=Module:Offering_need&amp;diff=6886&amp;oldid=prev"/>
		<updated>2023-08-09T10:40:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {} local lib = require(&amp;#039;Module:Feature&amp;#039;) local Offering = require(&amp;#039;Module:Offering&amp;#039;) local Parse = require(&amp;#039;Module:Parser&amp;#039;).getTemplateArgs local verifyQuality = require(&amp;#039;Module:Icon&amp;#039;).verifyQuality  function p.main(frame) 	local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, { 		parentOnly = false, 		wrapper = { &amp;#039;Template:Offering need&amp;#039; } 	}) 	return p._main(frame.args) end  function p._main(args) 	local data = Parse(&amp;#039;Lake Temple&amp;#039;, { only = &amp;#039;Offering&amp;#039; }) 	l...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
local lib = require(&amp;#039;Module:Feature&amp;#039;)&lt;br /&gt;
local Offering = require(&amp;#039;Module:Offering&amp;#039;)&lt;br /&gt;
local Parse = require(&amp;#039;Module:Parser&amp;#039;).getTemplateArgs&lt;br /&gt;
local verifyQuality = require(&amp;#039;Module:Icon&amp;#039;).verifyQuality&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, {&lt;br /&gt;
		parentOnly = false,&lt;br /&gt;
		wrapper = { &amp;#039;Template:Offering need&amp;#039; }&lt;br /&gt;
	})&lt;br /&gt;
	return p._main(frame.args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	local data = Parse(&amp;#039;Lake Temple&amp;#039;, { only = &amp;#039;Offering&amp;#039; })&lt;br /&gt;
	local out  = mw.html.create()&lt;br /&gt;
	local target = args.item&lt;br /&gt;
	local plural = args.item_plural&lt;br /&gt;
	local group = args.group&lt;br /&gt;
	local matches = {}&lt;br /&gt;
	for _, call in ipairs(data) do&lt;br /&gt;
		local settings = {&lt;br /&gt;
			delim = call.delim or &amp;#039;;&amp;#039;,&lt;br /&gt;
			amount_delim = call.amount_delim or &amp;#039;*&amp;#039;,&lt;br /&gt;
			quality_pattern = &amp;#039;^(.-)&amp;#039; .. (call.quality_delim or &amp;#039;/&amp;#039;) .. &amp;#039;(.*)$&amp;#039;,&lt;br /&gt;
		}&lt;br /&gt;
		local i = &amp;#039;1&amp;#039;&lt;br /&gt;
		while call[i .. &amp;#039;_items&amp;#039;] do&lt;br /&gt;
			for item in lib.gsplit(call[i .. &amp;#039;_items&amp;#039;], settings.delim) do&lt;br /&gt;
				local pre, quality = Offering.checkQuality(item, settings.quality_pattern)&lt;br /&gt;
				quality = verifyQuality(quality)&lt;br /&gt;
				local pre_parts = lib.split(pre, settings.amount_delim)&lt;br /&gt;
				local name = string.lower(pre_parts[1])&lt;br /&gt;
				local amount = pre_parts[2] or 1&lt;br /&gt;
				if name == target then&lt;br /&gt;
					local matching = mw.html.create()&lt;br /&gt;
					matching:tag(&amp;#039;b&amp;#039;):wikitext(amount)&lt;br /&gt;
					matching:wikitext(&amp;#039; &amp;#039;, lib.ternary(tonumber(amount)&amp;gt;1, plural, name), &amp;#039; of &amp;#039;)&lt;br /&gt;
					if quality then&lt;br /&gt;
						matching:wikitext(&amp;#039; at least &amp;#039;, quality)&lt;br /&gt;
					else&lt;br /&gt;
						matching:wikitext(&amp;#039; any&amp;#039;)&lt;br /&gt;
					end&lt;br /&gt;
					matching:wikitext(&amp;#039; quality&amp;#039;, lib.ternary(tonumber(amount)&amp;gt;1, &amp;#039; are &amp;#039;, &amp;#039; is &amp;#039;), &amp;#039;needed&amp;#039;)&lt;br /&gt;
					matching:wikitext(&amp;#039; for the [[Lake Temple#&amp;#039;, call[i .. &amp;#039;_name&amp;#039;], &amp;#039;|&amp;#039;, call[i .. &amp;#039;_name&amp;#039;], &amp;#039; offering]] in the  &amp;#039;, call.altar, &amp;#039; altar&amp;#039;)&lt;br /&gt;
					table.insert(matches, matching)&lt;br /&gt;
				elseif group ~= nil and name == (&amp;#039;any &amp;#039; .. group) then&lt;br /&gt;
					local matching = mw.html.create()&lt;br /&gt;
					matching:tag(&amp;#039;b&amp;#039;):wikitext(amount)&lt;br /&gt;
					matching:wikitext(&amp;#039; of [[&amp;#039;, name, &amp;#039;]]&amp;#039;, &amp;#039; of &amp;#039;)&lt;br /&gt;
					if quality then&lt;br /&gt;
						matching:wikitext(&amp;#039; at least &amp;#039;, quality)&lt;br /&gt;
					else&lt;br /&gt;
						matching:wikitext(&amp;#039; any&amp;#039;)&lt;br /&gt;
					end&lt;br /&gt;
					matching:wikitext(&amp;#039; quality&amp;#039;, lib.ternary(tonumber(amount)&amp;gt;1, &amp;#039; are &amp;#039;, &amp;#039; is &amp;#039;), &amp;#039;needed&amp;#039;)&lt;br /&gt;
					matching:wikitext(&amp;#039; for the [[Lake Temple#&amp;#039;, call[i .. &amp;#039;_name&amp;#039;], &amp;#039;|&amp;#039;, call[i .. &amp;#039;_name&amp;#039;], &amp;#039; offering]] in the  &amp;#039;, call.altar, &amp;#039; altar&amp;#039;)&lt;br /&gt;
					table.insert(matches, matching)&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			i = tostring(tonumber(i)+1)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if #matches == 1 then&lt;br /&gt;
		out:node(matches[1]):wikitext(&amp;#039;.&amp;#039;)&lt;br /&gt;
	elseif #matches == 2 then&lt;br /&gt;
		out:node(matches[1]):wikitext(&amp;#039;, and &amp;#039;):node(matches[2]):wikitext(&amp;#039;.&amp;#039;)&lt;br /&gt;
	elseif #matches &amp;gt; 2 then&lt;br /&gt;
		for match_num, match_str in ipairs(matches) do&lt;br /&gt;
			if match_num  == 1 then&lt;br /&gt;
				out:node(match_str)&lt;br /&gt;
			elseif match_num == #matches then&lt;br /&gt;
				out:wikitext(&amp;#039;, &amp;#039;):node(match_str)&lt;br /&gt;
			else&lt;br /&gt;
				out:wikitext(&amp;#039;, and &amp;#039;):node(match_str):wikitext(&amp;#039;.&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return out&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin coral island</name></author>
	</entry>
</feed>