IF
  OnCreation()
  Global("TCSetDay","TC1000",0)
THEN
  RESPONSE #100
    DayNight(NOON)
    DayNight(MIDNIGHT)
    DayNight(NOON)
    DayNight(MIDNIGHT)
    DayNight(NOON)
    DayNight(MIDNIGHT)
    DayNight(NOON)
    DayNight(MIDNIGHT)
    DayNight(NOON)
    DayNight(MIDNIGHT)
    DayNight(NOON)
    DayNight(MIDNIGHT)
    SetGlobal("TCSetDay","TC1000",1)
    Explore()
END

IF
  Global("TCPartyHasPCSword1","GLOBAL",1)
THEN
  RESPONSE #100
    ActionOverride("Crate6",CreateItem("TCSW1H05",1,0,0))
    SetGlobal("TCPartyHasPCSword1","GLOBAL",2)
END

IF
  Global("TCPartyHasRihnLute","GLOBAL",1)
THEN
  RESPONSE #100
    ActionOverride("Crate8",CreateItem("TCLUTE01",1,0,0))
    SetGlobal("TCPartyHasRihnLute","GLOBAL",2)
END

IF
  !Dead("TCALTHON")
  Global("TCAlthonSpawn","TC1000",0)
  Global("TCAlthonJoined","GLOBAL",1)
  !InParty("TCALTHON")
THEN
  RESPONSE #100
    MoveGlobal("TC1000","TCALTHON",[1279.1466])
    ActionOverride("TCALTHON",SetBeenInPartyFlags())
    ActionOverride("TCALTHON",DestroyAllEquipment())
    ActionOverride("TCALTHON",CreateItem("TCALTHAM",1,0,0))
    ActionOverride("TCALTHON",FillSlot(SLOT_AMULET))
    SetGlobal("TCAlthonSpawn","TC1000",1)
END

IF
  !Dead("TCDIRBERT")
  Global("TCDirbertSpawn","TC1000",0)
  Global("TCDirbertJoined","GLOBAL",1)
  !InParty("TCDIRBERT")
THEN
  RESPONSE #100
    MoveGlobal("TC1000","TCDIRBERT",[1172.585])
    ActionOverride("TCDIRBERT",SetBeenInPartyFlags())
    ActionOverride("TCDIRBERT",DestroyAllEquipment())
    SetGlobal("TCDirbertSpawn","TC1000",1)
END

IF
  !Dead("TCSHADOW")
  Global("TCShadowSpawn","TC1000",0)
  Global("TCShadowJoined","GLOBAL",1)
  !InParty("TCSHADOW")
THEN
  RESPONSE #100
    MoveGlobal("TC1000","TCSHADOW",[1230.636])
    ActionOverride("TCSHADOW",SetBeenInPartyFlags())
    ActionOverride("TCSHADOW",DestroyAllEquipment())
    SetGlobal("TCShadowSpawn","TC1000",1)
END

IF
  !Dead("TCVILD")
  Global("TCVildSpawn","TC1000",0)
  Global("TCVildamyrJoined","GLOBAL",1)
  !InParty("TCVILD")
THEN
  RESPONSE #100
    MoveGlobal("TC1000","TCVILD",[413.2104])
    ActionOverride("TCVILD",SetBeenInPartyFlags())
    ActionOverride("TCVILD",DestroyAllEquipment())
    ActionOverride("TCVILD",CreateItem("TCVLDPL",1,0,0))
    ActionOverride("TCVILD",FillSlot(SLOT_ARMOR))
    SetGlobal("TCVildSpawn","TC1000",1)
END

IF
  !InMyArea("TCSLTINY")
  Global("SelfTalk","TC1000",0)
THEN
  RESPONSE #100
    SetGlobal("SelfTalk","TC1000",1)
    ActionOverride(Player1,StartDialogue("PLAYER1",Player1))
END

IF
  Global("TCKnowStairsBroken","GLOBAL",1)
  Global("TCKellanarSpawn","TC1000",0)
THEN
  RESPONSE #100
    SetGlobal("TCKellanarSpawn","TC1000",1)
    CreateCreatureObjectOffScreen("TCKELL",Player1,0,0,0)
END

IF
  GlobalGT("TCEscapeWestgate","GLOBAL",1)
  Exists("TCKELL")
THEN
  RESPONSE #100
    ActionOverride("TCKELL",EscapeAreaDestroy(5))
END

IF
  Global("TCEscapeWestgate","GLOBAL",1)
