[FUNCTION F_CONSECRATE_WEAPON_EXPIRE]
SOUND=01F8
TAG0.DAMINCREASE -= 10
IF (<TAG0.DAMINCREASE> == 0)
TAG.DAMINCREASE=
ENDIF
TAG0.MANALEECH -= 20
IF (<TAG0.MANALEECH> == 0)
TAG.MANALEECH=
ENDIF
TAG.CONSECRATE.WEAPON=

[Spell 203]
DEFNAME=s_Consecrate_Weapon
NAME=Consecrate Weapon
SOUND=
RUNES=
CAST_TIME=0.5
RESOURCES=
RUNE_ITEM=0
SCROLL_ITEM=0
FLAGS=spellflag_playeronly|spellflag_nofreezeoncast|spellflag_no_castanim
EFFECT_ID=
EFFECT=10
DURATION=0.0
MANAUSE=10
SKILLREQ=SKILL_CHIVALRY 15.0
INTERRUPT=0.0,0.0

ON=@Start
IF (<WEAPON>)
SAY @,,2 1060720
ELSE
SYSMESSAGELOC -1,501078
RETURN 1
ENDIF

ON=@Effect
IF !(<WEAPON>)
SYSMESSAGELOC -1,501078
RETURN 1
ELSE
	IF (<WEAPON.SKILL> == 31) //Archery
	LOCAL.ITEMID=013B1
	LOCAL.SOUND=0145
	ELIF (<WEAPON.SKILL> == 41) //Mace
	LOCAL.ITEMID=0FB4
	LOCAL.SOUND=0232
	ELSE
	LOCAL.ITEMID=0F5F
	LOCAL.SOUND=056
	ENDIF
SOUND 020C
SOUND <LOCAL.SOUND>
effect 3,03779,1,30,0,3,0
LOCAL.DELAY=<F_COMPUTE_POWERLEVEL 20>
	IF (<LOCAL.DELAY> < 3)
	LOCAL.DELAY=3
	ELIF (<LOCAL.DELAY> > 12)
	LOCAL.DELAY=12
	ENDIF
	IF (!(<TAG0.CONSECRATE.WEAPON>))
	TAG0.DAMINCREASE += 10
	TAG0.MANALEECH += 20
	TAG.CONSECRATE.WEAPON=1
	TIMERF <LOCAL.DELAY>,F_CONSECRATE_WEAPON_EXPIRE
	ENDIF
	FORCLIENTS 15
	SENDPACKET 0C7 00 D00 D00 W<LOCAL.ITEMID> W<HVAL <SRC.P.X>> W<HVAL <SRC.P.Y>> <HVAL <SRC.P.Z>> W<HVAL <SRC.P.X>> W<HVAL <SRC.P.Y>> <HVAL <SRC.P.Z>+50> 01 00 W00 00 00 D021 D03 W0251D W01 W00 D077 00 W0100
	ENDFOR
ENDIF

[EOF]