Code:
//override for t_clothing
[TYPEDEF t_clothing]
ON=@Click
IF (<TAG0.isblessed> = 1)
src.sysmessage This has tag.isblessed 1 and needs to call a contextmenu
TRIGGER ContextMenuRequest
message <name>
return 1 // thought maybe the returns were causing this.. dunno
ELSE
src.sysmessage Else
message <name>
RETURN 1
ENDIF
ON=@ContextMenuRequest
SRC.AddContextEntry 1000,3006278,0
SRC.AddContextEntry 2000,3006208,0
ON=@ContextMenuSelect
IF (<ARGN>==1000)
SRC.SAY CUT ARTICLE OF BLESSED CLOTHING
ENDIF
IF (<ARGN>==2000)
SRC.SAY GET CBD BACK
ENDIF
[eof]
[itemdef i_cbd]
id=i_deed
name=Clothing Bless Deed
on=@create
attr=04
CATEGORY=Custom
SUBSECTION=Special
DESCRIPTION=Clothing Bless Deed
ON=@DCLICK
IF (<CONT> == <SRC.FINDLAYER(21).uid>)
//src.sysmessageloc 1 1045156 //these dont seem to want to work?
src.sysmessageua 955 0 0 1 Select the article of clothing you wish to bless.
TARGETF f_BlessAnItem
RETURN 1
ELSE
SRC.SYSMESSAGELOC 1 1045156 // must be in backpack
RETURN 1
ENDIF
[FUNCTION f_BlessAnItem]
IF <ARGO.ISITEM>
IF (STRMATCH(*t_clothing*,<ARGO.TYPE>)) && (<ARGO.CONT> == <SRC.FINDLAYER(21).uid>)
IF !(<ARGO.ATTR> & attr_newbie)
SRC.SYSMESSAGELOC 1 1010025 1 // this cliloc wont display
//src.sysmessageua 955 0 0 1 The <ARGO.name> is now Blessed.
ARGO.ATTR=04
ARGO.NAME=<ARGO.NAME> [Blessed]
ARGO.HITPOINTS=0fffffff
ARGO.tag.isblessed=1
consume 1 i_cbd // is this ok or is there a more secure way?
ELSE
sysmessageua 955 0 0 1 This article of clothing is already Newbied or Blessed.
RETURN 1
ENDIF
ELSE
SRC.SYSMESSAGE This is not an article of clothing?
SRC.SYSMESSAGELOC 1 1005019
RETURN 1
ENDIF
ELSE
sysmessageua 955 0 0 1 This item is not able to be blessed.
RETURN 1
ENDIF
ON=@Targon_Char
src.sysmessageua 955 0 0 1 I dont think you can make someone else a newbie this way :/
return 1
//end of cbd