<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onload>

	YourTargetScore = 3100

	function waitForEventStart()
		repeat
			yrest(1000) -- check every second
			local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
			if Count == 2 then break end
		until false
	end

	function isEventFinished()
		local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
		if Count ~= 2 or ScorePE >= YourTargetScore or not PEFisVisible() then
			return true
		else
			retuen false
		end
	end

	function PEFisVisible()
		return RoMScript("PEFs:isVisible()")
	end

</onload>

   <!-- #  1 --><waypoint x="-21559" z="-22931" y="588" tag="Do Again">
	   player:target_NPC("Diandon");
	   yrest(100);
	   player:target_NPC("Diandon");
	   yrest(100);
   </waypoint>
   <!-- #  2 --><waypoint x="-21636" z="-22916" y="592">   </waypoint>
   <!-- #  3 --><waypoint x="-21742" z="-23032" y="588">
		local queststate = getQuestStatus("Extinguish More Flames");
		while queststate == "incomplete" do
			yrest(100);player:target_Object("Strange Flame Seedling");yrest(100);
			queststate = getQuestStatus("Extinguish More Flames");
			if isEventFinished() then
				__WPL:setForcedWaypointType("RUN")
				break
			end
		end
   </waypoint>
   <!-- #  4 --><waypoint x="-21642" z="-22920" y="592" tag="Home Base">
		if PEFisVisible() then
			waitForEventStart()
			__WPL:setForcedWaypointType("NORMAL")
			__WPL:setWaypointIndex(__WPL:findWaypointTag("Do Again"));
		end
   </waypoint>

</waypoints>
