[FUNCTION POISONDAMAGEAREA]
REF1=<UID>
FORCHARS 3
	IF ((<UID> != <REF1.UID>) && (<OWNER> != <REF1.UID>)) && (!(<ISBENEFICIAL <REF1.UID>>)) && (!(<OWNER.ISBENEFICIAL <REF1.UID>>))
	SPELLEFFECT S_POISON,<EVAL <REF1.POISONING>+<R100>>,<REF1>
	ENDIF
ENDFOR

[FUNCTION F_GIVE_PROPS]
//argn1 = chance to give prop
IF (!(STRMATCH(*T_PROPRIEDADES*,<TEVENTS>)))
EVENTS +T_PROPRIEDADES
ENDIF
FOR 5
LOCAL.GAVEPROP=0
	IF (<FLOATVAL (<ARGN1>/100)> > <RANDOMDOUBLE>)
		WHILE (!(<LOCAL.GAVEPROP>))
			DORAND 15
				BEGIN
					IF (!(<LOCAL.GAVEDAMINCREASE>))
						IF (!(<TAG0.DAMINCREASE>))
						TAG0.DAMINCREASE += <R30,50>
						ELSE
						TAG0.DAMINCREASE += <R0,10>
						ENDIF
					LOCAL.GAVEDAMINCREASE=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVESWINGINCREASE>))
					TAG0.SWINGINCREASE += <R20,30>
					LOCAL.GAVESWINGINCREASE=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVEHITCHANCEINCREASE>))
					TAG0.HITCHANCEINCREASE += <R12,20>
					LOCAL.GAVEHITCHANCEINCREASE=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVELIFELEECH>))
					TAG.LIFELEECH=<R30,50>
					LOCAL.GAVELIFELEECH=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVEMANALEECH>))
					TAG.MANALEECH=<R30,50>
					LOCAL.GAVEMANALEECH=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVESTAMLEECH>))
					TAG.STAMLEECH=<R30,50>
					LOCAL.GAVESTAMLEECH=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVEHITSPELL>))
						DORAND 4
						TAG.HITFIREBALL=<R30,50>
						TAG.HITHARM=<R30,50>
						TAG.HITLIGHTNING=<R30,50>
						TAG.MAGICARROW=<R30,50>
						ENDDO
					LOCAL.GAVEHITSPELL=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVEHITDISPEL>))
					TAG.HITDISPEL=<R30,50>
					LOCAL.GAVEHITDISPEL=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVEDEFENSECHANCEINCREASE>))
					TAG.HITCHANCEDECREASE=<R5,13>
					LOCAL.GAVEDEFENSECHANCEINCREASE=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVESPELLCHANNELING>))
					TAG.SPELLCHANNELING=1
					TAG0.FASTERCASTING --
					LOCAL.GAVESPELLCHANNELING=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVESLAYER>))
					SETSLAYER
					LOCAL.GAVESLAYER=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF ((!(<LOCAL.GAVEUSEBESTWEAPON>)) && (<SKILL> != 31))
					TAG.USEBESTWEAPONSKILL=1
					LOCAL.GAVEUSEBESTWEAPON=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF ((!(<LOCAL.GAVEVELOCITY>)) && (<SKILL> == 31))
					TAG.VELOCITY=<R10,40>
					LOCAL.GAVEVELOCITY=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVELUCK>))
					EVENTS +T_LUCK_ITEM
					TAG0.LUCK += <R50,100>
					LOCAL.GAVELUCK=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
				BEGIN
					IF (!(<LOCAL.GAVEFASTERCASTING>))
					TAG0.FASTERCASTING ++
					LOCAL.GAVEFASTERCASTING=1
					LOCAL.GAVEPROP=1
					ENDIF
				END
			ENDDO
		ENDWHILE
	ENDIF
ENDFOR
IF (<TAG0.FASTERCASTING> == 0)
TAG.FASTERCASTING=
ENDIF

