IF
        OnCreation()
        Global("JustRested","AR3505",1)
THEN
        RESPONSE #100
		TriggerActivation("Door3501",TRUE)
		TriggerActivation("Door7204",FALSE)
                SetGlobal("JustRested","AR3505",0)
                Wait(2)
                DisplayStringHead(Player1,@550629)
                Continue()
END

IF
        OnCreation()
        Global("JustRested","AR3505",0)
THEN
        RESPONSE #100
		TriggerActivation("Door3501",FALSE)
		TriggerActivation("Door7204",TRUE)
		Continue()
END

IF
        PartyRested()
THEN
	RESPONSE #100
		ActionOverride(Protagonist,RemoveSpell(3101)) //BGT
		ActionOverride(Protagonist,RemoveSpell(3101))
		ActionOverride(Protagonist,RemoveSpell(3102))
		ActionOverride(Protagonist,RemoveSpell(3102))
		ActionOverride(Protagonist,RemoveSpell(3103))
		ActionOverride(Protagonist,RemoveSpell(3103))
		ActionOverride(Protagonist,RemoveSpell(3104))
		ActionOverride(Protagonist,RemoveSpell(3104))
		ActionOverride(Protagonist,RemoveSpell(3105))
		ActionOverride(Protagonist,RemoveSpell(3105))
		ActionOverride(Protagonist,RemoveSpell(3106))
		ActionOverride(Protagonist,RemoveSpell(3106)) //BGT

		ActionOverride(Protagonist,RemoveSpell(4152)) //CLABBA05

		ActionOverride(Protagonist,RemoveSpell(4441)) //CLABBA09

		ActionOverride(Protagonist,RemoveSpell(4621)) //CLABDR02
		ActionOverride(Protagonist,RemoveSpell(4621))
		ActionOverride(Protagonist,RemoveSpell(4621))

		ActionOverride(Protagonist,RemoveSpell(4643)) //CLABDR03
		ActionOverride(Protagonist,RemoveSpell(4643))
		ActionOverride(Protagonist,RemoveSpell(4643))
		ActionOverride(Protagonist,RemoveSpell(4643))
		ActionOverride(Protagonist,RemoveSpell(4643))
		ActionOverride(Protagonist,RemoveSpell(4643))

		ActionOverride(Protagonist,RemoveSpell(4611)) //CLABDR04
		ActionOverride(Protagonist,RemoveSpell(4612))
		ActionOverride(Protagonist,RemoveSpell(4613))
		ActionOverride(Protagonist,RemoveSpell(4632))
		ActionOverride(Protagonist,RemoveSpell(4633))
		ActionOverride(Protagonist,RemoveSpell(4634))

		ActionOverride(Protagonist,RemoveSpell(3101)) //CLABDR05
		ActionOverride(Protagonist,RemoveSpell(3101))
		ActionOverride(Protagonist,RemoveSpell(3101))

		ActionOverride(Protagonist,RemoveSpell(4321)) //CLABFI02
		ActionOverride(Protagonist,RemoveSpell(4321))

		ActionOverride(Protagonist,RemoveSpell(4131)) //CLABFI03
		ActionOverride(Protagonist,RemoveSpell(4131))
		ActionOverride(Protagonist,RemoveSpell(4131))
		ActionOverride(Protagonist,RemoveSpell(4131))
		ActionOverride(Protagonist,RemoveSpell(4131))
		ActionOverride(Protagonist,RemoveSpell(4131))
		ActionOverride(Protagonist,RemoveSpell(4131))
		ActionOverride(Protagonist,RemoveSpell(4131))
		ActionOverride(Protagonist,RemoveSpell(4131))
		ActionOverride(Protagonist,RemoveSpell(4131))
		ActionOverride(Protagonist,RemoveSpell(4133))

		ActionOverride(Protagonist,RemoveSpell(4144)) //CLABFI04
		ActionOverride(Protagonist,RemoveSpell(4144))
		ActionOverride(Protagonist,RemoveSpell(4144))

		ActionOverride(Protagonist,RemoveSpell(4152)) //CLABFI05
		ActionOverride(Protagonist,RemoveSpell(4152))
		ActionOverride(Protagonist,RemoveSpell(4152))

		ActionOverride(Protagonist,RemoveSpell(4922)) //CLABFNCE

		ActionOverride(Protagonist,RemoveSpell(4811)) //CLABMO01
		ActionOverride(Protagonist,RemoveSpell(4811))
		ActionOverride(Protagonist,RemoveSpell(4811))
		ActionOverride(Protagonist,RemoveSpell(4815))

		ActionOverride(Protagonist,RemoveSpell(4211)) //CLABPA01
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4212))
		ActionOverride(Protagonist,RemoveSpell(4213))
		ActionOverride(Protagonist,RemoveSpell(4213))
		ActionOverride(Protagonist,RemoveSpell(4213))
		ActionOverride(Protagonist,RemoveSpell(4213))
		ActionOverride(Protagonist,RemoveSpell(4213))
		ActionOverride(Protagonist,RemoveSpell(4213))
		ActionOverride(Protagonist,RemoveSpell(4213))
		ActionOverride(Protagonist,RemoveSpell(4213))
		ActionOverride(Protagonist,RemoveSpell(4213))
		ActionOverride(Protagonist,RemoveSpell(4213))
		ActionOverride(Protagonist,RemoveSpell(4213))

		ActionOverride(Protagonist,RemoveSpell(4222)) //CLABPA02
		ActionOverride(Protagonist,RemoveSpell(4222))
		ActionOverride(Protagonist,RemoveSpell(4222))
		ActionOverride(Protagonist,RemoveSpell(4222))
		ActionOverride(Protagonist,RemoveSpell(4222))
		ActionOverride(Protagonist,RemoveSpell(4222))
		ActionOverride(Protagonist,RemoveSpell(4222))
		ActionOverride(Protagonist,RemoveSpell(4222))
		ActionOverride(Protagonist,RemoveSpell(4222))
		ActionOverride(Protagonist,RemoveSpell(4222))
		ActionOverride(Protagonist,RemoveSpell(4222))

		ActionOverride(Protagonist,RemoveSpell(4231))
		ActionOverride(Protagonist,RemoveSpell(4231))
		ActionOverride(Protagonist,RemoveSpell(4231))
		ActionOverride(Protagonist,RemoveSpell(4232))
		ActionOverride(Protagonist,RemoveSpell(4232))
		ActionOverride(Protagonist,RemoveSpell(4232))

		ActionOverride(Protagonist,RemoveSpell(3120)) //CLABPA12
		ActionOverride(Protagonist,RemoveSpell(3120))
		ActionOverride(Protagonist,RemoveSpell(3120))
		ActionOverride(Protagonist,RemoveSpell(3120))
		ActionOverride(Protagonist,RemoveSpell(3120))

		ActionOverride(Protagonist,RemoveSpell(4721)) //CLABPR02
		ActionOverride(Protagonist,RemoveSpell(4721))
		ActionOverride(Protagonist,RemoveSpell(4722))
		ActionOverride(Protagonist,RemoveSpell(4722))
		ActionOverride(Protagonist,RemoveSpell(4722))

		ActionOverride(Protagonist,RemoveSpell(4731)) //CLABPR03
		ActionOverride(Protagonist,RemoveSpell(4731))
		ActionOverride(Protagonist,RemoveSpell(4732))
		ActionOverride(Protagonist,RemoveSpell(4732))
		ActionOverride(Protagonist,RemoveSpell(4732))

		ActionOverride(Protagonist,RemoveSpell(4741)) //CLABPR04
		ActionOverride(Protagonist,RemoveSpell(4741))
		ActionOverride(Protagonist,RemoveSpell(4742))
		ActionOverride(Protagonist,RemoveSpell(4742))
		ActionOverride(Protagonist,RemoveSpell(4742))

		ActionOverride(Protagonist,RemoveSpell(3201)) //CLABPR05

		ActionOverride(Protagonist,RemoveSpell(4311)) //CLABRN01
		ActionOverride(Protagonist,RemoveSpell(4311))
		ActionOverride(Protagonist,RemoveSpell(4311))
		ActionOverride(Protagonist,RemoveSpell(4311))
		ActionOverride(Protagonist,RemoveSpell(4311))
		ActionOverride(Protagonist,RemoveSpell(4311))

		ActionOverride(Protagonist,RemoveSpell(4121)) //CLABRN02
		ActionOverride(Protagonist,RemoveSpell(4121))

		ActionOverride(Protagonist,RemoveSpell(4342)) //CLABRN04

		ActionOverride(Protagonist,RemoveSpell(4412)) //CLABTH01
		ActionOverride(Protagonist,RemoveSpell(4412))
		ActionOverride(Protagonist,RemoveSpell(4412))

		ActionOverride(Protagonist,RemoveSpell(4423)) //CLABTH02
		ActionOverride(Protagonist,RemoveSpell(4423))
		ActionOverride(Protagonist,RemoveSpell(4423))

		ActionOverride(Protagonist,RemoveSpell(4414)) //CLABTH03
		ActionOverride(Protagonist,RemoveSpell(4414))
		ActionOverride(Protagonist,RemoveSpell(4414))
