Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname DCS_QuestScript extends Quest
- { It just works. }
- ; Fallout 4 Papyrus script by ThoraldGM | http://thoraldgm.com | Updated 20171023
- ; Diamond City SWAT mod: https://www.nexusmods.com/fallout4/mods/10893/
- ; SCRIPT SECTIONS:
- ; LINE 017: PROPERTIES
- ; LINE 043: ON QUEST INIT
- ; LINE 053: DCS SET APPROVED OUTFITS
- ; LINE 085: CHECK FOR AUTOMATRON DLC
- ; LINE 121: CHECK FOR FAR HARBOR DLC
- ; LINE 169: CHECK FOR NUKA-WORLD DLC
- ; LINE 270: ADD OUTFIT TO APPROVED LIST
- ; ------------------------------------------------------------------------------------------------------------
- ; PROPERTIES
- ; ------------------------------------------------------------------------------------------------------------
- GlobalVariable Property pDCS_Global_DevTracking Auto Mandatory ; Developer messages enabled?
- FormList Property pDCS_Flst_Outfits_GlobalsFactions Auto Mandatory ; Contains globals for player to select factions 0-22
- FormList Property pDCS_Flst_Outfit_XautomatronX Auto Mandatory ; Empty Automatron formlist pending DLC check
- FormList Property pDCS_Flst_Outfit_XfarharborX Auto Mandatory ; Empty Far Harbor formlist pending DLC check
- FormList Property pDCS_Flst_Outfit_XnukaworldX Auto Mandatory ; Empty Nuka-World formlist pending DLC check
- ; ************************************************************************************************************
- ; NUKAGIRL IS ARMOR, NOT OUTFIT. WILL REQUIRE SPECIAL HANDLING IN THE DLC CHECK. (ADDFORM TO LL IF DLC FOUND)
- ; ************************************************************************************************************
- LeveledItem Property pDCS_LL_NukaGirl Auto Mandatory ; Empty NukaGirl leveled list pending DLC check
- Outfit Property pDCS_Outfit_NukaGirl Auto Mandatory ; Outfit contains the empty leveled list
- ; ************************************************************************************************************
- ; THESE ARE MULTI-ARRAYS CREATED IN CK: FORMLISTS CONTAIN FORMLISTS, WHICH CONTAIN [GLOBALS | OUTFITS | EMPTY]
- ; ************************************************************************************************************
- FormList Property pDCS_Flst_Outfits_GlobalsOutfits Auto Mandatory ; X: formlist of formlists, Y: formlist of globals
- FormList Property pDCS_Flst_Outfits Auto Const Mandatory ; X: formlist of formlists, Y: formlist of outfits
- FormList Property pDCS_Flst_Outfits_Allowed Auto ; Empty multi-array that will hold outfits selected by player
- ; ------------------------------------------------------------------------------------------------------------
- ; EVENT: ON QUEST INIT
- ; ------------------------------------------------------------------------------------------------------------
- Event OnQuestInit()
- DCS_SetApprovedOutfits() ; Set up default outfits. Player has not used MCM yet.
- EndEvent
- ; ------------------------------------------------------------------------------------------------------------
- ; CUSTOM FUNCTION: DCS SET APPROVED OUTFITS
- ; ------------------------------------------------------------------------------------------------------------
- Function DCS_SetApprovedOutfits()
- ; ********************************************************************************************************
- ; PREPARE TO STOCK MULTI-ARRAY (DCS_Flst_Outfits_Allowed) WITH APPROVED OUTFITS (OUTFIT GLOBAL VARIABLE == 1)
- ; ********************************************************************************************************
- FormList FactionList = pDCS_Flst_Outfits_GlobalsFactions ; Step 1: faction globals
- GlobalVariable FactionIndex
- FormList NestedList ; Step 2: outfit globals
- GlobalVariable NestedIndex
- FormList OutfitsList ; Step 3: actual outfits
- Outfit OutfitsIndex
- FormList ApprovedList ; Step 4: approved outfits
- Int x = 0 ; Outer loop range, set now
- Int FactionSize = FactionList.GetSize() - 3 ; Subtract DLCs from FactionSize pending DLC checks
- Int FactionGlobalInt
- Int y ; Inner loop range, set later (soon)
- Int NestedSize
- Int NestedGlobalInt
- Int i ; Prepare to fix AddForm not stacking correctly!
- ; ********************************************************************************************************
- ; CHECK IF PLAYER HAS AUTOMATRON DLC INSTALLED AND EXPAND FACTION/OUTFIT CHOICES
- ; ********************************************************************************************************
- bool AutomatronInstalled = Game.IsPluginInstalled("DLCRobot.esm")
- Utility.Wait(0.1)
- If AutomatronInstalled ; If Automatron DLC found,
- FactionSize += 1 ; increment FactionSize by 1
- ; And populate the Automatron outfit list
- Outfit[] AutomatronOutfits = new Outfit[7]
- AutomatronOutfits[0] = Game.GetFormFromFile(0x0100FEFF, "DLCRobot.esm") as Outfit ; DLC01Caravan_JacksonOutfit
- AutomatronOutfits[1] = Game.GetFormFromFile(0x0100FF05, "DLCRobot.esm") as Outfit ; DLC01Caravan_LizaOutfit
- AutomatronOutfits[2] = Game.GetFormFromFile(0x0100FF07, "DLCRobot.esm") as Outfit ; DLC01Caravan_ShadesOutfit
- AutomatronOutfits[3] = Game.GetFormFromFile(0x0100FF02, "DLCRobot.esm") as Outfit ; DLC01Caravan_ZoeOutfit
- AutomatronOutfits[4] = Game.GetFormFromFile(0x0100EBB8, "DLCRobot.esm") as Outfit ; DLC01MechanistOutfitArmor
- AutomatronOutfits[5] = Game.GetFormFromFile(0x0100EBB9, "DLCRobot.esm") as Outfit ; DLC01MechanistOutfitJumpsuit
- AutomatronOutfits[6] = Game.GetFormFromFile(0x0100863D, "DLCRobot.esm") as Outfit ; DLC01Outfit_BotRaider
- Utility.Wait(0.1)
- i = 6 ; IMPORTANT: AddForm adds every new element at index ZERO! So add forms BACKWARDS to match globals list!
- While i >= 0
- pDCS_Flst_Outfit_XautomatronX.AddForm(AutomatronOutfits[i] as Form)
- i -= 1
- EndWhile
- If pDCS_Global_DevTracking.GetValue() == 1
- Debug.Notification("DCS: Automatron handled.")
- EndIf
- EndIf
- ; ********************************************************************************************************
- ; CHECK IF PLAYER HAS FAR HARBOR DLC INSTALLED AND EXPAND FACTION/OUTFIT CHOICES
- ; ********************************************************************************************************
- bool FarHarborInstalled = Game.IsPluginInstalled("DLCCoast.esm")
- Utility.Wait(0.1)
- If FarHarborInstalled ; If Far Harbor DLC found,
- FactionSize += 1 ; increment FactionSize by 1
- ; And populate the Far Harbor outfit list
- Outfit[] FarHarborOutfits = new Outfit[19]
- FarHarborOutfits[0] = Game.GetFormFromFile(0x01020C4F, "DLCCoast.esm") as Outfit ; DLC03_Outfit_Trapper_Coast
- FarHarborOutfits[1] = Game.GetFormFromFile(0x01054313, "DLCCoast.esm") as Outfit ; DLC03_Outfit_Trapper_Coast_Boss
- FarHarborOutfits[2] = Game.GetFormFromFile(0x01020C50, "DLCCoast.esm") as Outfit ; DLC03_Outfit_Trapper_Woods
- FarHarborOutfits[3] = Game.GetFormFromFile(0x01054314, "DLCCoast.esm") as Outfit ; DLC03_Outfit_Trapper_Woods_Boss
- FarHarborOutfits[4] = Game.GetFormFromFile(0x01009154, "DLCCoast.esm") as Outfit ; DLC03_RainGear01_NoHat_Outfit
- FarHarborOutfits[5] = Game.GetFormFromFile(0x01009157, "DLCCoast.esm") as Outfit ; DLC03_RainGear01_Outfit
- FarHarborOutfits[6] = Game.GetFormFromFile(0x01009155, "DLCCoast.esm") as Outfit ; DLC03_RainGear02_NoHat_Outfit
- FarHarborOutfits[7] = Game.GetFormFromFile(0x01009158, "DLCCoast.esm") as Outfit ; DLC03_RainGear02_Outfit
- FarHarborOutfits[8] = Game.GetFormFromFile(0x01009156, "DLCCoast.esm") as Outfit ; DLC03_RainGear03_NoHat_Outfit
- FarHarborOutfits[9] = Game.GetFormFromFile(0x01009159, "DLCCoast.esm") as Outfit ; DLC03_RainGear03_Outfit
- FarHarborOutfits[10] = Game.GetFormFromFile(0x010576E3, "DLCCoast.esm") as Outfit ; DLC03_RainGear04_Outfit
- FarHarborOutfits[11] = Game.GetFormFromFile(0x010576E4, "DLCCoast.esm") as Outfit ; DLC03_RainGear05_Outfit
- FarHarborOutfits[12] = Game.GetFormFromFile(0x010576E2, "DLCCoast.esm") as Outfit ; DLC03_RainGear06_Outfit
- FarHarborOutfits[13] = Game.GetFormFromFile(0x0101A237, "DLCCoast.esm") as Outfit ; DLC03AllenLeeOutfit
- FarHarborOutfits[14] = Game.GetFormFromFile(0x01053FB3, "DLCCoast.esm") as Outfit ; DLC03BrooksOutfit
- FarHarborOutfits[15] = Game.GetFormFromFile(0x01057030, "DLCCoast.esm") as Outfit ; DLC03CoA_GrandZealotOutfit
- FarHarborOutfits[16] = Game.GetFormFromFile(0x0105698D, "DLCCoast.esm") as Outfit ; DLC03CoA_HighConfessorOutfit
- FarHarborOutfits[17] = Game.GetFormFromFile(0x01004484, "DLCCoast.esm") as Outfit ; DLC03CoAArchemistOutfit
- FarHarborOutfits[18] = Game.GetFormFromFile(0x01048ED9, "DLCCoast.esm") as Outfit ; DLC03OldLongfellowOutfit
- Utility.Wait(0.1)
- i = 18 ; IMPORTANT: AddForm adds every new element at index ZERO! So add forms BACKWARDS to match globals list!
- While i >= 0
- pDCS_Flst_Outfit_XfarharborX.AddForm(FarHarborOutfits[i] as Form)
- i -= 1
- EndWhile
- If pDCS_Global_DevTracking.GetValue() == 1
- Debug.Notification("DCS: Far Harbor handled.")
- EndIf
- EndIf
- ; ********************************************************************************************************
- ; CHECK IF PLAYER HAS NUKA-WORLD DLC INSTALLED AND EXPAND FACTION/OUTFIT CHOICES
- ; ********************************************************************************************************
- bool NukaWorldInstalled = Game.IsPluginInstalled("DLCNukaWorld.esm")
- Utility.Wait(0.1)
- If NukaWorldInstalled ; If Nuka-World DLC found,
- FactionSize += 1 ; increment FactionSize by 1
- ; Do special NukaGirl armor handling
- Outfit[] NukaWorldOutfits = new Outfit[35]
- Armor NukaGirlArmor = Game.GetFormFromFile(0x01029C0D, "DLCNukaWorld.esm") as Armor ; DLC04_Armor_NukaGirlOutfit (ARMOR!)
- Utility.Wait(0.1)
- pDCS_LL_NukaGirl.AddForm(NukaGirlArmor, 1, 1) ; Add armor to empty leveled list
- Utility.Wait(0.1)
- NukaWorldOutfits[0] = pDCS_Outfit_NukaGirl ; Assign outfit that contains list
- ; And finish populating the Nuka-World outfit list
- NukaWorldOutfits[1] = Game.GetFormFromFile(0x0100CC91, "DLCNukaWorld.esm") as Outfit ; DLC04_DaraHubbellOutfit
- NukaWorldOutfits[2] = Game.GetFormFromFile(0x0104B4F0, "DLCNukaWorld.esm") as Outfit ; DLC04_DixieOutfit
- NukaWorldOutfits[3] = Game.GetFormFromFile(0x0100D87C, "DLCNukaWorld.esm") as Outfit ; DLC04_DRG_RickyBraxtonOutfit
- NukaWorldOutfits[4] = Game.GetFormFromFile(0x0100D87A, "DLCNukaWorld.esm") as Outfit ; DLC04_DRG_SamTellerOutfit
- NukaWorldOutfits[5] = Game.GetFormFromFile(0x0100D87D, "DLCNukaWorld.esm") as Outfit ; DLC04_DRG_TerryTanakaOutfit
- NukaWorldOutfits[6] = Game.GetFormFromFile(0x01031F4D, "DLCNukaWorld.esm") as Outfit ; DLC04_GageOutfit
- NukaWorldOutfits[7] = Game.GetFormFromFile(0x0102DF09, "DLCNukaWorld.esm") as Outfit ; DLC04_HubologistOutfit
- NukaWorldOutfits[8] = Game.GetFormFromFile(0x010417AE, "DLCNukaWorld.esm") as Outfit ; DLC04_KK_RachelOutfit
- NukaWorldOutfits[9] = Game.GetFormFromFile(0x01048578, "DLCNukaWorld.esm") as Outfit ; DLC04_LizzieWyathOutfit
- NukaWorldOutfits[10] = Game.GetFormFromFile(0x010145DB, "DLCNukaWorld.esm") as Outfit ; DLC04_LucyOutfit
- NukaWorldOutfits[11] = Game.GetFormFromFile(0x01048579, "DLCNukaWorld.esm") as Outfit ; DLC04_MagsBlackOutfit
- NukaWorldOutfits[12] = Game.GetFormFromFile(0x0104A6A0, "DLCNukaWorld.esm") as Outfit ; DLC04_MasonOutfit
- NukaWorldOutfits[13] = Game.GetFormFromFile(0x0104B4EF, "DLCNukaWorld.esm") as Outfit ; DLC04_NishaOutfit
- NukaWorldOutfits[14] = Game.GetFormFromFile(0x0101763C, "DLCNukaWorld.esm") as Outfit ; DLC04_OswaldOutfit
- NukaWorldOutfits[15] = Game.GetFormFromFile(0x01036662, "DLCNukaWorld.esm") as Outfit ; DLC04_Outfit_Raider_Disciples
- NukaWorldOutfits[16] = Game.GetFormFromFile(0x01036673, "DLCNukaWorld.esm") as Outfit ; DLC04_Outfit_Raider_Operator
- NukaWorldOutfits[17] = Game.GetFormFromFile(0x01036674, "DLCNukaWorld.esm") as Outfit ; DLC04_Outfit_Raider_Pack
- NukaWorldOutfits[18] = Game.GetFormFromFile(0x0104B4F1, "DLCNukaWorld.esm") as Outfit ; DLC04_SavoyOutfit
- NukaWorldOutfits[19] = Game.GetFormFromFile(0x01048577, "DLCNukaWorld.esm") as Outfit ; DLC04_WilliamBlackOutfit
- NukaWorldOutfits[20] = Game.GetFormFromFile(0x01044845, "DLCNukaWorld.esm") as Outfit ; DLC04ColaCarsCrowd_Outfit_Raider_Pack
- NukaWorldOutfits[21] = Game.GetFormFromFile(0x010504EE, "DLCNukaWorld.esm") as Outfit ; DLC04FritschOutfit
- NukaWorldOutfits[22] = Game.GetFormFromFile(0x010489A9, "DLCNukaWorld.esm") as Outfit ; DLC04MQ04_SinnerOutfit
- NukaWorldOutfits[23] = Game.GetFormFromFile(0x01042B4F, "DLCNukaWorld.esm") as Outfit ; DLC04POISC07_KaliDunmoreOutfit
- NukaWorldOutfits[24] = Game.GetFormFromFile(0x01042B4D, "DLCNukaWorld.esm") as Outfit ; DLC04POISC07_MoniqueDunmoreOutfit
- NukaWorldOutfits[25] = Game.GetFormFromFile(0x0100A511, "DLCNukaWorld.esm") as Outfit ; DLC04RaiderOverbossOutfit
- NukaWorldOutfits[26] = Game.GetFormFromFile(0x01051B7E, "DLCNukaWorld.esm") as Outfit ; DLC04RandomRadGorillaOutfit
- NukaWorldOutfits[27] = Game.GetFormFromFile(0x010260E5, "DLCNukaWorld.esm") as Outfit ; DLC04SafariCitoOutfit
- NukaWorldOutfits[28] = Game.GetFormFromFile(0x0103B9D1, "DLCNukaWorld.esm") as Outfit ; DLC04SafariDrMcDermotOutfit
- NukaWorldOutfits[29] = Game.GetFormFromFile(0x0101CD22, "DLCNukaWorld.esm") as Outfit ; DLC04ShankOutfit
- NukaWorldOutfits[30] = Game.GetFormFromFile(0x0104A3D2, "DLCNukaWorld.esm") as Outfit ; DLC04SierraOutfitGlassesOff
- NukaWorldOutfits[31] = Game.GetFormFromFile(0x0104A3D3, "DLCNukaWorld.esm") as Outfit ; DLC04SierraOutfitGlassesOn
- NukaWorldOutfits[32] = Game.GetFormFromFile(0x01026217, "DLCNukaWorld.esm") as Outfit ; DLC04TraderOutfit
- NukaWorldOutfits[33] = Game.GetFormFromFile(0x01038298, "DLCNukaWorld.esm") as Outfit ; DLC04TraderOutfitNoCollar
- NukaWorldOutfits[34] = Game.GetFormFromFile(0x010518C9, "DLCNukaWorld.esm") as Outfit ; DLC04TravelerOutfit
- Utility.Wait(0.1)
- i = 34 ; IMPORTANT: AddForm adds every new element at index ZERO! So add forms BACKWARDS to match globals list!
- While i >= 0
- pDCS_Flst_Outfit_XnukaworldX.AddForm(NukaWorldOutfits[i] as Form)
- i -= 1
- EndWhile
- If pDCS_Global_DevTracking.GetValue() == 1
- Debug.Notification("DCS: Nuka-World handled.")
- EndIf
- EndIf
- ; ********************************************************************************************************
- ; STOCK MULTI-ARRAY (DCS_Flst_Outfits_Allowed) WITH APPROVED OUTFITS (OUTFIT GLOBAL VARIABLE == 1)
- ; ********************************************************************************************************
- While x < FactionSize ; Start with the outer loop
- FactionIndex = FactionList.GetAt(x) as GlobalVariable
- FactionGlobalInt = FactionIndex.GetValue() as Int
- If FactionGlobalInt == 1 ; If player selected faction,
- NestedList = pDCS_Flst_Outfits_GlobalsOutfits.GetAt(x) as FormList ; grab the outfits globals list for this faction
- NestedSize = NestedList.GetSize() ; and determine how many items are on it
- y = 0
- While y < NestedSize ; Move to the inner loop
- NestedIndex = NestedList.GetAt(y) as GlobalVariable
- NestedGlobalInt = NestedIndex.GetValue() as Int
- If NestedGlobalInt == 1 ; If player approved outfit,
- OutfitsList = pDCS_Flst_Outfits.GetAt(x) as FormList
- OutfitsIndex = OutfitsList.GetAt(y) as Outfit
- ApprovedList = pDCS_Flst_Outfits_Allowed.GetAt(x) as FormList
- ; ****************************************************************************************
- ; OK FOR ADDFORM TO STOCK BACKWARDS HERE, BECAUSE OUTFIT WILL BE SELECTED BY RANDOM ROLL
- ;
- ; (The outfit is selected in DCS_MonitorScript, which is attached to DCS_MonitorEffect.)
- ;
- ; (... And DCS_MonitorEffect is applied to non-companion Diamond City guards by cloak!)
- ; ****************************************************************************************
- ApprovedList.AddForm(OutfitsIndex as Form) ; add outfit to the approved list
- EndIf
- y += 1 ; Move to the next inner loop index
- EndWhile
- EndIf
- x += 1 ; Move to the next outer loop index
- EndWhile
- If pDCS_Global_DevTracking.GetValue() == 1
- Debug.Notification("DCS: Outfits stocked.")
- EndIf
- EndFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement