<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
	<!--	This file runs the daily "Demonstration Battle" in the Ancient Kingdom of Rorazan with class swap for turn in of quest.
			There is a failsafe check to ensure that one class is at least level 71 to do the daily, and another class is between 61 and 70 to turn it in. -->
	<onload>
	changeProfileOption("ANTI_KS", true)
	local dailyCount, dailyTotal = RoMScript("Daily_count()")
	print("Daily Quests: "..dailyCount.."/"..dailyTotal.." completed.")
	if dailyCount ~= 10 then
		<!-- Check to see we have suitable class levels to run the daily. -->
		local classtable = {"WARRIOR", "SCOUT", "ROGUE", "MAGE", "PRIEST", "KNIGHT", "WARDEN", "DRUID", "WARLOCK", "CHAMPION"}
		local maingood = false
		local secgood = false
		local usemain = -1
		local usesec = -1
		if player.Level >= 71 then
			maingood = true
			usemain = player.Class1
		elseif player.Level2 >= 71 then
			maingood = true
			usemain = player.Class2
		elseif player.Level3 >= 71 then
			maingood = true
			usemain = player.Class3
		end
		if maingood == true then
			if usemain == player.Class1 then
				if player.Level2 >= 61 and 70 >= player.Level2 then
					secgood = true
					usesec = player.Class2
				elseif player.Level3 >= 61 and 70 >= player.Level3 then
					secgood = true
					usesec = player.Class3
				end
			elseif usemain == player.Class2 then
				if player.Level >= 61 and 70 >= player.Level then
					secgood = true
					usesec = player.Class1
				elseif player.Level3 >= 61 and 70 >= player.Level3 then
					secgood = true
					usesec = player.Class3
				end
			elseif usemain == player.Class3 then
				if player.Level >= 61 and 70 >= player.Level then
					secgood = true
					usesec = player.Class1
				elseif player.Level2 >= 61 and 70 >= player.Level2 then
					secgood = true
					usesec = player.Class2
				end
			end
		end
		if maingood == false or secgood == false then
			error("No viable class combinations to run daily.",0)
		end
		print("Running Daily as "..classtable[usemain].."/"..classtable[usesec])
		if not __WPL.ResumePoint then
			__WPL:setWaypointIndex(1)
		end
		local zonename = RoMScript("GetZoneLocalName(GetZoneID())")
		if zonename ~= "Ancient Kingdom of Rorazan" then
			print("Moving to Ancient Kingdom of Rorazan for Demonstration Battle (Daily)")
			player:mount()
			travelTo("DemonstrationBattle")
		else
			local _NPC = player:findNearestNameOrId(120185) -- Find John Roger (House Maid) to begin.
			if _NPC and 150 > distance(_NPC, player) then
				__WPL:setWaypointIndex(16)
			end
			local _NPC = player:findNearestNameOrId(119856) -- Find Anthony Taz (Quest Giver) to begin.
			if _NPC and 150 > distance(_NPC, player) then
				__WPL:setWaypointIndex(1)
			end
		end
	else
		error("Daily quests already completed. Try again tomorrow.",0)
	end

	function dbAttack()
		if (player.Class1 == CLASS_MAGE or player.Class2 == CLASS_MAGE) then
			RoMScript("/cast Fireball")
		elseif (player.Class1 == CLASS_SCOUT or player.Class2 == CLASS_SCOUT) then
			RoMScript("/cast Shot")
		elseif (player.Class1 == CLASS_ROGUE or player.Class2 == CLASS_ROGUE) then
			RoMScript("/cast Shadowstab")
		elseif player.Class1 == CLASS_PRIEST then
			RoMScript("/cast Chain of Light")
		elseif player.Class1 == CLASS_KNIGHT then
			RoMScript("/cast Holy Strike")
		elseif player.Class1 == CLASS_WARDEN then
			RoMScript("/cast Charged Chop")
		elseif player.Class1 == CLASS_WARLOCK then
			RoMScript("/cast Surge of Malice")
		elseif player.Class1 == CLASS_DRUID then
			RoMScript("/cast Earth Arrow")
		elseif player.Class1 == CLASS_CHAMPION then 
			Attack()
		elseif player.Class1 == CLASS_WARRIOR then
			Attack()
		end
	end

	function startBattle()
		_target = player:findNearestNameOrId({106474,106475,106476})
		if _target then
			if _target.Aggressive == nil then
				RoMScript("TargetNearestEnemy()")
			else
				player:target(_target)
			end
			dbAttack()
		end
	end
	</onload>	
	<!-- #  1 --><waypoint x="-18359" z="-22715" y="473">
			if 71 > player.Level then
				__WPL:setWaypointIndex(3)
			end
	</waypoint>
	<!-- #  2 --><waypoint x="-18359" z="-22715" y="473">
			__WPL:setDirection(WPT_FORWARD)
			if getQuestStatus(425124) == "not accepted" then
				player:target_NPC(119856) -- Anthony Taz
				AcceptQuestByName(425124) -- Demonstration Battle
				yrest(250)
				repeat
					player:target_NPC(119856) -- Anthony Taz
					ChoiceOptionByName(getTEXT("SC_425104_G")) -- (Volunteer for demonstration)
					yrest(250)
				until getQuestStatus(425124) == "incomplete"
				repeat
					startBattle()
					yrest(250)
				until getQuestStatus(425124) == "complete"
			elseif getQuestStatus(425124) == "complete" then
				player:target_NPC(119856) -- Anthony Taz
				CompleteQuestByName(425124) -- Demonstration Battle
			end
			repeat
				player:mount()
				yrest(2000)
			until player.Mounted
	</waypoint>
	<!-- #  3 --><waypoint x="-18391" z="-22864" y="459">	</waypoint>
	<!-- #  4 --><waypoint x="-18450" z="-22976" y="459">	</waypoint>
	<!-- #  5 --><waypoint x="-18475" z="-23088" y="425">	</waypoint>
	<!-- #  6 --><waypoint x="-18408" z="-23091" y="425">	</waypoint>
	<!-- #  7 --><waypoint x="-18248" z="-23034" y="425">	</waypoint>
	<!-- #  8 --><waypoint x="-18117" z="-22995" y="471">	</waypoint>
	<!-- #  9 --><waypoint x="-17958" z="-23037" y="471">	</waypoint>
	<!-- # 10 --><waypoint x="-17770" z="-23134" y="471">	</waypoint>
	<!-- # 11 --><waypoint x="-17629" z="-23347" y="552">	</waypoint>
	<!-- # 12 --><waypoint x="-17617" z="-23499" y="552">	</waypoint>
	<!-- # 13 --><waypoint x="-17573" z="-23561" y="552">	</waypoint>
	<!-- # 14 --><waypoint x="-17403" z="-23419" y="620">	</waypoint>
	<!-- # 15 --><waypoint x="-17303" z="-23368" y="620">	</waypoint>
	<!-- # 16 --><waypoint x="-17215" z="-23499" y="619">
			local dailyCount, dailyTotal = RoMScript("Daily_count()")
			if getQuestStatus(425124) == "complete" and dailyCount == 0 then
				<!-- If primary class is over 71 and secondary is between 61 and 70, then fall through to next section to swap classes and turn in. -->
				if 71 >= player.Level and (player.Level2 >= 61 and 70 >= player.Level2) then 
					print("Beginning Demonstration Battle Daily")
				else
					player:target_NPC(120185) -- John Roger
					<!-- First we check to see if swapping current classes will meet the level requirements -->
					if player.Level2 >= 71 and (player.Level >= 61 and 70 >= player.Level) then
						swapClass(player.Class2, player.Class1)
					<!-- If swapping current classes was not good, continue to check class combinations until a suitable match is found. -->
					elseif player.Level >= 71 and (player.Level3 >= 61 and 70>= player.Level3) then
						swapClass(player.Class1, player.Class3)
					elseif player.Level2 >= 71 and (player.Level3 >= 61 and 70 >= player.Level3) then
						swapClass(player.Class2, player.Class3)
					elseif player.Level3 >= 71 and (player.Level >= 61 and 70 >= player.Level) then
						swapClass(player.Class3, player.Class1)
					elseif player.Level3 >= 71 and (player.Level2 >= 61 and 70 >= player.Level2) then
						swapClass(player.Class3, player.Class2)
					else
						error("No viable class combinations to run daily.",0)
					end
				end
			end
			if getQuestStatus(425124) == "not accepted" then
				if 71 > player.Level then
					repeat
						player:target_NPC(120185) -- John Roger
						swapClass()
					until player.Level >= 71
				end
			end
			if getQuestStatus(425124) == "complete" then
				if player.Level > 71 then
					repeat
						player:target_NPC(120185) -- John Roger
						swapClass()
					until 71 > player.Level
				end
			end
			if dailyCount == 10 then
				if inventory:itemTotalCount(202434) > 0 then
					print("Using a Daily Quest Reset Ticket")
					inventory:useItem(202434)
					yrest(2000)
				else
					error("Daily Quests Completed.",0)
				end
			end
			repeat
				player:mount()
				yrest(2000)
			until player.Mounted
			__WPL:setDirection(WPT_BACKWARD)
	</waypoint>
</waypoints>