END

//**************************************************************************
// stealing
//**************************************************************************
IF
        Global("CbChoresTheft","GLOBAL",1)
        OR(2)
             PartyHasItem("CLCK01")
             PartyHasItem("SCRL3H")
THEN
    RESPONSE #100
        CreateCreature("CBSTLKP1",[-1.-1],0)
END

//**************************************************************************
//Alchemy skill using
//**************************************************************************
IF
        Global("SPCL919","GLOBAL",1)
        PartyHasItem("CBSCRB0J")
        Global("CbScrollsScribedByAlchemy","GLOBAL",0)
THEN
    RESPONSE #100
        ActionOverride(Player1,CreateItem("CBCOPY10",1,1,0))
        ActionOverride(Player1,CreateItem("CBCOPY10",1,1,0))
        SetGlobal("CbScrollsScribedByAlchemy","GLOBAL",1)
        Continue()
END

IF
        Global("SPCL919","GLOBAL",1)
        PartyHasItem("CBSCRB0K")
        Global("CbScrollsScribedByAlchemy","GLOBAL",0)
THEN
    RESPONSE #100
        ActionOverride(Player1,CreateItem("CBCOPY11",1,1,0))
        ActionOverride(Player1,CreateItem("CBCOPY11",1,1,0))
        ActionOverride(Player1,CreateItem("CBCOPY11",1,1,0))
        SetGlobal("CbScrollsScribedByAlchemy","GLOBAL",1)
