;Accessory Equip script

If HasItem(#USERID,#TARGETID) = 1
	StrenthPlus = GetItemFlag1(#TARGETID)
	EndurancePlus = GetItemFlag2(#TARGETID)
	WisdomPlus = GetItemFlag3(#TARGETID)
	AgilityPlus = GetItemFlag4(#TARGETID)
	;ChanceOfBreaking = GetItemFlag4(#TARGETID)
	
	SetUserStrengthBonus(#USERID,GetUserStrengthBonus(#USERID)+StrenthPlus)
	SetUserEnduranceBonus(#USERID,GetUserEnduranceBonus(#USERID)+EndurancePlus)
	SetUserWisdomBonus(#USERID,GetUserWisdomBonus(#USERID)+WisdomPlus)
	SetUserAgilityBonus(#USERID,GetUserAgilityBonus(#USERID)+AgilityPlus)
	
	If StrenthPlus <> 0
		If StrenthPlus > 0
			SendCombatMessage(#USERID,"Your strength was increased by "+StrenthPlus+" ")
		Else
			SendCombatMessage(#USERID,"Your strength was decreased by "+Floor(0-StrenthPlus)+" ")
		EndIf
	EndIf
	If EndurancePlus <> 0
		If EndurancePlus > 0
			SendCombatMessage(#USERID,"Your endurance was increased by "+EndurancePlus+" ")
		Else
			SendCombatMessage(#USERID,"Your endurance was decreased by "+Floor(0-EndurancePlus)+" ")
		EndIf
	EndIf
	If WisdomPlus <> 0
		If WisdomPlus > 0
			SendCombatMessage(#USERID,"Your wisdom was increased by "+WisdomPlus+" ")
		Else
			SendCombatMessage(#USERID,"Your wisdom was decreased by "+Floor(0-WisdomPlus)+" ")
		EndIf
	EndIf
	If AgilityPlus <> 0
		If AgilityPlus > 0
			SendCombatMessage(#USERID,"Your agility was increased by "+AgilityPlus+" ")
		Else
			SendCombatMessage(#USERID,"Your agility was decreased by "+Floor(0-AgilityPlus)+" ")
		EndIf
	EndIf
EndIf

Label END

Continue = 1