another ?

Discussions on development of both the EQ2Emulator LUA Script Engine and Script specifications

Moderator: Team Members

Post Reply
User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

another ?

Post by Ememjr » Mon Mar 25, 2019 6:09 pm

this item questsdisplay pages on screen with response
in one section on live if you read that page you get an offer quest
if you then accept the quest the next page is displayed, if you decline the quest the book is closed

Code: Select all

function ReadStory1(Item, Player)
    offerquest (Item, Player,474)
	-- if accepted then 
    conversation = CreateConversation()
	AddConversationOption(conversation, "Continue Story 1","ContStory1")
	AddConversationOption(conversation, "Close")
	StartDialogConversation(conversation, 2, Item, Player, " ")
    
end
so in the above is there a way to wait for a response? from the offer quest?

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: another ?

Post by Jabantiz » Mon Mar 25, 2019 8:55 pm

Ememjr wrote: Mon Mar 25, 2019 6:09 pm so in the above is there a way to wait for a response? from the offer quest?
Accepted function of the quest script.

As you need an item I would store it in a temp variable then retrieve it in the accepted function or clear it in the declined function of the quest script.

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: another ?

Post by Ememjr » Tue Mar 26, 2019 3:38 am

ok so i did the offer quest with temp variable, and that portioan works what i did notice though is that none of the "close" respnse seem to be working

from what i understand that if i do not put a 2nd parameter (to the function) that it will close the dialog

but none of the close options are closing the dialog, i also just noticed that if i press close first then the other option does not work either

Code: Select all

--[[
	Script Name	: ItemScripts/the_history_of_ayr_dal.lua
	Script Purpose	:Book-- 
	Script Author	: Ememjr
	Script Date	: 2019.03.24
	Script Notes	: 
--]]



function examined(Item, Player)
	conversation = CreateConversation()
	AddConversationOption(conversation, "Continue Story","ContinueStory")
	AddConversationOption(conversation, "Close")
	StartDialogConversation(conversation, 2, Item, Player, "This is a three-part history of the Ayr'Dal.  Its pages cannot be completed at one time, but must be gained through valor and experience.")
end
function ContinueStory(Item, Player)
	conversation = CreateConversation()
	AddConversationOption(conversation, "Read Story 1","ReadStory1")
	AddConversationOption(conversation, "Close")
	StartDialogConversation(conversation, 2, Item, Player, "Each part of this history tome can only be completed in its own time.")
end
function ReadStory1(Item, Player)
    if not HasQuest(Player, 474) then
	    SetTempVariable(Player, "Q474", Item)
        OfferQuest(nil, Player, 474)
	end
	conversation = CreateConversation()
	AddConversationOption(conversation, "Continue Story 1","ContStory1")
	AddConversationOption(conversation, "Close")
	StartDialogConversation(conversation, 2, Item, Player, "B My name is Trinni Mellosius and I'm a half-elf.  I guess that's why my teacher asked me to write a research paper about our history.  As if we have a history of our own!  But since I need to pass this class, I guess I'll write one.")
    
end

function ContStory1(Item, Player)
    conversation = CreateConversation()
    AddConversationOption(conversation, "Close")
    StartDialogConversation(conversation, 2, Item, Player, "B So you're walking around Qeynos, or maybe even Freeport (I live in Willow Wood, so I just have to guess about you-know-where) and you see someone who has pointy ears like an elf, is taller than an elf, but not so tall as a human and what have you got?  Ayr'Dal!")

end

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: another ?

Post by Jabantiz » Tue Mar 26, 2019 3:49 pm

Yea, that seemed to have broken at some point for conversations that use an item. A workaround for now is to use the lua function CloseItemConversation(). this can just be put into the AddOption like so

Code: Select all

AddConversationOption(conversation, "Close", "CloseItemConversation")

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests