Updating Quests
Posted: Tue Dec 30, 2008 2:54 pm
I've been testing npc's and made a couple to test quests. Here is some code: (Built off crab quest)
To shorten that up I have this that is not working right:
Everything works, but I get "You did not find any quest items" when I kill the quest npc.
Edit: Found the problem. I was using this format:
Should have been using this format: (The PercentChance)
Code: Select all
[function Init(Quest)
RegisterQuest(Quest, "Kill Roots", "Hallmark", "Queen's Colony", 1, "Rayvor is deathly afraid of roots and wants you to kill some of them for him.")
AddQuestRewardCoin(Quest, 25)
SetQuestRewardExp(Quest, 200)
SetQuestPrereqLevel(Quest, 1)
AddQuestStepKill(Quest, 1, "Kill 1 of the roots nearby.", 1, "Kill roots for Sir Rayvor", "Kill roots for
Sir Rayvor", 65)
AddQuestStepCompleteAction(Quest, 1, "KilledAllRoots")
SetCompletedDescription(Quest, "I have killed all of the roots.")
QuestReturnNPC(Quest, 64)
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, "waves goodbye.", Player)
end
end
end
function KilledAllRoots(Quest, QuestGiver, Player)
UpdateQuestStepDescription(Quest, 1, "I killed the roots as Rayvor requested.")
UpdateQuestDescription(Quest, "I killed some of the roots on the beach. Return to Rayvor for your
reward.")
end
Code: Select all
AddQuestStepKill(Quest, 1, "Kill 1 of the roots nearby.", 1, "Kill roots for Sir Rayvor", "Kill roots for Sir Rayvor", 65)
Edit: Found the problem. I was using this format:
Code: Select all
AddQuestStepKill(Quest, Step ID, Description, Quantity, TaskGroupText, NPC ID(s))Code: Select all
AddQuestStepKill(Quest, Step ID, Description, Quantity, PercentChance,TaskGroupText, NPC ID(s)