[FUNCTION props]
IF (<TAG0.DAMINCREASE>)
SYSMESSAGELOCEX 04ac,1074325,00,(Cap 125%),<dTAG0.DAMINCREASE> //increased weapon damage
ENDIF
IF (<TAG0.HITCHANCEINCREASE>)
SYSMESSAGELOCEX 04ac,1073490,00,(Cap 50%),<dTAG0.HITCHANCEINCREASE> //hit chance increase (total)
ENDIF
IF (<TAG0.SWINGINCREASE>)
SYSMESSAGELOC 04ac,1074323,<dTAG0.SWINGINCREASE> //swing speed increase (total)
ENDIF
IF (<TAG0.HITCHANCEDECREASE>)
SYSMESSAGELOCEX 04ac,1073493,00,(Cap 50%),<dTAG0.HITCHANCEDECREASE> //defense chance increase (total)
ENDIF
IF (<TAG0.LOWERMANACOST>)
SYSMESSAGELOCEX 04ac,1073488,00,(Cap 50%),<dTAG0.LOWERMANACOST> //lower mana cost (total)
ENDIF
IF (<TAG0.LOWERREAGENTCOST>)
SYSMESSAGELOC 04ac,1060434,<dTAG0.LOWERREAGENTCOST>
ENDIF
IF (<TAG0.MAGICDAMINCREASE>)
SYSMESSAGELOCEX 04ac,1072380,00,(Cap 15% PVP),<dTAG0.MAGICDAMINCREASE> //spell damage increase (total)
ENDIF
IF (<TAG0.DAMAGERETURN>)
SYSMESSAGELOCEX 04ac,1072513,00,(Cap 35%),<dTAG0.DAMAGERETURN> //reflect physical damage (total)
ENDIF
IF (<TAG0.ITEMMANAREGEN>)
SYSMESSAGELOCEX 04ac,1060440,00,(Cap 20),<dTAG0.ITEMMANAREGEN>
ENDIF
IF (<TAG0.ITEMHITSREGEN>)
SYSMESSAGELOCEX 04ac,1060444,00,(Cap 22),<dTAG0.ITEMHITSREGEN>
ENDIF
IF (<TAG0.ITEMSTAMREGEN>)
SYSMESSAGELOCEX 04ac,1060443,00,(Cap 30),<dTAG0.ITEMSTAMREGEN>
ENDIF

[DEFNAME PROPSFIX]
T_SHOWPROPS T_PROPRIEDADES

[TYPEDEF T_PROPRIEDADES]
ON=@ClientToolTip
IF (<TAG0.UNIQUEITEM>)
SRC.ADDCLILOC 1042971,<DEF.BFONT_LGREEN>[UNIQUE ITEM]<DEF.BR><DEF.BFONT_WHITE>
ENDIF
IF (!(<ISEMPTY <TAG.CRAFTEDBY>>))
SRC.ADDCLILOC 1050043,<TAG0.CRAFTEDBY>
ENDIF
SRC.ADDCLILOC 1072225,<FVAL <WEIGHT>>
IF (<ISARMOR>) || (<TYPE> == T_SHIELD) || (<TYPE> == T_CLOTHING)
	IF (<TAG0.SELFREPAIR>)
	SRC.ADDCLILOC 1060450,<dTAG0.SELFREPAIR>
	ENDIF
ELIF (<ISWEAPON>)
	IF (<VALUE>)
		IF (<quality> >= 190)
		SRC.ADDCLILOC 1018303
		ENDIF
	ENDIF
SRC.ADDCLILOC 1060403,100
	IF (0<SPEED>)
	SRC.ADDCLILOC 1061167,<FVAL ((800000/(200*<ARGO.SPEED>))/4)-5>s
	ENDIF
	IF (<TYPE>==T_WEAPON_SWORD)
	SRC.ADDCLILOC 1061172
	ELIF (<TYPE>==T_WEAPON_FENCE)
	SRC.ADDCLILOC 1061174
	ELIF (<TYPE>==T_WEAPON_MACE_SMITH) || (<TYPE>==T_WEAPON_MACE_SHARP) || (<TYPE>==t_weapon_MACE_CROOK)
	SRC.ADDCLILOC 1061173
	ELIF (<TYPE>==T_WEAPON_BOW)
	SRC.ADDCLILOC 1061175
	ENDIF
