I've found myself in need of a waypoint that will execute some code without it going to the first waypoint. I've seen a few files that do it (for example, CoT with teleport, it checks for zone_id without going to the first WP) but I have no idea how they work. It should work regardless of class, zone_id or any other variable in this case.
So, let's start with something simple - suppose that I want to check whether I have more than 50 of item with ID 100000, and if I do, it should use 'recall', otherwise it should load waypoint file 'less than 50 items'.
Code for executing it in a waypoint would look like that
Code: Select all
local questitem = inventory:getItemCount(100000) -- item ID
if questitem > 49 then -- checks if at least 50
RoMScript('CastSpellByName("Recall Transport Spell")') -- not sure if correct name
else
loadPaths("less than 50 items");
endhttp://solarstrike.net/phpBB3/viewtopic ... a97#p28641
but it's a different name that the one in-game - I've pretty much made-up the name in that code.
So, how do I do this?