Page 1 of 2
I read the simple quest tutorial but its complicated hehe.
Posted: Tue Sep 29, 2009 7:18 pm
by Astal
Im just tryin learn quest scripting but i cant figure out how to tie the start of the quest in with the chat I mean after the player clicks yes I would like to give him the quest and such, but i cant find any examples to mess with, i tried the murrar shar quest and it doesnt even work when I use it unedited, when i accept the quest nothing happens lol.
Code: Select all
--[[
Script Name: Spirit of the Maiar
Script Purpose: Give player the Ascension Quest
Script Author: Astal
Script Date: 2009.09.27
Quest ID: 1
Zone: Queens Colony
Preceded By:
Followed By:
--]]
function respawn(NPC)
spawn(NPC)
end
function hailed(NPC, Spawn)
FaceTarget(NPC, Spawn)
conversation = CreateConversation()
AddConversationOption(conversation, "What is Ascension?", "WhatIsAscension")
AddConversationOption(conversation, "Yes", "Yes")
AddConversationOption(conversation, "No", "No")
StartConversation(conversation, NPC, Spawn, "Welcome " .. GetName(Spawn) .. ", do you come seeking Ascension?")
end
-----------------------------------------------------------------------------
-- functions to handle the extended conversations from hailed
-----------------------------------------------------------------------------
function WhatIsAscension(NPC, Spawn)
FaceTarget(NPC, Spawn)
conversation = CreateConversation()
AddConversationOption(conversation, "Thank You!")
StartConversation(conversation, NPC, Spawn, "Ascension is being transformed in to a more powerful being such as myself, it is not an easy task, but in the end it is well worth it.")
end
function No(NPC, Spawn)
FaceTarget(NPC, Spawn)
conversation = CreateConversation()
AddConversationOption(conversation, "Thank you!")
StartConversation(conversation, NPC, Spawn, "Under Construction! 3")
end
-----------------------------------------------------------------------------
-- Ascension Quest
-----------------------------------------------------------------------------
function Yes(NPC, Spawn)
FaceTarget(NPC, Spawn)
Init(Quest)
end
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Tue Sep 29, 2009 7:22 pm
by Scatman
You need a separate quest script and spawn script. In one of those functions in your spawn script you want to call the function OfferQuest(NPC, Spawn, Quest_ID). This will display the quest dialog for the client to choose accept or decline. My quest tutorial is for the quest script only. It does not include any part of the quest giver's spawn script. Also, check out the quest and quest_details table in the database.
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Tue Sep 29, 2009 7:25 pm
by Astal
Scatman wrote:You need a separate quest script and spawn script. In one of those functions in your spawn script you want to call the function OfferQuest(NPC, Spawn, Quest_ID). This will display the quest dialog for the client to choose accept or decline. My quest tutorial is for the quest script only. It does not include any part of the quest giver's spawn script. Also, check out the quest and quest_details table in the database.
OH, i tried putting quest script in the spawn script file lulz, im used to eq 1 quests
So there are no complete quest tutorials out yet?
Oh well lol
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Wed Sep 30, 2009 12:27 am
by Scatman
My quest tutorial in the tutorial sections is a complete quest tutorial. If by complete you mean it includes the spawn script, then no it is not "complete". The spawn script just needs to check what part of the quest you are on using HasCompletedQuest(Spawn, Quest_ID), HasQuest(Spawn, Quest_ID), GetQuestStep(Spawn, Quest_ID), etc and to handle the conversation differently.
Code: Select all
function hailed(NPC, Spawn)
FaceTarget(NPC, Spawn)
conversation = CreateConversation()
if HasCompletedQuest(Spawn, 1) then
Say(NPC, "Hey thanks for doing that task for me again!", Spawn)
elseif HasQuest(Spawn, 1) then
if GetQuestStep(Spawn, 1) == 1 then -- has quest, on step 1
AddConversationOption(conversation, "Not yet.")
elseif GetQuestStep(Spawn, 1) == 2 then -- has quest, on step 2
AddConversationOption(conversation, "I sure have!", "Quest1Complete")
end
StartConversation(conversation, NPC, Spawn, "Have you completed the work?")
else
AddConversationOption(conversation, "Yes I am!", "LookingForWork")
AddConversationOption(conversation, "Sorry I'm busy.")
StartConversation(conversation, NPC, Spawn, "Hello! Looking for some work?")
end
end
function LookingForWork(NPC, Spawn)
OfferQuest(NPC, Spawn, 1)
end
function Quest1Complete(NPC, Spawn)
SetStepComplete(Spawn, 1, 2)
end
I wrote that up real fast so don't hold me to syntax errors

