/////////////////////////////////////////////////////////////////////
// SHADOW1.S
/////////////////////////////////////////////////////////////////////

SETUP

    IF !gd_PLACED_SG_TOWNSFOLK
        

		PlaceC FOS_ASSN_M pASSN_M_START
		PlaceC FOS_ASSN_F pASSN_F_START
		PlaceC CURT	pCURT
		RunS CurtActions

		PlaceC POWDER pPOWDER
		RunS PowderActions
		PlaceC CANDICE pCANDICE
		Add gt_CANDICE_PRESENT

        Add gd_PLACED_SG_TOWNSFOLK

    ENDIF

	IF mj_DEFEAT_BART && gt_CANDICE_PRESENT
		Remove gt_CANDICE_PRESENT
		RemoveC CANDICE
//		IDoorLocked dCAND // can't lock it.. exterior not setup correctly
	ENDIF

	Add gt_CUE_POWDER_MELTDOWN
	Add gt_CUE_CANDICE_BREWING

END

VIG TempSetup FALSE

	SetWeather 0 0 0 0 0 0 0 0

	CachePortrait POWDER.BIN
	CachePortrait CANDICE.BIN
	CachePortrait GUARDF.BIN
	CachePortrait GUARDM.BIN

END

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

VIG CandiceBrewing ONESEC && gt_CUE_CANDICE_BREWING

	Remove gt_CUE_CANDICE_BREWING

	IF ISINSHOP-CAND_SHOP-mshrm_boom
		DelStock CAND_SHOP mshrm_boom
		Stock CAND_SHOP explode_bomb 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-herb_hex
		DelStock CAND_SHOP herb_hex
		Stock CAND_SHOP ptn_mana_l 1
		Stock CAND_SHOP ptn_heal_m 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-mshrm_mana
		DelStock CAND_SHOP mshrm_mana
		Stock CAND_SHOP ptn_mana_m 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-mshrm_trippy
		DelStock CAND_SHOP mshrm_trippy
		Stock CAND_SHOP ptn_trippy 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-mshrm_poison
		DelStock CAND_SHOP mshrm_poison
		Stock CAND_SHOP ptn_nomana 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-mshrm_dpoison
		DelStock CAND_SHOP mshrm_dpoison
		Stock CAND_SHOP ptn_poison 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-herb_cure
		DelStock CAND_SHOP herb_cure
		Stock CAND_SHOP ptn_curing 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-herb_str
		DelStock CAND_SHOP herb_str
		Stock CAND_SHOP ptn_strength 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-mshrm_mad
		DelStock CAND_SHOP mshrm_mad
		Stock CAND_SHOP ptn_haste 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-mshrm_sick
		DelStock CAND_SHOP mshrm_sick
		Stock CAND_SHOP poison_bomb 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-mshrm_bigmana
		DelStock CAND_SHOP mshrm_bigmana
		Stock CAND_SHOP ptn_mana_g 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-herb_bheal
		DelStock CAND_SHOP herb_bheal
		Stock CAND_SHOP ptn_heal_f 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-herb_magic
		DelStock CAND_SHOP herb_magic
		Stock CAND_SHOP ptn_mana_f 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-herb_poison
		DelStock CAND_SHOP herb_poison
		Stock CAND_SHOP ptn_heal_l 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-mshrm_acid
		DelStock CAND_SHOP mshrm_acid
		Stock CAND_SHOP hurt_bomb 1
	ENDIF
	IF ISINSHOP-CAND_SHOP-herb_heal
		DelStock CAND_SHOP herb_heal
		Stock CAND_SHOP ptn_heal_g 1
	ENDIF

END

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

