jexnico 
Journeyman

Posts: 191
Likes Given: 114
Likes Received: 3 in 3 posts
Joined: Jan 2014
Reputation: 0
![]()
|
Error in my insure script
Someone tell me what is wrong with this script? I type the command and when I select the item to be insured of this error.
The script is used to insure an item. (Do not lose it after death)
Quote:[DEFNAME insure_settings]
INSURANCE_PRICE 4000
[PLEVEL 1]
INSURE
[FUNCTION INSURE]
TARGETF TARGET_INSURE
SYSMESSAGE @04ec,3,1 What item would you like to insure?
[FUNCTION TARGET_INSURE]
LOCAL.TMP=<OBJ>
OBJ=<ARGO.UID>
IF (<OBJ.ATTR>&ATTR_NEWBIE)
SYSMESSAGELOC 04ec,3,1060870
ELIF (<OBJ.TOPOBJ>!=<SRC>)
SYSMESSAGELOC 04ec,3,1060871
ELIF (<SRC.TOTALGOLD> < <DEF.INSURANCE_PRICE>) || (<OBJ.ISEVENT.T_ITEM_INSURED>)
SYSMESSAGELOC 04ec,3,1060869
ELSE
OBJ.EVENTS +T_ITEM_INSURED
CONSUMEGOLD <DEF.INSURANCE_PRICE>
SYSMESSAGELOC 04ec,3,1060873
OBJ.UPDATE 1
ENDIF
OBJ=<LOCAL.TMP>
[TYPEDEF T_ITEM_INSURED]
ON=@ClientToolTip
SRC.ADDCLILOC 1061682
[EOF]
(This post was last modified: 02-18-2016 02:46 AM by jexnico.)
|
|
02-18-2016 02:44 AM |
|
|
Khaos 
Master
 
Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11
![]()
|
RE: Error in my insure script
Try this. TargetF doesn't need obj.
src = <person who called trigger>
argo = targeted whatevers UID. The UID though is called like uid.<argo>.key
local.id = targeted items ID. (Can't remember if it is baseid or dispid (so I checked argo instead local.id))
Code:
[FUNCTION TARGET_INSURE]
IF (<uid.<argo>.ATTR>&ATTR_NEWBIE)
SYSMESSAGELOC 04ec,3,1060870
ELIF (<uid.<argo>.TOPOBJ>!=<SRC>)
SYSMESSAGELOC 04ec,3,1060871
ELIF (<SRC.TOTALGOLD> < <DEF.INSURANCE_PRICE>) || (<uid.<argo>.ISEVENT.T_ITEM_INSURED>)
SYSMESSAGELOC 04ec,3,1060869
ELSE
uid.<argo>.EVENTS +T_ITEM_INSURED
src.CONSUMEGOLD <DEF.INSURANCE_PRICE>
SYSMESSAGELOC 04ec,3,1060873
uid.<argo>.UPDATE 1
ENDIF
Otherwise, you were doing the right things. I checked your clilocs and they are right. Obj and local.tmp were far from needed.
(This post was last modified: 02-18-2016 07:49 AM by Khaos.)
|
|
02-18-2016 07:46 AM |
|
The following 1 user Likes Khaos's post:1 user Likes Khaos's post
jexnico (02-19-2016)
|