;'Scavengeritem' Pick-up script (For scavenger 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,248)

ObjectsFound = GetUserFlag(0,11)-1

SendMessageToMap(455,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(456,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(457,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(458,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(459,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(460,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(461,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(462,ObjectsFound+"/50 objects found!",#MSG_SAY)
SendMessageToMap(463,ObjectsFound+"/50 objects found!",#MSG_SAY)

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

If ObjectsFound = 1
	SpawnItem(455,248,3,3)
ElseIf ObjectsFound = 2
	SpawnItem(455,248,13,15)
ElseIf ObjectsFound = 3
	SpawnItem(461,248,10,17)
ElseIf ObjectsFound = 4
	SpawnItem(460,248,6,18)
ElseIf ObjectsFound = 5
	SpawnItem(457,248,12,1)
ElseIf ObjectsFound = 6
	SpawnItem(461,248,8,10)
ElseIf ObjectsFound = 7
	SpawnItem(456,248,6,15)
ElseIf ObjectsFound = 8
	SpawnItem(462,248,5,12)
ElseIf ObjectsFound = 9
	SpawnItem(458,248,8,13)
ElseIf ObjectsFound = 10
	SpawnItem(460,248,6,18)
ElseIf ObjectsFound = 11
	SpawnItem(456,248,16,3)
ElseIf ObjectsFound = 12
	SpawnItem(458,248,8,13)
ElseIf ObjectsFound = 13
	SpawnItem(457,248,11,15)
ElseIf ObjectsFound = 14
	SpawnItem(459,248,7,15)
ElseIf ObjectsFound = 15
	SpawnItem(459,248,2,2)
ElseIf ObjectsFound = 16
	SpawnItem(463,248,16,14)
ElseIf ObjectsFound = 17
	SpawnItem(463,248,10,10)
ElseIf ObjectsFound = 18
	SpawnItem(455,248,3,3)
ElseIf ObjectsFound = 19
	SpawnItem(463,248,5,4)
ElseIf ObjectsFound = 20
	SpawnItem(463,248,16,14)
ElseIf ObjectsFound = 21
	SpawnItem(458,248,17,8)
ElseIf ObjectsFound = 22
	SpawnItem(462,248,5,12)
ElseIf ObjectsFound = 23
	SpawnItem(462,248,10,4)
ElseIf ObjectsFound = 24
	SpawnItem(458,248,17,8)
ElseIf ObjectsFound = 25
	SpawnItem(457,248,11,15)
ElseIf ObjectsFound = 26
	SpawnItem(458,248,3,9)
ElseIf ObjectsFound = 27
	SpawnItem(463,248,10,10)
ElseIf ObjectsFound = 28
	SpawnItem(458,248,8,13)
ElseIf ObjectsFound = 29
	SpawnItem(460,248,6,18)
ElseIf ObjectsFound = 30
	SpawnItem(455,248,3,3)
ElseIf ObjectsFound = 31
	SpawnItem(459,248,16,16)
ElseIf ObjectsFound = 32
	SpawnItem(455,248,13,15)
ElseIf ObjectsFound = 33
	SpawnItem(463,248,5,4)
ElseIf ObjectsFound = 34
	SpawnItem(457,248,12,1)
ElseIf ObjectsFound = 35
	SpawnItem(456,248,16,3)
ElseIf ObjectsFound = 36
	SpawnItem(462,248,10,4)
ElseIf ObjectsFound = 37
	SpawnItem(459,248,2,2)
ElseIf ObjectsFound = 38
	SpawnItem(460,248,6,18)
ElseIf ObjectsFound = 39
	SpawnItem(463,248,16,14)
ElseIf ObjectsFound = 40
	SpawnItem(457,248,11,15)
ElseIf ObjectsFound = 41
	SpawnItem(461,248,10,17)
ElseIf ObjectsFound = 42
	SpawnItem(459,248,16,16)
ElseIf ObjectsFound = 43
	SpawnItem(456,248,6,15)
ElseIf ObjectsFound = 44
	SpawnItem(458,248,3,9)
ElseIf ObjectsFound = 45
	SpawnItem(459,248,7,15)
;ElseIf ObjectsFound = 46
;	SpawnItem(457,248,12,1)
;ElseIf ObjectsFound = 47
;	SpawnItem(458,248,17,8)
;ElseIf ObjectsFound = 48
;	SpawnItem(461,248,8,10)
;ElseIf ObjectsFound = 49
;	SpawnItem(463,248,10,10)
EndIf

Label END

Continue = 1