id,trigger,conditions,script,text,options,notes
greetingFOBTOffNormal,OpenCommLink,"$faction.id == fob
!$isHostile
!$player.transponderOn
$entity.relativeStrength >= 0",,"""Your body can’t hide your soul, just be at ease.""","turnOnTransponder:Turn on transponder
cutCommLink:Cut comm link",
greetingFOBTOffWeaker,OpenCommLink,"$faction.id == fob
!$isHostile
!$player.transponderOn
$entity.relativeStrength < 0",,"""We hope you escaped the gaze of the old ones, but please, tell us your name.""","turnOnTransponder:Turn on transponder
cutCommLink:Cut comm link",
greetingFOBFriendly,OpenCommLink,"$faction.id == fob
$faction.friendlyToPlayer","$menuState = fleetConvMain 0
FireAll PopulateOptions","""Greetings, friend. May the light of the old gods ever shine on you and let us find further knowledge and truth in this material world.""",,
greetingFOBHostileWeaker,OpenCommLink,"$faction.id == fob
$entity.isHostile
$entity.relativeStrength < 0",$entity.ignorePlayerCommRequests = true 1,"""The Abyss gazes into you…""",cutCommLink:Cut comm link,
greetingFOBHostileWeakerDefiant,OpenCommLink,"$faction.id == fob
$entity.isHostile
$entity.relativeStrength < 0
$entity.weakerThanPlayerButHolding",$entity.ignorePlayerCommRequests = true 1,"""Did you know? Even the dead do not sleep forever. In a strange faraway time, even death will meet its end.""",cutCommLink:Cut comm link,
greetingFOBHostileStronger,OpenCommLink,"$faction.id == fob
$entity.isHostile
$entity.relativeStrength >= 0",$entity.ignorePlayerCommRequests = true 1,"""Human. Cry. Despair. Only you are to blame for finding yourself drowning in this vast dark sea.""",cutCommLink:Cut comm link,
greetingFOBNeutral,OpenCommLink,"$faction.id == fob
$faction.neutralToPlayer","$menuState = fleetConvMain 0
FireAll PopulateOptions","""Do not be afraid, human.""",,
flavorTextMarketFOB,TradePanelFlavorText,"$global.tradePanelMode == MARKET
$faction.id == fob","AddText ""The atmosphere of this alien market feels mysterious but treacherous. Everyone appears friendly, but their tentacles are unnerving to you. Religious symbols and sculptures decorate the area and you seem to feel the call of something ancient from the depths of a dark sea."" textGrayColor",,,
relLevelNeutralFob,RelationshipLevelDesc,"$faction.rel == NEUTRAL
$faction.id == fob",,The Borken advocate peace and sees all living beings as equals.,,
relLevelFavorableFob,RelationshipLevelDesc,"$faction.rel == FAVORABLE
$faction.id == fob",,The Borken look past the odd look in your eyes as you shake their hands and are pleased by your presence.,,
relLevelWelcomingFob,RelationshipLevelDesc,"$faction.rel == WELCOMING
$faction.id == fob",,"The Borken take you to see the statues of their ancient gods, but they say that one can never remember anything of this encounter once you return from it.",,
relLevelFriendlyFob,RelationshipLevelDesc,"$faction.rel == FRIENDLY
$faction.id == fob",,The Borken trader treats you as a guest. Perhaps you can make new acquaintances here.,,
relLevelCooperativeFob,RelationshipLevelDesc,"$faction.rel == COOPERATIVE
$faction.id == fob",,"They will aid you in your long interstellar journey, convincing you that eternal sleep does not mean death.",,
relLevelSuspiciousFob,RelationshipLevelDesc,"$faction.rel == SUSPICIOUS
$faction.id == fob",,"The Borken are not hostile to you, but there always seems to be something lurking in the corner of your eyes.",,
relLevelInhospitableFob,RelationshipLevelDesc,"$faction.rel == INHOSPITABLE
$faction.id == fob",,"The Borken seem to ignore you, yet you feel uneasy, like you hear an ominous cry from the depths of space.",,
relLevelHostileFob,RelationshipLevelDesc,"$faction.rel == HOSTILE
$faction.id == fob",,Disembodied voices haunt you in your head. It is as if the Borken are staring at you from every direction.,,
relLevelVengefulFob,RelationshipLevelDesc,"$faction.rel == VENGEFUL
$faction.id == fob",,"Disturbing dreams haunt your nights. The Borken’s hatred ringing in your ears, a chilling anger and a dark abyss staring deep into you.",,
marketPostOpenFobUntrustworthy,MarketPostOpen,"$hasMarket
$faction.id == fob score:1000
RepIsAtBest $faction.id SUSPICIOUS
RepIsAtWorst $faction.id INHOSPITABLE","$marketLeaveTooltip = ""$TheFaction does not trust you."" 0
$menuState = main 0
$tradeMode = NONE 0
FireAll PopulateOptions","You are $relAdjective with $theFaction and denied access to the markets of $market. You have been seriously asked to leave this system as soon as possible.",,
marketPostOpenFobHostile,MarketPostOpen,"$hasMarket
$faction.id == fob score:1000
RepIsAtBest $faction.id INHOSPITABLE","$marketLeaveTooltip = "" $TheFaction does not trade with outsiders."" 0
$menuState = main 0
$tradeMode = NONE 0
FireAll PopulateOptions","Your scanner detects powerful energy fluctuations of unknown origin at $entityName and a strange voice is ringing in your ear: ""You defile the land of the old gods, leave now, before Motta Sheamus crushes your spine.""",,
,,,,,,
#PCH,,,,,,
"privateChAddDeployOption
",PopulateOptions,"!$isPerson
PchInteractionCheck
!$pch.hasCh
PchRelationEnough $faction.id","PchSetMemoryData
SetShortcut deployCh ""B"" true
SetTooltip deployCh ""Note: Your relationship with the Borken Foundation must be welcomed and above, and the relationship with local forces must be good and above before deployment.""
SetEnabled deployCh $pch.repEnough",,7:deployCh:Deploy PCR,
"privateChAddManageOption
",PopulateOptions,"!$isPerson
PchInteractionCheck
$pch.hasCh
PchRelationEnough $faction.id","PchSetMemoryData
SetShortcut manageCh ""B"" true
$pchVer = v13.5.10",,7:manageCh:Manage PCR,
privateChDeployOptions,DialogOptionSelected,$option == deployCh,"$menuState = deployPch 0
SetTextHighlights 0 200
FireAll PchDeployOptions","------
There are no PCR facilities in this area, but you can contact the Borken Foundation Remote Construction Services to instruct your crew in the construction of a new facility in this location.

