You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
4.0 KiB

scn EBxOnGameLoad
int i
int n
int bImmersivePickupSounds
ref rItem
ref rEntry
ref rBottleUp
ref rBottleDown
int iCounter
int bAddEmpties
begin function { i }
; Runs on entering GameMode
; Using a callback here sometimes throws the exception, probably destroyed prematurely:
; 14154707 h 0FD78A00 8B4E0485 nvse_1_4.dll (10068A00)
; 14154707 ^ 005E234B 00000081 FalloutNV.exe
CallAfterSeconds 0.1 EBxOnGameMode
if EBxCanteenSipsMax > 0
let rEntry := ListGetNthForm EBxCanteenEffects EBxCanteenDrink
if IsFormValid rEntry
LNSetName ($rEntry) EBxVault13CanteenEffect
else
let EBxCanteenDrink := ListGetFormIndex EBxCanteenEffects WaterPurified
endif
endif
if EBxVersion < 31
let EBxVersion := 31
if IsModLoaded "ClassicPack.esm"
let ref rPreordQuest := GetFormFromMod "FalloutNV.esm" "17912D" ; VDLCPackQuest
if eval IsFormValid rPreordQuest && GetVariable "bClassicItemsGiven" rPreordQuest
if playerRef.GetItemCount EBxVault13Canteen == 0
let ref rPreordVaultCanteen := GetFormFromMod "FalloutNV.esm" "1735D2" ; PreordVaultCanteen
if eval IsFormValid rPreordVaultCanteen && playerRef.GetItemCount rPreordVaultCanteen == 0
playerRef.AddItem rPreordVaultCanteen 1 1
endif
endif
endif
endif
endif
if GetGameRestarted == 0
return
endif
; The following code can run fine from EBxBootstrap,
; running it in PostLoadGame provides support for scripted injections
; from MenuMode 4 and JIP gr_* scripts.
let bImmersivePickupSounds := FileExists "sound\fx\pickup sounds\bottles" 1
if bImmersivePickupSounds
let rBottleUp := rBottleDown := EBxPickUpEmptyBottle
else
let rBottleUp := EBxSoundBottleUp
let rBottleDown := EBxSoundBottleDown
endif
let i := 0
while rItem := ListGetNthForm NVDLC03AllEmptyBottlesLIST i
SetWeight EBxBottleWeight rItem ; Set bottle weight
SetBaseItemValue rItem EBxBottlePrice ; Set bottle price
SetPickupSound rItem rBottleUp
SetPutdownSound rItem rBottleDown
ListAddForm EBxUpgradableToDirtyList rItem
ListAddForm EBxUpgradableToPuraList rItem
ListAddForm EBxUpgradableToPurifiedList rItem
let i += 1
loop
; Upgradeable drinks
ListAddForm EBxUpgradableToPuraList WaterUnpurified
ListAddForm EBxUpgradableToPurifiedList WaterUnpurified
; Broken Steel drinks
if EBxTTW
set rItem to GetFormFromMod "BrokenSteel.esm" "4C7A" ; DLC03WQ03WaterHoly
if IsFormValid rItem
ListAddForm EBxUpgradableToDirtyList rItem 1
ListAddForm EBxUpgradableToPuraList rItem 1
ListAddForm EBxUpgradableToPurifiedList rItem 1
endif
set rItem to GetFormFromMod "BrokenSteel.esm" "6F62" ; DLC03WQ02AquaCura
if IsFormValid rItem
ListAddForm EBxUpgradableToDirtyList rItem
ListAddForm EBxUpgradableToPuraList rItem
ListAddForm EBxUpgradableToPurifiedList rItem
endif
let rItem := GetFormFromMod "BrokenSteel.esm" "104F" ; DLC03AquaPura
if IsFormValid rItem
ListAddForm EBxUpgradableToPurifiedList rItem
endif
endif
if bImmersivePickupSounds
let rBottleUp := rBottleDown := EBxPickUpDrink
else
let rBottleUp := ITMBottleUp
let rBottleDown := ITMBottleDown
endif
let bAddEmpties := 1
if FileExists "config\Bottle Rinse Repeat.ini"
let bAddEmpties := GetINIFloat "Settings:bAddEmptyBottlesOnConsumption" "Bottle Rinse Repeat.ini"
endif
let i := 0
while rItem := ListGetNthForm EBxDrinkLists i
if bAddEmpties
SetOnUseAidItemEventHandler EBxOnDrink 1 rItem
endif
if GetType rItem == 85 ; form list
let n := 0
while rEntry := ListGetNthForm rItem n
if GetPickupSound rEntry == 0
SetPickupSound rEntry rBottleUp
endif
if GetPutdownSound rEntry == 0
SetPutdownSound rEntry rBottleDown
endif
let n += 1
loop
elseif GetType rItem == 47
if GetPickupSound rItem == 0
SetPickupSound rItem rBottleUp
endif
if GetPutdownSound rItem == 0
SetPutdownSound rItem rBottleDown
endif
endif
let i += 1
loop
end