<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetLiveEventTasks</id>
	<title>API:GetLiveEventTasks - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetLiveEventTasks"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetLiveEventTasks&amp;action=history"/>
	<updated>2026-10-18T06:58:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetLiveEventTasks&amp;diff=30422&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetLiveEventTasks&amp;diff=30422&amp;oldid=prev"/>
		<updated>2026-10-16T19:44:20Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=LiveEvent}}&lt;br /&gt;
Returns the tasks of a live event, the player&amp;#039;s progress, and the reward levels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tasks = GetLiveEventTasks(eventId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;eventId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Event id, as in [[API:GetLiveEventList|GetLiveEventList]].&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;tasks : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Array of the event&amp;#039;s top-level task tables (indexed from 1), plus the named fields below. Nothing is returned if the event is unknown or inactive.&lt;br /&gt;
&lt;br /&gt;
Named fields of &amp;lt;code&amp;gt;tasks&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;overallMaxValue&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;overallCurrentValue&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || The player&amp;#039;s overall progress. The stock UI compares it with the reward level thresholds.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;eligible&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || Whether the player is eligible for the event rewards.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;rewards&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Array of reward levels (see below).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each task table (also used for &amp;lt;code&amp;gt;subtasks&amp;lt;/code&amp;gt;):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;taskId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Task id.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Task name.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;maxValue&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Progress needed for the task.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;currentValue&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || The player&amp;#039;s progress on the task.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;isOnlyText&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;tooltipText&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Tooltip text.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;subtasks&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Array of child task tables with the same layout.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;textureName&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || Only for tasks that have a picture: the texture name. Load the picture with [[API:SetLiveEventTaskImage|SetLiveEventTaskImage]] before using it.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;textureRightAlign&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || Only for tasks that have a picture.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each reward level in &amp;lt;code&amp;gt;rewards&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;threshold&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Overall progress needed for this level.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;items&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Array of [[API:GetInventoryItemData#Item data table|item data tables]] for the level&amp;#039;s reward items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The tasks are in the array part of the table, so loop over them with &amp;lt;code&amp;gt;ipairs&amp;lt;/code&amp;gt;. The stock UI also checks &amp;lt;code&amp;gt;type(task) == &amp;quot;table&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Exactly one argument must be passed.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
These are written to the UI log, and the function returns nothing.&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;GetLiveEventTasks&amp;#039;: Event %d not found.&amp;lt;/code&amp;gt; (also for an event that exists but is inactive)&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_tomeofknowledge/source/tomewindow_liveevent.lua&amp;lt;/code&amp;gt;, finding the parent of a task:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local tasksList = GetLiveEventTasks( eventId )&lt;br /&gt;
local function RecursiveHelper( currentTasksList, parentTaskId )&lt;br /&gt;
    for _, task in ipairs( currentTasksList )&lt;br /&gt;
    do&lt;br /&gt;
        ...&lt;br /&gt;
        if ( task.taskId == taskId )&lt;br /&gt;
        then&lt;br /&gt;
            return true, parentTaskId&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        local didFind, foundParentTaskId = RecursiveHelper( task.subtasks, task.taskId )&lt;br /&gt;
        ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the same file, the reward progress bar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
levelPercent = ( LiveEventTasks.overallCurrentValue - lastLevelThreshold ) / ( LiveEventTasks.rewards[level].threshold - lastLevelThreshold )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:SetLiveEventTaskImage|SetLiveEventTaskImage]]&lt;br /&gt;
* [[API:GetLiveEventData|GetLiveEventData]]&lt;br /&gt;
* [[API:SelectEventRewards|SelectEventRewards]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>