[ITEMDEF i_focus_mem]
ID=i_memory
NAME=Focus item mem
TYPE=T_EQ_SCRIPT

ON=@Create
ATTR=attr_newbie|attr_move_never

ON=@Timer
IF (((<CONT.STAM> < <CONT.MAXSTAM>) || (<CONT.MANA> < <CONT.MAXMANA>)) && (10 >= <R1,100>))
CONT.SKILLGAIN Focus <EVAL (<CONT.FOCUS>/10)+1>
ENDIF
LOCAL.ITEMSTAMREGEN=<CONT.TAG0.ITEMSTAMREGEN>
IF (<LOCAL.ITEMSTAMREGEN> > 30)
LOCAL.ITEMSTAMREGEN=30
ENDIF
LOCAL.ITEMMANAREGEN=<CONT.TAG0.ITEMMANAREGEN>
IF (<LOCAL.ITEMMANAREGEN> > 20)
LOCAL.ITEMMANAREGEN=20
ENDIF
LOCAL.ITEMHITSREGEN=<CONT.TAG0.ITEMHITSREGEN>
IF (<LOCAL.ITEMHITSREGEN> > 22)
LOCAL.ITEMHITSREGEN=22
ENDIF
TAG0.STAMREGEN += <EVAL (<CONT.FOCUS>/100)+(<LOCAL.ITEMSTAMREGEN>)+(<CONT.TAG0.BONUSSTAMREGEN>)>
IF (<TAG0.STAMREGEN> >= 10)
	IF (<CONT.STAM> < <CONT.MAXSTAM>)
	CONT.STAM += <EVAL (<TAG0.STAMREGEN>/10)>
		IF (<CONT.STAM> > <CONT.MAXSTAM>)
		CONT.STAM=<CONT.MAXSTAM>
		ENDIF
	ENDIF
TAG0.STAMREGEN -= <EVAL (<TAG0.STAMREGEN>/10)*10>
ENDIF
TAG0.MANAREGEN += <EVAL (<CONT.INT>/50)+(<CONT.FOCUS>/200)+(<CONT.MEDITATION>/90)+(<LOCAL.ITEMMANAREGEN>)+(<CONT.TAG0.BONUSMANAREGEN>)>
IF (<TAG0.MANAREGEN> >= 10)
	IF (<CONT.MANA> < <CONT.MAXMANA>)
	CONT.SKILLGAIN Meditation <EVAL (<CONT.Meditation>/10)+1>
	CONT.MANA += <EVAL (<TAG0.MANAREGEN>/10)>
		IF (<CONT.MANA> > <CONT.MAXMANA>)
		CONT.MANA=<CONT.MAXMANA>
		ENDIF
	ENDIF
TAG0.MANAREGEN -= <EVAL (<TAG0.MANAREGEN>/10)*10>
ENDIF
IF (<LOCAL.ITEMHITSREGEN>) || (<CONT.TAG0.BONUSHITSREGEN>)
TAG0.HITSREGEN += <EVAL <LOCAL.ITEMHITSREGEN>+<CONT.TAG0.BONUSHITSREGEN>>
	IF (<TAG0.HITSREGEN> >= 10)
		IF (<CONT.HITS> < <CONT.MAXHITS>)
		CONT.HITS += <EVAL (<TAG0.HITSREGEN>/10)>
			IF (<CONT.HITS> > <CONT.MAXHITS>)
			CONT.HITS=<CONT.MAXHITS>
			ENDIF
		ENDIF
	ENDIF
	TAG0.HITSREGEN -= <EVAL (<TAG0.HITSREGEN>/10)*10>
ENDIF
TIMER=1
RETURN 1

[EOF]