IF
	Range(NearestEnemyOf(Myself),5)
	OR(4)
		!GlobalTimerNotExpired("Cast","LOCALS")
		!StateCheck(Myself,STATE_INVISIBLE)
		Class(Myself,FIGHTER_ALL)
		Class(Myself,THIEF_ALL)
THEN
	RESPONSE #100
		EquipMostDamagingMelee()
		Attack(NearestEnemyOf(Myself))
END

IF
	InWeaponRange(NearestEnemyOf(Myself))
	!Range(NearestEnemyOf(Myself),5)
	OR(4)
		!GlobalTimerNotExpired("Cast","LOCALS")
		!StateCheck(Myself,STATE_INVISIBLE)
		Class(Myself,FIGHTER_ALL)
		Class(Myself,THIEF_ALL)
THEN
	RESPONSE #100
		Attack(NearestEnemyOf(Myself))
END

IF
	!InWeaponRange(NearestEnemyOf(Myself))
	!Range(NearestEnemyOf(Myself),5)
	GlobalTimerNotExpired("Cast","LOCALS")
THEN
	RESPONSE #100
		EquipRanged()
END

IF
	!InWeaponRange(NearestEnemyOf(Myself))
	!Range(NearestEnemyOf(Myself),5)
	!GlobalTimerNotExpired("Cast","LOCALS")
THEN
	RESPONSE #100
		EquipRanged()
		Attack(NearestEnemyOf(Myself))
END

IF
	True()
THEN
	RESPONSE #100
		NoAction()
END
