<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>
-- Duration: approx.  18mins
-- Version 1.0
	minPlayerLevel	= 83;				-- minimum PlayerLevel to accept the Quest.
	chest 			= {tool={pickid=122808,bagid=242627},rune={pickid=122810,bagid=242767},device={pickid=122809,bagid=242766}}
	questGiverId 	= 122763;
	questid 		= 426554;
	questName 		= GetIdName(questid);
	questtype 		= "daily" -- "public" or "daily";
	__WPL:setForcedWaypointType("TRAVEL")
	
	booltable={};
	booltable[true]	="yes";
	booltable[false]="no";

	function pickupChest (chesttype)
		
		print ("Trying to pickup "..GetIdName(chest[chesttype]['pickid']));    	
		player:update();inventory:update(); 
		local _amount = inventory:itemTotalCount(chest[chesttype]['bagid']);
		if  _amount == 3 then
			print ("Already collected 3 of "..GetIdName(chest[chesttype]['bagid']));
			return false;
		end
		local i = 0;
		repeat
			player:target_Object(chest[chesttype]['pickid']);    	
			i=i+1
			yrest(1000);
		until inventory:itemTotalCount(chest[chesttype]['bagid']) > _amount or i == 30
		
	end
	
	function questsDone()
		local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()");
		if (dailyQuestCount==dailyQuestsPerDay) then
			return true;
		else 
			return false;
		end
	end	
	
	if getQuestStatus(questName) == "complete"  then
		direction = WPT_BACKWARD;
	else
		direction = WPT_FORWARD;
	end
	
	if  questsDone() and questtype 		== "daily" then
		error ("Dailys done for today!",0);
	end
	
	
	currentwp = __WPL:getNearestWaypoint(player.X, player.Z, player.Y);
if false then
										if  currentwp == 5 and direction == WPT_FORWARD then 
											currentwp = currentwp-1
										elseif currentwp == 1 and direction == WPT_BACKWARD then 
											currentwp = currentwp+1
										end
										print ("current: "..currentwp);
										__WPL:setWaypointIndex(currentwp);
end
	__WPL:setDirection(direction);


	
	changeProfileOption("WAYPOINT_DEVIATION",5);

	for k,v in pairs(settings.profile.skills) do
		 v.AutoUse = false;
	end

	function fetchQuest()
		if questsDone() and questtype == "daily" then
			cprintf (cli.pink,"Time spend for this daily: %s Minutes\n",(os.time()-time)/60);
			if writeSQLite then
				writeSQLite ("TQDone",1);
			end
-- Enable easy switching between the 2 behaviours
			if true then
				error ("Dailys done for today!",0);
			else
-- bisschen ins abseits laufen..
			player:moveTo(CWaypoint(-10277,3108),false)

-- See http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&t=5573
			GetToVaranas();
				player:update();
				loadPaths("");
			end
			

		else
			if getQuestStatus(questName) ~="incomplete" or  getQuestStatus(questName) =="not accepted" then
				player:target_NPC(questGiverId);
				yrest(150);
				AcceptQuestByName(questName,questtype);
			end
		end
	end
	
	function completeQuest()
		if getQuestStatus(questName) =="complete" then
			player:target_NPC(questGiverId);
			yrest(150);
			CompleteQuestByName(questName);
		end
	end
	
--	__WPL:setWaypointIndex(__WPL:findWaypointTag("pickboxes"));	
</onload>

	<!-- #  1 --><waypoint x="-10303" z="3030" y="38" tag="questGiver">

	direction = WPT_FORWARD;
	__WPL:setDirection(direction)
	
	if getQuestStatus(questName) ~= "complete" and minPlayerLevel > player.Level then
	
	else
		completeQuest();
		fetchQuest();
		player:update();
--		if not player.Mounted then		player:mount();	end
	end
	

	</waypoint>
	<!-- #000 --><waypoint x="-10346" z="3065" y="38" tag="pickboxes"></waypoint>
	<!-- #000 --><waypoint x="-10408" z="3223" y="37" tag="pickboxes2"></waypoint>
	<!-- #000 --><waypoint x="-10400" z="3294" y="37" >pickupChest("rune");</waypoint>
	<!-- #000 --><waypoint x="-10440" z="3175" y="40"></waypoint>
	<!-- #000 --><waypoint x="-10447" z="3156" y="42">pickupChest("tool");pickupChest("device");
	if getQuestStatus(questName) ~="complete" then
		__WPL:setWaypointIndex(__WPL:findWaypointTag("pickboxes2"));
	else
		__WPL:setWaypointIndex(__WPL:findWaypointTag("questGiver"));
	end
	</waypoint>
	<!-- #  1 --><waypoint x="-9160" z="3013" y="38" tag="sturobold">	
		if not player.Mounted then		player:mount();	end
	</waypoint>
	<!-- #  2 --><waypoint x="-9405" z="2901" y="43">	</waypoint>
	<!-- #  3 --><waypoint x="-9556" z="2824" y="65">	</waypoint>
	<!-- #  4 --><waypoint x="-9897" z="2933" y="57">	</waypoint>
	<!-- #  5 --><waypoint x="-10003" z="2936" y="57">	</waypoint>
	<!-- #  6 --><waypoint x="-10128" z="2940" y="61">	</waypoint>
	<!-- #  7 --><waypoint x="-10250" z="3035" y="57">	</waypoint>
	
</waypoints>