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: #12
RE: refering item from pos or similar.
think this is the best way i could have it done:
Code:
ON=@SkillStart
IF (<src.weapon.baseid> == i_hammer_prospector_tool)
   IF (<argn1> == 45)
     src.sysmessage You have found a vein, dig deeper to check what type of ore it has.
     src.anim 11
     DORAND 2
     sound 293
     sound 294
     ENDDO
   return 1
   ENDIF
ENDIF

ON=@Targon_Ground
IF (<baseid> == i_hammer_prospector_tool) && (<serv.itemdef.<argn1>.type> == t_rock)
   IF <SRC.DISTANCE <SRC.TARGP>> > 2
    SRC.SYSMESSAGE That is too far away.
    RETURN 1
   ENDIF
   IF  !<SRC.CANSEELOS <SRC.TARGP>>
    SRC.SYSMESSAGE I cannot see that, how am i supposed to mine it?
    RETURN 1
   ENDIF
ENDIF

ON=@RegionResourceFound
IF (<src.weapon.baseid> == i_hammer_prospector_tool)
  IF (<argo.type> == t_rock)
    ref1=<argo>
    src.weapon.tag0.uses -= 1
    src.weapon.tag0.updatex
    IF (<src.weapon.dtag0.uses> < 1)
        src.weapon.remove
    ENDIF
    IF strmatch(*r_default_rock*,<src.region.events>)
      args = <serv.regiontype.r_default_rock.resources>
      for x 0 16
        if (<ref1.more1> == <streat <argv[<dlocal.x>]>>)
          local.success = <streat <argv[<eval <dlocal.x>+1>]>>
        endif
      endfor
      if (<ref1.more1> == mr_nothing)
         ref1.amount = <EVAL { <SERV.REGIONRESOURCE.MR_IRON.AMOUNT> } >
      endif
      if (<local.success>)
         ref1.more1 = <local.success>
      endif
    ELIF strmatch(*r_dungeon*,<src.region.events>)
      if (<ref1.more1> == mr_iron)
         ref1.more1 = mr_shadow
      elif (<ref1.more1> == mr_nothing)
         ref1.more1 = mr_iron
         ref1.amount = <EVAL { <SERV.REGIONRESOURCE.MR_IRON.AMOUNT> } >
      endif
    ENDIF      
  ENDIF
ENDIF

Dunno for the moment what other checks are missing.
(This post was last modified: 07-19-2014 09:27 AM by kn4tseb.)
07-19-2014 07:18 AM
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-19-2014 07:18 AM

Forum Jump:


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