<?xml version="1.0" encoding="utf-8"?><waypoints type="RUN">
<!-- Demonstration Battle daily quest -->
<!-- v1.1 -->
<!-- Original by: lolita, modifications by Bill D Cat -->
<!-- Do Demonstration Battle daily quest in Rorazan, and use daily reset tickets if you have some -->
<onLoad>

function checkDone()
	if getQuestStatus(425124) == "incomplete" then
		__WPL:setWaypointIndex(__WPL:findWaypointTag("Volunteer"))
	end
	if getQuestStatus(425124) == "complete" then
		__WPL:setWaypointIndex(__WPL:findWaypointTag("TurnIn"))
	end
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="-18345" z="-22669" y="469">
			checkDone()
			local dailyCount, dailyTotal = RoMScript("Daily_count()")
			if dailyCount == 10 then
				if inventory:itemTotalCount(202434) > 0 then
					print("Using a Daily Quest Reset Ticket")
					inventory:useItem(202434)
					yrest(2000)
					loadPaths(__WPL.FileName)
				else
					loadPaths("Dailys/BackToVaranas")
				end
			else
      			print("Daily Quests: "..dailyCount.."/"..dailyTotal.." completed.")
      		end
			player:target_NPC(119856) -- Anthony Taz
			AcceptQuestByName(425124) -- Demonstration Battle
	</waypoint>
	<!-- #  2 --><waypoint x="-18345" z="-22669" y="469" tag="Volunteer">
			player:target_NPC(119856) -- Anthony Taz
			ChoiceOptionByName(getTEXT("SC_425104_G")) -- (Volunteer for demonstration)
	</waypoint>
	<!-- #  3 --><waypoint x="-18345" z="-22669" y="469">
			startBattle()
			checkDone()
	</waypoint>
	<!-- #  4 --><waypoint x="-18345" z="-22669" y="469" tag="TurnIn">
			player:target_NPC(119856) -- Anthony Taz
			CompleteQuestByName(425124) -- Demonstration Battle
	</waypoint>
</waypoints>