Difference between revisions of "LUA:SetRequiredQuest"

(Created page with "= LUA Functions: SetRequiredQuest() = Sets a spawn as required for the given quest ==== Syntax ==== SetRequiredQuest(param1, param2, [param3]) ==== Parameters ==== ; Required...")
 
Line 4: Line 4:
  
 
==== Syntax ====
 
==== Syntax ====
SetRequiredQuest(param1, param2, [param3])
+
SetRequiredQuest(param1, param2, param3, [param4], [param5], [param6])
  
  
Line 11: Line 11:
 
: ''param1'' is the spawn we want to set
 
: ''param1'' is the spawn we want to set
 
: ''param2'' is the quest ID that requires it
 
: ''param2'' is the quest ID that requires it
; Optional - ''param3'' (int32)
 
 
: ''param3'' is the step that requires it
 
: ''param3'' is the step that requires it
 +
; Optional - ''param4'' (int8), ''param5'' (int8), ''param6'' (int16)
 +
: ''param4'' sets a spawn as private when the player does not meet quest reqs, grants access when they do. Set as 1 if used.
 +
: ''param5'' grants access after the specified quest step is completed, including after finishing a quest.
 +
: ''param6'' vis_flags override value to be used while a player does not meet quest reqs, uses vis_flags as normal when they do.
  
  
Line 18: Line 21:
 
<pre>
 
<pre>
 
function spawn(Spawn)
 
function spawn(Spawn)
     SetRequiredQuest(Spawn, 1234, 5)
+
     SetRequiredQuest(Spawn, 1234, 5, 0, 1, 0)
 
end
 
end
 
</pre>
 
</pre>
  
When the NPC spawns it will be set as required for step 5 of quest 1234
+
When the NPC spawns it will be set as required for step 5 of quest 1234, access will also be granted after completion of this step.
 +
 
 +
 
 +
==== Notes ====
 +
To calculate the values for vis flags, use the base values of (attackable = +64), (show_level = +32), (show_name = +16), (targetable = +4), (show_command_icon = +2). Add the sum of all the values you wish to be activated. For instance to have just show_name and targetable, use 20 as the value (4+16).

Revision as of 19:20, 6 November 2013

LUA Functions: SetRequiredQuest()

Sets a spawn as required for the given quest


Syntax

SetRequiredQuest(param1, param2, param3, [param4], [param5], [param6])


Parameters

Required - param1 (Spawn), param2 (int32)
param1 is the spawn we want to set
param2 is the quest ID that requires it
param3 is the step that requires it
Optional - param4 (int8), param5 (int8), param6 (int16)
param4 sets a spawn as private when the player does not meet quest reqs, grants access when they do. Set as 1 if used.
param5 grants access after the specified quest step is completed, including after finishing a quest.
param6 vis_flags override value to be used while a player does not meet quest reqs, uses vis_flags as normal when they do.


Usage

function spawn(Spawn)
    SetRequiredQuest(Spawn, 1234, 5, 0, 1, 0)
end

When the NPC spawns it will be set as required for step 5 of quest 1234, access will also be granted after completion of this step.


Notes

To calculate the values for vis flags, use the base values of (attackable = +64), (show_level = +32), (show_name = +16), (targetable = +4), (show_command_icon = +2). Add the sum of all the values you wish to be activated. For instance to have just show_name and targetable, use 20 as the value (4+16).