ENDIF
IF (<TYPE> == T_JEWELRY)
	IF (<TAG0.ENCHANCEPOTIONS>)
	SRC.ADDCLILOC 1060411,<dTAG0.ENCHANCEPOTIONS>
	ENDIF
	IF (<TAG0.GOLDINCREASE>)
	SRC.ADDCLILOC 1060414,<dTAG0.GOLDINCREASE>
	ENDIF
ENDIF
IF (<TAG0.NIGHTSIGHT>)
SRC.ADDCLILOC 1015008
ENDIF
IF (<TAG0.USEBESTWEAPONSKILL>)
SRC.ADDCLILOC 1060400
ENDIF
IF (<TAG0.DAMAGERETURN>)
SRC.ADDCLILOC 1060442,<EVAL <TAG0.DAMAGERETURN>>
ENDIF
IF (<TAG0.HITCHANCEDECREASE>)
SRC.ADDCLILOC 1060408,<dTAG0.HITCHANCEDECREASE>
ENDIF
IF (<TAG0.DAMINCREASE>)
SRC.ADDCLILOC 1060401,<dTAG0.DAMINCREASE>
ENDIF
IF (<TAG0.SWINGINCREASE>)
SRC.ADDCLILOC 1060486,<dTAG0.SWINGINCREASE>
ENDIF
IF (<TAG0.HITCHANCEINCREASE>)
SRC.ADDCLILOC 1060415,<dTAG0.HITCHANCEINCREASE>
ENDIF
IF (<TAG0.LIFELEECH>)
SRC.ADDCLILOC 1060422,<dTAG0.LIFELEECH>
ENDIF
IF (<TAG0.MANALEECH>)
SRC.ADDCLILOC 1060427,<dTAG0.MANALEECH>
ENDIF
IF (<TAG0.STAMLEECH>)
SRC.ADDCLILOC 1060430,<dTAG0.STAMLEECH>
ENDIF
IF (<TAG0.HITPOISONAREA>)
SRC.ADDCLILOC 1060429,<dTAG0.HITPOISONAREA>
ENDIF
IF (<TAG0.HITDISPEL>)
SRC.ADDCLILOC 1060417,<dTAG0.HITDISPEL>
ENDIF
IF (<TAG0.HITFIREBALL>)
SRC.ADDCLILOC 1060420,<dTAG0.HITFIREBALL>
ENDIF
IF (<TAG0.HITHARM>)
SRC.ADDCLILOC 1060421,<dTAG0.HITHARM>
ENDIF
IF (<TAG0.HITLIGHTNING>)
SRC.ADDCLILOC 1060423,<dTAG0.HITLIGHTNING>
ENDIF
IF (<TAG0.MAGICARROW>)
SRC.ADDCLILOC 1060426,<dTAG0.MAGICARROW>
ENDIF
IF (<TAG0.BALANCED>)
SRC.ADDCLILOC 1072792
ENDIF
IF (<TAG0.VELOCITY>)
SRC.ADDCLILOC 1072793,<dTAG0.VELOCITY>
ENDIF
IF (<TAG0.MAGICDAMINCREASE>)
SRC.ADDCLILOC 1060483,<dTAG0.MAGICDAMINCREASE>
ENDIF
IF (<TAG0.LOWERREAGENTCOST>)
SRC.ADDCLILOC 1060434,<dTAG0.LOWERREAGENTCOST>
ENDIF
IF (<TAG0.ENCHANCEPOTIONS>)
SRC.ADDCLILOC 1060411,<dTAG0.ENCHANCEPOTIONS>
ENDIF
IF (<TAG0.LOWERMANACOST>)
SRC.ADDCLILOC 1060433,<dTAG0.LOWERMANACOST>
ENDIF
IF (<TAG0.SPELLCHANNELING>)
SRC.ADDCLILOC 1060482
ENDIF
IF (<TAG0.FASTERCASTING>)
SRC.ADDCLILOC 1060413,<dTAG0.FASTERCASTING>
ENDIF
IF (<TAG0.FASTERCASTRECOVERY>)
SRC.ADDCLILOC 1060412,<dTAG0.FASTERCASTRECOVERY>
ENDIF

