Need a way of checking for static/dynamic items at a specified location
Posted: Sat Apr 09, 2005 7:22 pm
I've been working on a moonstone script today (thanks to Ripper @ LW forums for the idea to start on that hehe
, and have the script pretty much completed.
If the moonstone spawns on a creature in Felucca, it becomes a "Trammel Moonstone" and will open a gate to Trammel at the same location where it's being used in Felucca. And vice versa; If spawns in Trammel, it opens gate to Felucca.
I've got guardzone safeguards in, criminal/murderer safeguards, if user is mounted it won't work (OSI-style). And I'm able to check for valid maptiles on the target location by using the GetTileIDAtMapCoord function, so they won't be able to use the moonstone if the other side has a water/lava/whatever-tile there.
What I can't do yet though, is check to see if the target location is blocked by dynamic or static items; Walls, trees, player houses, etc. I'm not sure what a JS method/function to do that should look like, considering that there might be more than one item in a single tile, not all items block your movement, etc. but it's definitely needed.
I guess the same is necessary for the Gate Travel spell if it should ever be moved out to the JS engine.
If the moonstone spawns on a creature in Felucca, it becomes a "Trammel Moonstone" and will open a gate to Trammel at the same location where it's being used in Felucca. And vice versa; If spawns in Trammel, it opens gate to Felucca.
I've got guardzone safeguards in, criminal/murderer safeguards, if user is mounted it won't work (OSI-style). And I'm able to check for valid maptiles on the target location by using the GetTileIDAtMapCoord function, so they won't be able to use the moonstone if the other side has a water/lava/whatever-tile there.
What I can't do yet though, is check to see if the target location is blocked by dynamic or static items; Walls, trees, player houses, etc. I'm not sure what a JS method/function to do that should look like, considering that there might be more than one item in a single tile, not all items block your movement, etc. but it's definitely needed.
I guess the same is necessary for the Gate Travel spell if it should ever be moved out to the JS engine.