<?xml version="1.0" encoding="utf-8"?><waypoints TYPE="TRAVEL">
<onload>
bigonedone = 0 -- to check if candies were traded already...

settings.profile.options.HARVEST_DISTANCE=50 -- It will only target target_Object if within the range specified.

function checkdebuff(x,y,z)
        yrest(111)
        while (player:hasBuff("Frightened")) do   -- we got feared? better wait a sec and tele to pos
                yrest(3)
                teleport(x,y,z)
        end
end
function prankster()
        player:target_Object(116032); -- Spooky Pumpkin
        yrest(100)
        player:target_NPC(116033); -- Pumpkin Prankster
        inventory:useItem(207267); -- cage
        yrest(100)
        inventory:useItem(207267);
        yrest(100)

end

function checkstate()
        -- when 5 are found backwards and hand in
        local queststate = getQuestStatus("Pumpkin Pranksters")
        if queststate == "complete" then
                __WPL:setDirection(WPT_BACKWARD);
        end
end

function bigprankster()
         if bigonedone == 0 then
	player:clearTarget();
 		cprintf(cli.yellow,"1\n")			
                 -- is made to find the walking pumpkin...
                 settings.profile.options.HARVEST_DISTANCE=200 -- to find it :O
		 
		 target = player:getTarget(player:target_NPC("119977"));
		 target:update();
                 if (target.Name =="Pumpkin Prankster") then
			cprintf(cli.yellow,"2\n")
			target:update();
			teleport(target.X, target.Z)
                        bigonedone = 1
                 	player:target_NPC(119977)
			yrest(3000)
			target:update();
			teleport(target.X, target.Z)
			player:target_NPC(119977)
                 	-- select choice option 1 as often as possible :/
                 	while (1 > inventory:itemTotalCount(240524) + inventory:itemTotalCount(240525)) do -- Milk Candy or Rainbow Lollipop
                           	yrest(200)
                           	ChoiceOptionByName("I have some candy for you.")
                 	end
		 end
                 settings.profile.options.HARVEST_DISTANCE=50 -- to continue the pumpkins
         end
end



