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-nmm7 (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-nmm7 (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-nmm7 (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
some questions (foritems, block check)
Author Message
escribano
Journeyman
*

Posts: 170
Likes Given: 16
Likes Received: 32 in 23 posts
Joined: Nov 2012
Reputation: 2

Dragon Shard

Post: #2
RE: some questions (foritems, block check)
Art, i don't know if i really understood your question.. but, maybe this could be helpfull:

Question 1:
No, at least what i know that the only way to do that is creating an item and executing the FORanything in this item, the script for that is this:
Code:
[FUNCTION posempty]
serv.newitem i_gold
serv.new.p <args>
serv.new.attr 094
serv.new.update
return <qval <UID.<serv.new.uid>.f_posempty_check <args>> == 1?0:1>

[FUNCTION f_posempty_check]
local.tem 0
foritems 0
    if (<eval strlen(<baseid>)> > 1) && (<baseid> != i_gold)
        local.tem 1
    endif
endfor
remove
return <eval <local.tem>>
Note: this function should be called this way: if (<posempty 1000,1000,15,0>)

Question 2:
Yes, there is a way to check if the player can "see" the map point... this function also checks if the player is in distance z point, if there is walls blocking the line of sight...
Code:
If (<SRC.CANSEELOS 1000,1000,15,0>)

I don't know if this help.. but i've done an function to also check (using coordinates) if there is an item "near" of the point..
Code:
[FUNCTION isnearof]
serv.newitem i_gold
serv.new.p <argv[0]>,<argv[1]>,<argv[2]>,<argv[3]>
serv.new.attr 094
serv.new.update
return <UID.<serv.new.uid>.f_isnearof_check <argv[4]>,<argv[5]>>

[FUNCTION f_isnearof_check]
local.item <argv[0]>
local.closer 0

foritems <eval <argv[1]>>
    if (<baseid> == <local.item>)
        local.closer 1
    endif
endfor
remove
return <eval <local.closer>>
Note: this function should be called this way: if (<isnearof <src.p.x>,<src.p.y>,<src.p.z>,<src.p.m>,i_sword_viking,3>)
Where i_sword_viking you change to the item id you are looking for and the last parameter (3) is the distance you want to see if the item is near.

Hope it help!

UltimaPHP - OpenSource Ultima Online Server v0.1-pre-alpha under development, we need help!
(This post was last modified: 09-08-2015 03:21 AM by escribano.)
09-08-2015 03:17 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RE: some questions (foritems, block check) - escribano - 09-08-2015 03:17 AM

Forum Jump:


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