API:GetQuestRequest

Returns information about quests and their goals.
GetQuestRequest(index,arg2)
== Parameters==
=== Arguments===
: index
::The quest index number. possible values 1 to 30
: arg2
:: The value returned depends on this value.
=== Returns===
Returned information depends on the value given by 'arg2'.
arg2	Returned value
-3 	integer - Quest level
-2 	string - Quest name
-1 	integer - Number of goals required by quest to complete
1..n	string, integer - Name and status of goal (status = 0 if not complete and 1 if complete)
== note==
:* The number of goals is not the number of items. If you have to collect 10 of one item then that is 1 goal.
== Example==
Untested
function GetGoals(questID)
 questInfo = {}
 questInfo.level = GetQuestRequest(questID,-3) -- The level of the quest
 questInfo.name = GetQuestRequest(questID,-2) -- The name of the quest
 questInfo.goalnumber = GetQuestRequest(questID,-1) -- Number of goals to complete quest
 for i = 1, questInfo.goalnumber do -- For each goal get name and status
 questInfo[i] = {}
 questInfo[i].goalname, questInfo[i].goalstatus = GetQuestRequest(questID,i)
 end
 return questInfo -- Return object with quest info
end
Category:Functions