<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
<!--**************************************************************************************************************************************************************
******************************************************************************************************************************************************************
**																		   MAIN.XML																			**
**																	Waypoint Create by Xm3n																		**
**																																								**
**															Thanks to Lisa, M4gm4, and all other tester															**
**																																								**
******************************************************************************************************************************************************************
***************************************************************************************************************************************************************-->

<!-- ##Version 0.3.1asu Beta##												Options
##################################################################################################################################################################
##																	CHANGE FOLOW OPTION																			##
##																																								##
##				on line 48				changeProfileOption("INV_AUTOSELL_ENABLE", "true")		set to true if you sell bag contents							##
##						38				changeProfileOption("INV_AUTOSELL_FROMSLOT", xx)		1-180 (1-30 is the first bag 1-60 sec. ...)						##
##						39				changeProfileOption("INV_AUTOSELL_TOSLOT", xxx)			1-180 (1-30 is the first bag 1-60 sec. ...)						##
##						47				changeProfileOption("EGGPET_ENABLE_ASSIST", "true") 	Set to true if you wanna use your pet							##
##						40				dura = xxx												//100% = 1 // 50% = 0.5 // 10% = 0.1							##
##						41				instancebuff = true										true= On / false = Off get a buff if you open Coffin			##
##						44				Instancereset = false									if you want to farme DoD solo and no wait to 					##
##																									reset instance set this to true								##
##																																								##
##																								exp: Main char. go DoD and any other char is 					##
##																										in house or miller										##
##																																								##
##						50				Grassland_Mix = true									Set to true if you want use Grassland Mix						##
##						51-53			Magic_xxx = true										Set to true if you want use the magic_instruments 				##
##																																								##
##																								Set to party_true if you want use the magic_instruments			##
##																								form party member												##
##																																								##
##																								Set to false if you want to disable								##
###############################################################################################################################################################-->

					changeProfileOption("INV_AUTOSELL_FROMSLOT", 120)
					changeProfileOption("INV_AUTOSELL_TOSLOT", 180)
					dura = 0.9
					instancebuff = false
					
					--==New on Ver. 0.2==--
					Instancereset = true
					
					--==New on Ver. 0.3==--
					changeProfileOption("EGGPET_ENABLE_ASSIST", "false")
					changeProfileOption("INV_AUTOSELL_ENABLE", "true")
					
					Grassland_Mix = true
					Magic_Lute = false
					Magic_Tambourine = false
					Magic_Guitar = false

