/////////////////////////////////////////////////////////////////////
// CONSTEP.S - Eastern Steps
/////////////////////////////////////////////////////////////////////

SETUP

    IF gd_USED_FERRY
        IF !f_USED_FERRY
            Add     f_USED_FERRY
        ENDIF
    ENDIF

	IF !mj_BARTS_ASSAULT || mj_DEFEAT_BART
		PlaceC  ALLIS   pALLIS_ARRIVE
	ELSE
		RemoveC ALLIS
	ENDIF

	IF !gt_PLACED_CONSTEP_DENIZENS
		Add gt_PLACED_CONSTEP_DENIZENS

		PlaceC AMBUSH_EVIL_1 pEVIL_1
		PlaceC AMBUSH_EVIL_2 pEVIL_2
		PlaceC AMBUSH_EVIL_3 pEVIL_3
		PlaceC AMBUSH_EVIL_4 pEVIL_4
		RestrictedWanderButAttackOnSight AMBUSH_EVIL_1
		RestrictedWanderButAttackOnSight AMBUSH_EVIL_2
		RestrictedWanderButAttackOnSight AMBUSH_EVIL_3
		RestrictedWanderButAttackOnSight AMBUSH_EVIL_4

		PlaceC LUCKLESS_BRIGAND_1 pBRIG_1
		PlaceC LUCKLESS_BRIGAND_2 pBRIG_2
		PlaceC LUCKLESS_BRIGAND_3 pBRIG_3
		PlaceC LUCKLESS_BRIGAND_4 pBRIG_4
		PlaceC LUCKLESS_BRIGAND_5 pBRIG_5
		PlaceC LUCKLESS_BRIGAND_6 pBRIG_6
		PlaceC LUCKLESS_BRIGAND_7 pBRIG_7
		PlaceC LUCKLESS_BRIGAND_8 pBRIG_8
		RestrictedWanderButAttackOnSight LUCKLESS_BRIGAND_6
		RestrictedWanderButAttackOnSight LUCKLESS_BRIGAND_7
		RestrictedWanderButAttackOnSight LUCKLESS_BRIGAND_8
		Add gt_CUE_DEAD_BRIGANDS

	ENDIF
	IF ISDEAD-AMBUSH_EVIL_3
		RemoveC AMBUSH_EVIL_3
	ENDIF
	IF ISDEAD-AMBUSH_EVIL_4
		RemoveC AMBUSH_EVIL_4
	ENDIF

END

VIG TempSetup FALSE

	Set	gd_WEATHER_TYPE	0
	Set gd_WIND_TYPE	2
    RunS CueWeather

    SetLiquid WATER 930 20 5
	SetWaterType 0

	CachePortrait ALLIS.BIN

END

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

VIG RaalNoise1 FIVESEC && ONMAP-AMBUSH_EVIL_1 && !ISDEAD-AMBUSH_EVIL_1 && !INCOMBAT-AMBUSH_EVIL_1
	SWITCH RAND-3
		CASE 0
			SWITCH RAND-3
				CASE 0
					PlaySFXPerson Raal1.wav AMBUSH_EVIL_1
				CASE 1
//					PlaySFXPerson Raal2.wav AMBUSH_EVIL_1
				CASE 2
					PlaySFXPerson Raal9.wav AMBUSH_EVIL_1
			ENDSWITCH 
	ENDSWITCH
END

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

VIG RaalNoise2 FIVESEC && ONMAP-AMBUSH_EVIL_2 && !ISDEAD-AMBUSH_EVIL_2 && !INCOMBAT-AMBUSH_EVIL_2
	SWITCH RAND-3
		CASE 0
			SWITCH RAND-3
				CASE 0
					PlaySFXPerson Raal1.wav AMBUSH_EVIL_2
				CASE 1
//					PlaySFXPerson Raal2.wav AMBUSH_EVIL_2
				CASE 2
					PlaySFXPerson Raal9.wav AMBUSH_EVIL_2
			ENDSWITCH 
	ENDSWITCH
END

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

