Page 1 of 1

Need a way of checking for static/dynamic items at a specified location

Posted: Sat Apr 09, 2005 7:22 pm
by Xuri
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.

Posted: Sat Apr 09, 2005 8:21 pm
by giwo
Well we certainly have code in the source to get blocking statics and dynamics. This functionality just needs to be exposed to the JS.

I'll have a look at it.