[ITEMDEF i_evil_omen_timer]
ID=i_memory
TYPE=T_EQ_SCRIPT
NAME=Evil Omen

ON=@Timer
IF (<CONT.ISPLAYER>) && (<CONT.ISONLINE>)
CONT.REMOVEBUFF 1007
ENDIF
CONT.EVENTS -e_evil_omen
REMOVE
RETURN 1

[EVENTS E_EVIL_OMEN]
ON=@GetHit
SERV.Log <NAME> (<UID>) got hit with evil omen.
IF (<SRC.ISCHAR>)
	IF (!(<ARGN2>&<DEF.DAM_GOD>)) && (!(<ARGN2>&DAM_DRAIN)) && (<SRC> != <UID>)
	ARGN1 += <EVAL <ARGN1>/4>
	FINDID.i_evil_omen_timer.REMOVE
		IF (<ISPLAYER>) && (<ISONLINE>)
		REMOVEBUFF 1007
		ENDIF
	EVENTS -e_evil_omen
	ENDIF
ENDIF

ON=@SpellEffect
IF (<SRC.ISCHAR>)
	IF (<ARGN1> == 20) && (<SRC> != <UID>) //poison
	ARGN2 += 250
	FINDID.i_evil_omen_timer.REMOVE
		IF (<ISPLAYER>) && (<ISONLINE>)
		REMOVEBUFF 1007
		ENDIF
	EVENTS -e_evil_omen
	ENDIF
ENDIF

[Spell 105]
DEFNAME=s_Evil_Omen
NAME=Evil Omen
SOUND=0
RUNES=
CAST_TIME=0.7
RESOURCES=1 i_reag_batwing,1 i_reag_nox_crystal
RUNE_ITEM=0
SCROLL_ITEM=0
FLAGS=spellflag_targ_char|spellflag_targ_noself|spellflag_playeronly|spellflag_harm
EFFECT_ID=
EFFECT=
DURATION=0.0
MANAUSE=11
SKILLREQ=SKILL_NECROMANCY 20.0
INTERRUPT=0.0,0.0

ON=@Start
IF (<ISPLAYER>)
SAY @,3,1 Pas Tym An Sanct
ENDIF

ON=@Effect
IF (<SRC> == <UID>)
RETURN 1
ENDIF
IF (!(<ISEVENT.e_evil_omen>))
SOUND=0FC
EFFECT=3,03728,16,30,7,1150
EFFECT=3,03779,16,30,7,67
LOCAL.DURATION=<EVAL (<SRC.SPIRITSPEAK>/120)+4>
SERV.NEWITEM=i_evil_omen_timer,1,<UID>
NEW.TIMER=<LOCAL.DURATION>
	IF (<ISPLAYER>)
	ADDBUFF 1007 1075647 1075648 <dLOCAL.DURATION> oi
	ENDIF
EVENTS +E_EVIL_OMEN
ELSE
SRC.SYSMESSAGELOC -1,1060508
ENDIF

[EOF]