But you get the general idea of how a spawn script can work. Of course, you can make it look nicer than that.
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Wed Sep 30, 2009 11:57 am
by Astal
Scatman wrote:My quest tutorial in the tutorial sections is a complete quest tutorial. If by complete you mean it includes the spawn script, then no it is not "complete". The spawn script just needs to check what part of the quest you are on using HasCompletedQuest(Spawn, Quest_ID), HasQuest(Spawn, Quest_ID), GetQuestStep(Spawn, Quest_ID), etc and to handle the conversation differently.
Code: Select all
function hailed(NPC, Spawn)
FaceTarget(NPC, Spawn)
conversation = CreateConversation()
if HasCompletedQuest(Spawn, 1) then
Say(NPC, "Hey thanks for doing that task for me again!", Spawn)
elseif HasQuest(Spawn, 1) then
if GetQuestStep(Spawn, 1) == 1 then -- has quest, on step 1
AddConversationOption(conversation, "Not yet.")
elseif GetQuestStep(Spawn, 1) == 2 then -- has quest, on step 2
AddConversationOption(conversation, "I sure have!", "Quest1Complete")
end
StartConversation(conversation, NPC, Spawn, "Have you completed the work?")
else
AddConversationOption(conversation, "Yes I am!", "LookingForWork")
AddConversationOption(conversation, "Sorry I'm busy.")
StartConversation(conversation, NPC, Spawn, "Hello! Looking for some work?")
end
end
function LookingForWork(NPC, Spawn)
OfferQuest(NPC, Spawn, 1)
end
function Quest1Complete(NPC, Spawn)
SetStepComplete(Spawn, 1, 2)
end
I wrote that up real fast so don't hold me to syntax errors

But you get the general idea of how a spawn script can work. Of course, you can make it look nicer than that.
Thanks
What about the database. I think i put it in right but whats the Quest:Type field and the Quest_Details:Value field for?
Edit: NM, i just used the murrar shar quest, ill just modify it and figure out what im doin, thanks man
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Wed Sep 30, 2009 12:06 pm
by John Adams
All those quest and quest_details data are replacements for what was once
LUA functions for Quests.
See also the LUA Function sticky in the LUA Scripting forum. Same stuff, only in the DB instead of LUA Script.
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Wed Sep 30, 2009 12:08 pm
by Astal
thanks jon
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Wed Sep 30, 2009 12:25 pm
by Scatman
The `type` in the quest table refers to the Type you see in your quest journal. On live, you get a quest type and a zone. The zone specifies which zone the quest is currently taking place in (modifiable using LUA function UpdateQuestZone(Quest, ZoneName). A sample Type would be Heritage, World Event, simply another zone name (usually where the quest starts on live), Astal's Quest Line of Uberness; whatever you want!
The quest_details table handles the quest rewards and prereqs. You can use the database or you can still use the LUA functions in the quest's Init() function. If you use a MySQL GUI tool, the fields in quest_details are all enumed for easy use. The value is, simply the value for that entry. For example,
quest1 id = 1
quest2 id = 2
Let's say we are defining quest 2. We want quest 1 to be a prereq for quest 2, so the player can't get the quest before they have completed quest 1. To do this in the database, you would add a new row, quest_id = 2, type = "Prereq", subtype = "Quest", value = 1. So value in this case is the quest id for the prereq.
Let's say we want to give them an item reward and let's say the item id is 10052. Insert a new row, quest_id = 2, type = "Reward", subtype = "Item", value = 10052.
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Wed Sep 30, 2009 3:59 pm
by John Adams
Just cuz I like bragging about how cool my own editor is

here's a visual aid to help sort out what the fields might be set to:
quests table (single entry):
registerquest.jpg
quest_details (one to many):
quest_details.jpg
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Wed Sep 30, 2009 8:48 pm
by Astal
John Adams wrote:Just cuz I like bragging about how cool my own editor is

here's a visual aid to help sort out what the fields might be set to:
quests table (single entry):
registerquest.jpg
quest_details (one to many):
quest_details.jpg
where can i get said editor?
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Thu Oct 01, 2009 6:53 am
by John Adams
Astal wrote:where can i get said editor?
Join my team and work on our database exclusively.
Or wait til the public 2.0 version is released (no ETA, as I have very limited time to work on it)
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Thu Oct 01, 2009 1:59 pm
by Astal
John Adams wrote:Astal wrote:where can i get said editor?
Join my team and work on our database exclusively.
Or wait til the public 2.0 version is released (no ETA, as I have very limited time to work on it)
Hahaha, i dont think im good enough to do that, unless u have lists of exactly what needs done and i dont have to interpret the shit you get from Sony with that parser, cause i have no idea how to do that, but yeah im not working so im almost always available
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Thu Oct 01, 2009 3:35 pm
by ZexisStryfe
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Thu Oct 01, 2009 4:38 pm
by John Adams
/target Zexis
/incite
Re: I read the simple quest tutorial but its complicated hehe.
Posted: Fri Oct 02, 2009 8:18 am
by ZexisStryfe
/target John Adams
/useability "harm touch"