The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
@ItemDropOn_Ground region check
Author Message
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #1
@ItemDropOn_Ground region check
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.
(This post was last modified: 02-03-2017 09:36 PM by Russian.)
02-03-2017 09:36 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: @ItemDropOn_Ground region check
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
02-03-2017 10:35 PM
Find all posts by this user Like Post Quote this message in a reply
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #3
RE: @ItemDropOn_Ground region check
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]
(This post was last modified: 02-04-2017 01:25 AM by Russian.)
02-04-2017 01:25 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Russian's post
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: @ItemDropOn_Ground region check
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.
02-04-2017 02:10 AM
Find all posts by this user Like Post Quote this message in a reply
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #5
RE: @ItemDropOn_Ground region check
That is good change.
But my shard on Sphere 56b 2012, And it is impossible to transfer shard to 56c.
02-06-2017 03:55 PM
Find all posts by this user Like Post Quote this message in a reply
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #6
RE: @ItemDropOn_Ground region check
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?
01-23-2018 01:22 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)