what is wrong with thisfunction Hailed

Discussions of the design and development of in-game content.

Moderator: Team Members

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

what is wrong with thisfunction Hailed

Post by Ememjr » Sat Oct 28, 2017 4:37 pm

Code: Select all

function hailed(NPC, Spawn)
	FaceTarget(NPC, Spawn)
	local conversation = CreateConversation()
	StartConversation(conversation, NPC, Spawn, "Good day to you.  I've been hearing reports that the Peat Bog isn't safe right now.  I hope you didn't have any trouble if you came in that way.")
	if not HasQuest(Spawn, 240) then
       AddConversationOption(conversation, "What kind of trouble is out in the bog?", "Option4")
	end
end
it worked until i added the if not hasquest portion

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

Re: what is wrong with thisfunction Hailed

Post by Jabantiz » Sat Oct 28, 2017 6:36 pm

StartConversation() needs to be after AddConversationOption(). Just like the name suggests it will start the conversation and send all the packets and I believe the conversation pointer gets nuked after that so using Add after can cause errors/crashes.

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

Re: what is wrong with thisfunction Hailed

Post by Ememjr » Sun Oct 29, 2017 4:56 pm

never noticed that but it does make since got it to work

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests