Quest Question

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.
Post Reply
User avatar
palaxe
Posts: 65
Joined: Fri Oct 05, 2007 9:01 am
EQ2Emu Server: Aprilla
Location: U.S.A

Quest Question

Post by palaxe » Wed Mar 04, 2009 8:24 pm

Hi, I don't know if you guys even have time for this but we are stuck on something and can't find an answer.
Here it is,
We wrote a quest. It loads up just fine. But we cannot find out how to give the quest to the quest giver npc.
So in other words how do you assign the quest to the npc?
We put the primary command type to 1 because it refrences hail in entery comands as hail. So you can hail the npc.
But still the npc has no idea that she should hold the quest.
Do I need to add in a line in the quest saying that she is the one who starts it? Do we make a new script for her to start it?
here is the quest,


***************************************************************************************************************************************************

function Init(Quest)
RegisterQuest(Quest, "Kill The Spys", "Hallmark", "GreaterFaydark", 3, " Lanna wants you to kill the Spys that are watching our every move.")

AddQuestRewardCoin(Quest, 78)

SetQuestRewardExp(Quest, 500)

SetQuestPrereqLevel(Quest, 3)

AddQuestStepKill(Quest, 1, "Kill 6 of the Spys that are hidden watching us", 6, 100, "Kill The Spys for Lanna", 120514) --[[ this is the spys id to kill ]]--

AddQuestStepCompleteAction(Quest, 1, "KilledAllSpys")

SetCompletedDescription(Quest, "Now that we are no longer being watched, I must tell you, The Arathai's have taken over. I have never seen my race act like this. Someone of greater power is at fault. That is why I have betrayed them .")

QuestReturnNPC(Quest, 120540) --[[ this is lanna the quest giver id]]--
end

function Accepted(Quest, QuestGiver, Player)
if QuestGiver ~= nil then
if GetDistance(Player, QuestGiver) < 30 then
FaceTarget(QuestGiver, Player)
Say(QuestGiver, "Thank you for accepting this task " .. GetName(Player) .. ". Please return to me when you have completed it.")
Emote(QuestGiver, " thanks you warmly.", Player)
end
end
end

function Declined(Quest, QuestGiver, Player)
if QuestGiver ~= nil then
if GetDistance(Player, QuestGiver) < 30 then
FaceTarget(QuestGiver, Player)
Say(QuestGiver, "If you change your mind " .. GetName(Player) .. ", you know where to find me.")
Emote(QuestGiver, " Looks at you.", Player)
end
end
end

function KilledAllSpys(Quest, QuestGiver, Player)
UpdateQuestStepDescription(Quest, 1, "I killed the Spys as Lanna requested.")
UpdateQuestDescription(Quest, "I killed the spys that are hidden. Return to Lanna for your reward.")
end

***************************************************************************************************************************************************
How does Lanna know to give you the quest? So confused were to add her Id in... Thanks for any help Palaxe

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: Quest Question

Post by Scatman » Wed Mar 04, 2009 9:44 pm

When doing quests, you're going to need to handle the NPCs spawn script and the quest. There is a function called OfferQuest(NPC, Spawn, QuestID). In the NPC's spawn script, after you go through dialog with the NPC, you'll call that function.

User avatar
palaxe
Posts: 65
Joined: Fri Oct 05, 2007 9:01 am
EQ2Emu Server: Aprilla
Location: U.S.A

Re: Quest Question

Post by palaxe » Wed Mar 04, 2009 10:29 pm

Thanks Scatman, You saved me again.
Great I didn't even see that there... and I looked like 50 times.. lol ;)

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: Quest Question

Post by Scatman » Wed Mar 04, 2009 11:27 pm

Make sure you check the changelog every few days. LUA functions are still being developed and we are always adding or changing the functions (I changed AddQuestStepChat the other day). Also, if you feel the need for a function, post it on the forums.

User avatar
palaxe
Posts: 65
Joined: Fri Oct 05, 2007 9:01 am
EQ2Emu Server: Aprilla
Location: U.S.A

Re: Quest Question

Post by palaxe » Wed Mar 04, 2009 11:43 pm

Got it, Thanks Scatman. Lanna is under the mushroom. Check it out sometime :)

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Quest Question

Post by Zcoretri » Wed Mar 04, 2009 11:56 pm

palaxe wrote: AddQuestStepKill(Quest, 1, "Kill 6 of the Spys that are hidden watching us", 6, 100, "Kill The Spys for Lanna", 120514)
It looks like you are missing the icon parameter in the above function...

AddQuestStepKill(Quest, 1, "Kill 6 of the Spys that are hidden watching us", 6, 100, "Kill the Spys for Lanna", 611, 120514)

This will display 6 cross bones and will light up after each kill. I think if you put a zero there it will not display any icon.

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: Quest Question

Post by Scatman » Thu Mar 05, 2009 12:00 am

Yah, putting a zero for the icon parameter will not display an icon, but you do need to put at least a zero if you don't want one, otherwise it'll try to use the npc's ID as the icon and you'll end up getting a gray box, if the spawn ID is too high, or you'll get lucky and get a random icon. See my tutorial in the tutorial section for finding an icon.

User avatar
palaxe
Posts: 65
Joined: Fri Oct 05, 2007 9:01 am
EQ2Emu Server: Aprilla
Location: U.S.A

Re: Quest Question

Post by palaxe » Thu Mar 05, 2009 8:52 am

Ah, Thanks guys I didn't even see that. Ya there is a black box by the quest. I'll change that when I get home from work tonight. :) Thanks for all the help.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests