I read the simple quest tutorial but its complicated hehe.

General support forum. If you require assistance and your problem doesnt fall in any of the other categories, this is the forum for you!

Moderator: Team Members

Forum rules
READ THE FORUM STICKY THREADS BEFORE ASKING FOR HELP!
Most information can be found there, and if not, the posts will help you determine the information required to get assistance from the development team.
Incomplete Help Requests will be locked or deleted.
User avatar
Astal
Posts: 96
Joined: Tue Dec 09, 2008 1:35 pm

I read the simple quest tutorial but its complicated hehe.

Post by Astal » Tue Sep 29, 2009 7:18 pm

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
I DIE FREE!!

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: I read the simple quest tutorial but its complicated hehe.

Post by Scatman » Tue Sep 29, 2009 7:22 pm

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.

User avatar
Astal
Posts: 96
Joined: Tue Dec 09, 2008 1:35 pm

Re: I read the simple quest tutorial but its complicated hehe.

Post by Astal » Tue Sep 29, 2009 7:25 pm

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
I DIE FREE!!

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: I read the simple quest tutorial but its complicated hehe.

Post by Scatman » Wed Sep 30, 2009 12:27 am

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 :P But you get the general idea of how a spawn script can work. Of course, you can make it look nicer than that.

User avatar
Astal
Posts: 96
Joined: Tue Dec 09, 2008 1:35 pm

Re: I read the simple quest tutorial but its complicated hehe.

Post by Astal » Wed Sep 30, 2009 11:57 am

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 :P 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
Last edited by Astal on Wed Sep 30, 2009 12:07 pm, edited 1 time in total.
I DIE FREE!!

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: I read the simple quest tutorial but its complicated hehe.

Post by John Adams » Wed Sep 30, 2009 12:06 pm

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.

User avatar
Astal
Posts: 96
Joined: Tue Dec 09, 2008 1:35 pm

Re: I read the simple quest tutorial but its complicated hehe.

Post by Astal » Wed Sep 30, 2009 12:08 pm

thanks jon
I DIE FREE!!

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: I read the simple quest tutorial but its complicated hehe.

Post by Scatman » Wed Sep 30, 2009 12:25 pm

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.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: I read the simple quest tutorial but its complicated hehe.

Post by John Adams » Wed Sep 30, 2009 3:59 pm

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
You do not have the required permissions to view the files attached to this post.

User avatar
Astal
Posts: 96
Joined: Tue Dec 09, 2008 1:35 pm

Re: I read the simple quest tutorial but its complicated hehe.

Post by Astal » Wed Sep 30, 2009 8:48 pm

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?
I DIE FREE!!

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: I read the simple quest tutorial but its complicated hehe.

Post by John Adams » Thu Oct 01, 2009 6:53 am

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)

User avatar
Astal
Posts: 96
Joined: Tue Dec 09, 2008 1:35 pm

Re: I read the simple quest tutorial but its complicated hehe.

Post by Astal » Thu Oct 01, 2009 1:59 pm

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
I DIE FREE!!

User avatar
ZexisStryfe
Posts: 1026
Joined: Thu Jul 26, 2007 6:39 am
EQ2Emu Server: Sytherian Legends
Location: Connecticut
Contact:

Re: I read the simple quest tutorial but its complicated hehe.

Post by ZexisStryfe » Thu Oct 01, 2009 3:35 pm

If you keep taunting me with that I am gonna show up on your doorstep and beat the snot out of you until you agree to get cracking on it! :twisted: :twisted: :twisted:
~ EQ2 Emulator Project Manager

Image
Image
Image
"Zexis, from this day forth, you shall be known as... '3 of 6'" - John Adams

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: I read the simple quest tutorial but its complicated hehe.

Post by John Adams » Thu Oct 01, 2009 4:38 pm

/target Zexis
/incite

User avatar
ZexisStryfe
Posts: 1026
Joined: Thu Jul 26, 2007 6:39 am
EQ2Emu Server: Sytherian Legends
Location: Connecticut
Contact:

Re: I read the simple quest tutorial but its complicated hehe.

Post by ZexisStryfe » Fri Oct 02, 2009 8:18 am

/target John Adams
/useability "harm touch"
~ EQ2 Emulator Project Manager

Image
Image
Image
"Zexis, from this day forth, you shall be known as... '3 of 6'" - John Adams

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests