AddConversationOption(ConversationOption: Conversation, String: Option, String: Function)
Pre-Requisite(s)
- Needs previously created ConversationOption LUA Pointer with CreateConversation()
Parameter(s)
ConversationOption: Conversation - LUA Pointer for ConversationOption
String: Option - Displayed text to the Player
String: Function (OPTIONAL) - Function called in the SpawnScript if selected by Player. Optional field, leave blank to do nothing.
Return(s)
- None
Example(s)
– Taken from SpawnScripts/FarJourneyFreeport/HelmsmanNyles.lua
function hailed(NPC, Spawn)
local conversation = CreateConversation()
AddConversationOption(conversation, "Yes", "leave") – “Yes” is the selection for Player, “leave” is the function it calls
AddConversationOption(conversation, "No")
if GetClass(Spawn)>0 then
AddConversationOption(conversation, "Wait, I'm just a commoner.\n\n[CLASSIC CLASS CHANGE TO COMMONER].","Commoner")
end
StartConversation(conversation, NPC, Spawn, "Head for land?\n[Leave The Far Journey?]")
end
function leave(NPC, Spawn)
– determine next action when Player selects “Yes”
end
Result
Additional Notes