<!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++..==Start Functions==..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
																		###################
																		###!!!WARNING!!!###
																		###################
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++DONT CHANGE THE FOLLOW LINE+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->


					__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))
					changeProfileOption("AUTO_ELITE_FACTOR", 1000)
					changeProfileOption("HARVEST_DISTANCE", 50)

					Count = 0
					Zid = 0
					BuffCount = 0
					srun = 1

					if not eventparty then
						function eventparty()
							checkeventparty()
						end
					end

					if not checkeventparty then 
						--cprintf(cli.red, "\t\t\t !!!Fatal error!!!\nMicroMacro Stop\nPlease instal the user function \"userfunction_partymonitoring.lua\" \n")
						function checkeventparty()
						close()
						end
					end

					function Boss_buff()
						if useGoodie then 
							if Grassland_Mix == true then 
								if inventory:itemTotalCount(206874) > 1 then
									useGoodie(206874)
								end
							else
								cprintf(cli.yellow, "Please instal the user function \"useGoodie\" \n")
							end 
						end	

						if Magic_Tambourine == true then
							if inventory:itemTotalCount(204463) >= 1 then
								inventory:useItem(204463) -- 3 days
								yrest(4000)
							elseif inventory:itemTotalCount(204571) >= 1 then
								inventory:useItem(204571) -- 7 days
								yrest(4000)
							elseif inventory:itemTotalCount(206420) >= 1 then
								inventory:useItem(206420) -- 30 days
								yrest(4000)
							end
						elseif Magic_Tambourine == party_true then
								yrest(4000)
						end

						if Magic_Lute == true then
							if inventory:itemTotalCount(204544) >=1 then
								inventory:useItem(204544) -- 3 days
								yrest(4000)
							elseif inventory:itemTotalCount(204570) >= 1 then
								inventory:useItem(204570) -- 7 days
								yrest(4000)
							elseif inventory:itemTotalCount(206419) >= 1 then
								inventory:useItem(206419) -- 30 days
								yrest(4000)
							end
						elseif Magic_Lute == party_true then
								yrest(4000)
						end

						if  Magic_Guitar == true then
							if inventory:itemTotalCount(204461) >= 1 then
								inventory:useItem(204461) -- 3 days
								yrest(4000)
							elseif inventory:itemTotalCount(206418) >= 1 then
								inventory:useItem(206418) -- 7 days
								yrest(4000)
							elseif inventory:itemTotalCount(204569) >= 1 then
								inventory:useItem(204569) -- 30 days
								yrest(4000)
							end
						elseif  Magic_Guitar == party_true then
								yrest(4000)	
						end
					end

					function Countround()
						Count = Count+1;
						cprintf(cli.pink, "Round Nbr: %s\n\n", Count)
					end
					
					function checkdura()
						if dura > inventory:getMainHandDurability() then
							__WPL:setWaypointIndex(__WPL:findWaypointTag("mech"))
						end

						local bcount = inventory:getItemCount(0)
						if(  5 > bcount ) then
							__WPL:setWaypointIndex(__WPL:findWaypointTag("mech"))
						end
					end

					function findzi()					
						keyboardHold( settings.hotkeys.MOVE_FORWARD.key )
						yrest(500)
						keyboardRelease( settings.hotkeys.MOVE_FORWARD.key )
						waitForLoadingScreen(10)
						yrest(500)
						local getinlvl = sendMacro('GetInstanceLevel()')
						if getinlvl == ("easy") then
							zid = 128
						elseif getinlvl == ("normal") then
							zid = 127
						elseif getinlvl == ("hard") then
							zid = RoMScript("GetZoneID()");
							sendMacro('SetInstanceLevel("easy")');
							cprint(cli.blue, "Instance Lvl change to easy\n")
						end
					end

					function getbuff()
						player:harvest(114982)
						player:update() 
						if player:hasBuff(506432) then
							__WPL:setWaypointIndex(__WPL:findWaypointTag("havebuff"))
						else
							BuffCount = BuffCount+1
							if BuffCount > 8 then
								__WPL:setWaypointIndex(__WPL:findWaypointTag("havebuff"))
							end
						end
					end

					cprintf(cli.pink, "\n\n\nWaypoint create by Xm3n\n\n\n")

					function gcheck()
						local _go = false
						local groupnumber = RoMScript("GetNumPartyMembers()")
						if groupnumber == 0 then
							_go = false
						else
							_go = true
						end
						return _go
					end

					function ireset()
						local EventPartyName = "DoD"
						local readycheck1 = RoMScript("UnitName('party1')")
						local readycheck2 = RoMScript("UnitName('party2')")
						local readycheck3 = RoMScript("UnitName('party3')")
						local readycheck4 = RoMScript("UnitName('party4')")
						local readycheck5 = RoMScript("UnitName('party5')")
						local groupnumber = RoMScript("GetNumPartyMembers()")
						if Instancereset == true then
							SlashCommand("ILG destroy")
							yrest(500)
							SlashCommand("ILG inv")
						elseif gcheck() == true then
							repeat
							until checkparty(400) == true
							yrest(200)
							SlashCommand("ILG destroy")
							yrest(500)
							SlashCommand("ILG inv")
						end
						yrest(200)

						if 1 == srun and 0 == groupnumber then
							srun = srun+1
						elseif gcheck() == false then
							cprintf(cli.red, "You must wait 30min to reset instance or groupe a player\n")
							local _time = os.time()
							repeat
							until gcheck() == true or (os.time() - _time > 1800)
							srun = 1
						end

						if not Instancereset == true then
							eventparty(EventPartyName, "start")	
							yrest(500)
							if readycheck1 == nil then
								pname1 = ("Solo_run")
								cprintf(cli.red, "!!! Warning you not in a group !!!\n")
							else
								pname1 = readycheck1
							end
							if readycheck2 == nil then
								pname2 = ("NoPartyMembers")
							else
								pname2 = readycheck2
							end
							if readycheck3 == nil then
								pname3 = ("NoPartyMembers")
							else
								pname3 = readycheck3
							end
							if readycheck4 == nil then
								pname4 = ("NoPartyMembers")
							else
								pname4 = readycheck4
							end
							if readycheck5 == nil then
								pname5 = ("NoPartyMembers")
							else
								pname5 = readycheck5
							end
							keyboardPress(key.VK_SPACE)
							yrest(1000)
							repeat
							yrest(500)
							local message = checkeventparty(EventPartyName,{pname1,pname2,pname3,pname4,pname5})
							if message and message == pname1 or pname1 == "Solo_run" then char1 = true end
							if message and message == pname2 or pname2 == "NoPartyMembers" then char2 = true end
							if message and message == pname3 or pname3 == "NoPartyMembers" then char3 = true end
							if message and message == pname4 or pname4 == "NoPartyMembers" then char4 = true end
							if message and message == pname5 or pname5 == "NoPartyMembers" then char5 = true end
							until char1 and char2 and char3	and char4 and char5
							char1 = false
							char2 = false
							char3 = false
							char4 = false
							char5 = false
							eventparty(EventPartyName, "stop")
						end
					end
