;Event Starting Skill

If Lower(GetUserMessage(#USERID))="reset"
	SendMessageToUser(#USERID,"Event reseted.",#MSG_SERVER)
	SetUserFlag(0,11,0)
	SetUserFlag(0,10,0)
	SetUserFlag(1,10,0)
	GoTo END
EndIf


If GetUserFlag(0,10)<>0
	SendMessageToUser(#USERID,"There is already an event in progress!", #MSG_CRITICAL)
	Goto End
Else
	SetUserFlag(0,11,0)
	SetUserFlag(1,10,0)
	
	If GetUserMap(#USERID)=500
		SetUserFlag(0,10,1)
		EventName="Water Race"
		EventStartMap=500
		Script=148
		Goto EventStart
	EndIf
	If GetUserMap(#USERID)=452
		SetUserFlag(0,10,2)
		EventName="Forest Race"
		EventStartMap=452
		Script=179
		Goto EventStart
	EndIf
	If GetUserMap(#USERID)=550
		SetUserFlag(0,10,3)
		EventName="Death Dungeon"
		EventStartMap=550
		Script=180
		Goto EventStart
	EndIf
	If GetUserMap(#USERID)=552
		SetUserFlag(0,10,4)
		EventName="Four Corners"
		EventStartMap=552
		Script=182
		Goto EventStart
	EndIf
	If GetUserMap(#USERID)=464
		SetUserFlag(0,10,5)
		EventName="Scavenger Hunt"
		EventStartMap=464
		Script=211
		Goto EventStart
	EndIf	
	If GetUserMap(#USERID)=548
		SetUserFlag(0,10,6)
		EventName="Cyber Says"
		EventStartMap=548
		Script=520
		Goto EventStart
	EndIf
	If GetUserMap(#USERID)=580
		SetUserFlag(0,10,7)
		EventName="Urban Race"
		EventStartMap=580
		Script=253
		Goto EventStart
	EndIf
	If GetUserMap(#USERID)=655
		SetUserFlag(0,10,8)
		EventName="Dance Master"
		EventStartMap=655
		Script=271
		Goto EventStart
	EndIf
	If GetUserMap(#USERID)=830
		SetUserFlag(0,10,9)
		EventName="Desert Race"
		EventStartMap=830
		Script=362
		Goto EventStart
	EndIf

	SendMessageToUser(#USERID,"You must be in an event starting location!", #MSG_CRITICAL)
	Goto End
Endif

Label EventStart
If GetUserMessage(#USERID)="4"
	Timer(517,100,EventName,5,0)
	Timer(Script,240000,EventStartMap,0,0)
ElseIf GetUserMessage(#USERID)="3"
	Timer(517,100,EventName,4,0)
	Timer(Script,180000,EventStartMap,0,0)
ElseIf GetUserMessage(#USERID)="2"
	Timer(517,100,EventName,3,0)
	Timer(Script,120000,EventStartMap,0,0)
ElseIf GetUserMessage(#USERID)="1"
	Timer(517,100,EventName,2,0)
	Timer(Script,60000,EventStartMap,0,0)
Else
	Timer(517,100,EventName,6,0)
	Timer(Script,300000,EventStartMap,0,0)
Endif

Label End

Continue = 1