SphereCommunity
@ItemDropOn_Ground region check - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: @ItemDropOn_Ground region check (/Thread-ItemDropOn-Ground-region-check)



@ItemDropOn_Ground region check - Russian - 02-03-2017 09:36 PM

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.


RE: @ItemDropOn_Ground region check - darksun84 - 02-03-2017 10:35 PM

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
.= <argv[0]>
local.= <argv[1]>
local.= <argv[2]>
local.= <argv[3]>
serv.log  Item was dropped in <serv.map(<dlocal.x>,<dlocal.y>,<dlocal.z>,<dlocal.m>).region.name



RE: @ItemDropOn_Ground region check - Russian - 02-04-2017 01:25 AM

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]


RE: @ItemDropOn_Ground region check - darksun84 - 02-04-2017 02:10 AM

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.


RE: @ItemDropOn_Ground region check - Russian - 02-06-2017 03:55 PM

That is good change.
But my shard on Sphere 56b 2012, And it is impossible to transfer shard to 56c.


RE: @ItemDropOn_Ground region check - Russian - 01-23-2018 01:22 AM

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?