Code:
[ITEMDEF i_restore_bers]
Name=Restoration
ID=i_bottle_6
WEIGHT=25
On=@Create
COLOR=042c
more2 = 25
on=@click
message <name> (<eval <more2>>)
return 1
ON=@DCLICK
IF !(<SRC.TAG0.BERSERKER>)
SRC.MESSAGE @55 Only Berserker can drink restoration!
RETURN 1
ELSE
IF (<SRC.TAG0.BERSERKER>==1)
MOREX={15 17}
ELIF (<SRC.TAG0.BERSERKER>==2)
MOREX={17 20}
ELIF (<SRC.TAG0.BERSERKER>==3)
MOREX={20 23}
ELSE
MOREX={23 26}
ENDIF
ENDIF
IF (<SRC.HITS> >= <SRC.MAXHITS>)
SRC.MESSAGE @55 You are already at maximum healt!
RETURN 1
ENDIF
IF (<SRC.FINDID.i_rest_delay_level1>)
SRC.SYSMESSAGE @55 You can't drink restoration potion yet
RETURN 1
ENDIF
IF (<EVAL <MORE2>> > 0)
SRC.EFFECT=3,0376a,10,25,10
IF (<EVAL <SRC.HITS> + <MOREX>> >= <SRC.MAXHITS>)
SRC.HITS = <SRC.MAXHITS>
ELSE
SRC.HITS += <EVAL <MOREX>>
ENDIF
SERV.NEWITEM=i_rest_delay_level1
NEW.EQUIP=<SRC.UID>
MORE2 -= 1
SRC.SYSMESSAGE Charges left <EVAL <MORE2>>
ELSE
SRC.SYSMESSAGE @55 Charges over!
REMOVE
ENDIF
[ITEMDEF i_rest_delay_level1]
ID=i_memory
Name=Restore Delay level 1
Type=t_eq_script
On=@Create
attr = attr_newbie | attr_decay
On=@Equip
IF (<SRC.TAG0.BERSERKER>==1)
TIMER=5
ELIF (<SRC.TAG0.BERSERKER>==2)
TIMER=4
ELIF (<SRC.TAG0.BERSERKER>==3)
TIMER=3
ELSE
TIMER=3
ENDIF
RETURN 0
ON=@Timer
REMOVE
RETURN 1