The basic format that I use when making my waypoint files is something like this:
Code: Select all
<waypoint x="xxxx" z="zzzz" y="yyyy">
player:target_NPC(######)
AcceptQuestByName(######)
</waypoint>
<waypoint x="xxxx" z="zzzz" y="yyyy" tag="startQuestHere">
-- Do stuff here to complete quest, ie: kill mobs, get quest item loot, etc.
if getQuestStatus(######) == "complete" then
__WPL:setWaypointIndex(__WPL:findWaypointTag("endQuestHere"));
end
</waypoint>
<waypoint x="xxxx" z="zzzz" y="yyyy">
-- Do more stuff here
if getQuestStatus(######) == "incomplete" then
__WPL:setWaypointIndex(__WPL:findWaypointTag("startQuestHere"));
end
</waypoint>
<waypoint x="xxxx" z="zzzz" y="yyyy" tag="endQuestHere">
player:target_NPC(######)
CompleteQuestByName(######)
</waypoint>
Of course you may need to have more waypoints in between to allow you to move from where the NPC is to where you have to do the actual quest, but the logic flow works the same. Use the tags as appropriate to define where you want to re-start your hunt and kill if you didn't complete it in the first rotation, and one to say where to do when you do complete it.
Talk to the NPC and get the quest.
Move to where the quest is done, kill mobs, loot items, etc.
Move to where the NPC is again.
Turn in the quest.