IF
	Global("psBelleGoneCounter", "GLOBAL", 2)
	Global("psTeosSpawnsAgainCounter", "GLOBAL", 0)
Then
	Response #100
		SetGlobal("psTeosSpawnsAgainCounter", "GLOBAL", 1)
		CreateCreatureDoor("psTeos", [2415.2258], 0)
		ActionOverride("psTeos", SetDialog("psTeosRe"))
End

IF
	Dead("psBelle")
	Global("psBelleGoneCounter", "GLOBAL", 0)
Then
	Response #100
		SetGlobal("psBelleGoneCounter", "GLOBAL", 1)
END

IF
	Global("psTeosPetCounter", "GLOBAL", 2)
	Global("psTeosTheChickenSpawnedToggle", "GLOBAL", 0)
THEN
	Response #100
		CreateCreatureObject("psTeosCh", "psBelle", 0, 0, 0)
		ActionOverride("psTeosCh", Polymorph(CHICKEN))
		SetGlobal("psTeosTheChickenSpawnedToggle", "GLOBAL", 1)
End

IF
	Global("psTeosNotAccepted", "GLOBAL", 2)
	Global("psTeosInitialDialogToggle", "GLOBAL", 1)
THEN
	RESPONSE #100
		SetGlobal("psTeosNotAccepted", "GLOBAL", 3)
		CreateCreatureDoor("psTeos", [3000.2600], 0)
		Wait(1)
		ActionOverride("psTeos", StartDialogNoSet(Player1))
END

IF
	Global("psSphereStockedToggle","AR0411",0)
THEN
	RESPONSE #100
		SetGlobal("psSphereStockedToggle","AR0411",1)
		ActionOverride("Body1",CreateItem("psqttc",1,0,0)) // Tyndals Temporal Compressor
		ActionOverride("Golem Room Table",CreateItem("PSQAURA",1,0,0)) // Aura of Power
		ActionOverride("Knight Table",CreateItem("PSQTYSP",1,0,0)) // Tyndals Spacial Compressor
		ActionOverride("Tool CT1",CreateItem("PSQIRID",1,0,0)) // Iridium Sphere
		ActionOverride("Tool CT3",CreateItem("PSQKKKS",1,0,0)) // Keltons Kinetic Knives
		ActionOverride("Tool CT4",CreateItem("PSQKKKS",1,0,0)) // Keltons Kinetic Knives
		Continue()
END

IF
	Global("MageStrongHoldDone","AR0411",1)
	Global("psTeosTimerSpawnToggle","AR0411",0)
THEN
	RESPONSE #100
		SetGlobal("MageStrongHoldDone","AR0411",2)
		SetGlobal("psTeosTimerSpawnToggle","AR0411",1)
		SetGlobalTimer("psTimeToTeosSpawn","GLOBAL",SEVEN_DAYS)
		Continue()
END

IF
	Global("psFinalCutsceneToggle","GLOBAL",0)
	Global("psRetrievedKeyTalkedToMysToggle","GLOBAL",1)
	AreaCheckObject("ar0411", Player1)
THEN
	RESPONSE #100
		SetGlobal("psFinalCutsceneToggle","GLOBAL",1)
		ClearAllActions()
		ActionOverride(Player1,LeaveAreaLUA("ARpsq2","",[3093.2752],1))
		ActionOverride(Player2,LeaveAreaLUA("ARpsq2","",[3093.2752],1))
		ActionOverride(Player3,LeaveAreaLUA("ARpsq2","",[3093.2752],1))
		ActionOverride(Player4,LeaveAreaLUA("ARpsq2","",[3093.2752],1))
		ActionOverride(Player5,LeaveAreaLUA("ARpsq2","",[3093.2752],1))
		ActionOverride(Player6,LeaveAreaLUA("ARpsq2","",[3093.2752],1))
		Continue()
END

IF
	Global("psFinalQuestToKillMelCounter","GLOBAL",6)
	AreaCheckObject("ar0411", Player1)
THEN
	RESPONSE #100
		SetGlobal("psFinalQuestToKillMelCounter","GLOBAL",7)
		CreateCreatureObjectOffScreen("psBelle",Player1,0,0,0) // Cowled Wizard
		ActionOverride("psBelle", StartDialogNoSet(Player1))
END

IF
	GlobalTimerExpired("psTimeToTeosSpawn","GLOBAL")
	Global("psTeosSpawnToggle","AR0411",0)
THEN
	RESPONSE #100
		SetGlobal("psTeosSpawnToggle","AR0411",1)
		CreateCreatureObject("psTeos",Player1,0,0,0) // Teos
		Continue()
END

IF
	GlobalTimerExpired("psTimeToAdventurerSpawn","GLOBAL")
	Global("psAdventurerSpawnToggle","AR0411",0)
	AreaCheckObject("ar0411", Player1)
THEN
	RESPONSE #100
		SetGlobalTimer("psTimeToFanaticSpawn","GLOBAL",TWO_DAYS)
		SetGlobal("psAdventurerSpawnToggle","AR0411",1)
		CreateCreatureObjectOffScreen("psApAtt1",Player1,0,0,0) // Apprentice
		Continue()
END

IF
	GlobalTimerExpired("psTimeToFanaticSpawn","GLOBAL")
	Global("psFanaticSpawnToggle","AR0411",0)
	AreaCheckObject("ar0411", Player1)
THEN
	RESPONSE #100
		SetGlobalTimer("psTimeToDegoSpawn","GLOBAL",FOUR_DAYS)
		SetGlobal("psFanaticSpawnToggle","AR0411",1)
		CreateCreatureObjectOffScreen("psApAtt2",Player1,0,0,0) // Apprentice
		Continue()
END

IF
	GlobalTimerExpired("psTimeToDegoSpawn","GLOBAL")
	Global("psDegoSpawnToggle","AR0411",0)
	AreaCheckObject("ar0411", Player1)
THEN
	RESPONSE #100
		SetGlobalTimer("psTimeToBroomSpawn","GLOBAL",FOUR_DAYS)
		SetGlobal("GlobalTimerExpired","AR0411",1)
		CreateCreatureObjectOffScreen("psApAtt3",Player1,0,0,0) // Apprentice
		Continue()
END

IF
	GlobalTimerExpired("psTimeToBroomSpawn","GLOBAL")
	Global("psBroomSpawnCounter","AR0411",0)
	AreaCheckObject("ar0411", Player1)	
THEN
	RESPONSE #100
		SetGlobal("psBroomSpawnCounter","AR0411",1)
		StartCutSceneMode()
		FadeToColor([30.0],0)
		Wait(2)
		MoveViewPoint([3048.2739],INSTANT)
		CreateCreature("OBSERVE",[2950.2699],0) // No such index
		CreateCreature("psAdApp1",[2950.2699],0) // Apprentice
		CreateCreature("psBroom1",[2900.2620],0) // Broom
		FadeFromColor([30.0],0)
		StartCutScene("psCut35")
		Continue()
END

IF
	Global("psBroomSpawnCounter","AR0411",1)
THEN
	RESPONSE #100
		SetGlobal("psBroomSpawnCounter","AR0411",2)
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		CreateCreature("psBroom2",[2900.2620],0) // Broom
		Continue()
END