/////////////////////////////////////////////////////////////////////
// RAINBOW.S 
/////////////////////////////////////////////////////////////////////

SETUP

	PlaceC SKIFF pSKIFF

	IF !gt_PLACED_RAINBOW_CHARS
		Add gt_PLACED_RAINBOW_CHARS

	ELSE
		RemoveC RR_GARD_A_1
		RemoveC RR_GARD_A_2
		RemoveC RR_GARD_B_1
		RemoveC RR_GARD_B_2
		RemoveC RR_GARD_C_1
		RemoveC RR_GARD_C_2
		RemoveC RR_GARD_D_1
		RemoveC RR_GARD_D_2
		RemoveC RR_GARD_E_1
		RemoveC RR_GARD_E_2
		RemoveC RR_GARD_E_3
		RemoveC RR_GARD_F_1
		RemoveC RR_GARD_F_2
		RemoveC RR_GARD_F_3
	ENDIF

	PlaceC RR_GARD_A_1 pGARD_A_2
	PlaceC RR_GARD_A_2 pGARD_A_4
	PlaceC RR_GARD_B_1 pGARD_B_2
	PlaceC RR_GARD_B_2 pGARD_B_4
	PlaceC RR_GARD_C_1 pGARD_C_2
	PlaceC RR_GARD_C_2 pGARD_C_4
	PlaceC RR_GARD_D_1 pGARD_D_2
	PlaceC RR_GARD_D_2 pGARD_D_4
	PlaceC RR_GARD_E_1 pGARD_E_1
	PlaceC RR_GARD_E_2 pGARD_E_2
	PlaceC RR_GARD_E_3 pGARD_E_3
	PlaceC RR_GARD_F_1 pGARD_F_1
	PlaceC RR_GARD_F_2 pGARD_F_2
	PlaceC RR_GARD_F_3 pGARD_F_3
	RunS RainbowRockOrdersSquadsAToD
	Remove gt_RR_GARD_E_GUARDING
	Remove gt_RR_GARD_F_GUARDING

END

VIG TempSetup FALSE

    DisableTeleport RA_HEXSTONE

	Set	gd_WEATHER_TYPE	2
	Set gd_WIND_TYPE	1
    RunS CueWeather

	SetLiquid all 1650 20 20
	SetWaterType 0

	CachePortrait SKIFF.BIN

END

/////////////////////////////////////////////////////////////////////

VIG ArrivalFromShadowguard gt_SHDOCK_TO_RROCK

	Widescreen TRUE

	RunS QPalFadeRPG
	Wait 2500
	//"Land ho..."
	Say if012b SKIFF.BIN
	//"I'll be ready to head back whenever you are...fishing..."
	Say if012c SKIFF.BIN

	Remove gt_SHDOCK_TO_RROCK

	MoveCDir SKIFF pSKIFF_FISH

	Widescreen FALSE

END

/////////////////////////////////////////////////////////////////////

VIG TalkToSkiff MSG-iSKIFF

	Widescreen TRUE
	UnDrawSwordRemember

	EngageAndFace SKIFF P

	//"Back Again lad?"
	Say ifx002 SKIFF.BIN

	ResetChoice
	WHILE !MenuExit
		ClearChoices

		//Set Sail
		AddChoice 1 tx0101

		//Leave
		AddChoice 0 tx0003

		GetChoice SKIFF

		SWITCH Choice
			CASE 1
				//Set Sail

				//"Right you are me lad..."
				Say if012d SKIFF.BIN

				RunS PalFadeBLACK

				SetChoiceToExit

				Add gt_RROCK_TO_SHDOCK
				RemoveC SKIFF

				PostMsg t_SD_DOCK

			CASE 0
				//Leave

				//"Farewell, lad. Keep your head down."
				Say if0023 SKIFF.BIN
		ENDSWITCH
	ENDWHILE

	Widescreen FALSE
	UnDrawSwordRemember
END

/////////////////////////////////////////////////////////////////////

