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
refering item from pos or similar.
Author Message
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #11
RE: refering item from pos or similar.
OK this is pretty much what i did ... but its so far away from a simulation of mining, i might have to put the most part on a function so i can have a delay with the anim and mining sound, maybe a timer, would you help me a bit?
TY
PD: i did it this way because i want this tool to act not as a mining tool that extract resources, just to check veins, so no resource is gathered until the spot is mined.
a lot of checks like distance, LOS, etc, needs to be added...

Code:
ON=@Targon_ground
IF (<baseid> == i_hammer_prospector_tool)
  IF (<serv.itemdef.<argn1>.type> == t_rock)
  args = <serv.regiontype.r_default_rock.resources>
  local.oremore1 = <r1,15>
    serv.newitem i_worldgem_bit
    src.anim 11
    ref1 = <new>
    ref1.attr 092
    ref1.type t_rock
    ref1.more1 = <streat <argv[<local.oremore1>]>>
    ref1.timer <eval <serv.regionresource.<streat <argv[1]>>.regen>>
    ref1.p <src.targp>
    ref1.fix
    for x 1 15
      if (<ref1.more1> == <streat <argv[<dlocal.x>]>>)
        if (<src.mining> >= <eval { <serv.regionresource.<streat <argv[<dlocal.x>]>>.skill> } >)
            local.success = <streat <argv[<eval <dlocal.x>+1>]>>
            local.amount = <eval { <serv.regionresource.<streat <argv[<dlocal.x>]>>.amount> } >
        endif
      endif            
    endfor
      if (<local.success>)
          ref1.more1 = <local.success>
          ref1.amount = <local.amount>
          src.sysmessage You have found a vein of <serv.itemdef.i_ore_<strsub 3 <eval strlen(<local.success>)> <local.success>>.name>
      else
          src.sysmessageloc -1,503043
          ref1.amount = 0
      endif
    return 1
  ENDIF
ENDIF
(This post was last modified: 07-18-2014 03:15 PM by kn4tseb.)
07-18-2014 03:14 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RE: refering item from pos or similar. - kn4tseb - 07-18-2014 03:14 PM

Forum Jump:


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