[ITEMDEF i_mind_rot_delay]
ID=i_memory
TYPE=T_EQ_SCRIPT
NAME=Mind Rot

ON=@Timer
CONT.EVENTS -e_mind_rot
IF (<CONT.ISPLAYER>)
CONT.REMOVEBUFF 1017
CONT.SYSMESSAGELOC -1,1060872
ENDIF
CONT.TAG0.LOWERMANACOST += 25
IF (<CONT.TAG0.LOWERMANACOST> == 0)
CONT.TAG.LOWERMANACOST=
ENDIF
REMOVE
RETURN 1

[EVENTS e_mind_rot]
ON=@Death
FINDID.i_mind_rot_delay.TIMERD=1

[Spell 108]
DEFNAME=s_Mind_Rot
NAME=Mind Rot
SOUND=0
RUNES=
CAST_TIME=1.5
RESOURCES=1 i_reag_daemon_blood,1 i_reag_pig_iron,1 i_reag_batwing
RUNE_ITEM=0
SCROLL_ITEM=0
FLAGS=spellflag_playeronly|spellflag_targ_char|spellflag_harm|spellflag_targ_noself
EFFECT_ID=
EFFECT=
DURATION=0.0
MANAUSE=17
SKILLREQ=SKILL_NECROMANCY 30.0
INTERRUPT=0.0,0.0

ON=@Start
IF (<ISPLAYER>)
SAY @,3,1 Wis An Ben
ENDIF

ON=@Effect
IF (<SRC> == <UID>)
RETURN 1
ENDIF
IF (<ISEVENT.e_mind_rot>)
SRC.SYSMESSAGELOC -1,1005559
RETURN 1
ELSE
SOUND=01FB
SOUND=0258
EFFECT 3,0373A,16,30,9903,15
LOCAL.DURATION=<EVAL (((<SRC.SPIRITSPEAK>/10)-(<MAGICRESISTANCE>/10))/5)+20>
SKILLGAIN MagicResistance <SRC.NECROMANCY>
	IF (<ISPLAYER>)
	ADDBUFF 1017 1075665 1075666 <dLOCAL.DURATION> oi
	ENDIF
TAG0.LOWERMANACOST -= 25
EVENTS +e_mind_rot
SERV.NEWITEM=i_mind_rot_delay,1,<UID>
NEW.TIMER=<LOCAL.DURATION>
ENDIF

[EOF]