;'FortressScavItem' Pick-up script (For fortress hunt)

SetUserFlag(0,11,GetUserFlag(0,11)+1)

Points = GetUserFlag(#USERID,11)
Points = Points + 1
SendMessageToUser(#USERID,"You have "+Points+" points of 50!",#MSG_EMOTE)

SetUserFlag(#USERID,11,Points)

TakeItem(#USERID,485)

ObjectsFound = GetUserFlag(0,11)-1

SendMessageToMap(1180,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(1181,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(1182,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(1183,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(1184,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(1185,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(1186,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(1187,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(1188,ObjectsFound+"/50 objects found!",#MSG_SAY)

If GetUserFlag(0,11) > 50
	SendMessageToAll("The Fortress Hunt has ended, please exit the hunting stadium to claim your prize.",#MSG_SERVER)
	SetUserFlag(0,10,0)
EndIf

ObjectSpawn = 0

If ObjectsFound < 46
	ObjectSpawn = Random(1,12)
EndIf

If ObjectSpawn = 1
	SpawnItem(1183, 485, 5, 15)
ElseIf ObjectSpawn = 2
	SpawnItem(1183, 485, 11, 5)
ElseIf ObjectSpawn = 3
	SpawnItem(1187, 485, 8, 10)
ElseIf ObjectSpawn = 4
	SpawnItem(1181, 485, 11, 13)
ElseIf ObjectSpawn = 5
	SpawnItem(1181, 485, 2, 17)
ElseIf ObjectSpawn = 6
	SpawnItem(1186, 485, 10, 7)
ElseIf ObjectSpawn = 7
	SpawnItem(1184, 485, 6, 6)
ElseIf ObjectSpawn = 8
	SpawnItem(1184, 485, 14, 12)
ElseIf ObjectSpawn = 9
	SpawnItem(1182, 485, 5, 14)
ElseIf ObjectSpawn = 10
	SpawnItem(1185, 485, 5, 14)
ElseIf ObjectSpawn = 11
	SpawnItem(1180, 485, 7, 14)
ElseIf ObjectSpawn = 12
	SpawnItem(1180, 485, 17, 3)
EndIf

Label END

Continue = 1