VIG AssassinsInFlockOfSeagulls HALFSEC && !gt_PLAYED_ASSASSINS_IN_FOS && INAREA-P-FOS_ENTRANCE

	Add gt_PLAYED_ASSASSINS_IN_FOS

	Widescreen	TRUE

	freecam
	camcut pb05

	MoveCDir	P	pP_WATCH
	AddControl	P	LookAtTurnFollow FOS_ASSN_M

	Wait 2000
	LookAtTurn	FOS_ASSN_F	FOS_ASSN_M

	//"Listen, we've got to go..."
	QuickSay	st1001		GUARDF.BIN
	Wait		1000

	LookAtTurn	FOS_ASSN_M	FOS_ASSN_F
	UUComplete	FOS_ASSN_F

	UUSay

	MoveC		FOS_ASSN_F	pFOS_DOOR
	Wait		2500

	//"You go. I'm staying for another."
	QuickSay	st2001		GUARDM.BIN
	Wait		500

	LookAtTurn	FOS_ASSN_M	CURT
	Wait		500

	LookAtTurn	FOS_ASSN_F	FOS_ASSN_M
	UUComplete	FOS_ASSN_F

	UUSay

	Capture		FOS_ASSN_F	cF_POINTING_INFORMAL
	//"No, you're not. This is business - Crux's business. We have to go now."
	Say			st1002		GUARDF.BIN

	Wait		500

	Capture		FOS_ASSN_M	cM_STAND_AT_EASE3

	camcut pb04
	Wait		500

	//"OK, OK, I'm coming."
	Say			st2002		GUARDM.BIN

	//MoveC		FOS_ASSN_F	pFOS_DOOR
	MoveC_1tel FOS_ASSN_F SG_INN_IN pC_3a
	Wait		1000

	// *** point camera at contract, NOT assassins ***

	LooseOb		FOS_ASSN_M	contract
	wait 500
	//"All I wanted was to finish my beer."
	QuickSay			st202a		GUARDM.BIN
	MoveC_1tel FOS_ASSN_M SG_INN_IN pC_3a
	wait 1500
	UUSay
	campan cam06
	setcammoveconstant 5
	LookAtTurnFollow P FOS_ASSN_M
	wait 500

	StopC		P
	LookAtTurn  P CURT
	UUComplete  P
	Capture		P cM_SHRUG1
	UUComplete  P
	Wait 1000

	Widescreen FALSE
	normalcam
	setcammovenormal
	camcut p
END

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

VIG TalkToCurt MSG-iCURT

	Widescreen TRUE

	//EngageAndFace P CURT
	EngagePoint P pASSN_F_START 250
	UUComplete P

	LookAtTurnFollow P CURT
	LookAtTurnFollow CURT P
	//"I'm Curt...You after something?"
	Say cu0001

	ChangeProfileToIdentified Scitizen_Curt

	ResetChoice
	WHILE !MenuExit
		ClearChoices

		//Trade
		AddChoice 1 tx0008

		//The two drunks
		AddChoice 2 tx0105

		IF co_THEGUILD
			//Guild of Assassins
			AddChoice 3 tx0097
		ENDIF

		IF co_LORDCRUX
			//Lord Crux
			AddChoice 4 tx0102
		ENDIF

		//Barthelago
		AddChoice 5 tx0007

		IF co_LORDBANE
			//Lord Bane
			AddChoice 6 txpw04
		ENDIF

		IF co_ASH
			//Ash
			AddChoice 7 tx0106
		ENDIF

		//Leave
		AddChoice 0 tx0003

		GetChoice CURT

		SWITCH Choice
			CASE 1
				//Trade

				MessagesOff
				ShopPanel	CURT_SHOP	120		65		CURT	BUYSELL
				MessagesOn

			CASE 2
				//The two drunks

				//"I don't know their names, but they're employed by Lord Crux..."
				Say cu0002

				Add co_LORDCRUX

			CASE 3
				//Guild of Assassins

				//"Isn't that something to do with the Blood-Kin...?"
				Say cu0003

			CASE 4
				//Lord Crux

				//"...patron...lives out...to the west...wealthy...generous."
				Say cu0004
				ChangeProfileToIdentified Sassassin_Crux

			CASE 5
				//Barthelago

				//"Yes - the man...did stop...briefly...on his way to see the lord of the town..."
				Say cu0005

			CASE 6
				//Lord Bane
				
				//"Be careful...often disappears...not saying anything about his business...his people...dangerous vagabonds."
				Say cu0006

			CASE 7
				//Ash

				//"You'll find him over in the cemetery. He is the LIche-Keeper here - buries our dead..."
				Say cu0011

			CASE 0
				//Leave

				//"Next time you come by, try spending some money."
				Say cu0014
		ENDSWITCH
	ENDWHILE

	RunS CurtActions

	Widescreen FALSE
