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
Cannot equip with LINK
Author Message
mlyon83
Apprentice
*

Posts: 44
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2013
Reputation: 0



Post: #1
Cannot equip with LINK
This script is to keep a GM robe on PLEVEL 4 or greater at all times. It's working just fine, even creating the item, but it will not equip!

[ITEMDEF i_timer_gm]
ID=i_memory
TYPE=t_eq_script
LAYER=layer_special
NAME="GM Robe check"

ON=@Equip
LINK=<SRC.UID>
TIMER=1

ON=@Timer
IF (<LINK.ACCOUNT.PLEVEL> >= 4)
IF (<LINK.FINDLAYER.layer_robe.BASEID> != i_robe_gm)
LINK.SYSMESSAGE @00 Wear your GM robe.
LINK.NEWITEM=i_robe_gm
//Also tried SERV.NEWITEM
LINK.EQUIP
//Also tried LINK.ACT.EQUIP
ENDIF
ENDIF

TIMER=1
RETURN 1



Anyone have any idea why it won't equip?
04-29-2013 02:00 PM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #2
RE: Cannot equip with LINK
Suggestions:

1. You don't need to link the timer to the character in a trigger, you can just look at the "container" the timer is in to find who has it equipped...
2. You don't have to equip the robe, you can just create it already equipped...
3. The item doesn't have to be an ID=i_memory... you can make it look like any tile if that helps (tip: always set the weight to 0)

Code:
[ITEMDEF i_gm_robe_enforcer]
ID=i_cloth_cut
NAME=GM Robe Enforcer
TYPE=t_eq_script
LAYER=layer_special
WEIGHT=0
ON=@Create
   COLOR=021//red
ON=@Equip
   TIMER=10//Start the timer when it's equipped
ON=@Timer
   IF ((<CONT.ACCOUNT.PLEVEL> >= 4) && (<LINK.FINDLAYER.layer_robe.BASEID> != i_robe_gm))
      CONT.SYSMESSAGE @00 Wear your GM robe.
      SERV.NEWITEM=i_robe_gm,1,<CONT>
   ENDIF
   TIMER=10//restart the timer
   RETURN 1
04-29-2013 03:01 PM
Find all posts by this user Like Post Quote this message in a reply
mlyon83
Apprentice
*

Posts: 44
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2013
Reputation: 0



Post: #3
RE: Cannot equip with LINK
It worked, thanks, but I don't understand this command:

SERV.NEWITEM=i_robe_gm,1,<CONT>

I understand what SERV.NEWITEM is and what the i_robe_gm and 1 being the quantity, but how the heck does adding <CONT> actually add the item to equip? It worked, but I'm confused.
04-29-2013 03:44 PM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #4
RE: Cannot equip with LINK
The changelog says this:

Quote:15-02-05, Vjaka
...snip...
- Fixed NEWITEM id,amount in case if non-exact value was given (like {x y}).
- Added cont argument to NEWITEM (now it looks NEWITEM id,amount,container).

Probably what you don't understand is that the player is a container, and when you put an item in a player container, the item goes to its natural layer - not the pack... if you .xedit a character (or yourself) in game you can see these memories. You can even open them up and edit them. Which is why, sadly for you, your scheme to force GMs to wear their robe has limited value since they can easily defeat it. For example; editing it to set the timer to a large number, or change the layer, or drop it, or put it in another container, or just delete it... ;-)
(This post was last modified: 04-29-2013 05:15 PM by RanXerox.)
04-29-2013 05:14 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)