Construction will take some time and requires fees paid to local authorities and the Borken Foundation.
Initial deployment will give you access to a free Grade 0 PCR with 200 units of cargo capacity.",,
privateChDeployTypeMainOption,PchDeployOptions,$pch.deployType == 0,"SetEnabled deployPchMain $pch.canDeployMain
SetTextHighlights $pch.shouldPayToDeployStrC",Main facility cost: $pch.shouldPayToDeployStrC,1:deployPchMain:Set as secondary,
privateChDeployTypeSecOption,PchDeployOptions,$pch.deployType == 1,"SetEnabled deployPchSec $pch.canDeployMain
SetTextHighlights $pch.shouldPayToDeployStrC",Secondary facility cost: $pch.shouldPayToDeployStrC,1:deployPchSec:Set as primary,
privateChDeployShowOthersOption,PchDeployOptions,,SetEnabled showOtherPch $pch.hasServices,,3:showOtherPch:Show other facilities,
privateChDeployConfirmOption,PchDeployOptions,,"SetEnabled confirmDeploy $pch.canAffordDeploy
SetShortcut confirmDeploy ""C"" true",,5:confirmDeploy:Confirm deployment,
privateChDeployHelpOption,PchDeployOptions,,"SetShortcut deployHelp ""H"" true",,6:pchhelp:Help,
privateChDeployBackOption,PchDeployOptions,,SetShortcut leavePch ESCAPE,,10:leavePch:Leave,
,,,,,,
privateChDeployTypeEnableMain,DialogOptionSelected,$option == deployPchSec,"$pch.deployType = 0 0
PchSetMemoryData
FireAll PchDeployOptions",Target facility set as primary.,,
privateChDeployTypeEnableSec,DialogOptionSelected,$option == deployPchMain,"$pch.deployType = 1 0
PchSetMemoryData
FireAll PchDeployOptions",Target facility set as secondary.,,
privateChDeployStart,DialogOptionSelected,$option == confirmDeploy,"Wait $global.deployingWait 3.0 $global.deployingFinished $global.deployingInterrupted $global.deployingInProgress ""In deployment...""
expire $pch.shouldPayToDeploy 3.1
expire $pch.deployType 3.1
MakePlayerImmediatelyAttackable",,,
privateChDeployInterrupted,BeginFleetEncounter,$global.deployingInProgress,AbortWait $global.deployingWait,Contact with other fleets has forced the cancellation of PCR facility deployment. No payments will be required.,,
privateChDeployCompleted,OpenInteractionDialog,$global.deployingFinished score:100,AddPrivateCH,"Deployment successful. Construction fees have been transferred from your account to the Borken Foundation.
Please be aware that local authorities may destroy the facility should you enter hostilities.",,
,,,,,,
privateChManageOptions,DialogOptionSelected,$option == manageCh,"$menuState = managePch 0
FireAll PchManageOptions",,,
privateChManagePrintDescription,PchManageOptions,,SetTextHighlights $pchVer $pch.pchlevel $player.name $name,"Welcome to the $pchVer operating system.
The ultimate weapon of Borken traders! This facility connects to the PCR provided to you by the Borken Foundation to store cargo freely across the universe!