END

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

VIG CurtActions FALSE

	MoveCDir	CURT	pCURT
	AddControl	CURT	DelayControl 1 4
	AddControl	CURT	DelayControl 8 2
	AddControl	CURT	Capture cM_V3_WIPE_BAR2
	AddControl	CURT	Capture cM_V3_WIPE_BAR3
	AddControl	CURT	Capture cM_V3_WIPE_BAR4
	AddControl	CURT	Capture cM_V3_POUR_DRINK1
	AddControl	CURT	Capture cM_V3_POUR_DRINK2
	SequenceRandomlySelects CURT	

END

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

VIG TalkToCandice MSG-iCANDICE

	Widescreen TRUE
	UnDrawSwordRemember

	//EngageAndFace P CANDICE

	Engage P CANDICE 800
	AddControl P LookAtTurnFollow CANDICE
	LookAtTurnFollow CANDICE P

	IF mj_DEFEAT_GARGOS_2
		IF gt_CANDICE_SWOONED_ALREADY
			//"Ah, the handsome Warlock."
			Say nd0017 CANDICE.BIN
		ELSE
			//"Ah, the handsome traveller...the town is abuzz with your name."
			Say nd0015 CANDICE.BIN
		ENDIF
	ENDIF

	IF !ce_CANDICE
		Add ce_CANDICE

		//"Well, well...such a handsome face...out to claim Lightstealer's head?"
		Say nd0001 CANDICE.BIN
		Add co_LIGHTSTEALER
		//"I'm Candice, by the way..."
		Say nd003c CANDICE.BIN

		ChangeProfileToIdentified Mbloodkin_Candice
		ChangeProfileToIdentified Scitizen_Candice
	ENDIF

	ResetChoice
	WHILE !MenuExit
		ClearChoices

		IF !mj_DEFEAT_GARGOS_2
			IF co_THEGUILD
				//The Guild
				AddChoice 1 tx0097
			ENDIF

			IF co_LORDBANE
				//Lord Bane
				AddChoice 2 txpw04
			ENDIF

			//Chant
			AddChoice 3 txpw02

			//Barthelago
			AddChoice 4 tx0007
		ENDIF

		//Trade
		AddChoice 5 tx0008

		//Identify
		AddChoice 9 txid01

		//Leave
		AddChoice 0 tx0003

		GetChoice CANDICE

		SWITCH Choice
			CASE 1
				//The Guild

				//"Asking about that...best way to end up...dead....come back when you've learned some sense"
				Say nd0002 CANDICE.BIN

				SetChoiceToExit

			CASE 2
				//Lord Bane

				//"The only sane faction in this mess...you can trust them - but...Crux...the sheriff...don't..."
				Say nd003d CANDICE.BIN

				Add co_LORDCRUX

			CASE 3
				//Chant

				//"Chant?...try your luck at the Church of the White Moon...ask...Lord Bane."
				Say nd003a CANDICE.BIN

				Add co_LORDBANE

			CASE 4
				//Barthelago

				//"There is an inn...the Flock of Seagulls...you'll...likely find him there."
				Say nd003b CANDICE.BIN

			CASE 5
				//Trade

				MessagesOff
				ShopPanel	CAND_SHOP	125	65	CANDICE	BUYSELL
				MessagesOn

			CASE 9 
				//Identify

				MessagesOff
				ShopPanel	CAND_SHOP	100		65		CANDICE			IDENTIFY
				MessagesOn

			CASE 0
				//Leave

				IF mj_DEFEAT_GARGOS_2
					//"Until next time...Keep that pretty head out of trouble..."
					Say nd0013 CANDICE.BIN
					IF !gt_CANDICE_SWOONED_ALREADY
						Add gt_CANDICE_SWOONED_ALREADY
						//"You may have need of my services one day..."
						Say nd018a CANDICE.BIN
					ENDIF
				ELSE
					//"Until next time, sir. Keep out of trouble, you hear?"
					Say nd0013 CANDICE.BIN
				ENDIF
		ENDSWITCH
	ENDWHILE

	Widescreen FALSE

	StopC CANDICE

