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
LINK
Author Message
Llirik
Journeyman
*

Posts: 115
Likes Given: 0
Likes Received: 10 in 8 posts
Joined: Feb 2015
Reputation: 0

UO Forum

Post: #1
LINK
My construction is true? I'm use LINK at the first time!

[EVENTS e_repair]
ON=@ContextMenuRequest
src.addcontextentry 111,3000089

ON=@ContextMenuSelect
if (<distance> <= 3)
if <argn>==111 // Repair
src.newitem i_target_repair
src.act.target What item do you want to repair?
NEW.LINK=<UID> // ?
endif
else
src.sysmessage Too far away from the Vendor
endif

[ITEMDEF i_target_repair]
TYPE=t_eq_script

ON=@TargOn_Item
if (<LINK.DISTANCE> <= 5) // ?
if <src.targ.isweapon> || <src.targ.isarmor>
if <src.targ.hits>==<src.targ.maxhits>
src.sysmessage The item is already in full repair.
else
IF (<SRC.GOLD> >= (<SRC.TARG.MAXHITS>-<SRC.TARG.HITS>)*<SRC.TARG.TAG0.REPAIR>+1)
SRC.GOLD -= (<SRC.TARG.MAXHITS>-<SRC.TARG.HITS>)*<SRC.TARG.TAG0.REPAIR>+1
SRC.UPDATE
src.targ.hits=<src.targ.maxhits>
src.targ.update
src.emote repair the <src.targ.name>
ELSE
LINK.SAY You lack <eval (<SRC.TARG.MAXHITS>-<SRC.TARG.HITS>)*<SRC.TARG.TAG0.REPAIR>+1> gold! // ?
ENDIF
endif
else
src.sysmessage The item is not repairable
endif
else
src.sysmessage You can't reach the Vendor
endif
remove
return 1

Thank you!
(This post was last modified: 03-14-2016 05:32 AM by Llirik.)
03-14-2016 05:02 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #2
RE: LINK
Try this and give me the errors if it gives any:

Code:
[EVENTS e_repair]
ON=@ContextMenuRequest
src.addcontextentry 111,3000089

ON=@ContextMenuSelect
If <argn>==111    // Repair
If (<Src.Distance> > 3)
  Src.SMsg Too far away from the Vendor
  Return 1
EndIf
Src.SMsg Target the weapon or armor you want to repair.
Src.TargetF fRepair
Return 1
EndIf

[Function fRepair]
If (<ArgO.Distance> > 5)
Src.SMsg You cannot reach the vendor.
Return 1
EndIf

If !(<ArgO.IsWeapon>) || !(<ArgO.IsArmor>)
Src.SMsg You can only repair weapons and armor.
Return 1
EndIf

If (<ArgO.More1> == <ArgO.More1L>)
Src.SMsg This item is already in full repair.
Return 1
EndIf

dLocal.Cost=<Eval (((<ArgO.More1H>-<ArgO.More1L>)*<ArgO.Tag0.Repair>) +1)>
If (<Src.Gold> < <dLocal.Cost>)
Src.SMsg You don't have <dLocal.Cost> gold to repair this.
Return 1
Else
ArgO.More1L=<ArgO.More1H>
Src.Gold -= <dLocal.Cost>
ArgO.Update
Return 1
EndIf
(This post was last modified: 03-14-2016 06:46 PM by Khaos.)
03-14-2016 05:44 AM
Find all posts by this user Like Post Quote this message in a reply
Llirik
Journeyman
*

Posts: 115
Likes Given: 0
Likes Received: 10 in 8 posts
Joined: Feb 2015
Reputation: 0

UO Forum

Post: #3
RE: LINK
Not!

[Function fRepair]
On=@TargOn_Item
If (<ArgO.Distance> > 5)
Src.SysMessage You cannot reach the vendor.
Return 1
EndIf

Functions can have TRIGGERS? Maybe Events?
03-14-2016 05:59 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #4
RE: LINK
I fixed the above script. When we found triggers working in functions it was years ago and we are having issues replicating. It might have been fixed. SugarCube and I stumbled upon it on accident. Might have also been a dirty workaround we did. Cannot remember how we did it, but just used the code I edited. Also, Xun says 111 seems to be functioning oddly. Maybe raise the number.
03-14-2016 06:50 PM
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)