<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad><![CDATA[

	DOD_PARTY_LEADER = "LEADER_NAME"
	
	changeProfileOption("AUTO_ELITE_FACTOR",1000)
	changeProfileOption("LOOT_IN_COMBAT",false)
	
	EventMonitorStart("DoD", "CHAT_MSG_PARTY")
		
	function waitForLeader()
		yrest(100)
		keyboardPress(settings.hotkeys.JUMP.key)
		while true do
			cprintf(cli.lightred,"Waiting for leader...\n")
			local time, moreToCome, _name, _message = EventMonitorCheck("DoD","4,1",true)
			if _message then
				string.lower(_message)
			end
			if _message and (_message == "enter" or _message == "ready" or _message == "okander") then
				break
			else
				yrest(2000)
			end
			player:update()
		end
		cprintf(cli.lightgreen,"Party is ready!\n")
	end
	
	function ApplyPots()
		useGoodie("speed") -- Unbridled Enthusiasm
		useGoodie("casting") -- Clear Thought
		useGoodie("luck") --Turn of Luck Powder Dust
		useGoodie("defense") --Scarlet Love
		useGoodie("godspeed") --Godspeed
		useGoodie("pdmg") -- Housekeeper Special Salted Fish with Sauce
		useGoodie("critp") -- Housekeeper Special Caviar Sandwich
		useGoodie("patt2") -- Housekeeper Special Spicy Meatsauce Burrito
		useGoodie("patt3") -- Housekeeper Special Unimaginable Salad
	end
	
	function CountObjectsNearPoint(_nameorid, _point, inrange, printnames)
		if type(_point) ~= "table" then _point = {player.X,player.Z,player.Y} end
		local objectList = CObjectList();
		local detected = {}
	
		objectList:update()
		for i = 0,objectList:size() do
			local obj = objectList:getObject(i)
			if obj ~= nil and (obj.Id == _nameorid or obj.Name == _nameorid) and obj.Address ~= player.Address and obj.Name ~= "<UNKNOWN>" and (inrange == nil or inrange >= distance(_point.X,_point.Z,_point.Y,obj.X,obj.Z,obj.Y) ) then
				if printnames then
					table.insert(detected,obj.Name)
				end
			end
		end
		if #detected > 0 then
			cprintf(cli.yellow,"Objects in range:\n")
			for i = 1, #detected do
				cprintf(cli.pink,detected[i].."\t")
			end
			printf("\n")
		end
		return #detected
	end
	
	npcName = GetIdName(115536) -- Isaac Haden
	function visitmerchant()
		if inventory:getMainHandDurability() < 95 or inventory:itemTotalCount(0) < 12 then
			return true
		else
			return false
		end
	end
	mentos = 0
]]></onLoad>
	<!-- #  1 --><waypoint x="1645" z="-4908" y="752">
		__WPL:setDirection(WPT_FORWARD)
		if visitmerchant() then
			changeProfileOption("WAYPOINT_DEVIATION", 25)
			__WPL:setWaypointIndex(11)
		end
	</waypoint>
	<!-- #  2 --><waypoint x="1662" z="-4970" y="760">	</waypoint>
	<!-- #  3 --><waypoint x="1660" z="-5072" y="760">
		changeProfileOption("WAYPOINT_DEVIATION", 75)
	</waypoint>
	<!-- #  4 --><waypoint x="1665" z="-5069" y="760" tag="entrance">
		changeProfileOption("WAYPOINT_DEVIATION", 0)
		player:faceDirection(math.atan2(-5124 - player.Z, 1667 - player.X))
		waitForLeader()
		__WPL:setForcedWaypointType("RUN")
		GoThroughPortal(200)
		__WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X,player.Z,player.Y))
	</waypoint>
	<!-- #  5 --><waypoint x="1793" z="2880" y="433" tag="exit">
		if __WPL.Direction == WPT_BACKWARD then
			__WPL:setForcedWaypointType("RUN")
			GoThroughPortal(200)
			player:update()
			if getZoneId() ~= 209 then
				if RoMScript("GetNumPartyMembers()") > 1 then
					RoMScript("LeaveParty()")
					waitForLoadingScreen(15)
				else
					RoMScript("SendWedgePointReport()")
					waitForLoadingScreen(75)
				end
				__WPL:setDirection(WPT_FORWARD)
			end
			__WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X,player.Z,player.Y))
		else
			ApplyPots()
			waitForLeader()
			__WPL:setForcedWaypointType("NORMAL")
		end
	</waypoint>
	<!-- #  6 --><waypoint x="1892" z="2887" y="433">	</waypoint>
	<!-- #  7 --><waypoint x="2043" z="2699" y="433">	</waypoint>
	<!-- #  8 --><waypoint x="2124" z="2602" y="432">
		if __WPL.Direction == WPT_FORWARD then
			waitForLeader()
			mentos = inventory:itemTotalCount("Ancient Memento")
		end
	</waypoint>
	<!-- #  9 --><waypoint x="2153" z="2569" y="421">	</waypoint>
	<!-- # 10 --><waypoint x="2331" z="2361" y="401" tag="okander">
		if CountObjectsNearPoint("Okander") > 0 then
			if not player.Battling then
				yrest(250)
			end
			__WPL:setWaypointIndex(10)
		else
			__WPL:setDirection(WPT_BACKWARD)
			repeat
				yrest(500*math.random(4))
				local okander = player:findNearestNameOrId("Okander")
				if not okander then break end
				player:target(okander)
				player:update()
				player:loot()
			until inventory:itemTotalCount("Ancient Memento") > mentos
		end
	</waypoint>
	
	<!-- # 11 --><waypoint x="1704" z="-4756" y="752" tag="merchant">
		player:merchant(npcName)
		RoMScript("CloseAllWindows()")
		__WPL:setWaypointIndex(2)
	</waypoint>
	
	<!-- To the Sewers -->
	<!-- #  1 --><waypoint x="-3813" z="5117" y="19" tag="res">
		__WPL:setForcedWaypointType("RUN")
		player:mount()
	</waypoint>
	<!-- #  2 --><waypoint x="-3722" z="5220" y="12">	</waypoint>
	<!-- #  3 --><waypoint x="-3664" z="5311" y="11">	</waypoint>
	<!-- #  4 --><waypoint x="-3564" z="5362" y="11">	</waypoint>
	<!-- #  5 --><waypoint x="-3458" z="5434" y="9">	</waypoint>
	<!-- #  6 --><waypoint x="-3356" z="5530" y="10">	</waypoint>
	<!-- #  7 --><waypoint x="-3252" z="5629" y="3">	</waypoint>
	<!-- #  8 --><waypoint x="-3164" z="5736" y="4">	</waypoint>
	<!-- #  9 --><waypoint x="-3025" z="5864" y="2">	</waypoint>
	<!-- # 10 --><waypoint x="-2903" z="5980" y="10">	</waypoint>
	<!-- # 11 --><waypoint x="-2842" z="6059" y="9">	</waypoint>
	<!-- # 12 --><waypoint x="-2782" z="6170" y="10">	</waypoint>
	<!-- # 13 --><waypoint x="-2712" z="6284" y="4">	</waypoint>
	<!-- # 14 --><waypoint x="-2622" z="6353" y="6">	</waypoint>
	<!-- # 15 --><waypoint x="-2524" z="6397" y="15">	</waypoint>
	<!-- # 16 --><waypoint x="-2469" z="6465" y="19">	</waypoint>
	<!-- # 17 --><waypoint x="-2472" z="6526" y="30">	</waypoint>
	<!-- # 18 --><waypoint x="-2517" z="6567" y="38">	</waypoint>
	<!-- # 19 --><waypoint x="-2595" z="6612" y="49">	</waypoint>
	<!-- # 20 --><waypoint x="-2726" z="6687" y="32">	</waypoint>
	<!-- # 21 --><waypoint x="-2786" z="6721" y="42">	</waypoint>
	<!-- # 22 --><waypoint x="-2847" z="6764" y="40">	</waypoint>
	<!-- # 23 --><waypoint x="-2865" z="6824" y="40">	</waypoint>
	<!-- # 24 --><waypoint x="-2826" z="6956" y="40">	</waypoint>
	<!-- # 25 --><waypoint x="-2851" z="7047" y="15">	</waypoint>
	<!-- # 26 --><waypoint x="-2838" z="7121" y="-24">	</waypoint>
	<!-- # 27 --><waypoint x="-2912" z="7231" y="-96">
		GoThroughPortal(200)
		__WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X,player.Z,player.Y))
	</waypoint>
	<!-- # 28 --><waypoint x="43" z="-882" y="857">
		local jake = GetIdName(115572)
		NPCTeleport(jake,"Please transport me.")
		__WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X,player.Z,player.Y))
	</waypoint>
</waypoints>