---User data:
--Name: $player.name 
--Location: $name 
--Relation with FoB: $player.repToFob 

---PCR data:
--Access level: $pch.pchlevel
--Storage: $pch.curCQ / $pch.maxCQ

Access permission granted, please continue to control interface…",,
privateChManageSecOption,PchManageOptions,$pch.currentType == 1,"SetShortcut pickPch ""T"" true",,0:pickPch:Select PCR,
privateChManageUpgradeCargoOption,PchManageOptions,,,,1:upgradePch:Upgrade PCR,
privateChManageRemoveMainOption,PchManageOptions,,,,5:removePch:Remove PCR,
privateChManageShowOthersOption,PchManageOptions,,SetEnabled showOtherPch $pch.hasServices,,3:showOtherPch:Show other PCR,
privateChManageHelpFileOption,PchManageOptions,,"SetShortcut deployHelp ""H"" true",,6:pchhelp:Help,
privateChManageBackOption,PchManageOptions,,SetShortcut leavePch ESCAPE,,10:leavePch:Leave,
privateChManageUpgrade,DialogOptionSelected,$option == upgradePch,"SetEnabled confirmUpgrade $pch.canUpgradeCQ
SetTextHighlights $pch.pchlevel 200 $player.creditsStrC $pch.upgradeCQshouldPay 
SetShortcut backToManage ESCAPE","PCR level is now: $pch.pchlevel 

Upgrade to gain an additional 200 units of storage space

<< Current funds:  $player.creditsStrC 
>> Upgrade cost:  $pch.upgradeCQshouldPay ","1:confirmUpgrade:Confirm upgrade
10:backToManage:Return",
privateChManageUpgradeConfirm,DialogOptionSelected,$option == confirmUpgrade,"PchUpgradeCQ
FireAll PchManageOptions",Capacity upgrade successful!,,
privateChManageBackTo,DialogOptionSelected,$option == backToManage,"PchSetMemoryData
FireAll PchManageOptions",,,
privateChManageTransferPick,DialogOptionSelected,$option == pickPch,"SetShortcut backToManage ESCAPE
SetShortcut takePch ""T"" TRUE
SetShortcut savePch ""S"" TRUE",,"0:takePch:Take
1:savePch:Store
10:backToManage:Return",
privateChManageTransferTake,DialogOptionSelected,$option == takePch,PchTakeOrSaveCargo TRUE,,,
privateChManageTransferSave,DialogOptionSelected,$option == savePch,PchTakeOrSaveCargo FALSE,,,
privateChBack,DialogOptionSelected,$option == leavePch,"ShowDefaultVisual
$menuState = main 0
FireAll PopulateOptions",,,
,,,,,,
privateChConfirmRemove,DialogOptionSelected,$option == removePch,"SetShortcut confirmBack ESCAPE
SetEnabled confirmRemove $pch.canBeRemoved","Do you wish to dismantle this base?
Immediate destruction will cost 50,000 credits.","0:confirmRemove:Remove
1:confirmBack:Back",
privateChConfirmdRemove,DialogOptionSelected,$option == confirmRemove,"SetShortcut leavePch ESCAPE
PchDemolition",Destruction successful!,10:leavePch:Leave,
privateChConfirmRemoveBack,DialogOptionSelected,$option == confirmBack,FireAll PchManageOptions,,,
privateChHelpFile,DialogOptionSelected,$option == pchhelp,SetTextHighlights 3 4,"Crystal Rift facilities are divided into one primary and secondary facilities.
A maximum of 3 primary facilities can be deployed at established markets only, but may allow for free cargo transfer.
(Market size * 50,000 + 25,000) * (1.5 – FoB reputation [capping at 1.0 for cooperative] )