VIG RainbowRockOrdersSquadsAToD FALSE

	MoveCDir				RR_GARD_A_1 pGARD_A_3
	AddControl				RR_GARD_A_1 MoveCDir pGARD_A_4
	AddControl				RR_GARD_A_1 MoveCDir pGARD_A_1
	AddControl				RR_GARD_A_1 MoveCDir pGARD_A_2
	SequenceLoops			RR_GARD_A_1
	SwitchOnSightOfPlayer	RR_GARD_A_1 AttackDemo2

	MoveCDir				RR_GARD_A_2 pGARD_A_1
	AddControl				RR_GARD_A_2 MoveCDir pGARD_A_2
	AddControl				RR_GARD_A_2 MoveCDir pGARD_A_3
	AddControl				RR_GARD_A_2 MoveCDir pGARD_A_4
	SequenceLoops			RR_GARD_A_2
	SwitchOnSightOfPlayer	RR_GARD_A_2 AttackDemo2

	MoveCDir				RR_GARD_B_1 pGARD_B_3
	AddControl				RR_GARD_B_1 MoveCDir pGARD_B_4
	AddControl				RR_GARD_B_1 MoveCDir pGARD_B_1
	AddControl				RR_GARD_B_1 MoveCDir pGARD_B_2
	SequenceLoops			RR_GARD_B_1
	SwitchOnSightOfPlayer	RR_GARD_B_1 AttackDemo2

	MoveCDir				RR_GARD_B_2 pGARD_B_1
	AddControl				RR_GARD_B_2 MoveCDir pGARD_B_2
	AddControl				RR_GARD_B_2 MoveCDir pGARD_B_3
	AddControl				RR_GARD_B_2 MoveCDir pGARD_B_4
	SequenceLoops			RR_GARD_B_2
	SwitchOnSightOfPlayer	RR_GARD_B_2 AttackDemo2

	MoveCDir				RR_GARD_C_1 pGARD_C_3
	AddControl				RR_GARD_C_1 MoveCDir pGARD_C_4
	AddControl				RR_GARD_C_1 MoveCDir pGARD_C_1
	AddControl				RR_GARD_C_1 MoveCDir pGARD_C_2
	SequenceLoops			RR_GARD_C_1
	SwitchOnSightOfPlayer	RR_GARD_C_1 AttackDemo2

	MoveCDir				RR_GARD_C_2 pGARD_C_1
	AddControl				RR_GARD_C_2 MoveCDir pGARD_C_2
	AddControl				RR_GARD_C_2 MoveCDir pGARD_C_3
	AddControl				RR_GARD_C_2 MoveCDir pGARD_C_4
	SequenceLoops			RR_GARD_C_2
	SwitchOnSightOfPlayer	RR_GARD_C_2 AttackDemo2

	MoveCDir				RR_GARD_D_1 pGARD_D_3
	AddControl				RR_GARD_D_1 MoveCDir pGARD_D_4
	AddControl				RR_GARD_D_1 MoveCDir pGARD_D_1
	AddControl				RR_GARD_D_1 MoveCDir pGARD_D_2
	SequenceLoops			RR_GARD_D_1
	SwitchOnSightOfPlayer	RR_GARD_D_1 AttackDemo2

	MoveCDir				RR_GARD_D_2 pGARD_D_1
	AddControl				RR_GARD_D_2 MoveCDir pGARD_D_2
	AddControl				RR_GARD_D_2 MoveCDir pGARD_D_3
	AddControl				RR_GARD_D_2 MoveCDir pGARD_D_4
	SequenceLoops			RR_GARD_D_2
	SwitchOnSightOfPlayer	RR_GARD_D_2 AttackDemo2

END

/////////////////////////////////////////////////////////////////////

VIG RR_Squad_E_Guard TENSEC && !gt_RR_GARD_E_GUARDING && !INAREA-P-NEAR_E_SHIP

	Add gt_RR_GARD_E_GUARDING

	MoveCDir	RR_GARD_E_1	pGARD_E_1
	AddControl	RR_GARD_E_1	LookAtTurn	RR_GARD_E_2
	AddControl	RR_GARD_E_1	LookAtTurn	RR_GARD_E_3
	AddControl	RR_GARD_E_1	Capture		cM_TALK_WARNING1
	AddControl	RR_GARD_E_1	Capture		cM_TALK_DISAGREE1
	AddControl	RR_GARD_E_1	Capture		cM_TALK_AGREE1
	SequenceRandomlySelects RR_GARD_E_1

	MoveCDir	RR_GARD_E_2	pGARD_E_2
	AddControl	RR_GARD_E_2	LookAtTurn	RR_GARD_E_1
	AddControl	RR_GARD_E_2	LookAtTurn	RR_GARD_E_3
	AddControl	RR_GARD_E_2	Capture		cM_TALK_WARNING1
	AddControl	RR_GARD_E_2	Capture		cM_TALK_DISAGREE1
	AddControl	RR_GARD_E_2	Capture		cM_TALK_AGREE1
	SequenceRandomlySelects RR_GARD_E_2

	MoveCDir	RR_GARD_E_3	pGARD_E_3
	AddControl	RR_GARD_E_3	Capture		cM_GUARD_STAND1
	AddControl	RR_GARD_E_3	Capture		cM_GUARD_STAND2
	AddControl	RR_GARD_E_3	Capture		cM_GUARD_STAND3
	SequenceRandomlySelects RR_GARD_E_3

