Last night I figured out how to do what I was wanting to do. So basically, I took that previously posted section from the waypoints.lua file, and in my onload section, I add this version of that function:
Code: Select all
function CWaypointList:advance()
findChests() -- I added this function which is defined in my onLoad section
__WPL.LastWaypoint = __WPL.CurrentWaypoint -- and then changed all references of "self" to "__WPL""
if( __WPL.Direction == WPT_FORWARD ) then
__WPL.CurrentWaypoint = __WPL.CurrentWaypoint + 1;
if( __WPL.CurrentWaypoint > #__WPL.Waypoints ) then
__WPL.CurrentWaypoint = 1;
end
else
__WPL.CurrentWaypoint = __WPL.CurrentWaypoint - 1;
if( __WPL.CurrentWaypoint < 1 ) then
__WPL.CurrentWaypoint = #__WPL.Waypoints;
end
end
end
So now what that allows me to do is define anything I want to do at every waypoint without going in and typing my function into every waypoint, such as mirrorworld search for and open chests. BTW, I have that part written as well but of course, couldn't test it yesterday. I tested it using harvest nodes and it works. I have it where it will look for a nearby chest after combat, and after every waypoint. Also, when it sees a chest, it will save current player location, go get the chest, then go back to player location prior to moving on, that will help prevent it from moving off waypoint path to kill a mob, then see a chest to open, and end up with an obstacle between player and waypoint path. This would help minimize that. I will put it into a mirrorworld instance waypoint and test it next time one is open.