2022-07-23 15:38:20 +00:00
|
|
|
scn EBxBootstrap
|
|
|
|
|
|
|
|
ref rItem
|
|
|
|
ref rScript
|
|
|
|
ref rBrahminScriptDC
|
|
|
|
ref rList
|
|
|
|
int i
|
|
|
|
|
|
|
|
begin function {}
|
|
|
|
|
|
|
|
; Save default activate prompts for later
|
|
|
|
|
|
|
|
playerRef.AuxiliaryVariableSetString "*sDrinkPrompt" (GetStringSetting "sTargetTypeDrink")
|
|
|
|
playerRef.AuxiliaryVariableSetString "*sActivatePrompt" (GetStringSetting "sTargetTypeActivate")
|
|
|
|
|
2022-07-24 14:13:55 +00:00
|
|
|
; Fix bottle names in English version
|
|
|
|
|
|
|
|
if eval $ScotchBottle01Empty01 == "Large Whiskey Bottle"
|
|
|
|
SetName "Empty Scotch Bottle" ScotchBottle01Empty01
|
|
|
|
endif
|
|
|
|
|
|
|
|
if eval $Milkbottle01 == "Milk Bottle"
|
|
|
|
SetName "Empty Milk Bottle" Milkbottle01
|
|
|
|
endif
|
|
|
|
|
|
|
|
; INI settings
|
|
|
|
|
|
|
|
if FileExists "config\Bottle Rinse Repeat.ini"
|
2022-07-25 20:26:10 +00:00
|
|
|
let EBxFillBottleDelay := GetINIFloat "Settings:iFillBottleDelay" "Bottle Rinse Repeat.ini"
|
|
|
|
let EBxReplenishableCanteen := GetINIFloat "Settings:bReplenishableCanteen" "Bottle Rinse Repeat.ini"
|
|
|
|
let EBxCanteenSipsMax := GetINIFloat "Settings:iReplenishableCanteenMaxSips" "Bottle Rinse Repeat.ini"
|
|
|
|
if EBxCanteenSipsMax < 1
|
|
|
|
let EBxCanteenSipsMax := 4
|
|
|
|
endif
|
2022-07-24 14:13:55 +00:00
|
|
|
endif
|
|
|
|
|
2022-07-23 15:38:20 +00:00
|
|
|
; Add new items to form lists
|
|
|
|
|
|
|
|
ListAddForm NonAlchoholicDrinks EBxBrahminMilk
|
|
|
|
|
|
|
|
ListAddForm NVDLC03AllEmptyBottlesLIST EBxBeerBottleEmpty
|
|
|
|
ListAddForm RockItLauncherAmmo EBxBeerBottleEmpty
|
|
|
|
|
|
|
|
ListAddForm NVDLC03AllEmptyBottlesLIST EBxVodkaBottleEmpty
|
|
|
|
ListAddForm RockItLauncherAmmo EBxVodkaBottleEmpty
|
|
|
|
|
|
|
|
ListAddForm NVDLC03AllEmptyBottlesLIST EBxWineBottleEmpty
|
|
|
|
ListAddForm RockItLauncherAmmo EBxWineBottleEmpty
|
|
|
|
|
|
|
|
ListAddForm EBxUpgradableToDirtyList IrradiatedWaterUnpurified
|
|
|
|
ListAddForm EBxUpgradableToPuraList IrradiatedWaterUnpurified
|
|
|
|
ListAddForm EBxUpgradableToPurifiedList IrradiatedWaterUnpurified
|
|
|
|
|
|
|
|
; PipBoy icons
|
|
|
|
|
|
|
|
SetTexturePath "interface\icons\pipboyimages\items\items_whiskey.dds" WhiskeyBottle01Empty01
|
|
|
|
SetTexturePath "interface\icons\pipboyImages\Items\item_scotch.dds" ScotchBottle01Empty01
|
|
|
|
SetTexturePath "interface\icons\pipboyimages\items\items_cola.dds" NukaColaBottle
|
|
|
|
SetTexturePath "interface\icons\pipboyimages\items\items_cola.dds" SodaBottleEmpty01
|
|
|
|
SetTexturePath "interface\icons\pipboyimages\items\items_sunset_sarsp.dds" SSBottleEmpty
|
|
|
|
SetTexturePath "interface\icons\pipboyimages\items\milkbottle.dds" Milkbottle01
|
|
|
|
|
|
|
|
; Make irradiated water worthless
|
|
|
|
|
|
|
|
SetValueAlt IrradiatedWaterUnpurified EBxBottlePrice
|
|
|
|
|
|
|
|
; Vault 13 Canteen
|
|
|
|
|
2022-07-25 20:26:10 +00:00
|
|
|
if eval EBxReplenishableCanteen && IsModLoaded "ClassicPack.esm"
|
|
|
|
|
2022-07-23 15:38:20 +00:00
|
|
|
let rItem := GetFormFromMod "FalloutNV.esm" "174095" ; PreordVault13CanteenQuest
|
|
|
|
if IsFormValid rItem
|
|
|
|
RemoveScript rItem
|
|
|
|
endif
|
2022-07-25 20:26:10 +00:00
|
|
|
|
2022-07-23 15:38:20 +00:00
|
|
|
let rItem := GetFormFromMod "FalloutNV.esm" "1735D2" ; PreordVaultCanteen
|
|
|
|
if IsFormValid rItem
|
2022-07-25 20:26:10 +00:00
|
|
|
if eval $rItem == "Vault 13 Canteen"
|
|
|
|
SetName "Empty Vault 13 Canteen" rItem
|
|
|
|
endif
|
2022-07-23 15:38:20 +00:00
|
|
|
endif
|
2022-07-25 20:26:10 +00:00
|
|
|
|
2022-07-23 15:38:20 +00:00
|
|
|
endif
|
|
|
|
|
2022-07-25 20:26:10 +00:00
|
|
|
; Vault 13 Canteen effect
|
|
|
|
|
|
|
|
SetOnUseAidItemEventHandler (begin function { ref rEBxVault13Canteen }
|
|
|
|
if this == playerRef
|
|
|
|
if eval ref rEffect := ListGetNthForm EBxCanteenEffects EBxCanteenDrink
|
|
|
|
playerRef.CIOS rEffect
|
|
|
|
else
|
|
|
|
playerRef.CIOS WaterPurified
|
|
|
|
endif
|
|
|
|
if playerRef.GetItemCount EBxVault13Canteen == 0
|
|
|
|
let ref rCanteen := GetFormFromMod "FalloutNV.esm" "1735D2" ; PreordVaultCanteen
|
|
|
|
if IsFormValid rCanteen
|
|
|
|
playerRef.AddItem rCanteen 1 1
|
|
|
|
if MenuMode
|
|
|
|
RefreshItemsList
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
end) 1 EBxVault13Canteen
|
|
|
|
|
2022-07-23 15:38:20 +00:00
|
|
|
; Draining on middle click
|
|
|
|
; Short callback notation with SetOnKeyUp/DownEventHandler currently throws an exception with xNVSE 6.20 + JIP LN 56.31
|
|
|
|
|
|
|
|
SetOnMenuOpenEventHandler (begin function { i }
|
|
|
|
SetOnKeyUpEventHandler EBxOnMiddleClick 1 258
|
|
|
|
end) 1 1002
|
|
|
|
|
|
|
|
SetOnMenuCloseEventHandler (begin function { i }
|
|
|
|
SetOnKeyUpEventHandler EBxOnMiddleClick 0 258
|
|
|
|
end) 1 1002
|
|
|
|
|
|
|
|
; SSBottleEmptyNoFloat
|
|
|
|
|
|
|
|
if IsScripted SSBottleEmptyNoFloat == 0
|
|
|
|
SetEventHandler "OnAdd" (begin function { rItem, rScript }
|
|
|
|
; The item is not in player's inventory at this point
|
|
|
|
CallAfterSeconds 0 (begin function {}
|
|
|
|
let i := PlayerRef.GetItemCount SSBottleEmptyNoFloat
|
|
|
|
if i > 0
|
|
|
|
PlayerRef.RemoveItem SSBottleEmptyNoFloat i 1
|
|
|
|
PlayerRef.AddItem SSBottleEmpty i 1
|
|
|
|
endif
|
|
|
|
end)
|
|
|
|
end) "first"::SSBottleEmptyNoFloat "second"::playerRef
|
|
|
|
endif
|
|
|
|
|
|
|
|
; If not TTW, update NonAlchoholicDrinks
|
|
|
|
|
|
|
|
let EBxTTW := IsModLoaded "Fallout3.esm"
|
|
|
|
|
|
|
|
if EBxTTW == 0
|
|
|
|
let i := 0
|
|
|
|
while rItem := ListGetNthForm EBxListNonAlchoholicDrinks i
|
2022-07-24 14:13:55 +00:00
|
|
|
ListAddForm NonAlchoholicDrinks rItem -2 1
|
2022-07-23 15:38:20 +00:00
|
|
|
let i += 1
|
|
|
|
loop
|
|
|
|
endif
|
|
|
|
|
|
|
|
; Automatic detection of alchoholic drinks
|
|
|
|
|
|
|
|
let rList := TempCloneForm EmptyFormList
|
|
|
|
|
|
|
|
GetLoadedType rList 47
|
|
|
|
let i := ListGetCount rList
|
|
|
|
while i > 0
|
|
|
|
let i -= 1
|
|
|
|
let rItem := ListGetNthForm rList i
|
|
|
|
if GetEquipType rItem == 13
|
2022-07-24 14:13:55 +00:00
|
|
|
ListAddForm AlchoholicDrinks rItem -2 1
|
2022-07-23 15:38:20 +00:00
|
|
|
endif
|
|
|
|
loop
|
|
|
|
|
|
|
|
; Enable brahmin milking
|
|
|
|
|
|
|
|
if EBxTTW
|
2022-07-25 20:26:10 +00:00
|
|
|
let rBrahminScriptDC := GetFormFromMod "Fallout3.esm" "38705" ; CRBrahminScriptDC
|
2022-07-23 15:38:20 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
GetLoadedType rList 43
|
|
|
|
let i := ListGetCount rList
|
|
|
|
while i > 0
|
|
|
|
let i -= 1
|
|
|
|
let rItem := ListGetNthForm rList i
|
|
|
|
if eval (GetCreatureType rItem == 1) && (rScript := GetScript rItem) && (rScript == CRBrahminScript || rScript == rBrahminScriptDC)
|
|
|
|
continue
|
|
|
|
endif
|
|
|
|
ListRemoveNthForm rList i
|
|
|
|
loop
|
|
|
|
SetEventHandler "OnActivate" EBxMilkBrahmin "first"::rList "second"::playerRef
|
|
|
|
|
|
|
|
ListClear rList
|
|
|
|
let rList := 0
|
|
|
|
|
|
|
|
; Game load events
|
|
|
|
|
|
|
|
SetEventHandler "NewGame" ({} => call EBxOnGameLoad 1)
|
|
|
|
SetEventHandler "PostLoadGame" EBxOnGameLoad
|
|
|
|
|
|
|
|
end
|