VIG KillBrigands TENSEC && gt_CUE_DEAD_BRIGANDS

	Remove gt_CUE_DEAD_BRIGANDS

	SetHP LUCKLESS_BRIGAND_1 10
	SetHP LUCKLESS_BRIGAND_2 10
	SetHP LUCKLESS_BRIGAND_3 10
	SetHP LUCKLESS_BRIGAND_4 10
	SetHP LUCKLESS_BRIGAND_5 10
	SamplesOff
	NormalDamageNA LUCKLESS_BRIGAND_1 20
	NormalDamageNA LUCKLESS_BRIGAND_2 20
	NormalDamageNA LUCKLESS_BRIGAND_3 30
	NormalDamageNA LUCKLESS_BRIGAND_4 40
	NormalDamageNA LUCKLESS_BRIGAND_5 50
	SamplesOn

END

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

VIG ArriveAtStage2  ONESEC && gd_USED_FERRY

	Widescreen TRUE

    RunS PalFadeRPG
	Remove  gd_USED_FERRY
    Remove  gd_ALLIS_CONSTEP
	IF !gt_XP_USED_FERRY
		Add gt_XP_USED_FERRY
		AwardEP xp_USED_FERRY
	ENDIF

    Say     ah2001

    PlayerControl   On

	Widescreen FALSE

END

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

VIG ConStepAllisActions FIVESEC && !gd_ALLIS_CONSTEP

    MoveCDir    ALLIS   pALLIS_2
    AddControl  ALLIS   MoveCDir    pALLIS_1
    AddControl  ALLIS   MoveCDir    pALLIS_3
    AddControl  ALLIS   Capture     cM_STAND_AT_EASE1
    AddControl  ALLIS   Capture     cM_STAND1
    AddControl  ALLIS   Capture     cM_STAND2
    AddControl  ALLIS   Capture     cM_STAND3
    AddControl  ALLIS   Capture     cM_STAND4
    AddControl  ALLIS   Capture     cM_GUARD_STAND2
    AddControl  ALLIS   Capture     cM_WIPE_HANDS
    SequenceRandomlySelects ALLIS

    Add     gd_ALLIS_CONSTEP
END

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

VIG ConStepTalkAllis MSG-iALLIS

	Widescreen TRUE
    EngageAndFace   P   ALLIS

    Say ah2002

	ResetChoice

	WHILE !MenuExit
		ClearChoices

        // ferry to Madrigal
		AddChoice 1 txah01
        // Chant
		AddChoice 2 txpw02
        // Barthelago
		AddChoice 3 tx0007
        // Lord Crux
        IF co_LORDCRUX
    		AddChoice 4 txpw06
        ENDIF
        // Lightstealer
        IF co_LIGHTSTEALER
    		AddChoice 5 txpw07
        ENDIF
        // Lord Bane
        IF co_LORDBANE
    		AddChoice 6 txpw04
        ENDIF
        // leave
		AddChoice 0 tx0003

		GetChoice ALLIS

		SWITCH CHOICE
            // ferry to Madrigal
			CASE 1
                Say ah2005

                MoveCDir        ALLIS   pALLIS_LEAVE
                MoveCDir        P       pP_LEAVE

                PlayerControl   off
                Add             gd_GOING_TO_MADRIGAL

   				SetChoiceToExit
            // Chant
			CASE 2
                Say ah2006

            // Barthelago
			CASE 3
                Say ah2007
				ChangeProfileToIdentified Mcitizen_Bart

            // Lord Crux
			CASE 4
                Say ah2008

            // Lightstealer
			CASE 5
                Say ah2009

            // Lord Bane
			CASE 6
                Say ah2010

            // leave
			CASE 0
                Say ah2011

        ENDSWITCH

	ENDWHILE

    IF !gd_GOING_TO_MADRIGAL
        Remove      gd_ALLIS_CONSTEP
		Widescreen FALSE
    ENDIF
END

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

VIG FerryToMadrigal gd_GOING_TO_MADRIGAL && (INAREA-P-ON_FERRY || INAREA-ALLIS-ON_FERRY)
    Remove  gd_GOING_TO_MADRIGAL

	RunS PalFadeBLACK
    PostMsg t_ER_JETTY
    Add     gd_USED_FERRY
END

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