END

IF
        Global("SPCL919","GLOBAL",1)
        PartyHasItem("CBSCRB0L")
        Global("CbScrollsScribedByAlchemy","GLOBAL",0)
THEN
    RESPONSE #100
        ActionOverride(Player1,CreateItem("CBCOPY12",1,1,0))
        ActionOverride(Player1,CreateItem("CBCOPY12",1,1,0))
        ActionOverride(Player1,CreateItem("CBCOPY12",1,1,0))
        ActionOverride(Player1,CreateItem("CBCOPY12",1,1,0))
        SetGlobal("CbScrollsScribedByAlchemy","GLOBAL",1)
END

IF
        Global("CbScrollsScribedByAlchemy","GLOBAL",1)
THEN
    RESPONSE #100
        DisplayStringHead(Player1,@550630)
        SetGlobal("CbScrollsScribedByAlchemy","GLOBAL",2)
END
//**************************************************************************

IF
	Global("CbDoingMaidsChores","GLOBAL",2)
	Global("CbActivateTriggers_3505","GLOBAL",1)
THEN
	RESPONSE #100
		TriggerActivation("PrivateBedOne",TRUE)
		TriggerActivation("PrivateBedTwo",TRUE)
		TriggerActivation("PrivateBedThree",TRUE)
		TriggerActivation("PrivateBedFour",TRUE)
		TriggerActivation("PrivateBedFive",TRUE)
		TriggerActivation("PrivateBedSix",TRUE)
		TriggerActivation("PrivateBedSeven",TRUE)
		TriggerActivation("PrivateBedEight",TRUE)
		SetGlobal("CbPrivateBedOne","AR3505",0)
		SetGlobal("CbPrivateBedTwo","AR3505",0)
		SetGlobal("CbPrivateBedThree","AR3505",0)
		SetGlobal("CbPrivateBedFour","AR3505",0)
		SetGlobal("CbPrivateBedFive","AR3505",0)
		SetGlobal("CbPrivateBedSix","AR3505",0)
		SetGlobal("CbPrivateBedSeven","AR3505",0)
		SetGlobal("CbPrivateBedEight","AR3505",0)
		SetGlobal("CbActivateTriggers_3505","GLOBAL",2)
