Difference between revisions of "LUA:AddQuestPrereqQuest"

 
Line 1: Line 1:
= LUA Functions: AddQuestPrereqQuest() =
+
{{LUAFunction
Adds a quest prerequisite to the given quest.
+
|Name = AddQuestPrereqQuest
 
+
|Description = Adds a quest prerequisite to the given quest.
 
+
|Param1 = Quest
==== Syntax ====
+
|Param1Desc = is the quest we are adding a prerequisite to
AddQuestPrereqQuest(param1, param2)
+
|Param2 = int32
 
+
|Param2Desc = is the id of the prerequisite quest
 
+
|Example =
==== Parameters ====
 
; Required - ''param1'' (Quest), ''param2'' (int32)
 
: ''param1'' is the quest we are adding a prerequisite to
 
: ''param2'' is the id of the prerequisite quest
 
 
 
==== Usage ====
 
 
<pre>
 
<pre>
 
function Init(Quest)
 
function Init(Quest)
Line 19: Line 13:
 
end
 
end
 
</pre>
 
</pre>
 
+
|ExampleDesc = Only a player who has completed the quest with id 2 can do this quest.
Only a player who has completed the quest with id 2 can do this quest.
+
|Notes = While this function should still work it is now prefered to add quest prerequisite data into the DB.
 +
}}

Latest revision as of 12:18, 30 January 2021


LUA:AllFunctions - AddQuestPrereqQuest

Return to: LUA:AllFunctions | Tutorials | Portal | Forum | Project Manager | Bug Tracker


Adds a quest prerequisite to the given quest.

Syntax

AddQuestPrereqQuest(param1, param2)

Parameters

Required - param1 (Quest), param2 (int32)
param1 is the quest we are adding a prerequisite to
param2 is the id of the prerequisite quest


Example

function Init(Quest)
    -- can only do this quest if you have completed quest 2
    AddQuestPrereqQuest(Quest, 2)
end

Only a player who has completed the quest with id 2 can do this quest.

Notes

While this function should still work it is now prefered to add quest prerequisite data into the DB.