</onLoad>
	<!-- #  1 -->
				<waypoint x="1667" z="-4926" y="763" tag="start" type="TRAVEL">
					checkdura()
				</waypoint>
	<!-- #  2 -->
				<waypoint x="1678" z="-5092" y="772" tag="enter" type="TRAVEL">
					Countround()
					ireset()
				</waypoint>
	<!-- #  3 -->
				<waypoint x="1687" z="-5142" y="772" type="TRAVEL">
					findzi()
					--player:update
					local zoneid = RoMScript("GetZoneID()")
					if zoneid == 209 then
						__WPL:setWaypointIndex(__WPL:findWaypointTag("enter"))
					else
						__WPL:setWaypointIndex(__WPL:findWaypointTag("instance"))
					end
				</waypoint>
	<!-- #  4 -->
				<waypoint x="1793" z="2880" y="433" tag="instance">		</waypoint>
	<!-- #  5 -->
				<waypoint x="1911" z="2859" y="433">	</waypoint>
	<!-- #  6 -->
				<waypoint x="2036" z="2702" y="433">	</waypoint>
	<!-- #  7 -->
				<waypoint x="2252" z="2444" y="401">
					if gcheck() == true then
						if Instancereset == true then
							Boss_buff()
							player:fight()
						elseif not Instancereset == true then
							keyboardPress(key.VK_SPACE)
							local _time = os.time()
							repeat
							until checkparty(100) == true or (os.time() - _time > 120)
							Boss_buff()
							player:fight()
						end
					elseif not gcheck() == true then
						Boss_buff()
						player:fight()
					end
				</waypoint>
	<!-- #  8 -->
				<waypoint x="2191" z="2520" y="401">
					if instancebuff == true then
						player:update() 
						if player:hasBuff(506432) then
							__WPL:setWaypointIndex(__WPL:findWaypointTag("buffok"))
						else
							__WPL:setWaypointIndex(__WPL:findWaypointTag("getbuff"))
						end
					else
						__WPL:setWaypointIndex(__WPL:findWaypointTag("buffok"))
					end
				</waypoint>
	<!-- #  9 -->
				<waypoint x="2465" z="2338" y="401" tag="getbuff" type="TRAVEL">	</waypoint>
	<!-- # 10 -->
				<waypoint x="2687" z="2340" y="432" type="TRAVEL">	</waypoint>
	<!-- # 11 -->
				<waypoint x="2707" z="2389" y="432" tag="object">
					getbuff()
				</waypoint>
	<!-- # 12 -->
				<waypoint x="2756" z="2346" y="432">
					getbuff()
				</waypoint>
	<!-- # 13 -->
				<waypoint x="2792" z="2444" y="432">
					getbuff()
				</waypoint>
	<!-- # 14 -->
				<waypoint x="2693" z="2476" y="432">
					getbuff()
				</waypoint>
	<!-- # 15 -->
				<waypoint x="2768" z="2546" y="432">
					player:harvest(114982)
					player:update() 
					if player:hasBuff(506432) then
						__WPL:setWaypointIndex(__WPL:findWaypointTag("havebuff"))
					else
						BuffCount = BuffCount+1
						if BuffCount > 8 then
							__WPL:setWaypointIndex(__WPL:findWaypointTag("havebuff"))
						else
							__WPL:setWaypointIndex(__WPL:findWaypointTag("object"))
						end
					end
				</waypoint>
	<!-- # 16 -->
				<waypoint x="2712" z="2340" y="432" tag="havebuff" type="TRAVEL">	</waypoint>
	<!-- # 17 -->
				<waypoint x="2290" z="2357" y="401" type="TRAVEL">	</waypoint>
	<!-- # 18 -->
				<waypoint x="2192" z="2520" y="401" type="TRAVEL">	</waypoint>
	<!-- # 19 -->
				<waypoint x="2191" z="2520" y="401" tag="buffok" type="TRAVEL">
					BuffCount = 0
				</waypoint>
	<!-- # 20 -->
				<waypoint x="1994" z="2762" y="433" type="TRAVEL">	</waypoint>
	<!-- # 21 -->
				<waypoint x="1891" z="2876" y="433" tag="exit" type="TRAVEL">	</waypoint>
	<!-- # 22 -->
				<waypoint x="1700" z="2886" y="433" type="TRAVEL">
					findzi()
					local zoneid = RoMScript("GetZoneID()")
						if zoneid == zid then
							__WPL:setWaypointIndex(__WPL:findWaypointTag("exit"))
						else
							__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))
						end
				</waypoint>
	<!-- # 23 -->
			<waypoint x="1707" z="-4755" y="752" tag="mech" type="TRAVEL">
				local bcount = inventory:getItemCount(0)
				player:update()
				player:merchant(115536)				--== no more works on Chapter IV ==--
				yrest(500)
				local cbcount = inventory:getItemCount(0)
				if bcount == cbcount then
					if player:openStore(115536) then
						for i, item in pairs(inventory.BagSlot) do
							if item.SlotNumber >= settings.profile.options.INV_AUTOSELL_FROMSLOT +60 and settings.profile.options.INV_AUTOSELL_TOSLOT +60 >= item.SlotNumber then
								item:use() -- sells it to the store
							end
						end
					end
				end
				__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))
			</waypoint>
</waypoints>
