Код
[TYPEDEF t_container_pw]
ON=@Dclick
IF (<RESTEST 1 i_container_pw_info>)
IF (<FINDID.i_container_pw_info.LINK>==<SRC.UID>) || (<SRC.GM>)
FINDID.i_container_pw_info.TAG.OWNERCHECK=1
ELSE
FINDID.i_container_pw_info.TAG.OWNERCHECK=0
ENDIF
DIALOG d_container_pw
ELSE
SRC.NEWITEM=i_container_pw_info
SRC.ACT.CONT=<UID>
SRC.ACT.LINK=<SRC.UID>
SRC.SYSMESSAGE=You are now the owner of this container.
ENDIF
RETURN 1
[ITEMDEF i_container_pw_info]
ID=03789
NAME=Container Info (DO NOT REMOVE)
WEIGHT=0
TYPE=t_script
ON=@Create
ATTR=0090
TAG.Q=No question specified.
TAG.PW=
[DIALOG d_container_pw]
100, 80
page 0
resizepic 0 10 3600 450 180 // Grey Background
text 50 25 455 1 // Text: Enter the password correctly to open the container
gumppic 50 55 1143 // Pic: Black Box
textentry 60 57 250 20 0 0 <EVAL <FINDID.i_container_pw_info.TAG.OWNERCHECK>*4> // Text Box: The Pword (if owner or gm)
button 50 95 2103 2104 1 0 1 // Button: Okay
text 70 90 1152 2 // Text: Okay
button 150 95 2103 2104 1 0 0 // Button: Cancel
text 170 90 1152 3 // Text: Cancel
button 50 135 <EVAL (<FINDID.i_container_pw_info.TAG.OWNERCHECK>*1999)+104> <EVAL (<FINDID.i_container_pw_info.TAG.OWNERCHECK>*2000)+104> 1 0 2 // Button: Change Question and Password
text 70 130 455 <EVAL <FINDID.i_container_pw_info.TAG.OWNERCHECK>*5> // Text: Change Password
[DIALOG d_container_pw TEXT]
<VAR.BLANKLINE> // 0
Enter the password correctly to open the container // 1
Okay // 2
Cancel // 3
<FINDID.i_container_pw_info.TAG.PW> // 4
Change Password // 5
[DIALOG d_container_pw BUTTON]
ON=1
FINDID.i_container_pw_info.TAG.PWA=<argtxt[0]>
IF (STRMATCH(<FINDID.i_container_pw_info.TAG.PWA>,<FINDID.i_container_pw_info.TAG.PW>))
TYPE=t_container
USE
TYPE=t_container_pw
SRC.SYSMESSAGE=You have entered the password correctly.
ELSE
SRC.SYSMESSAGE='<FINDID.i_container_pw_info.TAG.PWA>' is not the correct password for this container.
ENDIF
FINDID.i_container_pw_info.TAG.PWA=
ON=2
DIALOG d_container_pw_edit
[DIALOG d_container_pw_edit]
100, 80
page 0
resizepic 0 10 3600 450 180 // Grey Background
text 50 25 455 1 // Text: Password
gumppic 50 50 1143 // Pic: Black Box
textentry 60 52 250 20 0 0 4 // Text Box: Password
button 50 115 2103 2104 1 0 1 // Button: Save Changes
text 70 110 1152 2 // Text: Save Changes
button 50 135 2103 2104 1 0 0 // Button: Cancel
text 70 130 1152 3 // Text: Cancel
[DIALOG d_container_pw_edit TEXT]
<VAR.BLANKLINE> // 0
Password: // 1
Save Changes // 2
Cancel // 3
<FINDID.i_container_pw_info.TAG.PW> // 4
[DIALOG d_container_pw_edit BUTTON]
ON=0
DIALOG d_container_pw
ON=1
FINDID.i_container_pw_info.TAG.PW=<argtxt[0]>
SRC.SYSMESSAGE=Password saved as '<FINDID.i_container_pw_info.TAG.PW>'
DIALOG d_container_pw
[TYPEDEF t_container_q_a]
ON=@Dclick
IF (<RESTEST 1 i_container_q_a_info>)
IF (<FINDID.i_container_q_a_info.LINK>==<SRC.UID>) || (<SRC.GM>)
FINDID.i_container_q_a_info.TAG.OWNERCHECK=1
ELSE
FINDID.i_container_q_a_info.TAG.OWNERCHECK=0
ENDIF
DIALOG d_container_q_a
ELSE
SRC.NEWITEM=i_container_q_a_info
SRC.ACT.CONT=<UID>
SRC.ACT.LINK=<SRC.UID>
SRC.SYSMESSAGE=You are now the owner of this chest.
ENDIF
RETURN 1
[ITEMDEF i_container_q_a_info]
ID=03789
NAME=Container Info (DO NOT REMOVE)
WEIGHT=0
TYPE=t_script
ON=@Create
ATTR=0090
TAG.Q=No question specified.
TAG.A=
[DIALOG d_container_q_a]
100, 80
page 0
resizepic 0 10 3600 450 200 // Grey Background
text 50 25 455 1 // Text: Answer the question correctly to open the container
text 50 60 1152 4 // Text: <TAG.Q>
gumppic 50 95 1143 // Pic: Black Box
textentry 60 97 250 20 0 0 <EVAL <FINDID.i_container_q_a_info.TAG.OWNERCHECK>*5> // Text Box: The Answer (if owner)
button 50 135 2103 2104 1 0 1 // Button: Okay
text 70 130 1152 2 // Text: Okay
button 150 135 2103 2104 1 0 0 // Button: Cancel
text 170 130 1152 3 // Text: Cancel
button 50 175 <EVAL (<FINDID.i_container_q_a_info.TAG.OWNERCHECK>*1999)+104> <EVAL (<FINDID.i_container_q_a_info.TAG.OWNERCHECK>*2000)+104> 1 0 2 // Button: Change Question and Password
text 70 170 455 <EVAL <FINDID.i_container_q_a_info.TAG.OWNERCHECK>*6> // Text: Change Question and Password
[DIALOG d_container_q_a TEXT]
<VAR.BLANKLINE> // 0
Answer the question correctly to open the container // 1
Okay // 2
Cancel // 3
<FINDID.i_container_q_a_info.TAG.Q> // 4
<FINDID.i_container_q_a_info.TAG.A> // 5
Change Question and Password // 6
[DIALOG d_container_q_a BUTTON]
ON=1
FINDID.i_container_q_a_info.TAG.AA=<argtxt[0]>
IF (STRMATCH(<FINDID.i_container_q_a_info.TAG.AA>,<FINDID.i_container_q_a_info.TAG.A>))
TYPE=t_container
USE
TYPE=t_container_q_a
SRC.SYSMESSAGE=You have entered the password correctly.
ELSE
SRC.SYSMESSAGE='<FINDID.i_container_q_a_info.TAG.AA>' is not the correct password for this container.
ENDIF
FINDID.i_container_q_a_info.TAG.AA=
ON=2
DIALOG d_container_q_a_edit
[DIALOG d_container_q_a_edit]
100, 80
page 0
resizepic 0 10 3600 450 200 // Grey Background
text 50 25 455 1 // Text: Current Question
gumppic 50 50 1143 // Pic: Black Box
textentry 60 52 250 20 0 0 5 // Text Box: Question
text 50 85 455 2 // Text: Current Password
gumppic 50 105 1143 // Pic: Black Box
textentry 60 107 250 20 0 1 6 // Text Box: Password
button 50 155 2103 2104 1 0 1 // Button: Save Changes
text 70 150 1152 3 // Text: Save Changes
button 50 175 2103 2104 1 0 0 // Button: Cancel
text 70 170 1152 4 // Text: Cancel
[DIALOG d_container_q_a_edit TEXT]
<VAR.BLANKLINE>
Question:
Password:
Save Changes
Cancel
<FINDID.i_container_q_a_info.TAG.Q>
<FINDID.i_container_q_a_info.TAG.A>
[DIALOG d_container_q_a_edit BUTTON]
ON=0
DIALOG d_container_q_a
ON=1
FINDID.i_container_q_a_info.TAG.Q=<argtxt[0]>
FINDID.i_container_q_a_info.TAG.A=<argtxt[1]>
SRC.SYSMESSAGE=Question saved as '<FINDID.i_container_q_a_info.TAG.Q>'
SRC.SYSMESSAGE=
SRC.SYSMESSAGE=Answer saved as '<FINDID.i_container_q_a_info.TAG.A>'
DIALOG d_container_q_a
[EOF]