Secondary facilities can be set up anywhere without limitation on number. Transfer to and from these requires a tax however.
((200,000 * (1 + 0.5 * units) * (1.5 – FoB reputation)
(In lack of a submarket, you have to use the PCR operating system.)

Primary facilities are cheaper to deploy than secondaries and payment is due upon completion.
Note that once deployed, destruction of a facility requires an additional fee. Furthermore, hostilities with local authorities will lead to the destruction of any facilities within their territory.",,
privateChShowOthers,DialogOptionSelected,$option == showOtherPch,PchPrintOthersStatus,,,
,,,,,,
#Peaceful Evolution,,,,,,
pem_checkCompletion,MarketPostDock,"$tradeMode != NONE
PeacefulEvolutionMission checkCompletion score:100",PeacefulEvolutionMission completeMissions,,,
pem_completedButNoDocking,MarketPostDock,"!$pem_noCompleteShown
$tradeMode == NONE
PeacefulEvolutionMission checkCompletion score:100","$pem_noCompleteShown = true 0
FireBest MarketPostDock",You can't complete the task in this situation.,,
,,,,,,
#Mental Healing,,,,,,
psy_greeting,PickGreeting,"$psy_isDoctor
!$entity.isHostile","ShowPersonVisual
FireAll PsyOfficersOpts
$psy_page = 0 0","After a short wait, your communication request is accepted.

""Welcome to the Borken Psychotherapy Clinic. I am the chief physician of this facility. Let me assure you right away that this clinic carries all required legal licenses. For a sufficient fee we will adjust the personalities of your officers without any risk of complications.""",,
psy_officerOption,PsyOfficersOpts,,"PsyShow Officers
SetShortcut cutCommLink ESCAPE",,,
psy_help,DialogOptionSelected,$option == psyhelp,,"“Borken personality adjustment therapy can change the personality of an officer.
Pricing: 25000 * Level * Personality Factor * (1.5 - (market stability * 0.075))
Reckless: 1.2
Aggressive: 1.2
Steady: 1.2
Cautious: 1.1
Timid: 0.8”",10:backToCO:Cancel,
psy_selectOfficer,DialogOptionSelected,"$psy_isDoctor
$isPerson
PsySelectOption Officer","FireAll PsyPersonalitiesOpts
SetTextHighlights $psy_officerName","""Are you sure you want $psy_officerName to undergo adjustment therapy? Please select the desired personality.""",,
psy_personalitiesOption,PsyPersonalitiesOpts,,PsyShow Personalities,,,
psy_personalitiesOption2,PsyPersonalitiesOpts,,,,10:backToCO:Cancel,
psy_selectPersonality,DialogOptionSelected,"$psy_isDoctor
$isPerson
PsySelectOption Personality","SetEnabled psy_confirm $cost_enough
SetTextHighlights $psy_officerName $psy_personalityName $psy_costStr","""Are you sure you want $psy_officerName to undergo adjustment therapy? This will cost $psy_costStr.""","1:psy_confirm:Confirm
10:backToCP:Cancel",
psy_confirmPersonality,DialogOptionSelected,$option == psy_confirm,"PsyShow Confirm
SetTextHighlights $psy_officerName","""The personality of $psy_officerName has been successfully corrected.""",10:backToCO:Cancel,
,,,,,,
psy_officerLastPage,DialogOptionSelected,$option == psylastPage,"PsyShow OPage Last
FireAll PsyOfficersOpts",,,
psy_officerNextPage,DialogOptionSelected,$option == psynextPage,"PsyShow OPage Next
FireAll PsyOfficersOpts",,,
psy_backToCO,DialogOptionSelected,$option == backToCO,FireAll PsyOfficersOpts,,,
psy_backToCP,DialogOptionSelected,$option == backToCP,FireAll PsyPersonalitiesOpts,,,
