;'Cyber Says' event - general+ending script

Value=#PARAM1

SENTENCE=""

If Value = 1
	SENTENCE="good morning"
ElseIf Value = 2
	SENTENCE="get ready"
ElseIf Value = 3
	SENTENCE="all set"
ElseIf Value = 4
	SENTENCE="lets start"
ElseIf Value = 5
	SENTENCE="begin typing"
ElseIf Value = 6
	SENTENCE="Prepared"
ElseIf Value = 7
	SENTENCE="Completed"
ElseIf Value = 8
	SENTENCE="Totalled"
ElseIf Value = 9
	SENTENCE="Reward"
ElseIf Value = 10
	SENTENCE="Destroyed"
ElseIf Value = 11
	SENTENCE="Down there"
ElseIf Value = 12
	SENTENCE="Over here"
ElseIf Value = 13
	SENTENCE="Higher up"
ElseIf Value = 14
	SENTENCE="Farther back"
ElseIf Value = 15
	SENTENCE="Further along"
ElseIf Value = 16
	SENTENCE="Shrikes disease"
ElseIf Value = 17
	SENTENCE="Cyberneticwraith"
ElseIf Value = 18
	SENTENCE="Abadonian Might"
ElseIf Value = 19
	SENTENCE="Russ stole my gold"
ElseIf Value = 20
	SENTENCE="Drac killed Comrade"
ElseIf Value = 21
	SENTENCE="Predhunter13 roars at ten"
ElseIf Value = 22
	SENTENCE="Comrade can divide by zero"
ElseIf Value = 23
	SENTENCE="Shrike is a mad genius"
ElseIf Value = 24
	SENTENCE="Dracflamloc is number 1"
ElseIf Value = 25
	SENTENCE="Just try and keep typing"
ElseIf Value = 26
	SENTENCE="Baked potatoes are good"
ElseIf Value = 27
	SENTENCE="Kiwis are good for you"
ElseIf Value = 28
	SENTENCE="I wonder it ti rednow I"
ElseIf Value = 29
	SENTENCE="Cyber says says Cyber"
ElseIf Value = 30
	SENTENCE="Cornrade is mispelled here"
ElseIf Value = 31
	SENTENCE="mystix hates people calling him mystic"
ElseIf Value = 32
	SENTENCE="lightningman lost his lightning"
ElseIf Value = 33
	SENTENCE="Moderators are fierce and quick to anger"
ElseIf Value = 34
	SENTENCE="Oisvo Deeps is under the underworks"
ElseIf Value = 35
	SENTENCE="Stop posting pictures of cats online"
ElseIf Value = 36
	SENTENCE="Cyberneticwraith AKA Cyber the wraith"
ElseIf Value = 37
	SENTENCE="I wonder when the others will mess up"
ElseIf Value = 38
	SENTENCE="I wonder why I keep on wondering"
ElseIf Value = 39
	SENTENCE="I wonder what Cyber will say next"
ElseIf Value = 40
	SENTENCE="Shares in DoZ increased ten fold today"
ElseIf Value = 41
	SENTENCE="I did not think you would make it this far"
ElseIf Value = 42
	SENTENCE="Cyber will warp you if you get this one wrong"
ElseIf Value = 43
	SENTENCE="My computer has a widescreen monitor"
ElseIf Value = 44
	SENTENCE="The beachhouse has a wondeful view of the sea"
ElseIf Value = 45
	SENTENCE="The morning awakens with a deeply colored sunrise"
ElseIf Value = 46
	SENTENCE="Dracflamloc dramatically debugs dangerous deallocations"
ElseIf Value = 47
	SENTENCE="Wookie warlord WarWookie wages war"
ElseIf Value = 48
	SENTENCE="Shrike systematicly slays silver sealions"
ElseIf Value = 49
	SENTENCE="Comrade compares computational calculations"
Else
	SENTENCE="Dr Dada daily diagnoses deadly diseases"
EndIf



If GetUserFlag(0, 11)=1

Users=0
LastUser=0

X=6
Y=6
While Y < 15
	While X < 15
		UserID = GetUserAtXY(548,X,Y)
		
		If UserID <> 0
			Users=Users+1
			
			Message=GetUserMessage(UserID)
			CyMsg=SENTENCE
			If Message=CyMsg
				LastUser=UserID
			Else
				if GetUserName(UserID)<>"Shrike"
				SendMessageToUser(UserID,"Cyber says, 'Wrong. It appears that you lose this time.'",#MSG_SAY)
				SendMessageToUser(UserID,"Cyber smiles a humorless smile, and warps you out of his presence.",#MSG_EMOTE)
				WarpUser(UserID, 509, 10, 11)
				SendMessageToMap(548,GetUserName(UserID)+" failed, and has been removed.",#MSG_SERVER)
				Users=Users-1
				else
					LastUser=UserID
				endif
			EndIf
		EndIf
		X=X+1
	Wend
	X=6
	Y=Y+1
Wend

If Users = 1
	SendMessageToUser(LastUser,"Cyber smiles, and warps you away.",#MSG_EMOTE)
	SendMessageToUser(LastUser,"You got 25,000 silver!",#MSG_TELL)
	SetUserSilver(LastUser,GetUserSilver(LastUser)+25000)
	WarpUser(LastUser, 509, 10, 11)
	SendMessageToAll("'Cyber Says' is now over, congratulations to "+GetUserName(LastUser)+" for winning the event.",#MSG_SERVER)
	Timer(346,100,LastUser,0,0)
	GoTo END
EndIf


;--------------------------------------
;End the script, if not already ending
;--------------------------------------


Users=0

X=6
Y=6
While Y < 15
	While X < 15
		UserID = GetUserAtXY(548,X,Y)
		
		If UserID <> 0
			Users=Users+1
		EndIf
		X=X+1
	Wend
	Y=Y+1
Wend

SendMessageToAll("'Cyber Says' is now over, 25,000 prize money is awarded to all the surviving players.",#MSG_SERVER)

Silver = 25000

X=6
Y=6
While Y < 15
	While X < 15
		UserID = GetUserAtXY(548,X,Y)
		
		If UserID > 0
			SetUserSilver(UserID,GetUserSilver(UserID)+Silver)
			SendMessageToUser(UserID,"You got "+Silver+" silver from Cyber Says!",#MSG_TELL)
		EndIf
		X=X+1
	Wend
	X=6
	Y=Y+1
Wend

;UserFlag ENDIF
EndIf

Label END

SetUserFlag(0,10,0)
SetUserFlag(0,11,0)

Continue = 1