/////////////////////////////////////////////////////////////////////
// MANOREXT.S		Lord Crux's manor : exterior
/////////////////////////////////////////////////////////////////////

SETUP

	IDoorLocked dLORD

	IF !gt_PLACED_MANOREXT_CHARS

		Add gt_PLACED_MANOREXT_CHARS
		Add gt_GUILD_RING_OK

		PlaceC MANOR_PIG_1 pG1
		PlaceC MANOR_PIG_2 pG2
		PlaceC MANOR_PIG_3 pG3
		PlaceC MANOR_PIG_4 pG4
		PlaceC MANOR_PIG_5 pG5
		PlaceC MANOR_PIG_6 pG6

		IF !mj_BLOODMASTER_BANE
			Add gt_CUE_LAEN_AT_MANOR
		ENDIF

	ENDIF

	IF mj_BLOODMASTER_BANE
		RemoveC LAEN
	ENDIF


	MoveCDir				MANOR_PIG_1 pG1
	AddControl				MANOR_PIG_1 Capture cM_GUARD_STAND1
	AddControl				MANOR_PIG_1 Capture cM_GUARD_STAND2
	AddControl				MANOR_PIG_1 Capture cM_GUARD_STAND3
	SequenceRandomlySelects	MANOR_PIG_1

	MoveCDir				MANOR_PIG_2 pG2
	AddControl				MANOR_PIG_2 Capture cM_GUARD_STAND1
	AddControl				MANOR_PIG_2 Capture cM_GUARD_STAND2
	AddControl				MANOR_PIG_2 Capture cM_GUARD_STAND3
	SequenceRandomlySelects	MANOR_PIG_2

	DelayControl			MANOR_PIG_3 1 1
	AddControl				MANOR_PIG_3 MoveC pG3
	AddControl				MANOR_PIG_3 MoveC pG4
	SequenceRandomlySelects	MANOR_PIG_3

	DelayControl			MANOR_PIG_4 1 1
	AddControl				MANOR_PIG_4 MoveC pG3
	AddControl				MANOR_PIG_4 MoveC pG4
	SequenceRandomlySelects	MANOR_PIG_4

	DelayControl			MANOR_PIG_5 1 1
	AddControl				MANOR_PIG_5 MoveC pG5
	AddControl				MANOR_PIG_5 MoveC pG6
	SequenceRandomlySelects	MANOR_PIG_5

	DelayControl			MANOR_PIG_6 1 1
	AddControl				MANOR_PIG_6 MoveC pG5
	AddControl				MANOR_PIG_6 MoveC pG6
	SequenceRandomlySelects	MANOR_PIG_6

	IF !gt_GUILD_RING_OK
		RunS AllGuardsHostile
	ENDIF

END

VIG TempSetup FALSE

	Set	gd_WEATHER_TYPE	0
	Set gd_WIND_TYPE	1
    RunS CueWeather

	CachePortrait PC1.BIN
	CachePortrait LAENCHNT.BIN

END

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

VIG LaenMeetsPlayer HALFSEC && gt_CUE_LAEN_AT_MANOR && INAREA-P-NEAR_LAEN
	camcut p 180
	Remove gt_CUE_LAEN_AT_MANOR

	// *** LAEN APPEARS ***

	Widescreen TRUE
	PlaceC LAEN pLAEN_1
	StopC P
camcut pos03

	//"Do not be alarmed...it is I, Laen Chant."
	QuickSay dacm01

	SetWalkType LAEN RUN
	MoveC LAEN pLAEN_2
	AddControl LAEN LookAtTurn P
	Wait 1000
	LookAtTurn P LAEN
	UUComplete P
	Capture P cM_TALK_SURPRISE1
	UUComplete P
	LookAtTurnFollow P LAEN
	UUComplete LAEN
	UUSay
	Face P LAEN

setcammoveconstant 1
campan pos05

	//"Chant! What are you doing here?"
	Say Hx0304

	//"I have business with the Guild...I would accompany you..."
	Say dacm02

	//"It is rumoured...Crux...in league with Light Stealer...I must have proof."
	Say dacm03
	ChangeProfileToIdentified Sassassin_Crux

	//"...guards...allow access...a certain ring...I have tried to attain one..."
	Say dacm04

	IF POS-P-guild_ring || ISEQUIPED-P-guild_ring
		//"I've had a little more luck."
		Say Hx0308
		//"Then you should wear it..."
		Say dacm05
	ELSE
		//"I have not found such a ring either."
		Say Hx0307
	ENDIF

	//"Come then...Let us cause a little trouble..."
	Say dacm06
camcut p
setcammovenormal

	RunS LaenFollowsPlayer
	Widescreen FALSE

END

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

VIG LaenFollowsPlayer ONESEC && !mj_BLOODMASTER_BANE && !gt_CUE_LAEN_AT_MANOR && !gt_CHANT_IN_TOW && INAREA-P-NEAR_LAEN

	Add gt_CHANT_IN_TOW
	Follow LAEN P

END

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

VIG LaenLeavesPlayer ONESEC && gt_CHANT_IN_TOW && INAREA-P-NEAR_EXIT && !f_CRUX_DEAD

	IF !gt_SPLIT_UP_LEAVING_MANOR
		//"We should split up..."
		QuickSay dacm08
		Add gt_SPLIT_UP_LEAVING_MANOR
	ENDIF

	Remove gt_CHANT_IN_TOW

	DelayControl LAEN 2 0
	AddControl LAEN MoveC pLAEN_2

END

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

