Page 1 of 1

Quest Question

Posted: Wed Mar 04, 2009 8:24 pm
by palaxe
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

Re: Quest Question

Posted: Wed Mar 04, 2009 9:44 pm
by Scatman
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.

Re: Quest Question

Posted: Wed Mar 04, 2009 10:29 pm
by palaxe
Thanks Scatman, You saved me again.
Great I didn't even see that there... and I looked like 50 times.. lol ;)

Re: Quest Question

Posted: Wed Mar 04, 2009 11:27 pm
by Scatman
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.

Re: Quest Question

Posted: Wed Mar 04, 2009 11:43 pm
by palaxe
Got it, Thanks Scatman. Lanna is under the mushroom. Check it out sometime :)

Re: Quest Question

Posted: Wed Mar 04, 2009 11:56 pm
by Zcoretri
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.

Re: Quest Question

Posted: Thu Mar 05, 2009 12:00 am
by Scatman
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.

Re: Quest Question

Posted: Thu Mar 05, 2009 8:52 am
by palaxe
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.