Difference between revisions of "LUA:AddQuestStepCompleteAction"

 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''
+
{{LUAFunction
AddQuestStepCompleteAction(Quest, Step ID, Function Name)'''
+
|Name = AddQuestStepCompleteAction
---
+
|Description =  Goes under "AddQuestStep, AddQuestStepChat, AddQuestStepKill, AddQuestStepLocation, AddQuestStepSpell, ect so that it calls a function once the step has been completed.
You will want to place one of these under your "AddQuestStep(chat, kill, location, spell, ect) so that it calls this funtion once the step has been completed.
+
|Param1 = Quest
Here is an example...
+
|Param1Desc = is the quest id
 +
|Param2 = StepID
 +
|Param2Desc = is the step id
 +
|Param3 = FunctionName
 +
|Param3Desc = is the name of the function to call
 +
|Example =
 +
<pre>
 +
AddQuestStepChat(Quest, 1, "I must speak with Tristan. He is standing near the Heated Stone Inn.", 1, "I need to manipulate two Barbarians into hating each other.", 0, 1390036)
  
+
  AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_Tristan")
    AddQuestStepChat(Quest, 1, "I must speak with Tristan. He is standing near the Heated Stone Inn.", 1, "I need to manipulate two Barbarians into hating each other.", 0, 1390036)<br>
+
</pre>
    AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_Tristan")
+
|ExampleDesc = This will call the function, "Step1_Complete_Tristan" when you have talked to the NPC Tristan. You can then make the "Step1_Complete_Tristan" function add another step, like so...
 +
<pre>
 +
function Step1_Complete_Tristan(Quest, QestGiver, Player)
 +
    UpdateQuestStepDescription(Quest, 1, "I have spoken with Tristan.")
  
This will call the function, "Step1_Complete_Tristan" when you have talked to the NPC Tristan. You can then make the "Step1_Complete_Tristan" function add another step, like so...
+
    AddQuestStepChat(Quest, 2, "I must speak with Wesley Tundrafoot. He is standing near the South Freeport gate.", 1, "I need to manipulate two Barbarians into hating each other.", 0, 1390045)
    function Step1_Complete_Tristan(Quest, QestGiver, Player)
+
    AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_Wesley")
      UpdateQuestStepDescription(Quest, 1, "I have spoken with Tristan.")<br>
+
end
      AddQuestStepChat(Quest, 2, "I must speak with Wesley Tundrafoot. He is standing near the South Freeport gate.", 1, "I need to manipulate two Barbarians into hating each other.", 0, 1390045)
+
</pre>
      AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_Wesley")
+
|Notes = this example would require a SetStepComplete in the spawnscripts due to the use of AddQuestStepChat
    end
+
}}
 
 
 
 
 
 
[http://www.eq2emulator.net/wiki/index.php/Developer:LUA_Functions Back to LUA Functions]
 
 
 
 
 
 
 
 
 
--[[User:Xanibunib|Xanibunib]] 17:26, 3 April 2009 (CDT)
 

Latest revision as of 12:16, 30 January 2021


LUA:AllFunctions - AddQuestStepCompleteAction

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


Goes under "AddQuestStep, AddQuestStepChat, AddQuestStepKill, AddQuestStepLocation, AddQuestStepSpell, ect so that it calls a function once the step has been completed.

Syntax

AddQuestStepCompleteAction(param1, param2, param3)

Parameters

Required - param1 (Quest), param2 (StepID), param3 (FunctionName)
param1 is the quest id
param2 is the step id
param3 is the name of the function to call


Example

AddQuestStepChat(Quest, 1, "I must speak with Tristan. He is standing near the Heated Stone Inn.", 1, "I need to manipulate two Barbarians into hating each other.", 0, 1390036)

   AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_Tristan")

This will call the function, "Step1_Complete_Tristan" when you have talked to the NPC Tristan. You can then make the "Step1_Complete_Tristan" function add another step, like so...

function Step1_Complete_Tristan(Quest, QestGiver, Player)
     UpdateQuestStepDescription(Quest, 1, "I have spoken with Tristan.")

     AddQuestStepChat(Quest, 2, "I must speak with Wesley Tundrafoot. He is standing near the South Freeport gate.", 1, "I need to manipulate two Barbarians into hating each other.", 0, 1390045)
     AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_Wesley")
end

Notes

this example would require a SetStepComplete in the spawnscripts due to the use of AddQuestStepChat