END

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

VIG PowderActions FALSE

	MoveCDir POWDER pPOWDER
	AddControl POWDER Capture cM_RUB_HANDS2_BETTER
	AddControl POWDER Filter Timeout 5 Wander
	SequenceLoops POWDER

END

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

VIG PowderMeltdown FIVESEC && gt_CUE_POWDER_MELTDOWN

	Remove gt_CUE_POWDER_MELTDOWN

	IF ISINSHOP-POWD_SHOP-rapier
		DelStock POWD_SHOP rapier
		DelStock POWD_SHOP rapier
		Stock POWD_SHOP rapier 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-scimitar
		DelStock POWD_SHOP scimitar
		DelStock POWD_SHOP scimitar
		Stock POWD_SHOP scimitar 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-bow
		DelStock POWD_SHOP bow
		DelStock POWD_SHOP bow
		Stock POWD_SHOP bow 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-longsword
		DelStock POWD_SHOP longsword
		DelStock POWD_SHOP longsword
		Stock POWD_SHOP longsword 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-warhammer
		DelStock POWD_SHOP warhammer
		DelStock POWD_SHOP warhammer
		Stock POWD_SHOP warhammer 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-waraxe
		DelStock POWD_SHOP waraxe
		DelStock POWD_SHOP waraxe
		Stock POWD_SHOP waraxe 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-halberd
		DelStock POWD_SHOP halberd
		DelStock POWD_SHOP halberd
		Stock POWD_SHOP halberd 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-fayrapier
		DelStock POWD_SHOP fayrapier
		DelStock POWD_SHOP fayrapier
		Stock POWD_SHOP fayrapier 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-ar_plt_am_thar
		DelStock POWD_SHOP ar_plt_am_thar
		DelStock POWD_SHOP ar_plt_am_thar
		Stock POWD_SHOP ar_plt_am_thar 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-ar_plt_hn_thar
		DelStock POWD_SHOP ar_plt_hn_thar
		DelStock POWD_SHOP ar_plt_hn_thar
		Stock POWD_SHOP ar_plt_hn_thar 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-ar_plt_ft_thar
		DelStock POWD_SHOP ar_plt_ft_thar
		DelStock POWD_SHOP ar_plt_ft_thar
		Stock POWD_SHOP ar_plt_ft_thar 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-ar_plt_hd_thar
		DelStock POWD_SHOP ar_plt_hd_thar
		DelStock POWD_SHOP ar_plt_hd_thar
		Stock POWD_SHOP ar_plt_hd_thar 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-ar_plt_bd_thar
		DelStock POWD_SHOP ar_plt_bd_thar
		DelStock POWD_SHOP ar_plt_bd_thar
		Stock POWD_SHOP ar_plt_bd_thar 2
	ENDIF
	IF ISINSHOP-POWD_SHOP-ar_plt_lg_thar
		DelStock POWD_SHOP ar_plt_lg_thar
		DelStock POWD_SHOP ar_plt_lg_thar
		Stock POWD_SHOP ar_plt_lg_thar 2
	ENDIF