VIG TalkToLaen MSG-iLAEN

	//"...save...talk...stay on...guard."
	Say dacm07

END

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

VIG GuardsAccostPlayer ONESEC && !gt_MANOR_GUARDS_APPROACHED && !DAMAGED-MANOR_PIG_1 && !DAMAGED-MANOR_PIG_2 && gt_GUILD_RING_OK && DISTFROM-P-MANOR_PIG_1-5

	IF ISEQUIPED-P-guild_ring
		//"You have the ring. You may pass..."
		//Say gu0002 DOH!
		//unlock front door
		IDoorClosed dLORD_FR
	ELSE
		//"You have no business here. Go away."
		//Say gu0001 DOH!
	ENDIF

	Add gt_MANOR_GUARDS_APPROACHED

END

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

VIG GuardsForgetPlayer gt_MANOR_GUARDS_APPROACHED && !DISTFROM-P-MANOR_PIG_1-5

	Remove gt_MANOR_GUARDS_APPROACHED
	IDoorLocked dLORD_FR

END

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

VIG FightPIG_12 HALFSEC && !gt_FIGHT_MANOR_PIG_12 && (DAMAGED-MANOR_PIG_1 || DAMAGED-MANOR_PIG_2) && (!ISDEAD-MANOR_PIG_1 || !ISDEAD-MANOR_PIG_2)

	Add gt_FIGHT_MANOR_PIG_12
	RunS AllGuardsHostile

	IF !mj_BLOODMASTER_BANE
		EngagePoint LAEN pG1 1000
		AddControl LAEN MeleeAttack
	ENDIF

END

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

VIG DeadPIG_12 gt_FIGHT_MANOR_PIG_12 && ISDEAD-MANOR_PIG_1 && ISDEAD-MANOR_PIG_2

	Remove gt_FIGHT_MANOR_PIG_12
	IF !mj_BLOODMASTER_BANE
		Follow LAEN P
	ENDIF

END

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

VIG FightPIG_3 HALFSEC && DAMAGED-MANOR_PIG_3 && !gt_FIGHT_MANOR_PIG_3 && !ISDEAD-MANOR_PIG_3

	Add gt_FIGHT_MANOR_PIG_3
	RunS AllGuardsHostile

	IF !mj_BLOODMASTER_BANE
		Engage LAEN MANOR_PIG_3 1000
		AddControl LAEN MeleeAttack
	ENDIF

END

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

VIG DeadPIG_3 gt_FIGHT_MANOR_PIG_3 && ISDEAD-MANOR_PIG_3

	Remove gt_FIGHT_MANOR_PIG_3
	IF !mj_BLOODMASTER_BANE
		Follow LAEN P
	ENDIF

END

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

VIG FightPIG_4 HALFSEC && DAMAGED-MANOR_PIG_4 && !gt_FIGHT_MANOR_PIG_4 && !ISDEAD-MANOR_PIG_4

	Add gt_FIGHT_MANOR_PIG_4
	RunS AllGuardsHostile

	IF !mj_BLOODMASTER_BANE
		Engage LAEN MANOR_PIG_4 1000
		AddControl LAEN MeleeAttack
	ENDIF

END

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

VIG DeadPIG_4 gt_FIGHT_MANOR_PIG_4 && ISDEAD-MANOR_PIG_4

	Remove gt_FIGHT_MANOR_PIG_4

	IF !mj_BLOODMASTER_BANE
		Follow LAEN P
	ENDIF

END

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

VIG FightPIG_5 HALFSEC && DAMAGED-MANOR_PIG_5 && !gt_FIGHT_MANOR_PIG_5 && !ISDEAD-MANOR_PIG_5

	Add gt_FIGHT_MANOR_PIG_5
	RunS AllGuardsHostile

	IF !mj_BLOODMASTER_BANE
		Engage LAEN MANOR_PIG_5 1000
		AddControl LAEN MeleeAttack
	ENDIF

END

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

VIG DeadPIG_5 gt_FIGHT_MANOR_PIG_5 && ISDEAD-MANOR_PIG_5

	Remove gt_FIGHT_MANOR_PIG_5

	IF !mj_BLOODMASTER_BANE
		Follow LAEN P
	ENDIF

END

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

VIG FightPIG_6 HALFSEC && DAMAGED-MANOR_PIG_6 && !gt_FIGHT_MANOR_PIG_6 && !ISDEAD-MANOR_PIG_6

	Add gt_FIGHT_MANOR_PIG_6
	RunS AllGuardsHostile

	IF !mj_BLOODMASTER_BANE
		Engage LAEN MANOR_PIG_6 1000
		AddControl LAEN MeleeAttack
	ENDIF

END

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

VIG DeadPIG_6 gt_FIGHT_MANOR_PIG_6 && ISDEAD-MANOR_PIG_6

	Remove gt_FIGHT_MANOR_PIG_6
	IF !mj_BLOODMASTER_BANE
		Follow LAEN P
	ENDIF

END

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

VIG AllGuardsHostile FALSE

	Remove gt_GUILD_RING_OK

	SwitchOnSightOfPlayer	MANOR_PIG_1 AttackDemo2
	SwitchOnSightOfPlayer	MANOR_PIG_2 AttackDemo2
	SwitchOnSightOfPlayer	MANOR_PIG_3 AttackDemo2
	SwitchOnSightOfPlayer	MANOR_PIG_4 AttackDemo2
	SwitchOnSightOfPlayer	MANOR_PIG_5 AttackDemo2
	SwitchOnSightOfPlayer	MANOR_PIG_6 AttackDemo2

END

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