ON=@Equip
IF (<TAG0.USEBESTWEAPONSKILL>)
	IF (<SRC.SWORDSMANSHIP> > <SRC.FENCING>) && (<SRC.SWORDSMANSHIP> > <SRC.MACEFIGHTING>)
	TAG.OVERRIDE.SKILL=41
	ELIF (<SRC.FENCING> > <SRC.SWORDSMANSHIP>) && (<SRC.FENCING> > <SRC.MACEFIGHTING>)
	TAG.OVERRIDE.SKILL=43
	ELIF (<SRC.MACEFIGHTING> > <SRC.SWORDSMANSHIP>) && (<SRC.MACEFIGHTING> > <SRC.FENCING>)
	TAG.OVERRIDE.SKILL=42
	ENDIF
ENDIF
IF (<TAG0.FASTERCASTRECOVERY>)
SRC.TAG0.FASTERCASTRECOVERY += <dTAG0.FASTERCASTRECOVERY>
ENDIF
IF (<TAG0.GOLDINCREASE>)
SRC.TAG0.GOLDINCREASE += <TAG0.GOLDINCREASE>
ENDIF
IF (<TAG0.LOWERREAGENTCOST>)
SRC.TAG0.LOWERREAGENTCOST += <TAG0.LOWERREAGENTCOST>
ENDIF
IF (<TAG0.FASTERCASTING>)
SRC.TAG0.FASTERCASTING += <TAG0.FASTERCASTING>
ENDIF
IF (<TAG0.MAGICDAMINCREASE>)
SRC.TAG0.MAGICDAMINCREASE += <TAG0.MAGICDAMINCREASE>
ENDIF
IF (<TAG0.LOWERMANACOST>)
SRC.TAG0.LOWERMANACOST += <TAG0.LOWERMANACOST>
ENDIF
IF (<TAG0.LIFELEECH>)
SRC.TAG0.LIFELEECH += <TAG0.LIFELEECH>
ENDIF
IF (<TAG0.MANALEECH>)
SRC.TAG0.MANALEECH += <TAG0.MANALEECH>
ENDIF
IF (<TAG0.STAMLEECH>)
SRC.TAG0.STAMLEECH += <TAG0.STAMLEECH>
ENDIF
IF (<TAG0.DAMINCREASE>)
SRC.TAG0.DAMINCREASE += <TAG0.DAMINCREASE>
ENDIF
IF (<TAG0.HITCHANCEINCREASE>)
SRC.TAG0.HITCHANCEINCREASE += <TAG0.HITCHANCEINCREASE>
ENDIF
IF (<TAG0.SWINGINCREASE>)
SRC.TAG0.SWINGINCREASE += <TAG0.SWINGINCREASE>
ENDIF
IF (<TAG0.HITCHANCEDECREASE>)
SRC.TAG0.HITCHANCEDECREASE += <TAG0.HITCHANCEDECREASE>
ENDIF
IF (<TAG0.NIGHTSIGHT>)
SRC.NIGHTSIGHT=1
ENDIF

ON=@UnEquip
IF (<TAG0.NIGHTSIGHT>)
SRC.NIGHTSIGHT=0
ENDIF
IF (<TAG0.HITCHANCEDECREASE>)
SRC.TAG0.HITCHANCEDECREASE -= <TAG0.HITCHANCEDECREASE>
	IF (<SRC.TAG0.HITCHANCEDECREASE> == 0)
	SRC.TAG.HITCHANCEDECREASE=
	ENDIF