THEN
  RESPONSE #100
    CutSceneId("PLAYER1")
    Wait(2)
    ClearAllActions()
    SaveGame(0)
    SmallWait(2)
    StartCutSceneMode()
    SetGlobal("TCEscapeWestgate","GLOBAL",2)
    ActionOverride(Player1,LeaveAreaLUA("TC1550","",[4700.1070],12))
    ActionOverride(Player2,LeaveAreaLUA("TC1550","",[4750.1040],0))
    ActionOverride(Player3,LeaveAreaLUA("TC1550","",[4780.1040],0))
    ActionOverride(Player4,LeaveAreaLUA("TC1550","",[4830.1040],0))
    ActionOverride(Player5,LeaveAreaLUA("TC1550","",[4730.1120],8))
    ActionOverride(Player6,LeaveAreaLUA("TC1550","",[4790.1120],8))
    ActionOverride(Player1,Wait(2))
    ActionOverride(Player1,MultiPlayerSync())
    EndCutSceneMode()
END

IF
  Global("TCChaarnaFollows","GLOBAL",1)
  Global("TCChaarnaNeedsPassage","GLOBAL",0)
  !Dead("TCCHAAR")
THEN
  RESPONSE #100
    SetGlobal("TCChaarnaNeedsPassage","GLOBAL",1)
END

IF
  Global("TCMarkessaCantJoin","GLOBAL",1)
  Global("TCMarkessaNeedsPassage","GLOBAL",0)
  !Dead("TCMARKES")
THEN
  RESPONSE #100
    SetGlobal("TCMarkessaNeedsPassage","GLOBAL",1)
END

IF
  Global("TCFoundBerilCrew","GLOBAL",1)
  GlobalTimerExpired("TCSpawnCrew","GLOBAL")
  Global("TCSailorSpawns","TC1000",0)
THEN
  RESPONSE #100
    CreateCreature("TCSAILO1",[653.2770],11)
    CreateCreature("TCSAILO2",[593.2734],12)
    CreateCreature("TCSAILO3",[769.2813],10)
    CreateCreature("TCSAILO4",[832.2811],9)
    CreateCreature("TCBERIL",[719.2651],13)
    SetGlobal("TCSailorSpawns","TC1000",1)
END

IF
  Global("TCGoToSuderham","GLOBAL",1)
  Global("TCMarkessaCantJoin","GLOBAL",1)
  Exists("TCMARKES")
THEN
  RESPONSE #100
    SetGlobal("TCMarkessaCantJoin","GLOBAL",2)
    ActionOverride("TCMARKES",MoveBetweenAreas("TC0200",[200.200],1))
    Continue()
END

IF
  Global("TCGoToSuderham","GLOBAL",1)
  Global("TCChaarnaFollows","GLOBAL",1)
  Exists("TCCHAAR")
THEN
  RESPONSE #100
    SetGlobal("TCChaarnaFollows","GLOBAL",2)
    ActionOverride("TCCHAAR",MoveBetweenAreas("TC0200",[220.220],1))
    Continue()
END

IF
  Global("TCGoToSuderham","GLOBAL",1)
THEN
  RESPONSE #100
    CutSceneId("PLAYER1")
    Wait(2)
    ClearAllActions()
    SaveGame(0)
    SmallWait(2)
    StartCutSceneMode()
    SetGlobal("TCGoToSuderham","GLOBAL",2)
    ActionOverride(Player1,LeaveAreaLUA("TC2000","",[4811.2205],0))
    ActionOverride(Player2,LeaveAreaLUA("TC2000","",[4863.2245],0))
    ActionOverride(Player3,LeaveAreaLUA("TC2000","",[4919.2214],0))
    ActionOverride(Player4,LeaveAreaLUA("TC2000","",[4966.2174],0))
    ActionOverride(Player5,LeaveAreaLUA("TC2000","",[4922.2128],0))
    ActionOverride(Player6,LeaveAreaLUA("TC2000","",[4876.2123],0))
    ActionOverride(Player1,Wait(2))
    ActionOverride(Player1,MultiPlayerSync())
    EndCutSceneMode()
END

IF
  Global("TCChaarnaFollows","GLOBAL",1)
  !InActiveArea("TCCHAAR")
  !Dead("TCCHAAR")
THEN
  RESPONSE #100
    MoveGlobalObject("TCCHAAR",Player1)
END

IF
  Global("TCMarkessaCantJoin","GLOBAL",1)
  !InActiveArea("TCMARKES")
  !Dead("TCMARKES")
THEN
  RESPONSE #100
    MoveGlobalObject("TCMARKES",Player1)
END

