LUA:SetRequiredQuest
- Last edited 9 years ago by I need to Update My Profile
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
This sets spawn access requirements for a spawn. When a player does not meet spawn access requirements, no vis flags will be sent for the spawn to that player. This disables use of the spawn (cannot target, use commands) but allows the player to still see the spawn. Using the private_spawn param (4) hides this spawn completely from the player. Param5 allows access to this spawn permanently after this quest step has been completed or while on this step. If you only want certain flags to be sent while a player does not have access to the spawn use the vis_flags override (param6). Notes on this below.
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).