ENDIF
IF (<TAG0.DAMINCREASE>)
SRC.TAG0.DAMINCREASE -= <TAG0.DAMINCREASE>
	IF (<SRC.TAG0.DAMINCREASE> == 0)
	SRC.TAG.DAMINCREASE=
	ENDIF
ENDIF
IF (<TAG0.FASTERCASTRECOVERY>)
SRC.TAG0.FASTERCASTRECOVERY -= <dTAG0.FASTERCASTRECOVERY>
	IF (<SRC.TAG0.FASTERCASTRECOVERY> == 0)
	SRC.TAG.FASTERCASTRECOVERY=
	ENDIF
ENDIF
IF (<TAG0.HITCHANCEINCREASE>)
SRC.TAG0.HITCHANCEINCREASE -= <TAG0.HITCHANCEINCREASE>
	IF (<SRC.TAG0.HITCHANCEINCREASE> == 0)
	SRC.TAG.HITCHANCEINCREASE=
	ENDIF
ENDIF
IF (<TAG0.SWINGINCREASE>)
SRC.TAG0.SWINGINCREASE -= <TAG0.SWINGINCREASE>
	IF (<SRC.TAG0.SWINGINCREASE> == 0)
	SRC.TAG.SWINGINCREASE=
	ENDIF
ENDIF
IF (<TAG0.MAGICDAMINCREASE>)
SRC.TAG0.MAGICDAMINCREASE -= <TAG0.MAGICDAMINCREASE>
	IF (<SRC.TAG0.MAGICDAMINCREASE> == 0)
	SRC.TAG.MAGICDAMINCREASE=
	ENDIF
ENDIF
IF (<TAG0.LOWERMANACOST>)
SRC.TAG0.LOWERMANACOST -= <TAG0.LOWERMANACOST>
	IF (<SRC.TAG0.LOWERMANACOST> == 0)
	SRC.TAG.LOWERMANACOST=
	ENDIF
ENDIF
IF (<TAG0.LIFELEECH>)
SRC.TAG0.LIFELEECH -= <TAG0.LIFELEECH>
	IF (<SRC.TAG0.LIFELEECH> == 0)
	SRC.TAG.LIFELEECH=
	ENDIF
ENDIF
IF (<TAG0.MANALEECH>)
SRC.TAG0.MANALEECH -= <TAG0.MANALEECH>
	IF (<SRC.TAG0.MANALEECH> == 0)
	SRC.TAG.MANALEECH=
	ENDIF
ENDIF
IF (<TAG0.STAMLEECH>)
SRC.TAG0.STAMLEECH -= <TAG0.STAMLEECH>
	IF (<SRC.TAG0.STAMLEECH> == 0)
	SRC.TAG.STAMLEECH=
	ENDIF
ENDIF
IF (<TAG0.FASTERCASTING>)
SRC.TAG0.FASTERCASTING -= <TAG0.FASTERCASTING>
	IF (<SRC.TAG0.FASTERCASTING> == 0)
	SRC.TAG.FASTERCASTING
	ENDIF
ENDIF
IF (<TAG0.LOWERREAGENTCOST>)
SRC.TAG0.LOWERREAGENTCOST -= <TAG0.LOWERREAGENTCOST>
	IF (<SRC.TAG0.LOWERREAGENTCOST> == 0)
	SRC.TAG.LOWERREAGENTCOST
	ENDIF
ENDIF
IF (<TAG0.GOLDINCREASE>)
SRC.TAG0.GOLDINCREASE -= <TAG0.GOLDINCREASE>
	IF (<SRC.TAG0.GOLDINCREASE> == 0)
	SRC.TAG.GOLDINCREASE=
	ENDIF
ENDIF
tag.override.skill

[EOF]