END

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

VIG TalkToPowder MSG-iPOWDER

	Widescreen TRUE
	UnDrawSwordRemember
	EngageAndFace P POWDER

	IF POS-P-alvaris_key || mj_FOUND_BLOODMASTER
		//"Welcome...I shall provide...armaments...All I ask...cost of...materials."
		Say po0001

		Add gt_POWDER_DISCOUNT
	ELSE
		//"Welcome, stranger. I am Powder..."
		Say po0002

	ENDIF
	IF !ce_POWDER
		ChangeProfileToIdentified Sbloodkin_Powder
		Add ce_POWDER
	ENDIF

	ResetChoice
	WHILE !MenuExit
		ClearChoices

		IF ce_HAMMER
			//Hammer
			AddChoice 1 txpw01
		ENDIF

		//Chant
		AddChoice 2 txpw02

		//Barthelago
		AddChoice 3 tx0007

		IF co_LORDBANE
			//Lord Bane
			AddChoice 4 txpw04
		ENDIF

		IF co_THEGUILD
			//The Guild
			AddChoice 5 tx0097
		ENDIF

		IF co_LORDCRUX
			//Lord Crux
			AddChoice 6 txpw06
		ENDIF

		IF co_LIGHTSTEALER
			//Lightstealer
			AddChoice 7 txpw07
		ENDIF

		IF co_BLOODMASTER
			//Bloodmaster
			AddChoice 8 txpw08
		ENDIF

		//Trade
		AddChoice 9 tx0008

		//Repair
		AddChoice 10 tx0086

		//Identify
		AddChoice 11 txid01

		//Leave
		AddChoice 0 tx0003

		GetChoice POWDER

		SWITCH Choice
			CASE 1
				//Hammer

				IF !gt_POWDER_METAL
					Add gt_POWDER_METAL

					//"...take this to him...""
					QuickSay po0003
					Wait 2000

					Capture POWDER cM_TOSS_GENTLE
					Capture P cM_OBJ_ACCEPT_1H1
					
					UUcomplete POWDER
					AwardOb P powders_mtl "stuff"
					UUSay
				ELSE
					//"...part of a promise...long ago."
					Say po0004
				ENDIF

			CASE 2
				//Chant

				//"You are the one that Chant found...?"
				Say po0005

			CASE 3
				//Barthelago

				//"I know nothing...Perhaps...Candice...or...at the inn?"
				Say po0006

			CASE 4
				//Lord Bane

				//"...our king...a good man...trust him."
				Say po0007

			CASE 5
				//The Guild

				//"...there was a fisherman's guild..."
				Say po0008

			CASE 6
				//Lord Crux

				//"...lord...rich...Some say he is a vampire, or in league with them...rumours."
				Say po0009

			CASE 7
				//Lightstealer

				//"...pure evil...Alvaris...forged...the hammer Blood-Master."
				Say po0010

				Add co_BLOODMASTER

			CASE 8
				//Bloodmaster

				//"...the only weapon...Alvaris...forged..."
				Say po0011

			CASE 9
				//Trade

				IF gt_POWDER_DISCOUNT
					MessagesOff
					ShopPanel	POWD_SHOP	100	65	POWDER	BUYSELL
					MessagesOn
				ELSE
					MessagesOff
					ShopPanel	POWD_SHOP	125	65	POWDER	BUYSELL
					MessagesOn
				ENDIF

			CASE 10
				//Repair
				MessagesOff
				ShopPanel	POWD_SHOP	100		65		POWDER			REPAIR
				MessagesOn

			CASE 11
				//Identify

				MessagesOff
				ShopPanel	POWD_SHOP	100		65		POWDER			IDENTIFY
				MessagesOn

			CASE 0
				//Leave

				//"Farewell..."
				Say po0012

		ENDSWITCH
	ENDWHILE

	Widescreen FALSE
//	DrawSwordRemember

END

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

