<?xml version="1.0" encoding="utf-8"?>
<Override>
  <Randomevents>
    <!-- GENERIC IGNORE OPTION 
  USE THIS TO CLEAR TAG AND LOOP INTO THE CONVERSATION -->
    <!-- <Label name="retry" />
        <ClearTagAction tag="triggerer_player" />
      
      <Option text="eventtext.option.ignore" endconversation="true">
        <WaitAction time="2" />
        <GoTo name="retry" />
      </Option> -->
    <!-- GENERIC NO REPEAT OPTION 
  PLACE THIS AT THE START OF THE EVENT AND LABEL AT THE END, SETDATAACTION SOMEWHERE -->
    <!-- <CheckDataAction identifier="eventnorepeat" condition="eq 0" >
        <Failure>
          <Goto name="end" />
        </Failure> 
      </CheckDataAction> 
      
      <SetDataAction identifier="eventnorepeat" operation="set" value="1" />
      
      <Label name="end" /> -->
    <EventSprites>
      <Sprite identifier="piratehaven" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="23,0,234,242" origin="0.5,0.5" />
      <Sprite identifier="piratehaven2" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="263,6,242,238" origin="0.5,0.5" />
      <Sprite identifier="banditcaptain" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="529,0,236,254" origin="0.5,0.5" />
      <Sprite identifier="bandittalk" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="768,0,256,256" origin="0.5,0.5" />
      <Sprite identifier="radiocall" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="25,269,216,216" origin="0.5,0.5" />
      <Sprite identifier="sonar" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="270,266,225,222" origin="0.5,0.5" />
      <Sprite identifier="subblueprint" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="530,260,239,235" origin="0.5,0.5" />
      <Sprite identifier="hitthelever" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="792,278,210,210" origin="0.5,0.5" />
      <Sprite identifier="bloodycuffs" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="11,529,221,221" origin="0.5,0.5" />
      <Sprite identifier="firefight" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="267,529,224,224" origin="0.5,0.5" />
      <Sprite identifier="traitoress" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="527,529,223,224" origin="0.5,0.5" />
      <Sprite identifier="hostage" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="779,526,225,225" origin="0.5,0.5" />
      <Sprite identifier="huskoutbreak" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="25,769,226,235" origin="0.5,0.5" />
      <Sprite identifier="brokenmachinery" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="283,792,199,199" origin="0.5,0.5" />
      <Sprite identifier="malfunction" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="540,796,208,208" origin="0.5,0.5" />
      <Sprite identifier="destruction" texture="%ModDir:2532991202%/Events/DE_Event_pic1.png" sourcerect="768,768,256,256" origin="0.5,0.5" />
    </EventSprites>
    <EventPrefabs>
      <ScriptedEvent identifier="militaryforces_position_npcs" commonness="100">
        <WaitAction time="3" />
        <TagAction criteria="humanprefabidentifier:outpostmanager" tag="outpostmanager" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:outpostmanagercoalition" tag="outpostmanager" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:outpostmanagerseparatists" tag="outpostmanager" ContinueIfNoTargetsFound="true" />
        <!--TagAction criteria="humanprefabidentifier:hrmanager" tag="hrmanager" ContinueIfNoTargetsFound="true" /-->
        <TagAction criteria="humanprefabidentifier:reactoroperator" tag="reactoroperator" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:merchantmilitary" tag="merchantmilitary" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:merchantarmory" tag="merchantarmory" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:outpostdoctor" tag="outpostdoctor" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="itemtag:adminseat" tag="adminseat" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="itemtag:hrseat" tag="hrseat" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="itemtag:reactoroperatorseat" tag="reactoroperatorseat" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="itemtag:merchantmilitaryseat" tag="merchantmilitaryseat" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="itemtag:merchantarmoryseat" tag="merchantarmoryseat" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="itemtag:doctorseat" tag="doctorseat" ContinueIfNoTargetsFound="true" />
        <NPCOperateItemAction npctag="outpostmanager" targettag="adminseat" ItemComponentName="Controller" operate="true" />
        <!--NPCOperateItemAction npctag="hrmanager" targettag="hrseat" ItemComponentName="Controller" operate="true" /-->
        <NPCOperateItemAction npctag="reactoroperator" targettag="reactoroperatorseat" ItemComponentName="Controller" operate="true" />
        <NPCOperateItemAction npctag="merchantmilitary" targettag="merchantmilitaryseat" ItemComponentName="Controller" operate="true" />
        <NPCOperateItemAction npctag="merchantarmory" targettag="merchantarmoryseat" ItemComponentName="Controller" operate="true" />
        <NPCOperateItemAction npctag="outpostdoctor" targettag="doctorseat" ItemComponentName="Controller" operate="true" />
      </ScriptedEvent>
      <!-- ////////////////////// -->
      <!-- ////////////////////// -->
      <!-- ////////////////////// -->
      <!-- ////////////////////// -->
      <!-- ////////////////////// -->
      <!-- only exists to help players figure out how to make construction crates, triggered by event below -->
      <ScriptedEvent identifier="Constructionrecipe" commonness="100">
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="itemidentifier:unitloaddevice" tag="constructioncargounit" SubmarineType="Outpost" chooserandom="true" />
        <TriggerAction target1tag="constructioncargounit" target2tag="player" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
        <ConversationAction targettag="triggerer_player" text="eventtext.constructionrecipe.recipe" eventsprite="mines" endconversation="true" />
      </ScriptedEvent>
      <!-- Construction event -->
      <ScriptedEvent identifier="Constructionprogress" commonness="100">
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="itemtag:fabricator" tag="selectedfabricator" SubmarineType="Outpost" chooserandom="true" />
        <TagAction criteria="itemtag:deconstructor" tag="selecteddeconstructor" SubmarineType="Outpost" chooserandom="true" />
        <TagAction criteria="itemidentifier:unitloaddevice" tag="constructioncargounit" SubmarineType="Outpost" chooserandom="true" />
        <TriggerEventAction identifier="Constructionrecipe" />
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="worker1" spawnlocation="Outpost" />
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="worker2" spawnlocation="Outpost" />
        <TriggerAction target1tag="worker1" target2tag="player" applytotarget1="contruction_manager" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
        <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.starterdialogue" eventsprite="mines">
          <Option text="eventtext.Constructionprogress.wehavecrates">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.speaktomeagain" />
            <GoTo name="waitingforgoods" />
          </Option>
          <Option text="eventtext.Constructionprogress.letmecheck">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.ifyoufindcrates" />
            <GoTo name="waitingforgoods" />
          </Option>
          <Option text="eventtext.Constructionprogress.notinterested">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.findmeagain" />
            <GoTo name="changemind" />
          </Option>
          <Option text="eventtext.Constructionprogress.nomaterials">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.wellwait" />
            <GoTo name="changemind" />
          </Option>
        </ConversationAction>
        <Label name="changemind" />
        <ClearTagAction tag="triggerer_player" />
        <ClearTagAction tag="contruction_manager" />
        <TriggerAction target1tag="worker1" target2tag="player" applytotarget1="contruction_manager" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
        <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.changeyourmind" eventsprite="mines">
          <Option text="eventtext.Constructionprogress.cratescoming">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.speaktomeagain" />
            <GoTo name="waitingforgoods" />
          </Option>
          <Option text="eventtext.generic.ignore" endconversation="true" />
        </ConversationAction>
        <Label name="waitingforgoods" />
        <ClearTagAction tag="triggerer_player" />
        <ClearTagAction tag="contruction_manager" />
        <HighlightAction targettag="constructioncargounit" targetcharacter="player" />
        <TriggerAction target1tag="worker1" target2tag="player" applytotarget1="contruction_manager" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
        <CheckItemAction targettag="constructioncargounit" itemidentifiers="constructionmaterialcrate" amount="5">
          <Success>
            <StatusEffectAction targettag="constructioncargounit">
              <StatusEffect target="this" noninteractable="true" setvalue="true" />
            </StatusEffectAction>
            <CheckReputationAction targettype="Location" condition="gte 50">
              <Success>
                <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.cratesdelivered" eventsprite="mines">
                  <Option text="eventtext.Constructionprogress.thanks">
                    <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.youdecide" eventsprite="mines">
                      <Option text="eventtext.Constructionprogress.settlement">
                        <ModifyLocationAction type="Settlement" />
                        <ConversationAction text="eventtext.Constructionprogress.settlementpicked" />
                        <GoTo name="reward" />
                      </Option>
                      <Option text="eventtext.Constructionprogress.base">
                        <ModifyLocationAction type="Base" />
                        <ConversationAction text="eventtext.Constructionprogress.basepicked" />
                        <GoTo name="reward" />
                      </Option>
                      <Option text="eventtext.Constructionprogress.research">
                        <ModifyLocationAction type="Research" />
                        <ConversationAction text="eventtext.Constructionprogress.researchpicked" />
                        <GoTo name="reward" />
                      </Option>
                      <Option text="eventtext.Constructionprogress.hospital">
                        <ModifyLocationAction type="Hospital" />
                        <ConversationAction text="eventtext.Constructionprogress.hospitalpicked" />
                        <GoTo name="reward" />
                      </Option>
                    </ConversationAction>
                  </Option>
                </ConversationAction>
              </Success>
              <Failure>
                <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.cratesdelivered" eventsprite="mines">
                  <Option text="eventtext.Constructionprogress.thanks">
                    <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.backtowork" />
                    <!-- 25% chance of any outcome -->
                    <RNGAction chance="0.50">
                      <Success>
                        <RNGAction chance="0.50">
                          <Success>
                            <ModifyLocationAction type="Settlement" />
                            <GoTo name="reward" />
                          </Success>
                          <Failure>
                            <ModifyLocationAction type="Base" />
                            <GoTo name="reward" />
                          </Failure>
                        </RNGAction>
                      </Success>
                      <Failure>
                        <RNGAction chance="0.50">
                          <Success>
                            <ModifyLocationAction type="Research" />
                            <GoTo name="reward" />
                          </Success>
                          <Failure>
                            <ModifyLocationAction type="Hospital" />
                            <GoTo name="reward" />
                          </Failure>
                        </RNGAction>
                      </Failure>
                    </RNGAction>
                  </Option>
                </ConversationAction>
              </Failure>
            </CheckReputationAction>
          </Success>
          <Failure>
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.notenough" eventsprite="mines">
              <Option text="eventtext.Constructionprogress.checkagain" endconversation="true">
                <GoTo name="waitingforgoods" />
              </Option>
              <Option text="eventtext.Constructionprogress.allwegot">
                <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.takecargoback" eventsprite="mines" />
                <GoTo name="changemind" />
              </Option>
            </ConversationAction>
          </Failure>
        </CheckItemAction>
        <Label name="reward" />
        <NPCOperateItemAction npctag="worker1" targettag="selectedfabricator" ItemComponentName="Fabricator" Operate="true" />
        <NPCOperateItemAction npctag="worker2" targettag="selecteddeconstructor" ItemComponentName="Deconstructor" Operate="true" />
        <HighlightAction targettag="constructioncargounit" targetcharacter="player" state="false" />
        <MoneyAction amount="2000" />
        <ReputationAction targettype="Location" increase="5" />
        <SpawnAction itemidentifier="coalitioncommendation" targetinventory="triggerer_player" />
        <ClearTagAction tag="triggerer_player" />
        <ClearTagAction tag="contruction_manager" />
      </ScriptedEvent>
      <!-- ////////////////////// -->
      <!-- Construction UPGRADE events, allow upgrading an outpost, simplified from construction -->
      <ScriptedEvent identifier="ConstructionUpgradeToColony" commonness="100">
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="itemidentifier:unitloaddevice" tag="constructioncargounit" SubmarineType="Outpost" chooserandom="true" />
        <TriggerEventAction identifier="Constructionrecipe" />
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="worker1" spawnlocation="Outpost" spawnpointtag="constructionworker" requirespawnpointtag="true" ContinueIfFailedToSpawn="false" />
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="worker2" spawnlocation="Outpost" spawnpointtag="constructionworker" requirespawnpointtag="true" ContinueIfFailedToSpawn="false" />
        <TriggerAction target1tag="worker1" target2tag="player" applytotarget1="contruction_manager" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
        <ConversationAction targettag="triggerer_player" text="eventtext.ConstructionUpgrade.starterdialogue" eventsprite="mines">
          <Option text="eventtext.Constructionprogress.letmecheck">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.ifyoufindcrates" />
          </Option>
          <Option text="eventtext.Constructionprogress.notinterested">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.findmeagain" />
          </Option>
        </ConversationAction>
        <ClearTagAction tag="triggerer_player" />
        <HighlightAction targettag="constructioncargounit" targetcharacter="player" />
        <Label name="waitingforgoods" />
        <CheckItemAction targettag="constructioncargounit" itemidentifiers="constructionmaterialcrate" amount="3">
          <Success>
            <StatusEffectAction targettag="constructioncargounit">
              <StatusEffect target="this" noninteractable="true" setvalue="true" />
            </StatusEffectAction>
            <TriggerAction target1tag="worker1" target2tag="player" applytotarget1="contruction_manager" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.cratesdelivered" eventsprite="mines">
              <Option text="eventtext.Constructionprogress.thanks">
                <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.backtowork" />
                <ModifyLocationAction type="Colony" />
                <GoTo name="reward" />
              </Option>
            </ConversationAction>
          </Success>
          <Failure>
            <GoTo name="waitingforgoods" />
          </Failure>
        </CheckItemAction>
        <Label name="reward" />
        <HighlightAction targettag="constructioncargounit" targetcharacter="player" state="false" />
        <MoneyAction amount="1000" />
        <ReputationAction targettype="Location" increase="3" />
      </ScriptedEvent>
      <ScriptedEvent identifier="ConstructionUpgradeToBase" commonness="100">
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="itemidentifier:unitloaddevice" tag="constructioncargounit" SubmarineType="Outpost" chooserandom="true" />
        <TriggerEventAction identifier="Constructionrecipe" />
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="worker1" spawnlocation="Outpost" spawnpointtag="constructionworker" requirespawnpointtag="true" ContinueIfFailedToSpawn="false" />
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="worker2" spawnlocation="Outpost" spawnpointtag="constructionworker" requirespawnpointtag="true" ContinueIfFailedToSpawn="false" />
        <TriggerAction target1tag="worker1" target2tag="player" applytotarget1="contruction_manager" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
        <ConversationAction targettag="triggerer_player" text="eventtext.ConstructionUpgrade.starterdialogue" eventsprite="mines">
          <Option text="eventtext.Constructionprogress.letmecheck">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.ifyoufindcrates" />
          </Option>
          <Option text="eventtext.Constructionprogress.notinterested">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.findmeagain" />
          </Option>
        </ConversationAction>
        <ClearTagAction tag="triggerer_player" />
        <HighlightAction targettag="constructioncargounit" targetcharacter="player" />
        <Label name="waitingforgoods" />
        <CheckItemAction targettag="constructioncargounit" itemidentifiers="constructionmaterialcrate" amount="3">
          <Success>
            <StatusEffectAction targettag="constructioncargounit">
              <StatusEffect target="this" noninteractable="true" setvalue="true" />
            </StatusEffectAction>
            <TriggerAction target1tag="worker1" target2tag="player" applytotarget1="contruction_manager" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.cratesdelivered" eventsprite="mines">
              <Option text="eventtext.Constructionprogress.thanks">
                <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.backtowork" />
                <ModifyLocationAction type="base" />
                <GoTo name="reward" />
              </Option>
            </ConversationAction>
          </Success>
          <Failure>
            <GoTo name="waitingforgoods" />
          </Failure>
        </CheckItemAction>
        <Label name="reward" />
        <HighlightAction targettag="constructioncargounit" targetcharacter="player" state="false" />
        <MoneyAction amount="1000" />
        <ReputationAction targettype="Location" increase="3" />
      </ScriptedEvent>
      <ScriptedEvent identifier="ConstructionUpgradeToHospital" commonness="100">
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="itemidentifier:unitloaddevice" tag="constructioncargounit" SubmarineType="Outpost" chooserandom="true" />
        <TriggerEventAction identifier="Constructionrecipe" />
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="worker1" spawnlocation="Outpost" spawnpointtag="constructionworker" requirespawnpointtag="true" ContinueIfFailedToSpawn="false" />
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="worker2" spawnlocation="Outpost" spawnpointtag="constructionworker" requirespawnpointtag="true" ContinueIfFailedToSpawn="false" />
        <TriggerAction target1tag="worker1" target2tag="player" applytotarget1="contruction_manager" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
        <ConversationAction targettag="triggerer_player" text="eventtext.ConstructionUpgrade.starterdialogue" eventsprite="mines">
          <Option text="eventtext.Constructionprogress.letmecheck">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.ifyoufindcrates" />
          </Option>
          <Option text="eventtext.Constructionprogress.notinterested">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.findmeagain" />
          </Option>
        </ConversationAction>
        <ClearTagAction tag="triggerer_player" />
        <HighlightAction targettag="constructioncargounit" targetcharacter="player" />
        <Label name="waitingforgoods" />
        <CheckItemAction targettag="constructioncargounit" itemidentifiers="constructionmaterialcrate" amount="3">
          <Success>
            <StatusEffectAction targettag="constructioncargounit">
              <StatusEffect target="this" noninteractable="true" setvalue="true" />
            </StatusEffectAction>
            <TriggerAction target1tag="worker1" target2tag="player" applytotarget1="contruction_manager" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.cratesdelivered" eventsprite="mines">
              <Option text="eventtext.Constructionprogress.thanks">
                <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.backtowork" />
                <ModifyLocationAction type="hospital" />
                <GoTo name="reward" />
              </Option>
            </ConversationAction>
          </Success>
          <Failure>
            <GoTo name="waitingforgoods" />
          </Failure>
        </CheckItemAction>
        <Label name="reward" />
        <HighlightAction targettag="constructioncargounit" targetcharacter="player" state="false" />
        <MoneyAction amount="1000" />
        <ReputationAction targettype="Location" increase="3" />
      </ScriptedEvent>
      <ScriptedEvent identifier="ConstructionUpgradeToResearch" commonness="100">
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="itemidentifier:unitloaddevice" tag="constructioncargounit" SubmarineType="Outpost" chooserandom="true" />
        <TriggerEventAction identifier="Constructionrecipe" />
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="worker1" spawnlocation="Outpost" spawnpointtag="constructionworker" requirespawnpointtag="true" ContinueIfFailedToSpawn="false" />
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="worker2" spawnlocation="Outpost" spawnpointtag="constructionworker" requirespawnpointtag="true" ContinueIfFailedToSpawn="false" />
        <TriggerAction target1tag="worker1" target2tag="player" applytotarget1="contruction_manager" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
        <ConversationAction targettag="triggerer_player" text="eventtext.ConstructionUpgrade.starterdialogue" eventsprite="mines">
          <Option text="eventtext.Constructionprogress.letmecheck">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.ifyoufindcrates" />
          </Option>
          <Option text="eventtext.Constructionprogress.notinterested">
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.findmeagain" />
          </Option>
        </ConversationAction>
        <ClearTagAction tag="triggerer_player" />
        <HighlightAction targettag="constructioncargounit" targetcharacter="player" />
        <Label name="waitingforgoods" />
        <CheckItemAction targettag="constructioncargounit" itemidentifiers="constructionmaterialcrate" amount="3">
          <Success>
            <StatusEffectAction targettag="constructioncargounit">
              <StatusEffect target="this" noninteractable="true" setvalue="true" />
            </StatusEffectAction>
            <TriggerAction target1tag="worker1" target2tag="player" applytotarget1="contruction_manager" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
            <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.cratesdelivered" eventsprite="mines">
              <Option text="eventtext.Constructionprogress.thanks">
                <ConversationAction targettag="triggerer_player" text="eventtext.Constructionprogress.backtowork" />
                <ModifyLocationAction type="research" />
                <GoTo name="reward" />
              </Option>
            </ConversationAction>
          </Success>
          <Failure>
            <GoTo name="waitingforgoods" />
          </Failure>
        </CheckItemAction>
        <Label name="reward" />
        <HighlightAction targettag="constructioncargounit" targetcharacter="player" state="false" />
        <MoneyAction amount="1000" />
        <ReputationAction targettype="Location" increase="3" />
      </ScriptedEvent>
      <!-- ////////////////////// -->
      <!-- ////////////////////// -->
      <!-- ////////////////////// -->
      <!-- ////////////////////// -->
      <!-- ////////////////////// -->
      <!-- ////////////////////// -->
      <!-- ////////////////////// -->
      <!-- Mine door event -->
      <ScriptedEvent identifier="minedoorevent" commonness="100">
        <WaitAction time="2" />
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="itemtag:mineterminal" tag="mineterminal" ContinueIfNoTargetsFound="false" />
        <TagAction criteria="itemtag:mineentrance" tag="mineentrance" ContinueIfNoTargetsFound="false" />
        <TriggerEventAction identifier="checkminepayment" />
        <StatusEffectAction targettag="mineterminal">
          <StatusEffect target="This" noninteractable="false" nonplayerteaminteractable="false" setvalue="true" disabledeltatime="true" />
        </StatusEffectAction>
        <Label name="restart" />
        <TriggerAction target1tag="player" target2tag="mineterminal" applytotarget1="mde_player" waitforinteraction="true" />
        <ConversationAction targettag="mde_player" text="eventtext.mine.terminal.interact" eventsprite="mines" dialogtype="small">
          <Option text="EventText.option.pay">
            <CheckMoneyAction targettag="mde_player" amount="250">
              <Success>
                <MoneyAction targettag="mde_player" amount="-250" />
                <ConversationAction targettag="mde_player" text="EventText.mine.terminal.interact.pay.success" eventsprite="mines" dialogtype="small" />
                <StatusEffectAction targettag="mineentrance">
                  <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                </StatusEffectAction>
                <StatusEffectAction targettag="mineterminal">
                  <StatusEffect target="This" LightColor="0,92,23,255" noninteractable="true" setvalue="true" disabledeltatime="true" />
                </StatusEffectAction>
                <SetDataAction identifier="mineopened" value="1" />
                <ClearTagAction tag="mde_player" />
              </Success>
              <Failure>
                <ConversationAction targettag="mde_player" text="EventText.mine.terminal.interact.pay.failure" eventsprite="mines" dialogtype="small" />
                <ClearTagAction tag="mde_player" />
                <GoTo name="restart" />
              </Failure>
            </CheckMoneyAction>
          </Option>
          <Option text="eventtext.option.leave" endconversation="true">
            <ClearTagAction tag="mde_player" />
            <GoTo name="restart" />
          </Option>
        </ConversationAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="checkminepayment">
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="hullname:entrance" tag="entrance" submarinetype="Outpost" />
        <TriggerAction target1tag="player" target2tag="entrance" radius="10" waitforinteraction="false" />
        <CheckDataAction identifier="mineopened" condition="eq 1">
          <Success>
            <SetDataAction identifier="mineopened" value="0" />
          </Success>
          <Failure>
            <StatusEffectAction targettag="alarm">
              <StatusEffect IsOn="true" target="This" setvalue="true" />
            </StatusEffectAction>
            <ConversationAction text="EventText.mine.breakin" ContinueAutomatically="true" dialogtype="small" />
            <ReputationAction targettype="Location" increase="-5" />
            <SetDataAction identifier="mineopened" value="0" />
          </Failure>
        </CheckDataAction>
      </ScriptedEvent>
      <!-- Events that randomly delete cave/lair items     -->
      <ScriptedEvent identifier="unlockorenodes" commonness="100">
        <WaitAction time="2" />
        <TagAction criteria="itemidentifier:mineralspawner" tag="deleteorenode" submarinetype="Outpost" chooserandom="true" ChoosePercentage="66" />
        <!-- 2/3 nodes are deleted -->
        <StatusEffectAction targettag="deleteorenode">
          <StatusEffect target="This">
            <Remove />
          </StatusEffect>
        </StatusEffectAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockorenodeslair" commonness="100">
        <WaitAction time="2" />
        <TagAction criteria="itemidentifier:mineralspawner" tag="deleteorenode" submarinetype="Outpost" ChoosePercentage="80" />
        <!-- 4/5 nodes are deleted -->
        <StatusEffectAction targettag="deleteorenode">
          <StatusEffect target="This">
            <Remove />
          </StatusEffect>
        </StatusEffectAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockplantnodes" commonness="100">
        <WaitAction time="2" />
        <TagAction criteria="itemidentifier:plantcluster" tag="plantnode" submarinetype="Outpost" chooserandom="true" ChoosePercentage="75" />
        <!-- 3/4 nodes are deleted -->
        <StatusEffectAction targettag="plantnode">
          <StatusEffect target="This">
            <Remove />
          </StatusEffect>
        </StatusEffectAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockplantnodeslair" commonness="100">
        <WaitAction time="2" />
        <TagAction criteria="itemidentifier:plantcluster" tag="deleteplantnode" submarinetype="Outpost" chooserandom="true" ChoosePercentage="75" />
        <!-- 3/4 nodes are deleted -->
        <StatusEffectAction targettag="deleteplantnode">
          <StatusEffect target="This">
            <Remove />
          </StatusEffect>
        </StatusEffectAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockpestnests" commonness="100">
        <WaitAction time="2" />
        <TagAction criteria="itemidentifier:cavepestspawner" tag="deletepestnest" submarinetype="Outpost" chooserandom="true" ChoosePercentage="75" />
        <!-- 3/4 nodes are deleted -->
        <StatusEffectAction targettag="deletepestnest">
          <StatusEffect target="This">
            <Remove />
          </StatusEffect>
        </StatusEffectAction>
      </ScriptedEvent>
      <!-- TODO: find a way to replace this, the event is everywhere -->
      <ScriptedEvent identifier="reactoroperatorsale" commonness="100">
        <TagAction criteria="player" tag="player" />
        <Label name="waitforinput" />
        <TriggerAction target1tag="reactoroperator" target2tag="player" applytotarget2="ro_trig_player" waitforinteraction="true" />
        <CheckReputationAction targettype="faction" identifier="Location" condition="gte -20">
          <Success>
            <ConversationAction targettag="ro_trig_player" text="eventtext.shop.engineer.interact" eventsprite="engineer">
              <Option text="eventtext.shop.engineer.option.fuelrod">
                <CheckMoneyAction targettag="ro_trig_player" Amount="900">
                  <Success>
                    <MoneyAction targettag="ro_trig_player" amount="-900" />
                    <SpawnAction itemidentifier="fuelrod" targetinventory="ro_trig_player" />
                    <SpawnAction itemidentifier="fuelrod" targetinventory="ro_trig_player" />
                    <SpawnAction itemidentifier="fuelrod" targetinventory="ro_trig_player" />
                    <SpawnAction itemidentifier="fuelrod" targetinventory="ro_trig_player" />
                    <ConversationAction targettag="ro_trig_player" text="eventtext.shop.engineer.option.fuelrod.buy.success" eventsprite="engineer" />
                    <ClearTagAction tag="ro_trig_player" />
                  </Success>
                  <Failure>
                    <ConversationAction targettag="ro_trig_player" text="eventtext.shop.engineer.option.fuelrod.buy.failure" eventsprite="engineer" />
                    <ClearTagAction tag="ro_trig_player" />
                    <GoTo name="waitforinput" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="eventtext.shop.engineer.option.fpga">
                <CheckMoneyAction targettag="ro_trig_player" Amount="250">
                  <Success>
                    <MoneyAction targettag="ro_trig_player" amount="-250" />
                    <SpawnAction itemidentifier="fpgacircuit" targetinventory="ro_trig_player" />
                    <SpawnAction itemidentifier="fpgacircuit" targetinventory="ro_trig_player" />
                    <ConversationAction targettag="ro_trig_player" text="eventtext.shop.engineer.option.fpga.buy.success" eventsprite="engineer" />
                    <ClearTagAction tag="ro_trig_player" />
                  </Success>
                  <Failure>
                    <ConversationAction targettag="ro_trig_player" text="eventtext.shop.engineer.option.fpga.buy.failure" eventsprite="engineer" />
                    <ClearTagAction tag="ro_trig_player" />
                    <GoTo name="waitforinput" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="eventtext.shop.engineer.option.extinguisher">
                <CheckMoneyAction targettag="ro_trig_player" Amount="100">
                  <Success>
                    <MoneyAction targettag="ro_trig_player" amount="-100" />
                    <SpawnAction itemidentifier="extinguisher" targetinventory="ro_trig_player" />
                    <ConversationAction targettag="ro_trig_player" text="eventtext.shop.engineer.option.extinguisher.buy.success" eventsprite="engineer" />
                    <ClearTagAction tag="ro_trig_player" />
                  </Success>
                  <Failure>
                    <ConversationAction targettag="ro_trig_player" text="eventtext.shop.engineer.option.extinguisher.buy.failure" eventsprite="engineer" />
                    <ClearTagAction tag="ro_trig_player" />
                    <GoTo name="waitforinput" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="eventtext.option.leave">
                <ConversationAction text="eventtext.general.decline" targettag="ro_trig_player" />
                <ClearTagAction tag="ro_trig_player" />
                <GoTo name="waitforinput" />
              </Option>
            </ConversationAction>
          </Success>
          <Failure>
            <ConversationAction targettag="ro_trig_player" text="eventtext.shop.engineer.unfriedly" eventsprite="group" />
            <ClearTagAction tag="ro_trig_player" />
          </Failure>
        </CheckReputationAction>
      </ScriptedEvent>
      <!-- Unused since we have vending machines -->
      <ScriptedEvent identifier="quartermaster" commonness="100">
        <TagAction criteria="player" tag="player" />
        <SpawnAction npcsetidentifier="DE_outpostnpcs" npcidentifier="quartermaster" targettag="quartermaster" spawnlocation="Outpost" />
        <Label name="waitforinput" />
        <TriggerAction target1tag="quartermaster" target2tag="player" applytotarget2="qm_trig_player" radius="200" waitforinteraction="true" />
        <ConversationAction targettag="qm_trig_player" text="eventtext.shop.quartermaster.interact" eventsprite="mechanic">
          <Option text="eventtext.shop.quartermaster.option.weldingfuel">
            <CheckMoneyAction targettag="qm_trig_player" Amount="1000">
              <Success>
                <MoneyAction targettag="qm_trig_player" amount="-1000" />
                <SpawnAction itemidentifier="weldingfueltank" targetinventory="qm_trig_player" />
                <SpawnAction itemidentifier="weldingfueltank" targetinventory="qm_trig_player" />
                <SpawnAction itemidentifier="weldingfueltank" targetinventory="qm_trig_player" />
                <SpawnAction itemidentifier="weldingfueltank" targetinventory="qm_trig_player" />
                <SpawnAction itemidentifier="weldingfueltank" targetinventory="qm_trig_player" />
                <SpawnAction itemidentifier="weldingfueltank" targetinventory="qm_trig_player" />
                <SpawnAction itemidentifier="weldingfueltank" targetinventory="qm_trig_player" />
                <SpawnAction itemidentifier="weldingfueltank" targetinventory="qm_trig_player" />
                <ConversationAction targettag="qm_trig_player" text="eventtext.shop.quartermaster.option.weldingfuel.buy.success" eventsprite="mechanic" />
                <ClearTagAction tag="qm_trig_player" />
              </Success>
              <Failure>
                <ConversationAction targettag="qm_trig_player" text="eventtext.shop.quartermaster.option.weldingfuel.buy.failure" eventsprite="mechanic" />
                <ClearTagAction tag="qm_trig_player" />
                <GoTo name="waitforinput" />
              </Failure>
            </CheckMoneyAction>
          </Option>
          <!--         <Option text="eventtext.shop.quartermaster.option.scrap">
          <CheckMoneyAction targettag="qm_trig_player" Amount="1000">
            <Success>
              <MoneyAction targettag="qm_trig_player" amount="-1000" />
              <SpawnAction itemidentifier="scrap" targetinventory="qm_trig_player" />
              <ConversationAction targettag="qm_trig_player" text="eventtext.shop.quartermaster.option.scrap.buy.success" eventsprite="mechanic" />
              <MissionAction missiontag="salvagewreck" />
              <ClearTagAction tag="qm_trig_player" />
            </Success>
            <Failure>
              <ConversationAction targettag="qm_trig_player" text="eventtext.shop.quartermaster.option.scrap.buy.failure" eventsprite="mechanic" />
              <ClearTagAction tag="qm_trig_player" />
              <GoTo name="waitforinput" />
            </Failure>
          </CheckMoneyAction>
        </Option> -->
          <Option text="eventtext.option.leave">
            <ConversationAction text="eventtext.general.decline" targettag="qm_trig_player" />
            <ClearTagAction tag="qm_trig_player" />
            <GoTo name="waitforinput" />
          </Option>
        </ConversationAction>
      </ScriptedEvent>
      <!-- scrap dealer, buy scrap  -->
      <ScriptedEvent identifier="scrapdealer1" commonness="100">
        <CheckDataAction identifier="scrapdealerprogress" condition="eq 0">
          <Failure></Failure>
          <Success>
            <TagAction criteria="player" tag="player" />
            <SpawnAction npcsetidentifier="customnpcs" npcidentifier="scrapdealer" targettag="scrapdealer" spawnlocation="Outpost" targetmoduletags="crewmodule" />
            <Label name="waitforinput" />
            <TriggerAction target1tag="scrapdealer" target2tag="player" applytotarget2="triggerer_player" radius="200" waitforinteraction="true" />
            <ConversationAction targettag="triggerer_player" text="EventText.scrapdealer1.scrapseller" eventsprite="office">
              <Option text="EventText.scrapdealer1.sellmescrap">
                <ConversationAction targettag="triggerer_player" text="EventText.scrapdealer1.junktreasure" eventsprite="office" />
                <GoTo name="skiptrigger" />
                <Label name="scrapproposition" />
                <TriggerAction target1tag="scrapdealer" target2tag="player" applytotarget2="triggerer_player" radius="200" waitforinteraction="true" />
                <Label name="skiptrigger" />
                <ConversationAction targettag="triggerer_player" text="EventText.scrapdealer1.buyscrap" eventsprite="office">
                  <Option text="EventText.scrapdealer1.deal">
                    <CheckMoneyAction targettag="triggerer_player" Amount="250">
                      <Success>
                        <MoneyAction targettag="triggerer_player" amount="-250" />
                        <SpawnAction itemidentifier="scrap" amount="4" targetinventory="triggerer_player" />
                        <SetDataAction identifier="scrapdealerprogress" value="1" />
                        <ConversationAction targettag="triggerer_player" text="EventText.scrapdealer1.scrapbought" />
                      </Success>
                      <Failure>
                        <ConversationAction targettag="triggerer_player" text="EventText.scrapdealer1.nomoney" eventsprite="office" />
                        <ClearTagAction tag="triggerer_player" />
                        <GoTo name="scrapproposition" />
                      </Failure>
                    </CheckMoneyAction>
                  </Option>
                  <Option text="eventtext.option.leave" endconversation="true">
                    <ClearTagAction tag="triggerer_player" />
                    <GoTo name="scrapproposition" />
                  </Option>
                </ConversationAction>
              </Option>
              <Option text="eventtext.option.leave" endconversation="true">
                <ClearTagAction tag="triggerer_player" />
                <GoTo name="waitforinput" />
              </Option>
            </ConversationAction>
          </Success>
        </CheckDataAction>
        <OnRoundEndAction>
          <CheckConditionalAction targettag="scrapdealer" IsDead="true">
            <Success>
              <SetDataAction identifier="scrapdealerprogress" value="3" />
            </Success>
          </CheckConditionalAction>
        </OnRoundEndAction>
      </ScriptedEvent>
      <!-- scrap dealer 2, buy scrap a gain get a salvage mission -->
      <ScriptedEvent identifier="scrapdealer2" commonness="100">
        <CheckDataAction identifier="scrapdealerprogress" condition="eq 1">
          <Failure></Failure>
          <Success>
            <TagAction criteria="player" tag="player" />
            <SpawnAction npcsetidentifier="customnpcs" npcidentifier="scrapdealer" targettag="scrapdealer" spawnlocation="Outpost" targetmoduletags="crewmodule" />
            <Label name="waitforinput" />
            <TriggerAction target1tag="scrapdealer" target2tag="player" applytotarget2="triggerer_player" radius="200" waitforinteraction="true" />
            <ConversationAction targettag="triggerer_player" text="EventText.scrapdealer2.scrapseller" eventsprite="office" />
            <GoTo name="skiptrigger" />
            <Label name="scrapproposition" />
            <TriggerAction target1tag="scrapdealer" target2tag="player" applytotarget2="triggerer_player" radius="200" waitforinteraction="true" />
            <Label name="skiptrigger" />
            <ConversationAction targettag="triggerer_player" text="EventText.scrapdealer2.buyscrap" eventsprite="office">
              <Option text="EventText.scrapdealer1.deal">
                <CheckMoneyAction targettag="triggerer_player" Amount="250">
                  <Success>
                    <MoneyAction targettag="triggerer_player" amount="-250" />
                    <SpawnAction itemidentifier="scrap" amount="6" targetinventory="triggerer_player" />
                    <SetDataAction identifier="scrapdealerprogress" value="2" />
                    <ConversationAction targettag="triggerer_player" text="EventText.scrapdealer2.scrapbought" />
                    <MissionAction missiontag="salvagewreck" />
                  </Success>
                  <Failure>
                    <ConversationAction targettag="triggerer_player" text="eventtext.shop.quartermaster.option.scrap.buy.failure" eventsprite="office" />
                    <ClearTagAction tag="triggerer_player" />
                    <GoTo name="scrapproposition" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="eventtext.option.leave" endconversation="true">
                <ClearTagAction tag="triggerer_player" />
                <GoTo name="waitforinput" />
              </Option>
            </ConversationAction>
          </Success>
        </CheckDataAction>
        <OnRoundEndAction>
          <CheckConditionalAction targettag="scrapdealer" IsDead="true">
            <Success>
              <SetDataAction identifier="scrapdealerprogress" value="3" />
            </Success>
          </CheckConditionalAction>
        </OnRoundEndAction>
      </ScriptedEvent>
      <!-- scrap dealer 3, transit event, spawns the corpse of the scrap dealer -->
      <ScriptedEvent identifier="scrapdealer3" commonness="25">
        <CheckDataAction identifier="scrapdealerprogress" condition="eq 2">
          <Failure></Failure>
          <Success>
            <TagAction criteria="player" tag="player" />
            <SpawnAction npcsetidentifier="customnpcs" npcidentifier="scrapdealer" targettag="scrapdealer" spawnlocation="wreck" />
            <TriggerAction target1tag="player" target2tag="scrapdealer" applytotarget2="triggerer_player" radius="200" waitforinteraction="false" />
            <SetDataAction identifier="scrapdealerprogress" value="3" />
          </Success>
        </CheckDataAction>
      </ScriptedEvent>
      <!-- spooky research outpost event -->
      <ScriptedEvent identifier="psychovisions" commonness="100">
        <CheckDataAction identifier="psychovisionsnorepeat" condition="eq 0">
          <Failure>
            <!-- does not spawn the event if already done -->
          </Failure>
          <Success>
            <TagAction criteria="player" tag="player" />
            <TagAction criteria="itemidentifier:op_researchterminal" tag="potentialresearchterminal" submarinetype="outpost" chooserandom="true" />
            <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="researcher" targettag="psychoresearcher" spawnpointtag="potentialresearchterminal" spawnlocation="Outpost" />
            <NPCFollowAction npctag="psychoresearcher" targettag="potentialresearchterminal" follow="true" />
            <TriggerAction target1tag="psychoresearcher" target2tag="player" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
            <AfflictionAction targettag="psychoresearcher" affliction="psychosis" strength="100" />
            <ConversationAction targettag="triggerer_player" text="eventtext.psychovisions.ghosts" eventsprite="MentalBreakdown">
              <Option text="eventtext.psychovisions.noghosts">
                <Goto name="skiplooptrigger" />
                <Label name="talktomadman" />
                <AfflictionAction targettag="psychoresearcher" affliction="psychosis" strength="100" />
                <TriggerAction target1tag="psychoresearcher" target2tag="player" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
                <Label name="skiplooptrigger" />
                <SkillCheckAction targettag="triggerer_player" requiredskill="Medical" requiredlevel="50">
                  <Success>
                    <ConversationAction targettag="triggerer_player" text="eventtext.psychovisions.insidemyhead" eventsprite="MentalBreakdown">
                      <Option text="eventtext.psychovisions.psychotic">
                        <ConversationAction targettag="triggerer_player" text="eventtext.psychovisions.panic" ContinueAutomatically="true" endconversation="true" eventsprite="MentalBreakdown" />
                        <CombatAction combatmode="Retreat" npctag="psychoresearcher" enemytag="potentialresearchterminal" isinstigator="false" witnessreaction="none" cooldown="10" />
                      </Option>
                      <Option text="eventtext.psychovisions.leave" endconversation="true">
                        <!-- ends event  -->
                        <ClearTagAction tag="triggerer_player" />
                      </Option>
                    </ConversationAction>
                  </Success>
                  <Failure>
                    <ConversationAction targettag="triggerer_player" text="eventtext.psychovisions.insidemyhead" eventsprite="MentalBreakdown">
                      <Option text="eventtext.psychovisions.leave" endconversation="true">
                        <!-- ends event  -->
                        <ClearTagAction tag="triggerer_player" />
                      </Option>
                    </ConversationAction>
                  </Failure>
                </SkillCheckAction>
              </Option>
            </ConversationAction>
            <Label name="checkpsychosisloop" />
            <WaitAction time="2" />
            <TriggerAction target1tag="potentialresearchterminal" target2tag="triggerer_player" applytotarget2="psychoplayer" radius="150" waitforinteraction="false" />
            <CheckAfflictionAction identifier="psychosis" targettag="psychoplayer" minstrength="20">
              <Success>
                <TriggerAction target1tag="potentialresearchterminal" target2tag="triggerer_player" applytotarget2="psychoplayer" radius="150" waitforinteraction="true" />
                <StatusEffectAction targettag="psychoplayer">
                  <StatusEffect target="This">
                    <Sound file="Content/Characters/Jove/JOVE_idle1.ogg" range="150" volume="2" frequencymultiplier="1" />
                    <Explosion range="500" force="0" empstrength="0.5" showeffects="false" />
                  </StatusEffect>
                </StatusEffectAction>
                <SetDataAction identifier="spookytext" operation="set" value="0" />
                <Label name="spawnmoretext" />
                <CheckDataAction identifier="spookytext" condition="lt 15">
                  <Success>
                    <SpawnAction itemidentifier="alienwritingdecalevent" targettag="alientext" spawnpointtag="potentialresearchterminal" offset="200" />
                    <SetDataAction identifier="spookytext" operation="add" value="1" />
                    <WaitAction time="0.1" />
                    <Goto name="spawnmoretext" />
                  </Success>
                  <Failure>
                    <SetDataAction identifier="psychovisionsnorepeat" operation="set" value="1" />
                    <ConversationAction targettag="psychoplayer" text="eventtext.psychovisions.listenalien" eventsprite="Ancient1" />
                    <WaitAction time="2" />
                    <ConversationAction targettag="psychoplayer" text="eventtext.psychovisions.paranoid" endconversation="true" />
                    <GiveSkillEXPAction skill="helm" amount="5" targettag="psychoplayer" />
                    <GiveSkillEXPAction skill="weapons" amount="2" targettag="psychoplayer" />
                  </Failure>
                </CheckDataAction>
              </Success>
              <Failure>
                <ClearTagAction tag="psychoplayer" />
                <Goto name="checkpsychosisloop" />
              </Failure>
            </CheckAfflictionAction>
          </Success>
        </CheckDataAction>
      </ScriptedEvent>
      <!--COALITION SECURITY OFFICER
    <ScriptedEvent identifier="securityofficer" commonness="100">
      <TagAction criteria="player" tag="player"/>
      <Label name="restart"/>
      <TriggerAction target1tag="securitynpc" target2tag="player" applytotarget2="cso_trig_player" radius="200" allowmultipletargets="true"/>
      <CheckReputationAction targettype="faction" identifier="coalition" condition="gte 20">
        <Success>
          <TriggerAction target1tag="securitynpc" target2tag="player" applytotarget2="cso_trig_player" radius="200" waitforinteraction="true"/>
          <NPCWaitAction npctag="securitynpc" wait="true"/>
          <ConversationAction targettag="cso_trig_player" text="eventtext.shop.securityofficer.interact" eventsprite="security">
            <Option text="eventtext.shop.securityofficer.option.coilgunammo">
              <CheckMoneyAction Amount="150">
                <Success>
                  <MoneyAction amount="-150"/>
                  <SpawnAction itemidentifier="coilgunammobox" targetinventory="cso_trig_player"/>
                  <ConversationAction targettag="cso_trig_player" text="eventtext.shop.securityofficer.option.coilgunammo.buy.success"/>
                  <NPCWaitAction npctag="securitynpc" wait="false"/>
                  <ClearTagAction tag="cso_trig_player"/>
                </Success>
                <Failure>
                  <ConversationAction targettag="cso_trig_player" text="eventtext.shop.securityofficer.option.coilgunammo.buy.failure"/>
                  <NPCWaitAction npctag="securitynpc" wait="false"/>
                  <ClearTagAction tag="cso_trig_player"/>
                  <GoTo name="restart"/>
                </Failure>
              </CheckMoneyAction>
            </Option>
            <Option text="eventtext.shop.securityofficer.option.revolverammo">
              <CheckMoneyAction Amount="600">
                <Success>
                  <MoneyAction amount="-600"/>
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="revolverround" targetinventory="cso_trig_player" />
                  <ConversationAction targettag="cso_trig_player" text="eventtext.shop.securityofficer.option.revolverammo.buy.success"/>
                  <NPCWaitAction npctag="securitynpc" wait="false"/>
                  <ClearTagAction tag="cso_trig_player"/>
                </Success>
                <Failure>
                  <ConversationAction targettag="cso_trig_player" text="eventtext.shop.securityofficer.option.revolverammo.buy.failure"/>
                  <NPCWaitAction npctag="securitynpc" wait="false"/>
                  <ClearTagAction tag="cso_trig_player"/>
                  <GoTo name="restart"/>
                </Failure>
              </CheckMoneyAction>
            </Option>
            <Option text="eventtext.shop.securityofficer.option.smgmagazine">
              <CheckMoneyAction Amount="400">
                <Success>
                  <MoneyAction amount="-400"/>
                  <SpawnAction itemidentifier="smgmagazine" targetinventory="cso_trig_player" />
                  <SpawnAction itemidentifier="smgmagazine" targetinventory="cso_trig_player" />
                  <ConversationAction targettag="cso_trig_player" text="eventtext.shop.securityofficer.option.smgmagazine.buy.success"/>
                  <NPCWaitAction npctag="securitynpc" wait="false"/>
                  <ClearTagAction tag="cso_trig_player"/>
                </Success>
                <Failure>
                  <ConversationAction targettag="cso_trig_player" text="eventtext.shop.securityofficer.option.smgmagazine.buy.failure"/>
                  <NPCWaitAction npctag="securitynpc" wait="false"/>
                  <ClearTagAction tag="cso_trig_player"/>
                  <GoTo name="restart"/>
                </Failure>
              </CheckMoneyAction>
            </Option>
            <Option text="eventtext.securityofficer.option.insult">
              <ReputationAction targettype="Faction" identifier="coalition" increase="-10"/>
              <ConversationAction text="eventtext.securityofficer.option.insult.answer" targettag="cso_trig_player">
                <Option text="eventtext.securityofficer.option.insult">
                  <ReputationAction targettype="Faction" identifier="coalition" increase="-20"/>
                  <ConversationAction text="eventtext.securityofficer.option.insult.answer.insult.answer" targettag="cso_trig_player"/>
                  <NPCWaitAction npctag="securitynpc" wait="false"/>
                  <GoTo name="arrest"/>
                </Option>
                <Option text="eventtext.option.leave">
                  <ConversationAction text="eventtext.securityofficer.option.insult.leave.answer" targettag="cso_trig_player"/>
                  <NPCWaitAction npctag="securitynpc" wait="false"/>
                </Option>
              </ConversationAction>
            </Option>
            <Option text="eventtext.option.leave">
              <ConversationAction text="eventtext.general.decline" targettag="cso_trig_player"/>
              <NPCWaitAction npctag="securitynpc" wait="false"/>
              <ClearTagAction tag="cso_trig_player"/>
              <GoTo name="restart"/>
            </Option>
          </ConversationAction>
        </Success>
        <Failure>
          <CheckReputationAction targettype="faction" identifier="coalition" condition="gte -60">
            <Success>
              <RNGAction chance="0.4">
                <Success>
                  <NPCFollowAction npctag="securitynpc" targettag="cso_trig_player" follow="true"/>
                  <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="securitynpccoalition" targettag="backup" spawnlocation="Outpost" spawnpointtype="Path"/>
                  <CheckItemAction targettag="cso_trig_player" RequiredConditionalMatchPercentage="1">
                    <Conditional HasTag="stolen" targetcontainedItem="true" />
                    <Success>
                      <ReputationAction targettype="Faction" identifier="coalition" increase="-10"/>
                      <NPCFollowAction npctag="securitynpc" targettag="cso_trig_player" follow="false"/>
                      <GoTo name="arrest"/>
                    </Success>
                    <Failure>
                      <ConversationAction text="eventtext.securityofficer.interact" targettag="cso_trig_player">
                        <Option text="eventtext.securityofficer.option.rude">
                          <ReputationAction targettype="Faction" identifier="coalition" increase="-1"/>
                          <ConversationAction text="eventtext.securityofficer.option.rude.answer" targettag="cso_trig_player"/>
                        </Option>
                        <Option text="eventtext.securityofficer.option.polite">
                          <ConversationAction text="eventtext.securityofficer.option.polite.answer" targettag="cso_trig_player"/>
                        </Option>
                      </ConversationAction>
                    </Failure>
                  </CheckItemAction>
                  <ConversationAction targettag="cso_trig_player" text="eventtext.securityofficer.bribe.interact" continueconversation="true">
                    <Option text="eventtext.securityofficer.bribe.option.polite">
                      <ConversationAction targettag="cso_trig_player" text="eventtext.securityofficer.bribe.option.polite.answer">
                        <Option text="eventtext.securityofficer.bribe.option.bribe.high">
                          <CheckMoneyAction Amount="500">
                            <Success>
                              <MoneyAction amount="-500"/>
                              <ConversationAction text="eventtext.securityofficer.bribe.option.bribe.success" targettag="cso_trig_player"/>
                              <ReputationAction targettype="Faction" identifier="coalition" increase="1"/>
                              <NPCFollowAction npctag="securitynpc" targettag="cso_trig_player" follow="false"/>
                              <ClearTagAction tag="cso_trig_player"/>
                            </Success>
                            <Failure>
                              <ConversationAction targettag="cso_trig_player" text="eventtext.securityofficer.bribe.option.bribe.failure"/>
                              <GoTo name="arrest"/>
                            </Failure>
                          </CheckMoneyAction>
                        </Option>
                        <Option text="eventtext.securityofficer.bribe.option.bribe.medium">
                          <RNGAction chance="0.75">
                            <Success>
                              <CheckMoneyAction Amount="250">
                                <Success>
                                  <MoneyAction amount="-250"/>
                                  <ConversationAction text="eventtext.securityofficer.bribe.option.bribe.success" targettag="cso_trig_player"/>
                                  <ReputationAction targettype="Faction" identifier="coalition" increase="1"/>
                                  <NPCFollowAction npctag="securitynpc" targettag="cso_trig_player" follow="false"/>
                                  <ClearTagAction tag="cso_trig_player"/>
                                </Success>
                                <Failure>
                                  <ConversationAction targettag="cso_trig_player" text="eventtext.securityofficer.bribe.option.bribe.failure"/>
                                  <GoTo name="arrest"/>
                                </Failure>
                              </CheckMoneyAction>
                            </Success>
                            <Failure>
                              <ConversationAction targettag="cso_trig_player" text="eventtext.securityofficer.bribe.option.bribe.rejected"/>
                              <GoTo name="arrest"/>
                            </Failure>
                          </RNGAction>
                        </Option>
                        <Option text="eventtext.securityofficer.bribe.option.bribe.low">
                          <RNGAction chance="0.50">
                            <Success>
                              <CheckMoneyAction Amount="75">
                                <Success>
                                  <MoneyAction amount="-75"/>
                                  <ConversationAction text="eventtext.securityofficer.bribe.option.bribe.success" targettag="cso_trig_player"/>
                                  <ReputationAction targettype="Faction" identifier="coalition" increase="1"/>
                                  <NPCFollowAction npctag="securitynpc" targettag="cso_trig_player" follow="false"/>
                                  <ClearTagAction tag="cso_trig_player"/>
                                </Success>
                                <Failure>
                                  <ConversationAction targettag="cso_trig_player" text="eventtext.securityofficer.bribe.option.bribe.failure"/>
                                  <GoTo name="arrest"/>
                                </Failure>
                              </CheckMoneyAction>
                            </Success>
                            <Failure>
                              <ConversationAction targettag="cso_trig_player" text="eventtext.securityofficer.bribe.option.bribe.rejected"/>
                              <GoTo name="arrest"/>
                            </Failure>
                          </RNGAction>
                        </Option>
                        <Option text="eventtext.option.leave">
                          <ConversationAction text="eventtext.securityofficer.bribe.option.leave.answer" targettag="cso_trig_player"/>
                          <ClearTagAction tag="cso_trig_player"/>
                        </Option>
                      </ConversationAction>
                    </Option>
                    <Option text="eventtext.securityofficer.bribe.option.rude">
                      <ReputationAction targettype="Faction" identifier="coalition" increase="-5"/>
                      <CombatAction combatmode="arrest" npctag="securitynpc" enemytag="cso_trig_player" witnessreaction="retreat"/>
                      <ConversationAction text="eventtext.securityofficer.bribe.option.rude.answer" targettag="cso_trig_player"/>
                      <ClearTagAction tag="cso_trig_player"/>
                    </Option>
                    <Option text="eventtext.option.leave">
                      <ConversationAction text="eventtext.securityofficer.bribe.option.leave.answer" targettag="cso_trig_player"/>
                      <GoTo name="arrest"/>
                    </Option>
                  </ConversationAction>
                </Success>
                <Failure>
                  <Label name="patrol"/>
                  <NPCWaitAction npctag="securityofficer" wait="false"/>
                  <ClearTagAction tag="cso_trig_player"/>
                </Failure>
              </RNGAction>
            </Success>
            <Failure>
              <Label name="arrest"/>
              <CombatAction combatmode="arrest" npctag="securitynpc" enemytag="cso_trig_player" isinstigator="false" guardreaction="none" witnessreaction="retreat"/>
              <WaitAction time="60"/>
              <GoTo name="patrol"/>
            </Failure>
          </CheckReputationAction>
        </Failure>
      </CheckReputationAction>
    </ScriptedEvent>
    -->
      <!--/////////////////// BLOCKADE EVENTS ////////////////
    /////////////////// BLOCKADE EVENTS ////////////////
    /////////////////// BLOCKADE EVENTS //////////////// -->
      <ScriptedEvent identifier="checkblockadestate_coldcaverns_coalition" commonness="100">
        <WaitAction time="8" />
        <!-- check if a blockade of this faction was unlocked previously for this biome -->
        <CheckDataAction identifier="blockade_coldcaverns_coalition_unlocked" condition="true">
          <Success>
            <TriggerEventAction identifier="opendoortoblockade" />
          </Success>
          <Failure>
            <!-- do nothing -->
          </Failure>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="checkblockadestate_europanridge_coalition" commonness="100">
        <WaitAction time="8" />
        <!-- check if a blockade of this faction was unlocked previously for this biome -->
        <CheckDataAction identifier="blockade_europanridge_coalition_unlocked" condition="true">
          <Success>
            <TriggerEventAction identifier="opendoortoblockade" />
          </Success>
          <Failure>
            <!-- do nothing -->
          </Failure>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="checkblockadestate_aphoticplateau_coalition" commonness="100">
        <WaitAction time="8" />
        <!-- check if a blockade of this faction was unlocked previously for this biome -->
        <CheckDataAction identifier="blockade_aphoticplateau_coalition_unlocked" condition="true">
          <Success>
            <TriggerEventAction identifier="opendoortoblockade" />
          </Success>
          <Failure>
            <!-- do nothing -->
          </Failure>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="checkblockadestate_greatsea_coalition" commonness="100">
        <WaitAction time="8" />
        <!-- check if a blockade of this faction was unlocked previously for this biome -->
        <CheckDataAction identifier="blockade_greatsea_coalition_unlocked" condition="true">
          <Success>
            <TriggerEventAction identifier="opendoortoblockade" />
          </Success>
          <Failure>
            <!-- do nothing -->
          </Failure>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="checkblockadestate_coldcaverns_separatists" commonness="100">
        <WaitAction time="8" />
        <!-- check if a blockade of this faction was unlocked previously for this biome -->
        <CheckDataAction identifier="blockade_coldcaverns_separatists_unlocked" condition="true">
          <Success>
            <TriggerEventAction identifier="opendoortoblockade" />
          </Success>
          <Failure>
            <!-- do nothing -->
          </Failure>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="checkblockadestate_europanridge_separatists" commonness="100">
        <WaitAction time="8" />
        <!-- check if a blockade of this faction was unlocked previously for this biome -->
        <CheckDataAction identifier="blockade_europanridge_separatists_unlocked" condition="true">
          <Success>
            <TriggerEventAction identifier="opendoortoblockade" />
          </Success>
          <Failure>
            <!-- do nothing -->
          </Failure>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="checkblockadestate_aphoticplateau_separatists" commonness="100">
        <WaitAction time="8" />
        <!-- check if a blockade of this faction was unlocked previously for this biome -->
        <CheckDataAction identifier="blockade_aphoticplateau_separatists_unlocked" condition="true">
          <Success>
            <TriggerEventAction identifier="opendoortoblockade" />
          </Success>
          <Failure>
            <!-- do nothing -->
          </Failure>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="checkblockadestate_greatsea_separatists" commonness="100">
        <WaitAction time="8" />
        <!-- check if a blockade of this faction was unlocked previously for this biome -->
        <CheckDataAction identifier="blockade_greatsea_separatists_unlocked" condition="true">
          <Success>
            <TriggerEventAction identifier="opendoortoblockade" />
          </Success>
          <Failure>
            <!-- do nothing -->
          </Failure>
        </CheckDataAction>
      </ScriptedEvent>
      <!--"Unlock Path blockade (generic template, versions by biome/cost below)"
         Only used for negociating and disabling the alarm, the actual event is openblockade -->
      <ScriptedEvent identifier="unlockpathblockade" commonness="0" unlockpathevent="true">
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="watchman" targettag="unlockpathnpc" spawnlocation="Outpost" spawnpointtag="unlockpath" />
        <TriggerEventAction identifier="blockadealarm" />
        <TriggerEventAction identifier="openblockade" />
        <CheckReputationAction targettype="Location" condition="gte 30">
          <Success>
            <ConversationAction text="EventText.unlockpathgeneric.c1" speakertag="unlockpathnpc" dialogtype="Regular" />
            <SetDataAction identifier="blockadeopened" value="1" />
            <TriggerEventAction identifier="opendoortoblockade" />
          </Success>
          <Failure>
            <Label name="retry" />
            <ConversationAction text="EventText.unlockpathgeneric.c2" speakertag="unlockpathnpc" invokertag="unlock_player" dialogtype="Regular" eventsprite="captain">
              <Option text="EventText.unlockpathgeneric.o1">
                <CheckMoneyAction amount="2000">
                  <Success>
                    <MoneyAction amount="-2000" />
                    <SetDataAction identifier="blockadeopened" value="1" />
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathgeneric.o1.c1" eventsprite="captain" />
                    <TriggerEventAction identifier="opendoortoblockade" />
                  </Success>
                  <Failure>
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathgeneric.nomoney" eventsprite="captain" />
                    <ClearTagAction tag="unlock_player" />
                    <GoTo name="retry" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="EventText.unlockpathgeneric.o2">
                <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathgeneric.o2.c1" eventsprite="captain" />
                <ClearTagAction tag="unlock_player" />
                <GoTo name="retry" />
              </Option>
            </ConversationAction>
          </Failure>
        </CheckReputationAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockpathcoldcaverns" commonness="1" unlockpathevent="true" unlockpathtooltip="lockedpathtooltipcoalitionreputation" unlockpathreputation="30" faction="coalition" biome="coldcaverns">
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="watchman" targettag="unlockpathnpc" spawnlocation="Outpost" spawnpointtag="unlockpath" />
        <TriggerEventAction identifier="blockadealarm" />
        <TriggerEventAction identifier="openblockade" />
        <CheckDataAction identifier="blockade_coldcaverns_coalition_unlocked" condition="true">
          <Success>
            <Goto name="skip" />
          </Success>
        </CheckDataAction>
        <CheckReputationAction targettype="Location" condition="gte 30">
          <Success>
            <ConversationAction text="EventText.unlockpathcoldcaverns.c1" speakertag="unlockpathnpc" dialogtype="Regular" />
            <SetDataAction identifier="blockadeopened" value="1" />
            <SetDataAction identifier="blockade_coldcaverns_coalition_unlocked" value="true" />
            <TriggerEventAction identifier="opendoortoblockade" />
            <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
            <StatusEffectAction targettag="blockadeswitch">
              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
            </StatusEffectAction>
          </Success>
          <Failure>
            <Label name="retry" />
            <ConversationAction text="EventText.unlockpathcoldcaverns.c2" speakertag="unlockpathnpc" invokertag="unlock_player" dialogtype="Regular" eventsprite="captain">
              <Option text="EventText.unlockpathcoldcaverns.o1">
                <CheckMoneyAction amount="2000">
                  <Success>
                    <MoneyAction amount="-2000" />
                    <SetDataAction identifier="blockadeopened" value="1" />
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathcoldcaverns.o1.c1" eventsprite="captain" />
                    <SetDataAction identifier="blockade_coldcaverns_coalition_unlocked" value="true" />
                    <TriggerEventAction identifier="opendoortoblockade" />
                    <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
                    <StatusEffectAction targettag="blockadeswitch">
                      <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                    </StatusEffectAction>
                  </Success>
                  <Failure>
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathcoldcaverns.o1.nomoney" eventsprite="captain" />
                    <ClearTagAction tag="unlock_player" />
                    <GoTo name="retry" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="EventText.unlockpath.refusebribe">
                <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathcoldcaverns.o2.c1" eventsprite="captain" />
                <ClearTagAction tag="unlock_player" />
                <GoTo name="retry" />
              </Option>
            </ConversationAction>
          </Failure>
        </CheckReputationAction>
        <Label name="skip" />
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockpatheuropanridge" commonness="1" unlockpathevent="true" unlockpathtooltip="lockedpathtooltipcoalitionreputation" unlockpathreputation="40" faction="coalition" biome="europanridge">
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="watchman" targettag="unlockpathnpc" spawnlocation="Outpost" spawnpointtag="unlockpath" />
        <TriggerEventAction identifier="blockadealarm" />
        <TriggerEventAction identifier="openblockade" />
        <CheckDataAction identifier="blockade_europanridge_coalition_unlocked" condition="true">
          <Success>
            <Goto name="skip" />
          </Success>
        </CheckDataAction>
        <CheckReputationAction targettype="Location" condition="gte 40">
          <Success>
            <ConversationAction text="EventText.unlockpatheuropanridge.c1" speakertag="unlockpathnpc" dialogtype="Regular" />
            <SetDataAction identifier="blockadeopened" value="1" />
            <SetDataAction identifier="blockade_europanridge_coalition_unlocked" value="true" />
            <TriggerEventAction identifier="opendoortoblockade" />
            <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
            <StatusEffectAction targettag="blockadeswitch">
              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
            </StatusEffectAction>
          </Success>
          <Failure>
            <Label name="retry" />
            <ConversationAction text="EventText.unlockpatheuropanridge.c2" speakertag="unlockpathnpc" invokertag="unlock_player" dialogtype="Regular" eventsprite="captain">
              <Option text="EventText.unlockpatheuropanridge.o1">
                <CheckMoneyAction amount="4000">
                  <Success>
                    <MoneyAction amount="-4000" />
                    <SetDataAction identifier="blockadeopened" value="1" />
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpatheuropanridge.o1.c1" eventsprite="captain" />
                    <SetDataAction identifier="blockade_europanridge_coalition_unlocked" value="true" />
                    <TriggerEventAction identifier="opendoortoblockade" />
                    <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
                    <StatusEffectAction targettag="blockadeswitch">
                      <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                    </StatusEffectAction>
                  </Success>
                  <Failure>
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpatheuropanridge.o1.nomoney" eventsprite="captain" />
                    <ClearTagAction tag="unlock_player" />
                    <GoTo name="retry" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="EventText.unlockpath.refusebribe">
                <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpatheuropanridge.o2.c1" eventsprite="captain" />
                <ClearTagAction tag="unlock_player" />
                <GoTo name="retry" />
              </Option>
            </ConversationAction>
          </Failure>
        </CheckReputationAction>
        <Label name="skip" />
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockpathaphoticplateau" commonness="1" unlockpathevent="true" unlockpathtooltip="lockedpathtooltipcoalitionreputation" unlockpathreputation="50" faction="coalition" biome="theaphoticplateau">
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="watchman" targettag="unlockpathnpc" spawnlocation="Outpost" spawnpointtag="unlockpath" />
        <TriggerEventAction identifier="blockadealarm" />
        <TriggerEventAction identifier="openblockade" />
        <CheckDataAction identifier="blockade_aphoticplateau_coalition_unlocked" condition="true">
          <Success>
            <Goto name="skip" />
          </Success>
        </CheckDataAction>
        <CheckReputationAction targettype="Location" condition="gte 50">
          <Success>
            <ConversationAction text="EventText.unlockpathaphoticplateau.c1" speakertag="unlockpathnpc" dialogtype="Regular" />
            <SetDataAction identifier="blockadeopened" value="1" />
            <SetDataAction identifier="blockade_aphoticplateau_coalition_unlocked" value="true" />
            <TriggerEventAction identifier="opendoortoblockade" />
            <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
            <StatusEffectAction targettag="blockadeswitch">
              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
            </StatusEffectAction>
          </Success>
          <Failure>
            <Label name="retry" />
            <ConversationAction text="EventText.unlockpathaphoticplateau.c2" speakertag="unlockpathnpc" invokertag="unlock_player" dialogtype="Regular" eventsprite="captain">
              <Option text="EventText.unlockpathaphoticplateau.o1">
                <CheckMoneyAction amount="8000">
                  <Success>
                    <MoneyAction amount="-8000" />
                    <SetDataAction identifier="blockadeopened" value="1" />
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathaphoticplateau.o1.c1" eventsprite="captain" />
                    <SetDataAction identifier="blockade_aphoticplateau_coalition_unlocked" value="true" />
                    <TriggerEventAction identifier="opendoortoblockade" />
                    <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
                    <StatusEffectAction targettag="blockadeswitch">
                      <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                    </StatusEffectAction>
                  </Success>
                  <Failure>
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathaphoticplateau.o1.nomoney" eventsprite="captain" />
                    <ClearTagAction tag="unlock_player" />
                    <GoTo name="retry" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="EventText.unlockpath.refusebribe">
                <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathaphoticplateau.o2.c1" eventsprite="captain" />
                <ClearTagAction tag="unlock_player" />
                <GoTo name="retry" />
              </Option>
            </ConversationAction>
          </Failure>
        </CheckReputationAction>
        <Label name="skip" />
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockpathgreatsea" commonness="1" unlockpathevent="true" unlockpathtooltip="lockedpathtooltipcoalitionreputation" unlockpathreputation="75" faction="coalition" biome="thegreatsea">
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="watchman" targettag="unlockpathnpc" spawnlocation="Outpost" spawnpointtag="unlockpath" />
        <TriggerEventAction identifier="blockadealarm" />
        <TriggerEventAction identifier="openblockade" />
        <CheckDataAction identifier="blockade_greatsea_coalition_unlocked" condition="true">
          <Success>
            <Goto name="skip" />
          </Success>
        </CheckDataAction>
        <CheckReputationAction targettype="Location" condition="gte 75">
          <Success>
            <ConversationAction text="EventText.unlockpathgreatsea.c1" speakertag="unlockpathnpc" dialogtype="Regular" eventsprite="captain" />
            <SetDataAction identifier="blockadeopened" value="1" />
            <SetDataAction identifier="blockade_greatsea_coalition_unlocked" value="true" />
            <TriggerEventAction identifier="opendoortoblockade" />
            <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
            <StatusEffectAction targettag="blockadeswitch">
              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
            </StatusEffectAction>
          </Success>
          <Failure>
            <Label name="retry" />
            <ConversationAction text="EventText.unlockpathgreatsea.c2" speakertag="unlockpathnpc" invokertag="unlock_player" dialogtype="Regular" eventsprite="captain">
              <Option text="EventText.unlockpathgreatsea.o1">
                <CheckMoneyAction amount="16000">
                  <Success>
                    <MoneyAction amount="-16000" />
                    <SetDataAction identifier="blockadeopened" value="1" />
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathgreatsea.o1.c1" eventsprite="captain" />
                    <SetDataAction identifier="blockade_greatsea_coalition_unlocked" value="true" />
                    <TriggerEventAction identifier="opendoortoblockade" />
                    <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
                    <StatusEffectAction targettag="blockadeswitch">
                      <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                    </StatusEffectAction>
                  </Success>
                  <Failure>
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathgreatsea.o1.nomoney" eventsprite="captain" />
                    <ClearTagAction tag="unlock_player" />
                    <GoTo name="retry" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="EventText.unlockpath.refusebribe">
                <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathgreatsea.o2.c1" eventsprite="captain" />
                <ClearTagAction tag="unlock_player" />
                <GoTo name="retry" />
              </Option>
            </ConversationAction>
          </Failure>
        </CheckReputationAction>
        <Label name="skip" />
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockpathcoldcavernsseparatists" commonness="1" unlockpathevent="true" unlockpathtooltip="lockedpathtooltipseparatistreputation" unlockpathreputation="30" faction="separatists" biome="coldcaverns">
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="watchman" targettag="unlockpathnpc" spawnlocation="Outpost" spawnpointtag="unlockpath" />
        <TriggerEventAction identifier="blockadealarm" />
        <TriggerEventAction identifier="openblockade" />
        <CheckDataAction identifier="blockade_coldcaverns_separatists_unlocked" condition="true">
          <Success>
            <Goto name="skip" />
          </Success>
        </CheckDataAction>
        <CheckReputationAction targettype="Location" condition="gte 30">
          <Success>
            <ConversationAction text="EventText.unlockpathcoldcavernsseparatists.c1" speakertag="unlockpathnpc" dialogtype="Regular" />
            <SetDataAction identifier="blockadeopened" value="1" />
            <SetDataAction identifier="blockade_coldcaverns_separatists_unlocked" value="true" />
            <TriggerEventAction identifier="opendoortoblockade" />
            <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
            <StatusEffectAction targettag="blockadeswitch">
              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
            </StatusEffectAction>
          </Success>
          <Failure>
            <Label name="retry" />
            <ConversationAction text="eventtext.unlockpathcoldcavernsseparatists.c2" speakertag="unlockpathnpc" invokertag="unlock_player" dialogtype="Regular" eventsprite="captain">
              <Option text="EventText.unlockpathcoldcaverns.o1">
                <CheckMoneyAction amount="2000">
                  <Success>
                    <MoneyAction amount="-2000" />
                    <SetDataAction identifier="blockadeopened" value="1" />
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="eventtext.unlockpathcoldcavernsseparatists.o1.c1" eventsprite="captain" />
                    <SetDataAction identifier="blockade_coldcaverns_separatists_unlocked" value="true" />
                    <TriggerEventAction identifier="opendoortoblockade" />
                    <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
                    <StatusEffectAction targettag="blockadeswitch">
                      <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                    </StatusEffectAction>
                  </Success>
                  <Failure>
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="eventtext.unlockpathcoldcavernsseparatists.o1.nomoney" eventsprite="captain" />
                    <ClearTagAction tag="unlock_player" />
                    <GoTo name="retry" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="EventText.unlockpath.refusebribe">
                <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="eventtext.unlockpathcoldcavernsseparatists.o2.c1" eventsprite="captain" />
                <ClearTagAction tag="unlock_player" />
                <GoTo name="retry" />
              </Option>
            </ConversationAction>
          </Failure>
        </CheckReputationAction>
        <Label name="skip" />
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockpatheuropanridgeseparatists" commonness="1" unlockpathevent="true" unlockpathtooltip="lockedpathtooltipseparatistreputation" unlockpathreputation="40" faction="separatists" biome="europanridge">
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="watchman" targettag="unlockpathnpc" spawnlocation="Outpost" spawnpointtag="unlockpath" />
        <TriggerEventAction identifier="blockadealarm" />
        <TriggerEventAction identifier="openblockade" />
        <CheckDataAction identifier="blockade_europanridge_separatists_unlocked" condition="true">
          <Success>
            <Goto name="skip" />
          </Success>
        </CheckDataAction>
        <CheckReputationAction targettype="Location" condition="gte 40">
          <Success>
            <ConversationAction text="eventtext.unlockpatheuropanridgeseparatists.c1" speakertag="unlockpathnpc" dialogtype="Regular" />
            <SetDataAction identifier="blockadeopened" value="1" />
            <SetDataAction identifier="blockade_europanridge_separatists_unlocked" value="true" />
            <TriggerEventAction identifier="opendoortoblockade" />
            <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
            <StatusEffectAction targettag="blockadeswitch">
              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
            </StatusEffectAction>
          </Success>
          <Failure>
            <Label name="retry" />
            <ConversationAction text="EventText.unlockpatheuropanridge.c2" speakertag="unlockpathnpc" invokertag="unlock_player" dialogtype="Regular" eventsprite="captain">
              <Option text="EventText.unlockpatheuropanridge.o1">
                <CheckMoneyAction amount="4000">
                  <Success>
                    <MoneyAction amount="-4000" />
                    <SetDataAction identifier="blockadeopened" value="1" />
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpatheuropanridge.o1.c1" eventsprite="captain" />
                    <SetDataAction identifier="blockade_europanridge_separatists_unlocked" value="true" />
                    <TriggerEventAction identifier="opendoortoblockade" />
                    <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
                    <StatusEffectAction targettag="blockadeswitch">
                      <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                    </StatusEffectAction>
                  </Success>
                  <Failure>
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpatheuropanridge.o1.nomoney" eventsprite="captain" />
                    <ClearTagAction tag="unlock_player" />
                    <GoTo name="retry" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="EventText.unlockpath.refusebribe">
                <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpatheuropanridge.o2.c1" eventsprite="captain" />
                <ClearTagAction tag="unlock_player" />
                <GoTo name="retry" />
              </Option>
            </ConversationAction>
          </Failure>
        </CheckReputationAction>
        <Label name="skip" />
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockpathaphoticplateauseparatists" commonness="1" unlockpathevent="true" unlockpathtooltip="lockedpathtooltipseparatistreputation" unlockpathreputation="50" faction="separatists" biome="theaphoticplateau">
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="watchman" targettag="unlockpathnpc" spawnlocation="Outpost" spawnpointtag="unlockpath" />
        <TriggerEventAction identifier="blockadealarm" />
        <TriggerEventAction identifier="openblockade" />
        <CheckDataAction identifier="blockade_aphoticplateau_separatists_unlocked" condition="true">
          <Success>
            <Goto name="skip" />
          </Success>
        </CheckDataAction>
        <CheckReputationAction targettype="Location" condition="gte 50">
          <Success>
            <ConversationAction text="EventText.unlockpathaphoticplateauseparatists.c1" speakertag="unlockpathnpc" dialogtype="Regular" />
            <SetDataAction identifier="blockadeopened" value="1" />
            <SetDataAction identifier="blockade_aphoticplateau_separatists_unlocked" value="true" />
            <TriggerEventAction identifier="opendoortoblockade" />
            <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
            <StatusEffectAction targettag="blockadeswitch">
              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
            </StatusEffectAction>
          </Success>
          <Failure>
            <Label name="retry" />
            <ConversationAction text="EventText.unlockpathaphoticplateau.c2" speakertag="unlockpathnpc" invokertag="unlock_player" dialogtype="Regular" eventsprite="captain">
              <Option text="EventText.unlockpathaphoticplateau.o1">
                <CheckMoneyAction amount="8000">
                  <Success>
                    <MoneyAction amount="-8000" />
                    <SetDataAction identifier="blockadeopened" value="1" />
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="eventtext.unlockpathaphoticplateauseparatists.o1.c1" eventsprite="captain" />
                    <SetDataAction identifier="blockade_aphoticplateau_separatists_unlocked" value="true" />
                    <TriggerEventAction identifier="opendoortoblockade" />
                    <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
                    <StatusEffectAction targettag="blockadeswitch">
                      <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                    </StatusEffectAction>
                  </Success>
                  <Failure>
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathaphoticplateau.o1.nomoney" eventsprite="captain" />
                    <ClearTagAction tag="unlock_player" />
                    <GoTo name="retry" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="EventText.unlockpath.refusebribe">
                <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathaphoticplateau.o2.c1" eventsprite="captain" />
                <ClearTagAction tag="unlock_player" />
                <GoTo name="retry" />
              </Option>
            </ConversationAction>
          </Failure>
        </CheckReputationAction>
        <Label name="skip" />
      </ScriptedEvent>
      <ScriptedEvent identifier="unlockpathgreatseaseparatists" commonness="1" unlockpathevent="true" unlockpathtooltip="lockedpathtooltipseparatistreputation" unlockpathreputation="75" faction="separatists" biome="thegreatsea">
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="watchman" targettag="unlockpathnpc" spawnlocation="Outpost" spawnpointtag="unlockpath" />
        <TriggerEventAction identifier="blockadealarm" />
        <TriggerEventAction identifier="openblockade" />
        <CheckDataAction identifier="blockade_greatsea_separatists_unlocked" condition="true">
          <Success>
            <Goto name="skip" />
          </Success>
        </CheckDataAction>
        <CheckReputationAction targettype="Location" condition="gte 75">
          <Success>
            <ConversationAction text="eventtext.unlockpathgreatseaseparatists.c1" speakertag="unlockpathnpc" dialogtype="Regular" eventsprite="captain" />
            <SetDataAction identifier="blockadeopened" value="1" />
            <SetDataAction identifier="blockade_greatsea_separatists_unlocked" value="true" />
            <TriggerEventAction identifier="opendoortoblockade" />
            <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
            <StatusEffectAction targettag="blockadeswitch">
              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
            </StatusEffectAction>
          </Success>
          <Failure>
            <Label name="retry" />
            <ConversationAction text="EventText.unlockpathgreatsea.c2" speakertag="unlockpathnpc" invokertag="unlock_player" dialogtype="Regular" eventsprite="captain">
              <Option text="EventText.unlockpathgreatsea.o1">
                <CheckMoneyAction amount="16000">
                  <Success>
                    <MoneyAction amount="-16000" />
                    <SetDataAction identifier="blockadeopened" value="1" />
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathgreatsea.o1.c1" eventsprite="captain" />
                    <SetDataAction identifier="blockade_greatsea_separatists_unlocked" value="true" />
                    <TriggerEventAction identifier="opendoortoblockade" />
                    <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
                    <StatusEffectAction targettag="blockadeswitch">
                      <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                    </StatusEffectAction>
                  </Success>
                  <Failure>
                    <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathgreatsea.o1.nomoney" eventsprite="captain" />
                    <ClearTagAction tag="unlock_player" />
                    <GoTo name="retry" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="EventText.unlockpath.refusebribe">
                <ConversationAction speakertag="unlockpathnpc" waitforinteraction="false" targettag="unlock_player" text="EventText.unlockpathgreatsea.o2.c1" eventsprite="captain" />
                <ClearTagAction tag="unlock_player" />
                <GoTo name="retry" />
              </Option>
            </ConversationAction>
          </Failure>
        </CheckReputationAction>
        <Label name="skip" />
      </ScriptedEvent>
      <!-- opens the door leading to blockade lever, triggered by events above -->
      <ScriptedEvent identifier="opendoortoblockade" commonness="1">
        <TagAction criteria="itemtag:blockadedoor" submarinetype="Outpost" tag="blockadedoor" />
        <TagAction criteria="itemtag:blockadebutton" submarinetype="Outpost" tag="blockadebutton" />
        <TagAction criteria="itemtag:blockadesensor" submarinetype="Outpost" tag="blockadesensor" />
        <TagAction criteria="itemtag:blockadedoorstatus" tag="blockadedoorstatus" />
        <StatusEffectAction targettag="blockadedoorstatus">
          <StatusEffect target="this" lightcolor="0,255,0,255" setvalue="true" />
        </StatusEffectAction>
        <StatusEffectAction targettag="blockadebutton">
          <StatusEffect target="this" noninteractable="true" setvalue="true" />
        </StatusEffectAction>
        <StatusEffectAction targettag="blockadesensor">
          <StatusEffect target="This" targetitemcomponent="MotionSensor" isActive="false" />
          <StatusEffect target="This" condition="-100" setvalue="true" />
        </StatusEffectAction>
        <WaitAction time="1" />
        <StatusEffectAction targettag="blockadedoor">
          <StatusEffect target="this" ShouldBeOpen="true" noninteractable="true" setvalue="true" />
        </StatusEffectAction>
        <SetDataAction identifier="blockadeopened" value="1" />
      </ScriptedEvent>
      <!-- simple event that unlocks the path by flicking a lever -->
      <ScriptedEvent identifier="openblockade" commonness="1">
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="itemtag:blockadeswitch" submarinetype="Outpost" tag="blockadeswitch" />
        <TutorialHighlightAction targetcharacter="player" targettag="blockadeswitch" />
        <EventObjectiveAction targettag="player" type="add" identifier="eventtext.openblockade.gotolever" />
        <Label name="retry" />
        <CheckConditionalAction targettag="blockadeswitch" targetitemcomponent="Controller" State="True">
          <Success>
            <StatusEffectAction targettag="blockadeswitch">
              <StatusEffect target="this" noninteractable="true" setvalue="true" />
            </StatusEffectAction>
            <StatusEffectAction targettag="blockadeswitch">
              <StatusEffect target="this">
                <Sound file="Content/Items/Door/Door2.ogg" range="10000" dontmuffle="true" volume="3" frequencymultiplier="0.25" />
                <Explosion range="5000.0" camerashake="2" stun="0" force="0.0" flames="false" smoke="false" flash="false" shockwave="false" sparks="false" underwaterbubble="false" />
              </StatusEffect>
            </StatusEffectAction>
            <UnlockPathAction />
            <EventObjectiveAction targettag="player" type="completeandremove" identifier="eventtext.openblockade.gotolever" />
          </Success>
          <Failure>
            <WaitAction time="1" />
            <Goto name="retry" />
          </Failure>
        </CheckConditionalAction>
      </ScriptedEvent>
      <!-- triggers alarm if it detects a player in the blockade hulls without negociating with NPC -->
      <ScriptedEvent identifier="blockadealarm">
        <CheckMissionAction MissionTag="outposttakeovermission" Type="Current">
          <Success>
            <!-- do not activate if takeover active -->
          </Success>
          <Failure>
            <TagAction criteria="player" tag="player" />
            <TagAction criteria="hullname:commandroom" tag="blockadehull" submarinetype="Outpost" />
            <TagAction criteria="itemtag:securityalarm" submarinetype="Outpost" tag="alarm" />
            <!-- spawns security in the blockade room -->
            <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="securitynpc[faction]" targettag="security" spawnlocation="Outpost" spawnpointtag="blockadehull" />
            <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="securitynpc[faction]" targettag="security" spawnlocation="Outpost" spawnpointtag="blockadehull" />
            <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="securitynpc[faction]" targettag="security" spawnlocation="Outpost" spawnpointtag="blockadehull" />
            <TriggerAction target1tag="player" target2tag="blockadehull" applytotarget1="triggerer_player" radius="10" disableincombat="false" disableiftargetincapacitated="false" waitforinteraction="false" />
            <CheckDataAction identifier="blockadeopened" condition="eq 1">
              <Success>
                <SetDataAction identifier="blockadeopened" value="0" />
              </Success>
              <Failure>
                <StatusEffectAction targettag="alarm">
                  <StatusEffect IsOn="true" target="This" setvalue="true" />
                </StatusEffectAction>
                <StatusEffectAction targettag="security">
                  <StatusEffect target="this">
                    <Forcesay message="eventtext.blockadealarm.breakin" sayinradio="true" />
                  </StatusEffect>
                </StatusEffectAction>
                <StatusEffectAction targettag="blockadehull">
                  <StatusEffect target="this" duration="3">
                    <Sound file="Content/Sounds/Radiostatic.ogg" range="4000" volume="2" loop="true" />
                  </StatusEffect>
                </StatusEffectAction>
                <ReputationAction targettype="Location" increase="-25" />
                <SetDataAction identifier="blockadeopened" value="0" />
                <WaitAction time="1" />
                <Label name="tagcombatloop" />
                <TriggerAction target1tag="player" target2tag="blockadehull" applytotarget1="triggerer_player" radius="10" disableincombat="false" disableiftargetincapacitated="false" waitforinteraction="false" />
                <CombatAction combatmode="Offensive" npctag="securitynpc" enemytag="triggerer_player" isinstigator="false" witnessreaction="retreat" />
                <WaitAction time="5" />
                <ClearTagAction tag="triggerer_player" />
                <Goto name="tagcombatloop" />
              </Failure>
            </CheckDataAction>
          </Failure>
        </CheckMissionAction>
      </ScriptedEvent>
      <!--/////////////////// BANDIT EVENTS ////////////////
    /////////////////// BANDIT EVENTS ////////////////
    /////////////////// BANDIT EVENTS //////////////// -->
      <!-- TODO: tag the team instead -->
      <ScriptedEvent identifier="pirateoutpostevent">
        <TagAction criteria="player" tag="player" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="speciesname:Human" submarinetype="Outpost" team="FriendlyNPC" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="speciesname:Human" submarinetype="Outpost" team="Team2" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="itemtag:pirateentrance" tag="pirateentrance" ContinueIfNoTargetsFound="false" />
        <TagAction criteria="itemtag:navterminal" tag="commsrelay" submarinetype="player" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="itemtag:piratechair" tag="piratechair" ContinueIfNoTargetsFound="true" />
        <NPCChangeTeamAction npctag="piratenpc" teamtag="FriendlyNPC" />
        <WaitAction time="1" />
        <CheckReputationAction targettype="faction" identifier="bandits" condition="gte -12">
          <!-- Must have over -12 pirate rep, if under pirates are hostile and event doesnt trigger -->
          <Success>
            <TriggerEventAction identifier="piratecheckfordead" />
            <!-- continue -->
          </Success>
          <Failure>
            <Goto name="end" />
          </Failure>
        </CheckReputationAction>
        <CheckReputationAction targettype="faction" identifier="coalition" condition="gte 60">
          <!-- Pirates turn hostile if too much coalition rep -->
          <Success>
            <NPCChangeTeamAction npctag="piratenpc" teamtag="Team2" />
            <TriggerAction target1tag="commsrelay" target2tag="player" applytotarget2="listener_player" radius="300" waitforinteraction="true" />
            <ConversationAction text="eventtext.commsrelay.piratehaven" dialogtype="Small" targettag="listener_player">
              <Option text="eventtext.option.listen">
                <StatusEffectAction targettag="commsrelay">
                  <StatusEffect target="This" duration="10.2">
                    <Sound file="%ModDir:2532991202%/Sounds/Events/PirateBroadcast.ogg" range="500" volume="1" loop="true" />
                  </StatusEffect>
                </StatusEffectAction>
                <ConversationAction text="eventtext.commsrelay.piratehaven.answer" dialogtype="Small" targettag="listener_player" eventsprite="piratehaven" endconversation="true" />
              </Option>
              <Option text="eventtext.option.ignore" endconversation="true"></Option>
            </ConversationAction>
          </Success>
          <!-- Choose to negociate or attack -->
          <Failure>
            <SpawnAction NPCSetIdentifier="outpostnpcspirate" NPCIdentifier="securitynpcpirate" TargetTag="guard" SpawnPointTag="guard" />
            <SpawnAction NPCSetIdentifier="outpostnpcspirate" NPCIdentifier="securitynpcpirate" TargetTag="dockingguard" SpawnPointTag="dockingguard" />
            <NPCOperateItemAction npctag="guard" targettag="piratechair" ItemComponentName="Controller" operate="true" />
            <TriggerEventAction identifier="piratehavenalarm" />
            <!-- Toll part, reuse triggerer_player if this is bugged -->
            <Label name="patrol" />
            <ClearTagAction tag="pso_trig_player" />
            <TriggerAction target1tag="guard" target2tag="player" applytotarget2="pso_trig_player" radius="250" disableincombat="true" disableiftargetincapacitated="true" waitforinteraction="true" allowmultipletargets="true" />
            <CheckReputationAction targettype="faction" identifier="coalition" condition="lt 20">
              <Success>
                <TriggerAction target1tag="guard" target2tag="pso_trig_player" radius="200" waitforinteraction="false" />
                <Label name="psooptions" />
                <ConversationAction targettag="pso_trig_player" text="eventtext.piratesecurityofficer.toll.low.interact" eventsprite="piratehaven">
                  <!-- Pay the toll, get in, + reputation -->
                  <Option text="eventtext.piratesecurityofficer.highrep.pay.high">
                    <CheckMoneyAction Amount="1000">
                      <Success>
                        <MoneyAction amount="-1000" />
                        <ReputationAction targettype="Faction" identifier="bandits" increase="5" />
                        <ConversationAction text="eventtext.piratesecurityofficer.highrep.paytoll.success" targettag="pso_trig_player" eventsprite="piratehaven" />
                        <SetDataAction identifier="piratehavenunlocked" value="1" />
                        <StatusEffectAction targettag="pirateentrance">
                          <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                        </StatusEffectAction>
                        <ConversationAction text="eventtext.piratesecurityofficer.highrep.paytoll.success.extra.reputation" targettag="pso_trig_player" eventsprite="piratehaven">
                          <!-- Option to pay extra to lower your coalition reputation? -->
                          <Option text="eventtext.piratesecurityofficer.highrep.paytoll.success.extra.reputation.buy">
                            <CheckMoneyAction Amount="1000">
                              <Success>
                                <MoneyAction amount="-1000" />
                                <ReputationAction targettype="Faction" identifier="coalition" increase="-20" />
                                <ReputationAction targettype="Faction" identifier="bandits" increase="5" />
                                <ConversationAction text="eventtext.piratesecurityofficer.highrep.paytoll.success.extra.reputation.buy.success" targettag="pso_trig_player" />
                                <ClearTagAction tag="pso_trig_player" />
                              </Success>
                              <Failure>
                                <ConversationAction text="eventtext.piratesecurityofficer.highrep.paytoll.success.extra.reputation.buy.failure" />
                                <ClearTagAction tag="pso_trig_player" />
                              </Failure>
                            </CheckMoneyAction>
                          </Option>
                          <Option text="eventtext.option.leave">
                            <ConversationAction text="eventtext.piratesecurityofficer.highrep.paytoll.success.extra.reputation.declined" targettag="pso_trig_player" />
                            <ClearTagAction tag="pso_trig_player" />
                          </Option>
                        </ConversationAction>
                      </Success>
                      <Failure>
                        <ConversationAction targettag="pso_trig_player" text="eventtext.piratesecurityofficer.highrep.paytoll.failure" />
                        <GoTo name="psooptions" />
                      </Failure>
                    </CheckMoneyAction>
                  </Option>
                  <!-- Haggle (helm skill check, get in but failure locks armory) -->
                  <Option text="eventtext.piratesecurityofficer.highrep.pay.medium">
                    <CheckMoneyAction Amount="750">
                      <Success>
                        <SkillCheckAction requiredskill="helm" requiredlevel="60" targettag="pso_trig_player">
                          <Success>
                            <MoneyAction amount="-750" />
                            <ConversationAction text="eventtext.piratesecurityofficer.highrep.haggle.success" targettag="pso_trig_player" />
                            <SetDataAction identifier="piratehavenunlocked" value="1" />
                            <StatusEffectAction targettag="pirateentrance">
                              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                            </StatusEffectAction>
                            <ClearTagAction tag="pso_trig_player" />
                          </Success>
                          <Failure>
                            <MoneyAction amount="-750" />
                            <ConversationAction targettag="pso_trig_player" text="eventtext.piratesecurityofficer.highrep.haggle.failure" />
                            <SetDataAction identifier="piratehavenunlocked" value="1" />
                            <StatusEffectAction targettag="pirateentrance">
                              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                            </StatusEffectAction>
                            <ClearTagAction tag="pso_trig_player" />
                            <TriggerEventAction identifier="piratearmorylocked" />
                          </Failure>
                        </SkillCheckAction>
                      </Success>
                      <Failure>
                        <ConversationAction targettag="pso_trig_player" text="eventtext.piratesecurityofficer.highrep.haggle.rejected" />
                        <GoTo name="psooptions" />
                      </Failure>
                    </CheckMoneyAction>
                  </Option>
                  <!-- Plead. -reputation (very low success chance), no armory. If no money, attack -->
                  <Option text="eventtext.piratesecurityofficer.highrep.pay.low">
                    <CheckMoneyAction Amount="250">
                      <Success>
                        <SkillCheckAction requiredskill="helm" requiredlevel="100" targettag="pso_trig_player">
                          <Success>
                            <MoneyAction amount="-250" />
                            <ConversationAction text="eventtext.piratesecurityofficer.highrep.plead.success" targettag="pso_trig_player" />
                            <SetDataAction identifier="piratehavenunlocked" value="1" />
                            <StatusEffectAction targettag="pirateentrance">
                              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                            </StatusEffectAction>
                            <ClearTagAction tag="pso_trig_player" />
                            <TriggerEventAction identifier="piratearmorylocked" />
                          </Success>
                          <Failure>
                            <MoneyAction amount="-250" />
                            <CheckItemAction targettag="pso_trig_player" itemtags="clothing" applytagtoitem="playerclothes">
                              <Success>
                                <Label name="removeclothes" />
                                <ConversationAction targettag="pso_trig_player" text="eventtext.piratesecurityofficer.highrep.plead.undress">
                                  <Option text="eventtext.piratesecurityofficer.highrep.plead.UhOh">
                                    <ConversationAction targettag="pso_trig_player" text="eventtext.piratesecurityofficer.highrep.plead.failure" fadetoblack="true" ContinueAutomatically="true" />
                                    <Waitaction time="1" />
                                    <AfflictionAction targettag="pso_trig_player" affliction="stun" strength="6" />
                                    <AfflictionAction targettag="pso_trig_player" affliction="blunttrauma" strength="3" limbtype="head" />
                                    <StatusEffectAction targettag="playerclothes">
                                      <StatusEffect target="This" spawnedincurrentoutpost="true" allowstealing="false" setvalue="true">
                                        <DropItem />
                                      </StatusEffect>
                                    </StatusEffectAction>
                                    <StatusEffectAction targettag="pso_trig_player">
                                      <StatusEffect target="This">
                                        <Sound file="Content/Sounds/Damage/Limbblunt4.ogg" range="800" volume="2" frequencymultiplier="1" />
                                        <Sound file="Content/Sounds/Impact/SoftImpact1.ogg" range="800" volume="3" frequencymultiplier="1" />
                                        <Sound file="Content/Items/Medical/Bandage2.ogg" range="800" volume="2" frequencymultiplier="0.5" />
                                      </StatusEffect>
                                    </StatusEffectAction>
                                    <SetDataAction identifier="piratehavenunlocked" value="1" />
                                    <StatusEffectAction targettag="pirateentrance">
                                      <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                                    </StatusEffectAction>
                                    <CombatAction combatmode="Arrest" npctag="dockingguard" enemytag="pso_trig_player" isinstigator="true" guardreaction="none" witnessreaction="none" />
                                    <ClearTagAction tag="pso_trig_player" />
                                    <TriggerEventAction identifier="piratearmorylocked" />
                                  </Option>
                                </ConversationAction>
                              </Success>
                              <Failure>
                                <Goto name="removeclothes" />
                              </Failure>
                            </CheckItemAction>
                          </Failure>
                        </SkillCheckAction>
                      </Success>
                      <Failure>
                        <ConversationAction targettag="pso_trig_player" text="eventtext.piratesecurityofficer.highrep.plead.rejected" ContinueAutomatically="true" endconversation="true" />
                        <GoTo name="attack" />
                      </Failure>
                    </CheckMoneyAction>
                  </Option>
                  <Option text="eventtext.piratesecurityofficer.toll.option.insult">
                    <ReputationAction targettype="faction" identifier="bandits" increase="-5" />
                    <!-- TODO: NEXTUPDATE use Forcesay to make NPCs speak instead of dialog box -->
                    <ConversationAction text="eventtext.piratesecurityofficer.toll.option.insult.answer" targettag="pso_trig_player" ContinueAutomatically="true" endconversation="true" />
                    <GoTo name="attack" />
                  </Option>
                </ConversationAction>
              </Success>
              <Failure>
                <!-- If large coalition rep -->
                <CheckReputationAction targettype="faction" identifier="coalition" condition="lt 60">
                  <Success>
                    <TriggerAction target1tag="guard" target2tag="pso_trig_player" radius="200" waitforinteraction="false" />
                    <Label name="psooptions2" />
                    <ConversationAction targettag="pso_trig_player" text="eventtext.piratesecurityofficer.toll.high.interact" eventsprite="piratehaven">
                      <!-- Pay the toll, get in, + reputation -->
                      <Option text="eventtext.piratesecurityofficer.lowrep.pay.high">
                        <CheckMoneyAction Amount="2000">
                          <Success>
                            <MoneyAction amount="-2000" />
                            <ConversationAction text="eventtext.piratesecurityofficer.lowrep.paytoll.success" targettag="pso_trig_player" />
                            <SetDataAction identifier="piratehavenunlocked" value="1" />
                            <StatusEffectAction targettag="pirateentrance">
                              <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                            </StatusEffectAction>
                            <ReputationAction targettype="Faction" identifier="coalition" increase="-5" />
                            <ReputationAction targettype="Faction" identifier="bandits" increase="5" />
                            <ConversationAction text="eventtext.piratesecurityofficer.lowrep.paytoll.success.extra.reputation" targettag="pso_trig_player">
                              <!-- Option to pay extra to lower your coalition reputation? -->
                              <Option text="eventtext.piratesecurityofficer.lowrep.paytoll.success.extra.reputation.buy">
                                <CheckMoneyAction Amount="1000">
                                  <Success>
                                    <MoneyAction amount="-1000" />
                                    <ReputationAction targettype="Faction" identifier="coalition" increase="-20" />
                                    <ReputationAction targettype="Faction" identifier="bandits" increase="5" />
                                    <ConversationAction text="eventtext.piratesecurityofficer.lowrep.paytoll.success.extra.reputation.buy.success" targettag="pso_trig_player" />
                                    <ClearTagAction tag="pso_trig_player" />
                                  </Success>
                                  <Failure>
                                    <ConversationAction text="eventtext.piratesecurityofficer.lowrep.paytoll.success.extra.reputation.buy.failure" />
                                    <ClearTagAction tag="pso_trig_player" />
                                  </Failure>
                                </CheckMoneyAction>
                              </Option>
                              <Option text="eventtext.option.leave">
                                <ConversationAction text="eventtext.piratesecurityofficer.lowrep.paytoll.success.extra.reputation.declined" targettag="pso_trig_player" />
                                <ClearTagAction tag="pso_trig_player" />
                              </Option>
                            </ConversationAction>
                          </Success>
                          <Failure>
                            <ConversationAction targettag="pso_trig_player" text="eventtext.piratesecurityofficer.lowrep.paytoll.failure" />
                            <GoTo name="psooptions2" />
                          </Failure>
                        </CheckMoneyAction>
                      </Option>
                      <!-- Haggle (helm skill check, get in but failure locks armory) -->
                      <Option text="eventtext.piratesecurityofficer.lowrep.pay.medium">
                        <CheckMoneyAction Amount="1500">
                          <Success>
                            <SkillCheckAction requiredskill="helm" requiredlevel="60" targettag="pso_trig_player">
                              <Success>
                                <MoneyAction amount="-1500" />
                                <ConversationAction text="eventtext.piratesecurityofficer.lowrep.haggle.success" targettag="pso_trig_player" />
                                <SetDataAction identifier="piratehavenunlocked" value="1" />
                                <StatusEffectAction targettag="pirateentrance">
                                  <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                                </StatusEffectAction>
                                <ClearTagAction tag="pso_trig_player" />
                              </Success>
                              <Failure>
                                <MoneyAction amount="-1500" />
                                <ConversationAction targettag="pso_trig_player" text="eventtext.piratesecurityofficer.lowrep.haggle.failure" />
                                <SetDataAction identifier="piratehavenunlocked" value="1" />
                                <StatusEffectAction targettag="pirateentrance">
                                  <StatusEffect target="This" State="true" setvalue="true" disabledeltatime="true" />
                                </StatusEffectAction>
                                <ClearTagAction tag="pso_trig_player" />
                                <TriggerEventAction identifier="piratearmorylocked" />
                              </Failure>
                            </SkillCheckAction>
                          </Success>
                          <Failure>
                            <ConversationAction targettag="pso_trig_player" text="eventtext.piratesecurityofficer.toll.option.haggle.rejected" />
                            <GoTo name="psooptions2" />
                          </Failure>
                        </CheckMoneyAction>
                      </Option>
                      <Option text="eventtext.piratesecurityofficer.toll.option.insult">
                        <ReputationAction targettype="Faction" identifier="bandits" increase="-5" />
                        <ConversationAction text="eventtext.piratesecurityofficer.toll.option.insult.answer" targettag="pso_trig_player" ContinueAutomatically="true" endconversation="true" />
                        <Label name="attack" />
                        <CombatAction combatmode="Offensive" npctag="guard" enemytag="pso_trig_player" isinstigator="false" guardreaction="none" witnessreaction="none" cooldown="10" />
                        <CombatAction combatmode="Arrest" npctag="dockingguard" enemytag="pso_trig_player" isinstigator="false" guardreaction="none" witnessreaction="none" cooldown="10" />
                        <WaitAction time="30" />
                        <GoTo name="patrol" />
                      </Option>
                    </ConversationAction>
                  </Success>
                </CheckReputationAction>
              </Failure>
            </CheckReputationAction>
          </Failure>
        </CheckReputationAction>
        <Label name="end" />
      </ScriptedEvent>
      <!-- triggers alarm if it detects a player in the pirate outpost without negociating with NPC -->
      <ScriptedEvent identifier="piratehavenalarm">
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="hullname:armory" tag="piratehull" submarinetype="Outpost" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="hullname:centralaccessshaft" tag="piratehull" submarinetype="Outpost" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="hullname:centralaccesspassage" tag="piratehull" submarinetype="Outpost" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="hullname:crewquarters" tag="piratehull" submarinetype="Outpost" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="hullname:electrical" tag="piratehull" submarinetype="Outpost" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="hullname:engineering" tag="piratehull" submarinetype="Outpost" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="hullname:medbay" tag="piratehull" submarinetype="Outpost" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="hullname:reactorroom" tag="piratehull" submarinetype="Outpost" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="hullname:research" tag="piratehull" submarinetype="Outpost" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="hullname:subtopright" tag="piratehull" submarinetype="Outpost" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="speciesname:Human" submarinetype="Outpost" team="FriendlyNPC" tag="piratenpc" />
        <TagAction criteria="itemtag:securityalarm" submarinetype="Outpost" tag="alarm" />
        <TriggerAction target1tag="player" target2tag="piratehull" applytotarget1="triggerer_player" radius="10" disableincombat="false" disableiftargetincapacitated="false" waitforinteraction="false" allowmultipletargets="true" />
        <CheckDataAction identifier="piratehavenunlocked" condition="eq 1">
          <Success>
            <SetDataAction identifier="piratehavenunlocked" value="0" />
          </Success>
          <Failure>
            <StatusEffectAction targettag="alarm">
              <StatusEffect IsOn="true" target="This" setvalue="true" />
            </StatusEffectAction>
            <!-- TODO: NEXTUPDATE use Forcesay to make NPCs speak instead of dialog box -->
            <ConversationAction text="eventtext.piratehavenalarm.breakin" dialogtype="small" eventsprite="firefight" ContinueAutomatically="true" />
            <StatusEffectAction targettag="piratehull">
              <StatusEffect target="this" duration="3" oneshot="true">
                <Sound file="Content/Sounds/Radiostatic.ogg" range="4000" volume="2" loop="true" />
              </StatusEffect>
            </StatusEffectAction>
            <ReputationAction targettype="Location" increase="-5" />
            <NPCChangeTeamAction npctag="piratenpc" teamtag="Team2" />
            <SetDataAction identifier="piratehavenunlocked" value="0" />
          </Failure>
        </CheckDataAction>
      </ScriptedEvent>
      <!-- Pirate Divers -->
      <ScriptedEvent identifier="piratediversoutpost">
        <CheckDataAction identifier="piratediversnorepeat" condition="eq 0">
          <Failure></Failure>
          <Success>
            <CheckReputationAction targettype="faction" identifier="bandits" condition="lt -5">
              <Success>
                <TagAction criteria="hullname:airlock" tag="airlock" submarinetype="Player" />
                <TagAction criteria="hullname:airlock" tag="airlock" submarinetype="Outpost" />
                <TagAction criteria="itemtag:navterminal" tag="navterminal" SubmarineType="Player" chooserandom="true" />
                <TagAction criteria="player" tag="player" />
                <TagAction criteria="crew" tag="crew" />
                <WaitAction time="10" />
                <SpawnAction npcsetidentifier="outpostnpcspirate" npcidentifier="commonerpirate" targettag="pirateambusher" spawnlocation="Outpost" targetmoduletags="crewpirate" spawnpointtag="pirateambusher" />
                <TriggerAction target1tag="player" target2tag="pirateambusher" applytotarget1="playertofollow" radius="50" waitforinteraction="false" />
                <NPCFollowAction npctag="pirateambusher" targettag="playertofollow" follow="true" />
                <ConversationAction targettag="playertofollow" text="eventtext.piratediversoutpost.meetambusher" endeventifinterrupted="false" dialogtype="Small" eventsprite="bandittalk">
                  <Option text="eventtext.piratediversoutpost.agree" endconversation="true">
                    <Label name="dialogstep2" />
                    <NPCFollowAction npctag="pirateambusher" targettag="playertofollow" follow="true" />
                    <WaitAction time="5" />
                    <TriggerAction target1tag="pirateambusher" target2tag="player" applytotarget2="playertofollow" radius="150" waitforinteraction="false" />
                    <ConversationAction text="eventtext.piratediversoutpost.Iwascaptain" eventsprite="bandittalk" />
                    <WaitAction time="5" />
                    <TriggerAction target1tag="pirateambusher" target2tag="player" applytotarget2="playertofollow" radius="150" waitforinteraction="false" />
                    <ConversationAction text="eventtext.piratediversoutpost.Iwascaptain2" eventsprite="bandittalk">
                      <Option text="eventtext.piratediversoutpost.goodluck" endconversation="true">
                        <Label name="dialogstep3" />
                        <NPCFollowAction npctag="pirateambusher" targettag="playertofollow" follow="true" />
                        <WaitAction time="5" />
                        <TriggerAction target1tag="pirateambusher" target2tag="player" applytotarget2="playertofollow" radius="150" waitforinteraction="false" />
                        <ConversationAction text="eventtext.piratediversoutpost.offersbooze" eventsprite="bandittalk">
                          <Option text="eventtext.piratediversoutpost.takebooze">
                            <ConversationAction text="eventtext.piratediversoutpost.drinkup" eventsprite="bandittalk" />
                            <SpawnAction itemidentifier="he-rum" targetinventory="playertofollow" />
                            <SpawnAction itemidentifier="he-rum" targetinventory="playertofollow" />
                            <SpawnAction itemidentifier="he-rum" targetinventory="playertofollow" />
                            <NPCFollowAction npctag="pirateambusher" targettag="playertofollow" follow="false" />
                            <!-- Go to part 2 -->
                            <GoTo name="pirateinvaders" />
                          </Option>
                          <Option text="eventtext.piratediversoutpost.getthehelloff">
                            <ConversationAction text="eventtext.piratediversoutpost.dontgetalong" eventsprite="bandittalk" endconversation="true" />
                            <NPCFollowAction npctag="pirateambusher" targettag="playertofollow" follow="false" />
                            <!-- Go to part 2 -->
                            <GoTo name="pirateinvaders" />
                          </Option>
                        </ConversationAction>
                      </Option>
                      <Option text="eventtext.piratediversoutpost.dontcare" endconversation="true">
                        <GoTo name="dialogstep3" />
                      </Option>
                    </ConversationAction>
                  </Option>
                  <Option text="eventtext.piratediversoutpost.buggeroff" endconversation="true">
                    <GoTo name="dialogstep2" />
                  </Option>
                </ConversationAction>
                <!-- part 2: pirates invade -->
                <Label name="pirateinvaders" />
                <WaitAction time="15" />
                <SpawnAction npcsetidentifier="pirate_npcs" npcidentifier="piratediver" targettag="piratediver" SpawnLocation="Outpost" spawnpointtag="piratedivers" teamid="Team2" amount="3" />
                <NPCFollowAction npctag="pirateambusher" targettag="airlock" follow="true" />
                <NPCFollowAction npctag="piratediver" targettag="airlock" follow="true" />
                <TriggerAction target1tag="piratediver" target2tag="airlock" applytotarget1="boardedpirate" radius="100" waitforinteraction="false" />
                <WaitAction time="3" />
                <StatusEffectAction targettag="piratediver">
                  <StatusEffect target="this">
                    <Sound file="Content/Items/Tools/Crowbar.ogg" volume="3" range="2000" />
                  </StatusEffect>
                </StatusEffectAction>
                <ConversationAction targettag="player" text="eventtext.piratediversoutpost.soundinairlock" dialogtype="Small" eventsprite="ventinside" ContinueAutomatically="true" />
                <WaitAction time="2" />
                <NPCFollowAction npctag="pirateambusher" targettag="navterminal" follow="true" />
                <NPCFollowAction npctag="piratediver" targettag="navterminal" follow="true" />
                <TriggerAction target1tag="piratediver" target2tag="navterminal" applytotarget2="playertofollow" radius="400" waitforinteraction="false" />
                <NPCFollowAction npctag="piratediver" targettag="navterminal" follow="false" />
                <!-- use spoken dialogue if ever implemented -->
                <ConversationAction targettag="player" text="eventtext.piratediversoutpost.takeover" dialogtype="Small" eventsprite="firefight" ContinueAutomatically="true" />
                <SetDataAction identifier="piratediversnorepeat" operation="set" value="1" />
                <NPCChangeTeamAction npctag="pirateambusher" teamtag="Team2" />
                <NPCChangeTeamAction npctag="piratediver" teamtag="Team2" />
                <Label name="combatrefresh" />
                <TagAction criteria="player" tag="player" />
                <CombatAction combatmode="Offensive" npctag="pirateambusher" enemytag="player" isinstigator="true" guardreaction="none" witnessreaction="retreat" />
                <CombatAction combatmode="Offensive" npctag="piratediver" enemytag="crew" isinstigator="true" guardreaction="none" witnessreaction="retreat" />
                <WaitAction time="5" />
                <GoTo name="combatrefresh" />
              </Success>
              <Failure></Failure>
            </CheckReputationAction>
          </Success>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="piratearmorylocked">
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="itemtag:armorybutton" tag="armorybutton" SubmarineType="Outpost" ContinueIfNoTargetsFound="false" />
        <TagAction criteria="itemtag:armorydoor" tag="armorydoor" SubmarineType="Outpost" ContinueIfNoTargetsFound="false" />
        <SetDataAction identifier="armorylocked" value="1" />
        <StatusEffectAction targettag="armorybutton">
          <StatusEffect target="this" noninteractable="true" setvalue="true" />
        </StatusEffectAction>
        <StatusEffectAction targettag="armorydoor">
          <StatusEffect target="this" IsOpen="false" setvalue="true" />
        </StatusEffectAction>
        <TriggerEventAction identifier="piratearmoryalarm" />
        <TriggerAction target1tag="player" target2tag="armorydoor" applytotarget1="triggerer_player" waitforinteraction="true" />
        <ConversationAction targettag="triggerer_player" text="eventtext.piratearmorylocked.doorlocked">
          <Option text="eventtext.piratearmorylocked.howmuch">
            <GoTo name="payarmoryskiptrigger" />
            <Label name="payarmory" />
            <TriggerAction target1tag="player" target2tag="armorydoor" applytotarget1="triggerer_player" waitforinteraction="true" />
            <Label name="payarmoryskiptrigger" />
            <ConversationAction targettag="triggerer_player" text="eventtext.piratearmorylocked.500mk">
              <Option text="eventtext.piratearmorylocked.Pay">
                <CheckMoneyAction targettag="triggerer_player" Amount="500">
                  <Success>
                    <MoneyAction amount="-500" />
                    <ConversationAction targettag="triggerer_player" text="eventtext.piratearmorylocked.dooropens" />
                    <StatusEffectAction targettag="armorybutton">
                      <StatusEffect target="this" noninteractable="false" setvalue="true" />
                    </StatusEffectAction>
                    <SetDataAction identifier="armorylocked" value="0" />
                  </Success>
                  <Failure>
                    <ConversationAction targettag="triggerer_player" text="eventtext.piratearmorylocked.nomoney" endconversation="true" />
                    <ClearTagAction tag="triggerer_player" />
                    <GoTo name="payarmory" />
                  </Failure>
                </CheckMoneyAction>
              </Option>
              <Option text="eventtext.piratearmorylocked.noway">
                <ConversationAction targettag="triggerer_player" text="eventtext.piratearmorylocked.comeback" endconversation="true" />
                <ClearTagAction tag="triggerer_player" />
                <Goto name="payarmory" />
              </Option>
            </ConversationAction>
          </Option>
        </ConversationAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="piratearmoryalarm">
        <TagAction criteria="player" tag="player" />
        <TagAction criteria="itemtag:armorydoor" tag="armorydoor" SubmarineType="Outpost" />
        <TagAction criteria="hullname:armory" tag="armory" submarinetype="Outpost" />
        <TagAction criteria="itemtag:securityalarm" submarinetype="Outpost" tag="alarm" />
        <TriggerAction target1tag="player" target2tag="armory" applytotarget1="triggerer_player" radius="10" waitforinteraction="false" />
        <CheckDataAction identifier="armorylocked" condition="eq 0">
          <Success>
            <!-- Do nothing -->
          </Success>
          <Failure>
            <StatusEffectAction targettag="alarm">
              <StatusEffect IsOn="true" target="This" setvalue="true" />
            </StatusEffectAction>
            <!-- TODO: NEXTUPDATE use Forcesay to make NPCs speak instead of dialog box -->
            <ConversationAction text="eventtext.piratearmoryalarm.breakin" dialogtype="small" eventsprite="firefight" ContinueAutomatically="true" />
            <ReputationAction targettype="Location" increase="-35" />
            <StatusEffectAction targettag="armorydoor">
              <StatusEffect target="this" IsOpen="true" noninteractable="true" setvalue="true" />
            </StatusEffectAction>
          </Failure>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="piratestashalarm">
        <TagAction criteria="player" tag="player" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:merchantcity" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:merchantmedical" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:merchantarmory" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:subupgradenpcpirate" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:subsalesnpcpirate" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:repairnpcpirate" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:reactoroperatorpirate" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:securitynpcpirate" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:outpostmanagerpirate" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:commonerpirate" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:hrmanagerpirate" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:outpostdoctorpirate" tag="piratenpc" ContinueIfNoTargetsFound="true" />
        <NPCChangeTeamAction npctag="piratenpc" teamtag="Team2" />
        <TriggerAction target1tag="player" target2tag="piratenpc" applytotarget1="triggerer_player" applytotarget2="attacker" radius="3000" disableincombat="true" disableiftargetincapacitated="true" waitforinteraction="false" allowmultipletargets="true" />
        <CombatAction combatmode="Offensive" npctag="attacker" enemytag="player" isinstigator="true" guardreaction="none" witnessreaction="none" />
        <Label name="attackplayer" />
        <TriggerAction target1tag="player" target2tag="piratenpc" applytotarget1="triggerer_player" applytotarget2="attacker" radius="800" disableincombat="true" disableiftargetincapacitated="true" waitforinteraction="false" allowmultipletargets="true" />
        <CombatAction combatmode="Offensive" npctag="attacker" enemytag="player" isinstigator="true" guardreaction="none" witnessreaction="none" />
        <WaitAction time="10" />
        <ClearTagAction tag="triggerer_player" />
        <GoTo name="attackplayer" />
      </ScriptedEvent>
      <ScriptedEvent identifier="piratemissioninformant" commonness="100">
        <TagAction criteria="player" tag="player" />
        <Label name="waitforinput" />
        <ClearTagAction tag="pmi_trig_player" />
        <TriggerAction target1tag="outpostmanagerpirate" target2tag="player" applytotarget2="pmi_trig_player" radius="200" waitforinteraction="true" />
        <ConversationAction targettag="pmi_trig_player" text="eventtext.piratemissioninformant.interact" eventsprite="banditcaptain">
          <Option text="eventtext.piratemissioninformant.option.buy">
            <CheckMoneyAction Amount="1000">
              <Success>
                <MoneyAction amount="-1000" />
                <ConversationAction targettag="pmi_trig_player" text="eventtext.piratemissioninformant.option.buy.success" eventsprite="banditcaptain" />
                <MissionAction missiontag="coalitionciv" />
              </Success>
              <Failure>
                <ConversationAction targettag="pmi_trig_player" text="eventtext.piratemissioninformant.option.buy.failure" eventsprite="banditcaptain" />
                <GoTo name="waitforinput" />
              </Failure>
            </CheckMoneyAction>
          </Option>
          <Option text="eventtext.option.leave">
            <ConversationAction text="eventtext.general.decline" targettag="pmi_trig_player" />
            <GoTo name="waitforinput" />
          </Option>
        </ConversationAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="piratebodybag" commonness="100">
        <CheckDataAction identifier="piratebodybagnorepeat" condition="eq 0">
          <Failure></Failure>
          <Success>
            <TagAction criteria="player" tag="player" />
            <SpawnAction itemidentifier="huskbodybag" targettag="bodybag" spawnlocation="Outpost" spawnpointtag="husk" ignorebyai="true" />
            <TriggerAction target1tag="bodybag" target2tag="player" applytotarget2="triggerer_player" radius="120" waitforinteraction="false" />
            <ConversationAction text="EventText.piratebodybag.smellyroom" dialogtype="small" targettag="triggerer_player" eventsprite="brokenmachinery" endconversation="true" />
            <WaitAction time="2" />
            <StatusEffectAction targettag="bodybag">
              <StatusEffect target="This" IsActive="true" />
            </StatusEffectAction>
            <Label name="retry" />
            <ClearTagAction tag="bag_player" />
            <TriggerAction target1tag="bodybag" target2tag="player" applytotarget2="bag_player" radius="120" waitforinteraction="true" />
            <ConversationAction text="EventText.piratebodybag.hearthump" dialogtype="small" targettag="bag_player" eventsprite="brokenmachinery">
              <Option text="EventText.piratebodybag.kickit" endconversation="true">
                <SetDataAction identifier="piratebodybagnorepeat" operation="set" value="1" />
                <StatusEffectAction targettag="bodybag">
                  <StatusEffect target="This" condition="-15" duration="10" />
                </StatusEffectAction>
              </Option>
              <Option text="EventText.piratebodybag.stayaway" endconversation="true">
                <WaitAction time="3" />
                <Goto name="retry" />
              </Option>
            </ConversationAction>
          </Success>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="piratecheckfordead">
        <TagAction criteria="player" tag="player" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:merchantcity" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:merchantmedical" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:merchantarmory" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:subupgradenpcpirate" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:subsalesnpcpirate" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:repairnpcpirate" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:reactoroperatorpirate" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:securitynpcpirate" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:outpostmanagerpirate" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:commonerpirate" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:hrmanagerpirate" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <TagAction criteria="humanprefabidentifier:outpostdoctorpirate" tag="deadpirate" ContinueIfNoTargetsFound="true" />
        <Label name="recheck" />
        <CheckConditionalAction targettag="deadpirate" isdead="true">
          <Success>
            <NPCChangeTeamAction npctag="deadpirate" teamtag="Team2" />
          </Success>
          <Failure>
            <WaitAction time="1" />
            <GoTo name="recheck" />
          </Failure>
        </CheckConditionalAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="pantytheft">
        <CheckDataAction identifier="pantytheftnorepeat" condition="eq 0">
          <Failure>
            <!-- does not spawn the event if already done -->
          </Failure>
          <Success>
            <!-- waits until other events are spawned so it can tag other npcs too -->
            <Waitaction time="10" />
            <TagAction criteria="player" tag="player" />
            <!-- tags the ID cards on bots -->
            <TagAction criteria="bot" tag="outpostbot" submarinetype="Outpost" />
            <TagAction criteria="itemtag:clothing" tag="stolenclothes" submarinetype="Outpost" />
            <!-- unlocks the shelf in the vanilla outpost that contains clothes -->
            <TagAction criteria="itemidentifier:crateshelf" tag="unlockcrateshelf" submarinetype="Outpost" ContinueIfNoTargetsFound="true" />
            <StatusEffectAction targettag="unlockcrateshelf">
              <StatusEffect target="This" noninteractable="false" setvalue="true" />
            </StatusEffectAction>
            <StatusEffectAction targettag="stolenclothes">
              <StatusEffect target="This" noninteractable="false" setvalue="true" />
            </StatusEffectAction>
            <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="commoner" targettag="smuggler" spawnlocation="Outpost" targetmoduletags="adminmodule" />
            <TriggerAction target1tag="player" target2tag="smuggler" applytotarget1="heyyouplayer" radius="200" />
            <ConversationAction targettag="heyyouplayer" text="eventtext.pantytheft.heyyou" endeventifinterrupted="false" endconversation="true" eventsprite="bandittalk" />
            <Label name="talktonpc" />
            <ConversationAction speakertag="smuggler" invokertag="panty_player" text="eventtext.pantytheft.opportunity" endeventifinterrupted="false" eventsprite="bandittalk">
              <Option text="eventtext.generic.continue">
                <ConversationAction targettag="panty_player" text="eventtext.pantytheft.confidentiality" endeventifinterrupted="false" eventsprite="JacovSubra1">
                  <Option text="eventtext.generic.continue">
                    <ConversationAction targettag="panty_player" text="eventtext.pantytheft.plantingtags" endeventifinterrupted="false" eventsprite="JacovSubra1">
                      <Option text="eventtext.pantytheft.ifitpays">
                        <ConversationAction text="eventtext.pantytheft.grabclothes" endeventifinterrupted="false" endconversation="true" eventsprite="Duffelbag" />
                        <SpawnAction itemidentifier="traitorduffelbag" targetinventory="panty_player" targettag="stealingbag" />
                        <StatusEffectAction targettag="stealingbag">
                          <StatusEffect target="This" delay="30" SpawnedInCurrentOutpost="true" AllowStealing="false" stackable="false" setvalue="true" />
                        </StatusEffectAction>
                      </Option>
                      <Option text="eventtext.generic.refuse" endconversation="true">
                        <ClearTagAction tag="panty_player" />
                        <Goto name="end" />
                      </Option>
                    </ConversationAction>
                  </Option>
                </ConversationAction>
              </Option>
              <Option text="eventtext.generic.ignore" endconversation="true">
                <ClearTagAction tag="panty_player" />
                <WaitAction time="1" />
                <Goto name="talktonpc" />
              </Option>
            </ConversationAction>
            <Label name="retry" />
            <Waitaction time="1" />
            <TriggerAction target1tag="player" target2tag="smuggler" applytotarget1="deliverer_player" waitforinteraction="true" />
            <!-- double check: if player carries bag, and if bad has ID cards -->
            <CheckItemAction targettag="deliverer_player" itemtags="stealingbag">
              <Success>
                <CheckItemAction targettag="stealingbag" itemtags="stolenclothes" amount="5" ApplyTagToItem="removeclothes">
                  <Success>
                    <StatusEffectAction targettag="removeclothes">
                      <StatusEffect target="This">
                        <Remove />
                      </StatusEffect>
                    </StatusEffectAction>
                    <StatusEffectAction targettag="stealingbag">
                      <StatusEffect target="This">
                        <Remove />
                      </StatusEffect>
                    </StatusEffectAction>
                    <ReputationAction increase="3" identifier="bandits" targettype="Faction" />
                    <MoneyAction amount="500" targettag="deliverer_player" />
                    <SetDataAction identifier="pantytheftnorepeat" value="1" />
                    <ConversationAction targettag="deliverer_player" text="eventtext.pantytheft.clothesdelivered" dialogtype="Small" endconversation="true" eventsprite="bandittalk" />
                  </Success>
                  <Failure>
                    <Goto name="noclothes" />
                  </Failure>
                </CheckItemAction>
              </Success>
              <Failure>
                <Label name="noclothes" />
                <ConversationAction text="eventtext.pantytheft.moreclothes" targettag="deliverer_player" dialogtype="Small" endconversation="true" eventsprite="bandittalk" />
                <ClearTagAction tag="deliverer_player" />
                <Goto name="retry" />
              </Failure>
            </CheckItemAction>
            <Label name="end" />
          </Success>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="vendingsmashing">
        <CheckDataAction identifier="vendingsmashingnorepeat" condition="eq 0">
          <Failure>
            <!-- does not spawn the event if already done -->
          </Failure>
          <Success>
            <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="securitynpc[faction]" targettag="vendingsecurity" spawnlocation="Outpost" />
            <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="commoner" targettag="thief" spawnlocation="Outpost" />
            <TagAction criteria="player" tag="player" />
            <TagAction criteria="itemtag:vendingmachine" tag="targetvendingmachine" submarinetype="Outpost" />
            <!-- wait a little before triggering so you have time to leave the sub -->
            <WaitAction time="60" />
            <TriggerAction target1tag="player" target2tag="thief" applytotarget1="heyyouplayer" radius="200" />
            <ConversationAction targettag="heyyouplayer" text="eventtext.vendingsmashing.heyyou" endeventifinterrupted="false" dialogtype="Small" endconversation="true" eventsprite="bandittalk" />
            <NPCWaitAction npctag="thief" wait="false" />
            <Label name="talktonpc" />
            <ConversationAction speakertag="thief" invokertag="triggerer_player" text="eventtext.vendingsmashing.quickcash" endeventifinterrupted="false" eventsprite="bandittalk">
              <Option text="eventtext.generic.continue">
                <ConversationAction targettag="triggerer_player" text="eventtext.vendingsmashing.machinetrick" endeventifinterrupted="false" dialogtype="Small" eventsprite="Terrorism1">
                  <Option text="eventtext.generic.continue">
                    <ConversationAction targettag="triggerer_player" text="eventtext.vendingsmashing.hitemhard" endeventifinterrupted="false" dialogtype="Small" eventsprite="Terrorism1">
                      <Option text="eventtext.vendingsmashing.Notsubtle">
                        <ConversationAction text="eventtext.vendingsmashing.Ilootyourun" endeventifinterrupted="false" dialogtype="Small" endconversation="true" eventsprite="Terrorism1" />
                        <SpawnAction itemidentifier="crowbar" targetinventory="triggerer_player" targettag="smashingcrowbar" />
                        <SpawnAction itemidentifier="toolbelt" targetinventory="thief" targettag="stealingbag" ignorebyai="true" />
                        <NPCFollowAction npctag="thief" targettag="triggerer_player" follow="true" />
                        <TriggerAction target1tag="thief" target2tag="targetvendingmachine" applytotarget2="selectvendingmachine" radius="200" />
                        <NPCFollowAction npctag="thief" targettag="triggerer_player" follow="false" />
                        <TriggerAction target1tag="triggerer_player" target2tag="selectvendingmachine" radius="200" waitforinteraction="true" />
                        <ConversationAction targettag="triggerer_player" text="eventtext.vendingsmashing.readycrowbar" endeventifinterrupted="false" eventsprite="Terrorism1" endconversation="true" />
                        <Label name="foundvendingmachine" />
                        <TriggerAction target1tag="triggerer_player" target2tag="selectvendingmachine" radius="200" waitforinteraction="true" />
                        <CheckItemAction targettag="triggerer_player" itemidentifiers="crowbar" RequireEquipped="true">
                          <Failure>
                            <WaitAction time="1" />
                            <Goto name="foundvendingmachine" />
                          </Failure>
                          <Success>
                            <NPCChangeTeamAction npctag="thief" teamtag="Team1" />
                            <StatusEffectAction targettag="selectvendingmachine">
                              <StatusEffect target="this">
                                <SpawnItem identifier="banditprop6" spawnposition="This" Offset="0,10" />
                                <Sound file="Content/Sounds/Damage/GlassImpact2.ogg" range="500" />
                                <ParticleEmitter particle="shrapnel" particleamount="15" velocitymin="50" velocitymax="150" anglemin="0" anglemax="360" scalemin="0.5" scalemax="1" colormultiplier="255,255,255,180" />
                              </StatusEffect>
                            </StatusEffectAction>
                            <StatusEffectAction targettag="smashingcrowbar">
                              <StatusEffect target="This" SpawnedInCurrentOutpost="true" AllowStealing="false" setvalue="true" />
                            </StatusEffectAction>
                            <ReputationAction targettype="Location" increase="-1" />
                            <NPCOperateItemAction npctag="thief" targettag="selectvendingmachine" ItemComponentName="Fabricator" Operate="true" AbandonOnReset="true" />
                            <WaitAction time="1" />
                            <!-- items spawned in bag -->
                            <SpawnAction itemidentifier="weldingfueltank" targetinventory="stealingbag" targettag="stolenitem" ignorebyai="true" />
                            <SpawnAction itemidentifier="batterycell" targetinventory="stealingbag" targettag="stolenitem" ignorebyai="true" />
                            <SpawnAction itemidentifier="ethanol" targetinventory="stealingbag" targettag="stolenitem" ignorebyai="true" />
                            <SpawnAction itemidentifier="antibiotics" targetinventory="stealingbag" targettag="stolenitem" ignorebyai="true" />
                            <!-- items spawned around vending machine -->
                            <WaitAction time="0.5" />
                            <SpawnAction itemidentifier="weldingfueltank" SpawnPointTag="selectvendingmachine" targettag="stolenitem" offset="100" />
                            <WaitAction time="0.5" />
                            <SpawnAction itemidentifier="batterycell" SpawnPointTag="selectvendingmachine" targettag="stolenitem" offset="100" />
                            <WaitAction time="0.5" />
                            <SpawnAction itemidentifier="ethanol" SpawnPointTag="selectvendingmachine" targettag="stolenitem" offset="100" />
                            <WaitAction time="0.5" />
                            <SpawnAction itemidentifier="antibiotics" SpawnPointTag="selectvendingmachine" targettag="stolenitem" offset="100" />
                            <!-- tag items as stolen -->
                            <StatusEffectAction targettag="stolenitem">
                              <StatusEffect target="This" SpawnedInCurrentOutpost="true" AllowStealing="false" setvalue="true" />
                            </StatusEffectAction>
                            <CombatAction combatmode="arrest" npctag="vendingsecurity" enemytag="triggerer_player" isinstigator="true" guardreaction="none" witnessreaction="none" />
                            <WaitAction time="5" />
                            <!-- jank, to make NPC stop operating -->
                            <Goto name="skipoperate" />
                            <Label name="skipoperate" />
                            <CombatAction combatmode="Retreat" npctag="thief" enemytag="triggerer_player" isinstigator="false" witnessreaction="none" />
                            <NPCChangeTeamAction npctag="thief" teamtag="FriendlyNPC" />
                            <WaitAction time="3" />
                            <TriggerAction target1tag="triggerer_player" target2tag="thief" waitforinteraction="true" />
                            <ReputationAction increase="3" identifier="bandits" targettype="Faction" />
                            <MoneyAction amount="200" targettag="triggerer_player" />
                            <SetDataAction identifier="vendingsmashingnorepeat" value="1" />
                            <ConversationAction targettag="triggerer_player" text="eventtext.vendingsmashing.yourshare" dialogtype="Small" endconversation="true" eventsprite="bandittalk" />
                          </Success>
                        </CheckItemAction>
                      </Option>
                      <Option text="eventtext.generic.refuse">
                        <Goto name="end" />
                      </Option>
                    </ConversationAction>
                  </Option>
                </ConversationAction>
              </Option>
              <Option text="eventtext.generic.ignore" endconversation="true">
                <ClearTagAction tag="triggerer_player" />
                <Goto name="talktonpc" />
              </Option>
            </ConversationAction>
          </Success>
        </CheckDataAction>
        <Label name="end" />
      </ScriptedEvent>
      <!--"Orange Protection Society"-->
      <ScriptedEvent identifier="orangePETA" commonness="100">
        <!-- checks if you've done 2 or more orangeboy transports -->
        <CheckDataAction identifier="orangePETAcounter" condition="gte 2">
          <Failure>
            <!-- does not spawn the event if already done -->
          </Failure>
          <Success>
            <CheckDataAction identifier="orangePETAnorepeat" condition="eq 0">
              <Failure>
                <!-- does not spawn the event if already done -->
              </Failure>
              <Success>
                <TagAction criteria="player" tag="player" />
                <SpawnAction npcsetidentifier="customnpcs" npcidentifier="orangelover" targettag="orangelover1" spawnlocation="Outpost" spawnpointtype="Path" offset="100" />
                <SpawnAction npcsetidentifier="customnpcs" npcidentifier="orangelover" targettag="orangelover2" spawnlocation="Outpost" spawnpointtag="orangelover1" offset="100" />
                <SpawnAction npcsetidentifier="customnpcs" npcidentifier="orangelover" targettag="orangelover3" spawnlocation="Outpost" spawnpointtag="orangelover2" offset="100" />
                <NPCFollowAction npctag="orangelover2" targettag="orangelover1" follow="true" />
                <NPCFollowAction npctag="orangelover3" targettag="orangelover2" follow="true" />
                <TriggerAction target1tag="orangelover1" target2tag="player" applytotarget2="triggerer_player" radius="250" waitforinteraction="false" />
                <NPCFollowAction npctag="orangelover1" targettag="triggerer_player" follow="true" />
                <SetDataAction identifier="orangePETAnorepeat" operation="set" value="1" />
                <ConversationAction targettag="triggerer_player" text="EventText.orangePETA.spotted" eventsprite="group">
                  <Option text="EventText.orangePETA.whatme">
                    <ConversationAction targettag="triggerer_player" text="EventText.orangePETA.OPSspeech1" eventsprite="group">
                      <Option text="EventText.generic.continue">
                        <ConversationAction targettag="triggerer_player" text="EventText.orangePETA.OPSspeech2" eventsprite="group">
                          <Option text="EventText.orangePETA.lie">
                            <RNGAction chance="0.2">
                              <Success>
                                <GiveSkillEXPAction skill="helm" amount="3" targettag="triggerer_player" />
                                <ConversationAction targettag="triggerer_player" text="EventText.orangePETA.whatarelief" eventsprite="group" endconversation="true" />
                                <NPCFollowAction npctag="orangelover1" targettag="triggerer_player" follow="false" />
                                <SpawnAction itemidentifier="chitinhelmet" amount="1" targetinventory="triggerer_player" />
                              </Success>
                              <Failure>
                                <ConversationAction targettag="triggerer_player" text="EventText.orangePETA.getem" eventsprite="mediator" endconversation="true" />
                                <CombatAction combatmode="Offensive" npctag="orangelover1" enemytag="triggerer_player" isinstigator="true" guardreaction="arrest" witnessreaction="retreat" />
                                <CombatAction combatmode="Offensive" npctag="orangelover2" enemytag="triggerer_player" isinstigator="true" guardreaction="arrest" witnessreaction="retreat" />
                                <CombatAction combatmode="Offensive" npctag="orangelover3" enemytag="triggerer_player" isinstigator="true" guardreaction="arrest" witnessreaction="retreat" />
                              </Failure>
                            </RNGAction>
                          </Option>
                          <Option text="EventText.orangePETA.delicious">
                            <GiveSkillEXPAction skill="weapons" amount="2" targettag="triggerer_player" />
                            <ConversationAction targettag="triggerer_player" text="EventText.orangePETA.getem" eventsprite="mediator" endconversation="true" />
                            <CombatAction combatmode="Offensive" npctag="orangelover1" enemytag="triggerer_player" isinstigator="true" guardreaction="arrest" witnessreaction="retreat" />
                            <CombatAction combatmode="Offensive" npctag="orangelover2" enemytag="triggerer_player" isinstigator="true" guardreaction="arrest" witnessreaction="retreat" />
                            <CombatAction combatmode="Offensive" npctag="orangelover3" enemytag="triggerer_player" isinstigator="true" guardreaction="arrest" witnessreaction="retreat" />
                          </Option>
                        </ConversationAction>
                      </Option>
                    </ConversationAction>
                  </Option>
                </ConversationAction>
              </Success>
            </CheckDataAction>
          </Success>
        </CheckDataAction>
      </ScriptedEvent>
      <!-- ////////////// OTHER EVENTS ///////////// -->
      <!-- remove lithomorphs in outpost levels, I hate it. repeated once because it sometimes fail -->
      <ScriptedEvent identifier="removelithomorphsoutpost" commonness="100">
        <TagAction criteria="itemtag:lithomorphspawner" tag="lithomorphspawner" />
        <Label name="removelithosagain" />
        <StatusEffectAction targettag="lithomorphspawner">
          <StatusEffect target="This">
            <Remove />
          </StatusEffect>
        </StatusEffectAction>
        <GoTo name="removelithosagain" maxtimes="1" />
      </ScriptedEvent>
      <ScriptedEvent identifier="circuswelcome" commonness="100">
        <CheckDataAction identifier="circuswelcomenorepeat" condition="eq 0">
          <Failure>
            <!-- does not spawn the event if already done -->
          </Failure>
          <Success>
            <TagAction criteria="player" tag="player" />
            <TagAction criteria="itemidentifier:op_clownmarquee" tag="showtimesign" submarinetype="Outpost" />
            <TagAction criteria="itemidentifier:searchlight" tag="showtimesign" submarinetype="Outpost" />
            <TagAction criteria="itemtag:smokeemitter" tag="smokeemitter" submarinetype="Outpost" />
            <TriggerAction target1tag="player" target2tag="showtimesign" radius="420" />
            <WaitAction time="2" />
            <ReputationAction increase="5" identifier="Clowns" targettype="Faction" />
            <StatusEffectAction targettag="showtimesign">
              <StatusEffect target="this" duration="5">
                <Sound file="Content/Items/Jobgear/Clown/ITEM_bananaSlip1.ogg" range="2000" volume="3" frequencymultiplier="0.5" />
                <ParticleEmitter particle="impactfirearm" particlespersecond="15" velocitymin="0" velocitymax="0" anglemin="180" anglemax="360" scalemin="0.5" scalemax="1" distancemin="50" distancemax="500" colormultiplier="255,255,255,200" lifetimemultiplier="50" />
                <ParticleEmitter particle="whitespark" particlespersecond="30" velocitymin="100" velocitymax="200" anglemin="240" anglemax="320" scalemin="1" scalemax="2" distancemin="5" distancemax="250" colormultiplier="255,255,255,255" lifetimemultiplier="5" HighQualityCollisionDetection="true" />
              </StatusEffect>
            </StatusEffectAction>
            <StatusEffectAction targettag="smokeemitter">
              <StatusEffect target="this" duration="5">
                <ParticleEmitter particle="flare" particlespersecond="5" velocitymin="0" velocitymax="100" anglemin="80" anglemax="100" scalemin="2" scalemax="4" distancemin="0" distancemax="50" colormultiplier="255,255,255,120" lifetimemultiplier="1" HighQualityCollisionDetection="false" />
              </StatusEffect>
            </StatusEffectAction>
            <WaitAction time="3" />
            <ConversationAction targettag="player" text="eventtext.circuswelcome.foundus" dialogtype="Small" endconversation="true" eventsprite="Jestmaster" />
            <SetDataAction identifier="circuswelcomenorepeat" value="1" />
          </Success>
        </CheckDataAction>
      </ScriptedEvent>
      <ScriptedEvent identifier="piezopioneer" commonness="100">
        <CheckDataAction identifier="piezopioneernorepeat" condition="eq 0">
          <Failure>
            <!-- does not spawn the event if already done -->
          </Failure>
          <Success>
            <TagAction criteria="player" tag="player" />
            <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="minerskeptic" spawnlocation="Outpost" spawnpointtag="mineevent" />
            <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="miner" targettag="minerpiezo" spawnlocation="Outpost" spawnpointtag="minerskeptic" />
            <NPCFollowAction npctag="minerpiezo" targettag="minerskeptic" follow="true" />
            <TriggerAction target1tag="minerskeptic" target2tag="player" applytotarget2="hearer_player" radius="150" />
            <ConversationAction targettag="hearer_player" text="EventText.piezopioneer.argument" eventsprite="mediator">
              <Option text="EventText.piezopioneer.hmmm" endconversation="true" />
            </ConversationAction>
            <NPCFollowAction npctag="minerpiezo" targettag="minerskeptic" follow="false" />
            <Label name="tryagain" />
            <WaitAction time="2" />
            <TriggerAction target1tag="minerpiezo" target2tag="player" applytotarget2="triggerer_player" radius="150" waitforinteraction="true" />
            <ConversationAction targettag="triggerer_player" text="EventText.piezopioneer.upsetminer" eventsprite="mechanic">
              <Option text="EventText.piezopioneer.inquirepiezos">
                <ConversationAction targettag="triggerer_player" text="EventText.piezopioneer.taleofpioneers" eventsprite="badvibration1">
                  <Option text="EventText.piezopioneer.insane">
                    <ConversationAction targettag="triggerer_player" text="EventText.piezopioneer.strangetool" eventsprite="mechanic">
                      <Option text="EventText.piezopioneer.youdontknow">
                        <ConversationAction targettag="triggerer_player" text="EventText.piezopioneer.taketool" eventsprite="mines" endconversation="true" />
                        <SpawnAction itemidentifier="piezochipper" amount="1" targetinventory="triggerer_player" />
                        <SetDataAction identifier="piezopioneernorepeat" operation="set" value="1" />
                      </Option>
                    </ConversationAction>
                  </Option>
                </ConversationAction>
              </Option>
            </ConversationAction>
          </Success>
        </CheckDataAction>
      </ScriptedEvent>
      <!-- literally just spawns a merchant for the 1st outpost in campaign -->
      <ScriptedEvent identifier="startermerchant" commonness="100">
        <!-- <TagAction criteria="humanprefabidentifier:merchantoutpost" tag="removenpc" ContinueIfNoTargetsFound="true" />
      <StatusEffectAction targettag="removenpc">
        <StatusEffect type="Always" target="Character" oneshot="true">
          <RemoveCharacter />
        </StatusEffect>
      </StatusEffectAction> -->
        <SpawnAction npcsetidentifier="outpostnpcs1" npcidentifier="merchantoutpost" targettag="startermerchant" spawnlocation="Outpost" spawnpointtag="shop_outpost" teamid="FriendlyNPC" />
      </ScriptedEvent>
    </EventPrefabs>
  </Randomevents>
</Override>