Here is an example based on the Tainted quest in Queen's Colony:
Code: Select all
--this function is called whenever a player examines an item in their inventory
function examined(Item, Player)
-- When implementing the full quest you would need to display this only on the initial examination
-- since this is an example, I am leaving out the HasQuest and GetQuestStep checks
conversation = CreateConversation()
AddConversationOption(conversation, "Examine the parchment.", "ExamineFirstParchment")
AddConversationOption(conversation, "Put the parchment away.", "CloseDialog")
StartItemConversation(conversation, Item, Player, "The edges of the parchment are torn and jagged as though ripped from a much larger document.")
end
function ExamineFirstParchment(Item, Player)
-- Send quest update for the Tainted quest for this step
conversation = CreateConversation()
AddConversationOption(conversation, "Put the parchment away.", "CloseDialog")
StartItemConversation(conversation, Item, Player, "You can barely make out some writing on this scrap: \"The toxic crawlers will be useful to cover our ... the totem ...\" The reference to a totem is puzzling. Why would someone want a totem covered in spiders? There must be more pieces of this parchment amongst these toxic crawlers.")
end
function CloseDialog(Item, Player)
CloseItemConversation(Item, Player)
end
--this function is called whenever a player receives an item (doesn't matter how)
function obtained(Item, Player)
--you could use this for quests but since this is a test it will only display a message
Emote(Player, "received the item and the villagers rejoiced!", 0, Player)
end
--this function is called whenever a player destroys an item
function destroyed(Item, Player)
end