[TYPEDEF T_SET_PIECE]
ON=@ClientToolTip
SRC.ADDCLILOC 1027987
IF (!(<TAG0.SETTYPE>)) //armor set
SRC.ADDCLILOC 1072376,<dTAG0.SET_TOTAL_AMOUNT>
	IF (<COLOR> == <TAG0.SET_FULL_COLOR>)
	SRC.ADDCLILOC 1072377
	ENDIF
ELIF (<TAG0.SETTYPE> == 1) //weapon&armor set
SRC.ADDCLILOC 1073491,<dTAG0.SET_TOTAL_AMOUNT>
	IF (<COLOR> == <TAG0.SET_FULL_COLOR>)
	SRC.ADDCLILOC 1073492
	ENDIF
ELIF (<TAG0.SETTYPE> == 2) //jewelry set
SRC.ADDCLILOC 1080240,<dTAG0.SET_TOTAL_AMOUNT>
	IF (<COLOR> == <TAG0.SET_FULL_COLOR>)
	SRC.ADDCLILOC 1080241
	ENDIF
ENDIF

ON=@Equip
FOR 25
	IF (STRMATCH(*<SRC.FINDLAYER.<dLOCAL._FOR>.BASEID>*,<TAG.SETITEMLIST>))
	LOCAL.SETAMOUNT ++
	REF<dLOCAL.SETAMOUNT>=<SRC.FINDLAYER.<dLOCAL._FOR>.UID>
	ENDIF
ENDFOR
IF (<LOCAL.SETAMOUNT> == <TAG0.SET_TOTAL_AMOUNT>)
	FOR <LOCAL.SETAMOUNT>
	REF<dLOCAL._FOR>.TAG.LASTCOLOR=<REF<dLOCAL._FOR>.COLOR>
	REF<dLOCAL._FOR>.COLOR=<TAG0.SET_FULL_COLOR>
	ENDFOR
TRY SRC.F_GIVE_BONUS_<TAG0.SET_NAME> 1 //give bonuses
SRC.SPELLEFFECT S_NIGHT_SIGHT,25000.0,<SRC>
SRC.SYSMESSAGELOC -1,1072391 //The magic of your armor combines to assist you!
ENDIF

ON=@UnEquip
IF (<COLOR> == <TAG0.SET_FULL_COLOR>)
TRY SRC.F_GIVE_BONUS_<TAG0.SET_NAME> 0 //remove bonuses
	FOR 25
		IF (STRMATCH(*<SRC.FINDLAYER.<dLOCAL._FOR>.BASEID>*,<TAG.SETITEMLIST>))
		LOCAL.SETAMOUNT ++
		REF<dLOCAL.SETAMOUNT>=<SRC.FINDLAYER.<dLOCAL._FOR>.UID>
		ENDIF
	ENDFOR
	IF (<LOCAL.SETAMOUNT> == <TAG0.SET_TOTAL_AMOUNT>)
		FOR <LOCAL.SETAMOUNT>
		REF<dLOCAL._FOR>.COLOR=<REF<dLOCAL._FOR>.TAG.LASTCOLOR>
		REF<dLOCAL._FOR>.TAG.LASTCOLOR=
		ENDFOR
	ENDIF
ENDIF

[EOF]