END

IF
	GlobalGT("CbPrivateBedOne","AR3505",0)
	GlobalGT("CbPrivateBedTwo","AR3505",0)
	GlobalGT("CbPrivateBedThree","AR3505",0)
	GlobalGT("CbPrivateBedFour","AR3505",0)
	GlobalGT("CbPrivateBedFive","AR3505",0)
	GlobalGT("CbPrivateBedSix","AR3505",0)
	GlobalGT("CbPrivateBedSeven","AR3505",0)
	GlobalGT("CbPrivateBedEight","AR3505",0)
	Global("CbActivateTriggers_3505","GLOBAL",2)
THEN
	RESPONSE #100
		SetGlobal("CbActivateTriggers_3505","GLOBAL",3)
		IncrementGlobal("CbKeepBedsMade","GLOBAL",1)
END

IF
	Global("CbPrivateBedOne","AR3505",1)
THEN
	RESPONSE #100
		SetGlobal("CbPrivateBedOne","AR3505",2)
		TriggerActivation("PrivateBedOne",FALSE)
END

IF
	Global("CbPrivateBedTwo","AR3505",1)
THEN
	RESPONSE #100
		SetGlobal("CbPrivateBedTwo","AR3505",2)
		TriggerActivation("PrivateBedTwo",FALSE)
END

IF
	Global("CbPrivateBedThree","AR3505",1)
THEN
	RESPONSE #100
		SetGlobal("CbPrivateBedThree","AR3505",2)
		TriggerActivation("PrivateBedThree",FALSE)
END

IF
	Global("CbPrivateBedFour","AR3505",1)
THEN
	RESPONSE #100
		SetGlobal("CbPrivateBedFour","AR3505",2)
		TriggerActivation("PrivateBedFour",FALSE)
END

IF
	Global("CbPrivateBedFive","AR3505",1)
THEN
	RESPONSE #100
		SetGlobal("CbPrivateBedFive","AR3505",2)
		TriggerActivation("PrivateBedFive",FALSE)
END

IF
	Global("CbPrivateBedSix","AR3505",1)
THEN
	RESPONSE #100
		SetGlobal("CbPrivateBedSix","AR3505",2)
		TriggerActivation("PrivateBedSix",FALSE)
END

IF
	Global("CbPrivateBedSeven","AR3505",1)
THEN
	RESPONSE #100
		SetGlobal("CbPrivateBedSeven","AR3505",2)
		TriggerActivation("PrivateBedSeven",FALSE)
END

IF
	Global("CbPrivateBedEight","AR3505",1)
THEN
	RESPONSE #100
		SetGlobal("CbPrivateBedEight","AR3505",2)
		TriggerActivation("PrivateBedEight",FALSE)
END

