I decided to add another quest to an NPC.
Now I was curious for spawn scripts, do I use multiple for one npc or do I fit it all in one. I could not get either way to work and allow for multiple quests. This is the same was if the a target conversation NPC already has a script.
Multiple Quests
Moderator: Team Members
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Re: Multiple Quests
Use only one spawn script per spawn. You can easily set up conversations that give different quests based on the players selections.
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: Multiple Quests
I usually handle NPCs who interact with you on more than a single quest like this:
Let's say:
quest1 id = 1
quest2 id = 2
my spawnscript would look something like this:
Let's say:
quest1 id = 1
quest2 id = 2
my spawnscript would look something like this:
Code: Select all
function hailed(NPC, Spawn)
if HasCompletedQuest(Spawn, 1) then
if HasCompletedQuest(Spawn, 2) then
-- completed both quests
elseif HasQuest(Spawn, 2) then
-- completed quest 1, has quest 2
else
-- completed quest 1, does not have quest 2
elseif HasQuest(Spawn, 1) then
-- has quest 1
else
-- has no quests, has not completed either
end
end-
JCL
- Posts: 212
- Joined: Tue Oct 16, 2007 4:54 pm
- EQ2Emu Server: World of Tyrania
Re: Multiple Quests
Hmm, yeah that way seems good, I'll give that a try.
Edit: That way gave quite a few "end" errors at "elseif" that I couldn't fix.
I did find a way to get the second quest in though.
Edit: That way gave quite a few "end" errors at "elseif" that I couldn't fix.
I did find a way to get the second quest in though.
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: Multiple Quests
Lol ya sorry I forgot the second "end" in the nested if statement. Leave it to me to forget ends or parenthesis's.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Multiple Quests
I am submitting a patent for what I call "ScatScript".
These are scripts that usually have a beginning, a middle, but no end.
~runs~
These are scripts that usually have a beginning, a middle, but no end.
~runs~
-
JCL
- Posts: 212
- Joined: Tue Oct 16, 2007 4:54 pm
- EQ2Emu Server: World of Tyrania
Re: Multiple Quests
Thanks for the second End lol.
Yeah I said I got it working, then I remembered I forgot to make it so the quests completes when you turn it back in after the step updates. I added that in and got more end errors near "else" and "if". It's really fun trying to fix that :/... LUA is kind of annoying.
Yeah I said I got it working, then I remembered I forgot to make it so the quests completes when you turn it back in after the step updates. I added that in and got more end errors near "else" and "if". It's really fun trying to fix that :/... LUA is kind of annoying.
Who is online
Users browsing this forum: No registered users and 0 guests