Page 1 of 1

New quest LUA functions

Posted: Sat Nov 02, 2013 9:35 pm
by thefoof
The first one is AddQuestStepProgressAction(Quest*, [int32] step_id, [string] "function_name") this works the same as AddQuestStepCompleteAction, adding a call to the quest script when gaining progress in a step,
the params passed to the called function are: (Quest*, [Spawn*] QuestGiver, Player*, [int32] progress_added).

Wiki:AddQuestStepProgressAction()


The second function is:

AddQuestStepHarvest(Quest*, [int] step, string "step text", [int] quantity, [int] percentage, [string] "taskgroup text", int icon, [int] item_id1, [int] item_id2, ...) this is the same syntax as AddQuestStepObtainItem and AddQuestStepCraft, if you can't tell by the name it will update when a player harvests a defined item :P.

Wiki:AddQuestStepHarvest()

Re: New quest LUA functions

Posted: Tue Nov 05, 2013 10:25 am
by John Adams
Not to nag, but these are all making their way to the Wiki, right? I couldn't find them.

Re: New quest LUA functions

Posted: Tue Nov 05, 2013 4:10 pm
by thefoof
Yup, I'm working on my last quest feature I've had on the backburner for a long time (namely enhancements to SetRequiredQuest and related server functions) and once I get that done I'll do all these pages at once.

Re: New quest LUA functions

Posted: Wed Nov 06, 2013 7:35 am
by John Adams
Sorry, you know how I get ;) All dad-like and stuff.

SetRequiredQuest()

Posted: Wed Nov 06, 2013 4:42 pm
by thefoof
Let me start off by saying that all of these new params mentioned here are optional, and the syntax is:
SetRequiredQuest(Spawn*, [int32] quest_id, [int32] step_id, [int8] private_access, [int8] completion_access, [int16] vis_flag_override)

First off, the basic idea of the function originally is if a player doesn't have a specified quest/step, it disables vis flags (targetable, show_name ect). I just expanded upon it and improved reliability on it a bit. Enhancements:

1.Spawns will now update instantly once a step is completed.

2.If the private access param is set as 1, the spawn will also be hidden from the player if quest requirements are not met, and access granted if they are.

3.If the completion access param is set as 1, access be granted during and after a step has been completed, including after the entire quest is complete.

4.The flag override value will allow you to activate specific flags when a player does not meet quest requirements for this spawn, the values are +64 for attackable, +32 for show_level, + 16 for show_name, +4 for targetable, +2 show_command_icon, just add up which values you want activated. For example if you want targetable and show_command_icon, set this value as 6.


Wiki:SetRequiredQuest()