<?xml version="1.0" encoding="utf-8"?><waypoints type="RUN">
<onLoad>
--== Start in Varanas 34 / 23 ==--

BuffOfMouseId = 508509				-- Boshaftigkeit 
OwnBuffId = 508510					-- Arkane Flamme (max 100)
HungryMouse = 117259	;
FlameAltar = 117258;
--Rune id : 120157

minSelfBuff = 91;


function getbufflevel(buffId)
	player:update();
	level = -1;
	if player:hasBuff(buffId) then
		buff = player:getBuff(buffId)
		if type(buff) == "table" then
			level =  buff.Level;
		else
--			print ("debug: "..buff);
		end
	else
		level = -1;
	end
		return level;
end


function discardMouse()
	t=player:findNearestNameOrId(HungryMouse);
	if t ~= nil then
		player:target(t);
		i=10;
		while t.Type >0 do
			moveTo(t.X+i,t.Z+i);
			yrest(100);
			print ("Kille Mouse");
			RoMScript("UseExtraAction(1)");
			yrest(1250);
			t:update();
			i=i+1;
		end
		player:clearTarget();
	end
end


while 1 do
	if minSelfBuff > getbufflevel(OwnBuffId) then
		
		altar=player:findNearestNameOrId(FlameAltar);
		if altar == nil then 
			error ("Flamealtar not in Range",404)
		else
			player:target(altar);
		end
		while minSelfBuff > getbufflevel(OwnBuffId) do
			Attack();
			yrest(100);
			if 0 > getbufflevel(OwnBuffId) then
				moveTo(2750,845);
				NPCTeleport ("Lieve","Stadtplatz");
				moveTo(4809,-2152);
				moveTo(5039,-2397);
				player:target_NPC("Ajis");
				yrest(500);
				RoMScript("ChoiceOption(1)");
				yrest(250);
				RoMScript("CloseAllWindows()");
				error("Finished",0);
			end
		end
	end
	discardMouse();
end

</onLoad>
</waypoints>