END

/////////////////////////////////////////////////////////////////////

VIG RR_Squad_E_Attack ONESEC && gt_RR_GARD_E_GUARDING && (INAREA-P-NEAR_E_SHIP || DAMAGED-RR_GARD_E_1 || DAMAGED-RR_GARD_E_2 || DAMAGED-RR_GARD_E_3)

	Remove gt_RR_GARD_E_GUARDING
	ClearDamaged  RR_GARD_E_1
	ClearDamaged  RR_GARD_E_2
	ClearDamaged  RR_GARD_E_3

	GiveSightOfPlayerTo RR_GARD_E_1
	GiveSightOfPlayerTo RR_GARD_E_2
	GiveSightOfPlayerTo RR_GARD_E_3

	AttackDemo2 RR_GARD_E_1
	AttackDemo2 RR_GARD_E_2
	AttackDemo2 RR_GARD_E_3

END

/////////////////////////////////////////////////////////////////////

VIG RR_Squad_F_Guard TENSEC && !gt_RR_GARD_F_GUARDING && !INAREA-P-NEAR_F_SHIP

	Add gt_RR_GARD_F_GUARDING

	MoveCDir	RR_GARD_F_1	pGARD_F_1
	AddControl	RR_GARD_F_1	LookAtTurn	RR_GARD_F_2
	AddControl	RR_GARD_F_1	LookAtTurn	RR_GARD_F_3
	AddControl	RR_GARD_F_1	Capture		cM_TALK_WARNING1
	AddControl	RR_GARD_F_1	Capture		cM_TALK_DISAGREE1
	AddControl	RR_GARD_F_1	Capture		cM_TALK_AGREE1
	SequenceRandomlySelects RR_GARD_F_1

	MoveCDir	RR_GARD_F_2	pGARD_F_2
	AddControl	RR_GARD_F_2	LookAtTurn	RR_GARD_F_1
	AddControl	RR_GARD_F_2	LookAtTurn	RR_GARD_F_3
	AddControl	RR_GARD_F_2	Capture		cM_TALK_WARNING1
	AddControl	RR_GARD_F_2	Capture		cM_TALK_DISAGREE1
	AddControl	RR_GARD_F_2	Capture		cM_TALK_AGREE1
	SequenceRandomlySelects RR_GARD_F_2

	MoveCDir	RR_GARD_F_3	pGARD_F_3
	AddControl	RR_GARD_F_3	Capture		cM_GUARD_STAND1
	AddControl	RR_GARD_F_3	Capture		cM_GUARD_STAND2
	AddControl	RR_GARD_F_3	Capture		cM_GUARD_STAND3
	SequenceRandomlySelects RR_GARD_F_3

END

/////////////////////////////////////////////////////////////////////

VIG RR_Squad_F_Attack ONESEC && gt_RR_GARD_F_GUARDING && (INAREA-P-NEAR_F_SHIP || DAMAGED-RR_GARD_F_1 || DAMAGED-RR_GARD_F_2 || DAMAGED-RR_GARD_F_3)

	Remove gt_RR_GARD_F_GUARDING
	ClearDamaged  RR_GARD_F_1
	ClearDamaged  RR_GARD_F_2
	ClearDamaged  RR_GARD_F_3

	GiveSightOfPlayerTo RR_GARD_F_1
	GiveSightOfPlayerTo RR_GARD_F_2
	GiveSightOfPlayerTo RR_GARD_F_3

	AttackDemo2 RR_GARD_F_1
	AttackDemo2 RR_GARD_F_2
	AttackDemo2 RR_GARD_F_3

END

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

VIG FlyBy FALSE

	Widescreen TRUE

	// *** EXAMPLE CAMERA FLY-BY CODE ***

	// use Wait at start and end to help when editing the final recording
	// use UUCameraComplete to wait for a pan to finish
	// use SetCamMoveConstant to set camera movement per frame
	//     - remember the movie is played at 25fps no matter how slow it records

	SetCamMoveConstant 40
	FreeCam
	PhotoOn

	camcut flyby05

	campan flyby03
	UUCameraComplete

	campan flyby01
	UUCameraComplete

	campan flyby02
	UUCameraComplete

	PhotoOff

	// *** END OF FLY-BY ***

	Widescreen FALSE

END

/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////

VIG AltombReappear gg_VANISHED_ALTOMB
	Remove gg_VANISHED_ALTOMB
	FX_Visible P
END