[ITEMDEF i_bedroll]
DEFNAME=i_bedroll
TYPE=t_bedroll
VALUE=136 //maybe change value
WEIGHT=12.5
DUPELIST=01f25,01f26,01f27
ON=@DCLICK
//store badroll for recovery
src.cTag._bedroll = <I.uid>
//look for a campfire with in 2 tiles
foritems 2
IF (<type> == t_campfire)
//found a campfire, pass a camping skill check
IF (<src.skillcheck 10,20>)
//show logout gump
src.sdialog d_log_out_gump
return
ELSE
SRC.SYSMESSAGE You were unable to secure this camp site.
return
ENDIF
ENDIF
endfor
//if we made it here, there is no campfire in range
SRC.SYSMESSAGE To use a bedroll a campfire must be close.
return
[DIALOG d_log_out_gump]
0,0
page 0
resizepic 280 240 9270 232 120
dtext 339 266 1152 Camp Site Secured!
dtext 310 286 1152 You may now logout safely.
button 368 320 247 249 1 0 1
tilepic 290 255 0FAC
tilepic 460 255 0A59
[DIALOG d_log_out_gump BUTTON]
ON=1
//move bedroll back to inventory
UID.<src.cTag._bedroll>.BOUNCE //maybe change to remove
//disconnect player after slight delay
timerf 1, f_leave
[FUNCTION f_leave]
TRYSRV serv.uid.<uid>.disconnect
timerf 1, TRYSRV serv.uid.<uid>.disconnect