SphereCommunity

Full Version: @ItemDropOn_Ground region check
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello.

ON=@ItemDropOn_Ground
When player drop the item, coordinates of player: <P>
the coordinates of the object that had been dropped: <ARGS>

How to set check, what region flag was set in tile, where drop was dropped?

As example this check not work:
IF !(<REGION.<ARGS>.FLAGS> & REGION_FLAG_NODECAY)

Sphere 56b.
Try to use serv.map(x,y,z), see http://wiki.sphere.torfo.org/index.php?title=Map_Points
Example:
PHP Code:
ON=@ItemDropOn_Ground
local
.x = <argv[0]>
local.y = <argv[1]>
local.z = <argv[2]>
local.m = <argv[3]>
serv.log  Item was dropped in <serv.map(<dlocal.x>,<dlocal.y>,<dlocal.z>,<dlocal.m>).region.name> 
You are fantastic wizard!

Code:
ON=@ItemDropOn_Ground
IF !(<ISGM>)
    IF (<ACT.CAN> & CAN_I_BLOCK)
        IF (<REGION.FLAGS> & REGION_FLAG_NODECAY) || (<ROOM.FLAGS> & REGION_FLAG_NODECAY)
        LOCAL.X=<ARGV[0]>
        LOCAL.Y=<ARGV[1]>
        LOCAL.Z=<ARGV[2]>
        LOCAL.M=<ARGV[3]>
        SERV.log Item was dropped in <SERV.MAP(<DLOCAL.X>,<DLOCAL.Y>,<DLOCAL.Z>,<DLOCAL.M>).REGION.FLAGS>
            IF !(<SERV.MAP(<DLOCAL.X>,<DLOCAL.Y>,<DLOCAL.Z>,<DLOCAL.M>).REGION.FLAGS> & REGION_FLAG_NODECAY)
            SYSMESSAGE @0486 It is possible to establish this subject only in the house.
            ACT.CONT=<FINDLAYER.21.UID>
            ENDIF
        ENDIF
    ENDIF
ENDIF

This fix can help with bug:

[Image: 70424272989693807298.png]
Just discovered that script above will not work in Sphere 56c/d version.

From a 2015 change:

Changed: Trigger @DropOn_Ground / @ItemDropOn_Ground now is fired when the item is already on the ground instead get fired before place it on ground. So there's no more ARGS showing the drop location P (use <ACT.P> instead) and also 'return 1' will disable drop sound and decay timer.
That is good change.
But my shard on Sphere 56b 2012, And it is impossible to transfer shard to 56c.
ERRROR:
17:26:ERROR:(e_startx.scp,197)Can't resolve <SERV.MAP(5794>

197 stroke:
IF (<SERV.MAP(<ARGV[0]>,<ARGV[1]>).REGION.FLAGS> & REGION_FLAG_NODECAY) || (<SERV.MAP(<ARGV[0]>,<ARGV[1]>).ROOM.FLAGS> & REGION_FLAG_NODECAY)
What is wrong?
Reference URL's