</onload>


        <!-- #  1 --><waypoint x="-4208" z="5028" y="17">
                -- from snoop to questgiver
        </waypoint>
        <!-- #  2 --><waypoint x="-4215" z="4844" y="14">        </waypoint>
        <!-- #  3 --><waypoint x="-4246" z="4838" y="13">
                player:target_NPC("Belle Rossly");
                yrest(200)
                AcceptQuestByName("Pumpkin Pranksters")
                local queststate = getQuestStatus("Pumpkin Pranksters")
                if queststate == "complete" then
                        CompleteQuestByName("Pumpkin Pranksters")
			yrest(500)
			RoMScript("CastSpellByName('Transport: Logar')")
			waitForLoadingScreen();
			cprintf(cli.yellow,"Candies are done lets do next thing!\n")
			loadPaths("pumpkinfestival")

                end
        </waypoint>
        <!-- #  5 --><waypoint x="-4058" z="5042" y="14">
                -- questgiver to quest
        </waypoint>
        <!-- #  6 --><waypoint x="-4057" z="5215" y="36">        </waypoint>
        <!-- #  7 --><waypoint x="-4087" z="5319" y="49">        </waypoint>
        <!-- #  8 --><waypoint x="-4126" z="5456" y="32">        </waypoint>
        <!-- #  9 --><waypoint x="-4169" z="5609" y="36">        </waypoint>
        <!-- # 10 --><waypoint x="-4190" z="5836" y="45">        </waypoint>
        <!-- # 11 --><waypoint x="-4197" z="5920" y="45" tag="outofhere">
                local queststate = getQuestStatus("Pumpkin Pranksters")
                if ((bigonedone == 0) and (queststate == "complete")) then
                 __WPL:setWaypointIndex(__WPL:findWaypointTag("dobigone"));
                end
        </waypoint>

        <!-- #  1 --><waypoint x="-3905" z="6153" y="55" tag="notfinished">
        -- the point at which we wait until pumpkin spawn

        local queststate = getQuestStatus("Pumpkin Pranksters")
        if queststate == "complete" then
                __WPL:setDirection(WPT_BACKWARD);
        else
                -- questing starts here
                cprintf(cli.yellow,"We park here and wait for Spooky pumpkin...\n")
                settings.profile.options.HARVEST_DISTANCE=200
                player:update();
                while (true) do
                        yrest(250)

                        player:target_Object("Spooky Pumpkin");
                        spooky = player:getTarget();
			if spooky then
                        -- found at least one so we can start the farm
                                player:clearTarget();
                                settings.profile.options.HARVEST_DISTANCE=50
                                player:update();
                                yrest(100)
                                break
                        end
			bigprankster()
                end
                checkdebuff(-3905,6153,55)
                prankster()
        end
        </waypoint>
        <!-- #  2 --><waypoint x="-3889" z="5984" y="56">
                checkdebuff(-3889,5984,56)
                prankster()
        </waypoint>
        <!-- #  3 --><waypoint x="-3641" z="5917" y="60">
                checkdebuff(-3641,5917,60)
                prankster()
        </waypoint>
        <!-- #  4 --><waypoint x="-3776" z="6145" y="55">
                checkdebuff(-3776,6145,55)
                prankster()
        </waypoint>
        <!-- #  5 --><waypoint x="-3682" z="6155" y="55">
                checkdebuff(-3682,6155,55)
                prankster()
                checkstate()
        </waypoint>
        <!-- #  6 --><waypoint x="-3704" z="6221" y="62">
                checkdebuff(-3704,6221,62)
                prankster()
        </waypoint>
        <!-- #  7 --><waypoint x="-3658" z="6237" y="62">
                checkdebuff(-3658,6237,62)
                prankster()
                checkstate()
        </waypoint>
        <!-- #  8 --><waypoint x="-3631" z="6110" y="55">        </waypoint>
        <!-- #  9 --><waypoint x="-3510" z="6018" y="59">
                checkdebuff(-3510,6018,59)
                prankster()
        </waypoint>
        <!-- #  1 --><waypoint x="-3682" z="6061" y="55">        </waypoint>
        <!-- #  2 --><waypoint x="-4118" z="6039" y="55">         </waypoint>
        <!-- #  1 --><waypoint x="-4048" z="6112" y="55">
                checkdebuff(-4048,6112,55)
                prankster()
        </waypoint>
        <!-- #  2 --><waypoint x="-4130" z="6064" y="55">        </waypoint>
        <!-- #  3 --><waypoint x="-4238" z="6083" y="55">
                checkdebuff(-4238,6083,55)
                prankster()
        </waypoint>
        <!-- #  4 --><waypoint x="-4306" z="6087" y="55">        </waypoint>
        <!-- #  5 --><waypoint x="-4379" z="6018" y="58">
                checkdebuff(-4379,6018,58)
                prankster()
        </waypoint>
        <!-- #  6 --><waypoint x="-4346" z="6021" y="56">        </waypoint>
        <!-- #  7 --><waypoint x="-4309" z="5984" y="55">        </waypoint>
        <!-- #  8 --><waypoint x="-4352" z="5932" y="59">
                checkdebuff(-4352,5932,59)
                prankster()
        </waypoint>
        <!-- #  9 --><waypoint x="-4314" z="5718" y="45">
                checkdebuff(-4314,5718,45)
                prankster()
        </waypoint>
        <!-- #  1 --><waypoint x="-4388" z="5773" y="45">        </waypoint>
        <!-- # 10 --><waypoint x="-4451" z="5664" y="45">
                checkdebuff(-4451,5664,45)
                prankster()
        </waypoint>
        <!-- # 11 --><waypoint x="-4501" z="5750" y="45">        </waypoint>
        <!-- # 12 --><waypoint x="-4521" z="5825" y="58">
        </waypoint>
        <!-- # 13 --><waypoint x="-4483" z="5837" y="58">
                checkdebuff(-4483,5837,58)
                prankster()
        </waypoint>
        <!-- # 14 --><waypoint x="-4458" z="5752" y="45">        </waypoint>
        <!-- # 15 --><waypoint x="-4145" z="5965" y="55">
                __WPL:setWaypointIndex(__WPL:findWaypointTag("notfinished"));
        </waypoint>


        <!-- #  1 --><waypoint x="-4055" z="6024" y="55" tag="dobigone">
        if bigonedone == 1 then
                 __WPL:setWaypointIndex(__WPL:findWaypointTag("outofhere"));
        end
                bigprankster()
        </waypoint>
        <!-- #  2 --><waypoint x="-3822" z="6050" y="55">
                bigprankster()
        </waypoint>
        <!-- #  3 --><waypoint x="-3576" z="6132" y="55">
                bigprankster()
        </waypoint>
        <!-- #  5 --><waypoint x="-3860" z="6030" y="55">
                bigprankster()
        </waypoint>
        <!-- #  6 --><waypoint x="-4134" z="5986" y="55">
                bigprankster()
        </waypoint>
        <!-- #  7 --><waypoint x="-4456" z="5722" y="45">
                bigprankster()
        </waypoint>
        <!-- #  8 --><waypoint x="-4238" z="5798" y="45">
                bigprankster()
                __WPL:setDirection(WPT_BACKWARD);
        </waypoint>

</waypoints>