Compare commits
No commits in common. "master" and "3.0" have entirely different histories.
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1 +0,0 @@
|
|||||||
*.* filter= diff= merge= -text
|
|
||||||
Binary file not shown.
@ -1,5 +0,0 @@
|
|||||||
[Settings]
|
|
||||||
iFillBottleDelay = 1
|
|
||||||
bReplenishableCanteen = 1
|
|
||||||
iReplenishableCanteenMaxSips = 4
|
|
||||||
bAddEmptyBottlesOnConsumption = 1
|
|
||||||
@ -1,16 +1,13 @@
|
|||||||
if GetNVSEVersionFull < 6.25
|
if GetNVSEVersionFull < 6.2
|
||||||
MessageBoxEx "Bottle Rinse Repeat requires xNVSE 6.25+."
|
MessageBoxEx "Bottle Rinse Repeat requires xNVSE 6.20+."
|
||||||
return
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if GetPluginVersion "JohnnyGuitarNVSE" < 325
|
if GetPluginVersion "JohnnyGuitarNVSE" < 325
|
||||||
MessageBoxEx "Bottle Rinse Repeat requires JohnnyGuitar NVSE 3.25+."
|
MessageBoxEx "Bottle Rinse Repeat requires JohnnyGuitar NVSE 3.25+."
|
||||||
return
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if GetPluginVersion "JIP LN NVSE" < 55.70
|
if GetPluginVersion "JIP LN NVSE" < 55.70
|
||||||
MessageBoxEx "Bottle Rinse Repeat requires JIP LN 55.70+."
|
MessageBoxEx "Bottle Rinse Repeat requires JIP LN 55.70+."
|
||||||
return
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CallAfterSeconds 0.8 EBxBootstrap 1
|
call EBxBootstrap
|
||||||
|
|||||||
@ -1,42 +0,0 @@
|
|||||||
scn EBxActivateWaterSource
|
|
||||||
|
|
||||||
ref rSource
|
|
||||||
string_var sPrompt
|
|
||||||
|
|
||||||
begin function {}
|
|
||||||
|
|
||||||
SetGameMainLoopCallback EBxOnCrosshairTracker 0
|
|
||||||
|
|
||||||
SetOnControlDownEventHandler EBxOnControlDown 0 5
|
|
||||||
;SetOnControlUpEventHandler EBxOnControlUp 0 5
|
|
||||||
;EnableControl 5
|
|
||||||
|
|
||||||
let rSource := GetCrosshairRef
|
|
||||||
|
|
||||||
if GetCrosshairWater
|
|
||||||
let sPrompt := playerRef.AuxiliaryVariableGetString "*sDrinkPrompt"
|
|
||||||
elseif eval IsFormValid rSource && (sPrompt := rSource.GetActivatorPrompt) == ""
|
|
||||||
let sPrompt := playerRef.AuxiliaryVariableGetString "*sActivatePrompt"
|
|
||||||
endif
|
|
||||||
|
|
||||||
if GetUIFloat "HUDMainMenu\_DUIF3" > 0 ; DarnUI
|
|
||||||
SetUIStringAlt "HUDMainMenu/InfoWrap/Info/justify_center_hotrect/string" $sPrompt
|
|
||||||
else
|
|
||||||
SetUIStringAlt "HUDMainMenu/Info/justify_center_hotrect/string" $sPrompt
|
|
||||||
endif
|
|
||||||
|
|
||||||
sv_destruct sPrompt
|
|
||||||
|
|
||||||
if IsFormValid rSource
|
|
||||||
|
|
||||||
MessageEx "filling bottles"
|
|
||||||
|
|
||||||
call EBxFillFromObject rSource
|
|
||||||
|
|
||||||
if rSource.HasScriptBlock 2
|
|
||||||
rSource.Activate playerRef 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,185 +0,0 @@
|
|||||||
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")
|
|
||||||
|
|
||||||
; 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"
|
|
||||||
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"
|
|
||||||
endif
|
|
||||||
|
|
||||||
if EBxCanteenSipsMax < 1
|
|
||||||
let EBxCanteenSipsMax := 4
|
|
||||||
endif
|
|
||||||
|
|
||||||
; 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
|
|
||||||
|
|
||||||
if eval EBxReplenishableCanteen && IsModLoaded "ClassicPack.esm"
|
|
||||||
|
|
||||||
let rItem := GetFormFromMod "FalloutNV.esm" "174095" ; PreordVault13CanteenQuest
|
|
||||||
if IsFormValid rItem
|
|
||||||
RemoveScript rItem
|
|
||||||
endif
|
|
||||||
|
|
||||||
let rItem := GetFormFromMod "FalloutNV.esm" "1735D2" ; PreordVaultCanteen
|
|
||||||
if IsFormValid rItem
|
|
||||||
if eval $rItem == "Vault 13 Canteen"
|
|
||||||
SetName "Empty Vault 13 Canteen" rItem
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
; 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
|
|
||||||
|
|
||||||
; 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
|
|
||||||
ListAddForm NonAlchoholicDrinks rItem -2 1
|
|
||||||
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
|
|
||||||
ListAddForm AlchoholicDrinks rItem -2 1
|
|
||||||
endif
|
|
||||||
loop
|
|
||||||
|
|
||||||
; Enable brahmin milking
|
|
||||||
|
|
||||||
if EBxTTW
|
|
||||||
let rBrahminScriptDC := GetFormFromMod "Fallout3.esm" "38705" ; CRBrahminScriptDC
|
|
||||||
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
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
scn EBxFillFromObject
|
|
||||||
|
|
||||||
ref rSource
|
|
||||||
ref rDrink
|
|
||||||
ref rReplaceables
|
|
||||||
array_var aArgs
|
|
||||||
|
|
||||||
begin function { rSource }
|
|
||||||
|
|
||||||
if rSource == 0
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let aArgs := call EBxGetDrinksToUpgrade rSource
|
|
||||||
|
|
||||||
if eval 0 >= ar_size aArgs
|
|
||||||
let aArgs := ar_null
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let rDrink := aArgs[0]
|
|
||||||
let rReplaceables := aArgs[1]
|
|
||||||
let aArgs := ar_null
|
|
||||||
|
|
||||||
if playerRef.GetItemCount caps001 < playerRef.GetItemCount rReplaceables
|
|
||||||
ShowMessage EBxMsgNoCaps
|
|
||||||
endif
|
|
||||||
|
|
||||||
call EBxReplaceFormListWithItem rDrink rReplaceables
|
|
||||||
|
|
||||||
call EBxReplenishCanteen rDrink 0
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
scn EBxGetBottleByDrink
|
|
||||||
|
|
||||||
int iCount
|
|
||||||
ref rDrink
|
|
||||||
ref rBaseForm
|
|
||||||
ref rBottle
|
|
||||||
|
|
||||||
begin function { rDrink }
|
|
||||||
|
|
||||||
if IsReference rDrink
|
|
||||||
set rBaseForm to rDrink.GetBaseForm
|
|
||||||
else
|
|
||||||
set rBaseForm to rDrink
|
|
||||||
endif
|
|
||||||
|
|
||||||
if rBaseForm == IrradiatedScotch || rBaseForm == Scotch || rBaseForm == ScotchGood
|
|
||||||
set rBottle to ScotchBottle01Empty01
|
|
||||||
elseif rBaseForm == SSBottleFull || rBaseForm == IrradiatedSSBottleFull
|
|
||||||
set rBottle to SSBottleEmpty
|
|
||||||
elseif rBaseForm == Beer || rBaseForm == IrradiatedBeer
|
|
||||||
set rBottle to EBxBeerBottleEmpty
|
|
||||||
elseif rBaseForm == Vodka
|
|
||||||
set rBottle to EBxVodkaBottleEmpty
|
|
||||||
elseif rBaseForm == Whiskey || rBaseForm == IrradiatedWhiskey || rBaseForm == WhiskeyDixon
|
|
||||||
set rBottle to WhiskeyBottle01Empty01
|
|
||||||
elseif rBaseForm == Wine
|
|
||||||
set rBottle to EBxWineBottleEmpty
|
|
||||||
elseif eval rBaseForm == EBxBrahminMilk || IsRefInList WaterLIST rDrink > -1
|
|
||||||
|
|
||||||
; prevent endless loop
|
|
||||||
if ListGetCount NVDLC03AllEmptyBottlesLIST > 0
|
|
||||||
|
|
||||||
while rBottle == 0 || rBottle == SSBottleEmptyNoFloat
|
|
||||||
set iCount to ListGetCount NVDLC03AllEmptyBottlesLIST
|
|
||||||
set iCount to Rand 0 iCount
|
|
||||||
set rBottle to ListGetNthForm NVDLC03AllEmptyBottlesLIST iCount
|
|
||||||
loop
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
elseif IsRefInList NukaBottleDrinks rDrink > -1
|
|
||||||
set rBottle to NukaColaBottle
|
|
||||||
elseif eval GetAddictionEffect rBaseForm == WithdrawalAlcohol || IsRefInList AlchoholicDrinks rDrink > -1
|
|
||||||
set rBottle to ScotchBottle01Empty01
|
|
||||||
elseif IsRefInList NonAlchoholicDrinks rDrink > -1
|
|
||||||
set rBottle to SodaBottleEmpty01
|
|
||||||
endif
|
|
||||||
|
|
||||||
SetFunctionValue rBottle
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
scn EBxGetDrinksToUpgrade
|
|
||||||
|
|
||||||
ref rSource
|
|
||||||
ref rWaterType
|
|
||||||
ref rWaterEffect
|
|
||||||
|
|
||||||
; TTW
|
|
||||||
ref rMQA
|
|
||||||
ref rAquaPura
|
|
||||||
|
|
||||||
begin function { rSource }
|
|
||||||
|
|
||||||
if GetType rSource == 21 ; activator
|
|
||||||
set rWaterType to rSource.GetActivatorWaterType
|
|
||||||
else
|
|
||||||
set rWaterType to GetCrosshairWater
|
|
||||||
endif
|
|
||||||
|
|
||||||
if IsFormValid rWaterType == 0
|
|
||||||
SetFunctionValue (ar_construct "array")
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
set rWaterEffect to GetWaterFormEffect rWaterType
|
|
||||||
|
|
||||||
if IsFormValid rWaterEffect == 0
|
|
||||||
; fallback for water types without effect
|
|
||||||
SetFunctionValue (ar_list WaterUnpurified, EBxUpgradableToDirtyList)
|
|
||||||
|
|
||||||
elseif rWaterEffect == WaterHeal1Purified
|
|
||||||
if EBxHardcore
|
|
||||||
SetFunctionValue (ar_list WaterUnpurified, EBxUpgradableToDirtyList)
|
|
||||||
else
|
|
||||||
SetFunctionValue (ar_list WaterPurified, EBxUpgradableToPurifiedList)
|
|
||||||
endif
|
|
||||||
|
|
||||||
elseif rWaterEffect == WaterHeal2Good
|
|
||||||
SetFunctionValue (ar_list WaterUnpurified, EBxUpgradableToDirtyList)
|
|
||||||
|
|
||||||
elseif rWaterEffect == WaterHeal3Average
|
|
||||||
if EBxHardcore
|
|
||||||
SetFunctionValue (ar_list IrradiatedWaterUnpurified, NVDLC03AllEmptyBottlesLIST)
|
|
||||||
else
|
|
||||||
SetFunctionValue (ar_list WaterUnpurified, EBxUpgradableToDirtyList)
|
|
||||||
endif
|
|
||||||
|
|
||||||
elseif rWaterEffect == WaterHeal4Bad || rWaterEffect == WaterHeal5Terrible
|
|
||||||
SetFunctionValue (ar_list IrradiatedWaterUnpurified, NVDLC03AllEmptyBottlesLIST)
|
|
||||||
|
|
||||||
elseif rWaterEffect == WaterHeal1Rads500 ; Lethal Water
|
|
||||||
SetFunctionValue (ar_construct "array")
|
|
||||||
|
|
||||||
elseif eval EBxTTW && rWaterEffect == GetFormFromMod "BrokenSteel.esm" "B400" ; DLC03TidalBasinWaterEffect
|
|
||||||
let rMQA := GetFormFromMod "Fallout3.esm" "14E93" ; MQA
|
|
||||||
let rAquaPura := GetFormFromMod "BrokenSteel.esm" "104F" ; DLC03AquaPura
|
|
||||||
|
|
||||||
if IsFormValid rMQA && IsFormValid rAquaPura
|
|
||||||
if GetStageDone rMQA 100 == 1
|
|
||||||
; Project Purity water source has been infected, skip bottling
|
|
||||||
SetFunctionValue (ar_construct "array")
|
|
||||||
else
|
|
||||||
SetFunctionValue (ar_list rAquaPura, EBxUpgradableToPuraList)
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
SetFunctionValue (ar_construct "array")
|
|
||||||
endif
|
|
||||||
|
|
||||||
else
|
|
||||||
; fallback for custom water types
|
|
||||||
SetFunctionValue (ar_list WaterUnpurified, EBxUpgradableToDirtyList)
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
scn EBxMilkBrahmin
|
|
||||||
|
|
||||||
ref rBrahmin
|
|
||||||
ref rActionRef
|
|
||||||
ref rOwner
|
|
||||||
int iChance
|
|
||||||
int iTimestamp
|
|
||||||
int iLastMilked
|
|
||||||
|
|
||||||
begin function { rBrahmin, rActionRef }
|
|
||||||
|
|
||||||
if playerRef.IsSneaking || rBrahmin.GetDead ; Keep tipping intact
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
if playerRef.GetItemCount EBxUpgradableToPuraList == 0
|
|
||||||
ShowMessage EBxMsgNoBottles
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
if playerRef.GetItemCount caps001 == 0
|
|
||||||
ShowMessage EBxMsgNoCaps
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let iTimestamp := (GetUserTime)["Hour"]
|
|
||||||
if iTimestamp == 0
|
|
||||||
let iTimestamp := 24
|
|
||||||
endif
|
|
||||||
|
|
||||||
let iLastMilked := rBrahmin.GetAV Variable09
|
|
||||||
|
|
||||||
if iLastMilked != 0
|
|
||||||
if iLastMilked == iTimestamp
|
|
||||||
ShowMessage EBxMsgBrahminMilked
|
|
||||||
return
|
|
||||||
elseif iTimestamp < iLastMilked
|
|
||||||
rBrahmin.SetAV Variable09 0
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
let iChance := playerRef.GetAV luck * 10 - GetRandomPercent + 1
|
|
||||||
|
|
||||||
if iChance < 0
|
|
||||||
ShowMessage EBxMsgBrahminMilked
|
|
||||||
rBrahmin.SetAV Variable09 iTimestamp
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
rBrahmin.PlaySound NPCBrahminIdleMoo
|
|
||||||
|
|
||||||
call EBxReplaceFormListWithItem EBxBrahminMilk EBxUpgradableToPuraList
|
|
||||||
|
|
||||||
if EBxCanteenSipsMax > 0
|
|
||||||
call EBxReplenishCanteen EBxBrahminMilk 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
rBrahmin.SetAV Variable09 iTimestamp
|
|
||||||
|
|
||||||
; TODO: Show owned brahmin's prompt in red
|
|
||||||
;
|
|
||||||
; set rOwner to rBrahmin.GetOwner
|
|
||||||
; if IsFormValid rOwner == 0
|
|
||||||
; set rOwner to rBrahmin.GetParentCellOwner
|
|
||||||
; endif
|
|
||||||
|
|
||||||
; if IsFormValid rOwner
|
|
||||||
; if rOwner != PlayerFaction && rOwner != playerRef.GetBaseForm
|
|
||||||
; if eval GetType rOwner != 8 || PlayerRef.GetInFaction rOwner != 1 || rBrahmin.GetOwningFactionRequiredRank > PlayerRef.GetFactionRank rOwner
|
|
||||||
; playerRef.SendStealingAlarm rBrahmin
|
|
||||||
; endif
|
|
||||||
; endif
|
|
||||||
; endif
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
scn EBxOnControlDown
|
|
||||||
|
|
||||||
int iControl
|
|
||||||
|
|
||||||
begin function { iControl }
|
|
||||||
|
|
||||||
; start countdown
|
|
||||||
playerRef.AuxiliaryVariableErase "*timer"
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
scn EBxOnControlUp
|
|
||||||
|
|
||||||
int iControl
|
|
||||||
ref rSource
|
|
||||||
string_var sPrompt
|
|
||||||
|
|
||||||
begin function { iControl }
|
|
||||||
|
|
||||||
if eval EBxFillBottleDelay > 0 && playerRef.AuxiliaryVariableGetFloat "*timer" < EBxFillBottleDelay
|
|
||||||
MessageEx "Normal activation"
|
|
||||||
let rSource := GetCrosshairRef
|
|
||||||
if IsFormValid rSource
|
|
||||||
rSource.Activate playerRef 1
|
|
||||||
endif
|
|
||||||
playerRef.AuxiliaryVariableErase "*timer"
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
if EBxFillBottleDelay <= 0
|
|
||||||
call EBxActivateWaterSource
|
|
||||||
endif
|
|
||||||
|
|
||||||
playerRef.AuxiliaryVariableErase "*timer"
|
|
||||||
|
|
||||||
EnableControl 5
|
|
||||||
SetOnControlUpEventHandler EBxOnControlUp 0 5
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
scn EBxOnCrosshair
|
|
||||||
|
|
||||||
ref rSource
|
|
||||||
ref rDrink
|
|
||||||
int iCount
|
|
||||||
array_var aDrinksToUpgrade
|
|
||||||
string_var sOrigPrompt
|
|
||||||
string_var sPrompt
|
|
||||||
string_var sBottles
|
|
||||||
|
|
||||||
begin function { rSource }
|
|
||||||
|
|
||||||
if rSource == 0 ; IsFormValid returns 0 on form 35
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
if rSource.GetType != 21 ; activator
|
|
||||||
if GetCrosshairWater == 0
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
elseif rSource.GetActivatorWaterType == 0
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let aDrinksToUpgrade := call EBxGetDrinksToUpgrade rSource
|
|
||||||
|
|
||||||
if eval 0 >= ar_size aDrinksToUpgrade
|
|
||||||
let aDrinksToUpgrade := ar_null
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let rDrink := aDrinksToUpgrade[0]
|
|
||||||
let iCount := GetMinOf (playerRef.GetItemCount caps001) (playerRef.GetItemCount (aDrinksToUpgrade[1]))
|
|
||||||
let aDrinksToUpgrade := ar_null
|
|
||||||
|
|
||||||
if iCount > 0
|
|
||||||
let sBottles := sv_construct "%g bottle%{s%}" iCount (iCount > 1)
|
|
||||||
elseif call EBxReplenishCanteen rDrink 1
|
|
||||||
let sBottles := "canteen"
|
|
||||||
else
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
if GetCrosshairWater
|
|
||||||
let sPrompt := sv_construct "%{Drink or hold to fill%}%{Fill%} %z with %n" (EBxFillBottleDelay > 0) (EBxFillBottleDelay <= 0) sBottles rDrink
|
|
||||||
SetStringSetting "sTargetTypeDrink" $sPrompt
|
|
||||||
CallAfterSeconds 0 ({} => SetStringSetting "sTargetTypeDrink" (playerRef.AuxiliaryVariableGetString "*sDrinkPrompt"))
|
|
||||||
elseif eval rSource.GetActivatorPrompt != ""
|
|
||||||
let sOrigPrompt := rSource.GetActivatorPrompt
|
|
||||||
if EBxFillBottleDelay > 0
|
|
||||||
let sPrompt := $(rSource.GetActivatorPrompt) + " or hold to fill"
|
|
||||||
else
|
|
||||||
let sPrompt := "Fill"
|
|
||||||
endif
|
|
||||||
let sPrompt := sv_construct "%z %z with %n" sPrompt sBottles rDrink
|
|
||||||
rSource.SetActivatorPrompt $sPrompt
|
|
||||||
CallAfterSeconds 0 ({} => rSource.SetActivatorPrompt $sOrigPrompt)
|
|
||||||
else
|
|
||||||
let sPrompt := sv_construct "%{Activate or hold to fill%}%{Fill%} %z with %n" (EBxFillBottleDelay > 0) (EBxFillBottleDelay <= 0) sBottles rDrink
|
|
||||||
SetStringSetting "sTargetTypeActivate" $sPrompt
|
|
||||||
CallAfterSeconds 0 ({} => SetStringSetting "sTargetTypeActivate" (playerRef.AuxiliaryVariableGetString "*sActivatePrompt"))
|
|
||||||
endif
|
|
||||||
|
|
||||||
DisableControl 5
|
|
||||||
SetOnControlDownEventHandler EBxOnControlDown 1 5
|
|
||||||
SetOnControlUpEventHandler EBxOnControlUp 1 5
|
|
||||||
|
|
||||||
SetGameMainLoopCallback EBxOnCrosshairTracker 1 1 11
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
scn EBxOnCrosshairAfter
|
|
||||||
|
|
||||||
ref rActivator
|
|
||||||
|
|
||||||
begin function {}
|
|
||||||
|
|
||||||
if GetCrosshairWater
|
|
||||||
|
|
||||||
SetStringSetting "sTargetTypeDrink" (playerRef.AuxiliaryVariableGetString "*sDrinkPrompt")
|
|
||||||
|
|
||||||
elseif playerRef.AuxiliaryVariableGetSize "*ap"
|
|
||||||
|
|
||||||
let rActivator := GetCrosshairRef
|
|
||||||
if IsFormValid rActivator
|
|
||||||
rActivator.SetActivatorPrompt (playerRef.AuxiliaryVariableGetString "*ap")
|
|
||||||
endif
|
|
||||||
playerRef.AuxiliaryVariableErase "*ap"
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
SetStringSetting "sTargetTypeActivate" (playerRef.AuxiliaryVariableGetString "*sActivatePrompt")
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
scn EBxOnCrosshairTracker
|
|
||||||
|
|
||||||
ref rSource
|
|
||||||
|
|
||||||
begin function {}
|
|
||||||
|
|
||||||
if MenuMode == 0
|
|
||||||
|
|
||||||
if eval EBxFillBottleDelay > 0 && IsControlDisabled 5 && IsKeyPressed (GetControl 5) 2
|
|
||||||
if playerRef.AuxiliaryVariableGetFloat "*timer" < EBxFillBottleDelay
|
|
||||||
playerRef.AuxiliaryVariableSetFloat "*timer" (playerRef.AuxiliaryVariableGetFloat "*timer" + GetSecondsPassed)
|
|
||||||
else
|
|
||||||
MessageEx "activating source"
|
|
||||||
call EBxActivateWaterSource
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if GetCrosshairWater
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
if eval rSource := GetCrosshairRef
|
|
||||||
if rSource.GetType == 21 ; activator
|
|
||||||
if rSource.GetActivatorWaterType
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
SetGameMainLoopCallback EBxOnCrosshairTracker 0
|
|
||||||
|
|
||||||
SetOnControlDownEventHandler EBxOnControlDown 0 5
|
|
||||||
SetOnControlUpEventHandler EBxOnControlUp 0 5
|
|
||||||
EnableControl 5
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
scn EBxOnDrink
|
|
||||||
|
|
||||||
ref rDrink
|
|
||||||
ref rBottle
|
|
||||||
|
|
||||||
begin function { rDrink }
|
|
||||||
|
|
||||||
if this != playerRef
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let rBottle := call EBxGetBottleByDrink rDrink
|
|
||||||
|
|
||||||
if IsFormValid rBottle == 0
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
AddItem rBottle 1 1
|
|
||||||
|
|
||||||
if MenuMode
|
|
||||||
RefreshItemsList
|
|
||||||
endif
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,145 +0,0 @@
|
|||||||
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
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
scn EBxOnGameMode
|
|
||||||
|
|
||||||
begin function {}
|
|
||||||
|
|
||||||
SetJohnnyOnCrosshairEventHandler 1 EBxOnCrosshair 0 xMarker 21
|
|
||||||
SetJohnnyOnCrosshairEventHandler 1 EBxOnCrosshair 0 xMarker 35
|
|
||||||
SetJohnnyOnCrosshairEventHandler 1 EBxOnCrosshair 0 xMarker 78
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
scn EBxOnMiddleClick
|
|
||||||
|
|
||||||
int iKeyID
|
|
||||||
ref rItem
|
|
||||||
ref rBottle
|
|
||||||
|
|
||||||
begin function { iKeyID }
|
|
||||||
|
|
||||||
if iKeyID != 258 ; not middle click
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
set rItem to GetSelectedItemRef
|
|
||||||
|
|
||||||
if IsFormValid rItem
|
|
||||||
if rItem.GetType == 47 ; ingestible
|
|
||||||
|
|
||||||
set rBottle to call EBxGetBottleByDrink rItem
|
|
||||||
|
|
||||||
if IsFormValid rBottle
|
|
||||||
set rItem to rItem.GetBaseObject
|
|
||||||
playerRef.RemoveItem rItem 1 1
|
|
||||||
playerRef.AddItem rBottle 1 1
|
|
||||||
PlaySound ITMBottleDown 1
|
|
||||||
MessageExAlt 1 ($rBottle + " " + $(GetStringSetting "sAddItemtoInventory")) ; ShowMessage causes CTD in MenuMode 1002
|
|
||||||
RefreshItemsList
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
scn EBxPreordVault13CanteenScript
|
|
||||||
|
|
||||||
begin GameMode
|
|
||||||
|
|
||||||
if GetContainer != playerRef
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
set EBxCanteenSipsMax to 4
|
|
||||||
|
|
||||||
if playerRef.GetItemCount EBxVault13Canteen < EBxCanteenSipsMax
|
|
||||||
playerRef.AddItem EBxVault13Canteen EBxCanteenSipsMax 1
|
|
||||||
RemoveMe
|
|
||||||
if MenuMode
|
|
||||||
RefreshItemsList
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
scn EBxReplaceFormListWithItem
|
|
||||||
|
|
||||||
; Arguments
|
|
||||||
ref rReplacer
|
|
||||||
ref rReplaceFormList
|
|
||||||
|
|
||||||
; Temp vars
|
|
||||||
ref rItem
|
|
||||||
int iCount
|
|
||||||
int iOutputAmount
|
|
||||||
int iRemainingItems
|
|
||||||
int i
|
|
||||||
|
|
||||||
begin Function { rReplacer, rReplaceFormList }
|
|
||||||
|
|
||||||
let iOutputAmount := GetMinOf (playerRef.GetItemCount Caps001) (playerRef.GetItemCount rReplaceFormList)
|
|
||||||
|
|
||||||
if iOutputAmount == 0
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
if rReplacer == EBxBrahminMilk
|
|
||||||
let iOutputAmount := 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
let iRemainingItems := iOutputAmount
|
|
||||||
|
|
||||||
while rItem := ListGetNthForm rReplaceFormList i
|
|
||||||
|
|
||||||
let iCount := playerRef.GetItemCount rItem
|
|
||||||
let iCount := GetMinOf iCount iRemainingItems
|
|
||||||
|
|
||||||
playerRef.RemoveItem rItem iCount 1
|
|
||||||
playerRef.RemoveItem Caps001 iCount 1
|
|
||||||
|
|
||||||
let iRemainingItems -= iCount
|
|
||||||
|
|
||||||
if iRemainingItems <= 0
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
|
|
||||||
let i += 1
|
|
||||||
loop
|
|
||||||
|
|
||||||
playerRef.AddItem rReplacer iOutputAmount
|
|
||||||
|
|
||||||
end
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
scn EBxReplenishCanteen
|
|
||||||
|
|
||||||
ref rNewDrink
|
|
||||||
ref rCurrentDrink
|
|
||||||
ref rCanteen
|
|
||||||
ref rPreordVaultCanteen
|
|
||||||
int iCount
|
|
||||||
int iNewDrink
|
|
||||||
int bCheckOnly
|
|
||||||
|
|
||||||
begin function { rNewDrink, bCheckOnly }
|
|
||||||
|
|
||||||
if EBxReplenishableCanteen == 0
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
if playerRef.GetItemCount EBxVault13Canteen == 0
|
|
||||||
let ref rPreordVaultCanteen := GetFormFromMod "FalloutNV.esm" "1735D2" ; PreordVaultCanteen
|
|
||||||
if eval ! IsFormValid rPreordVaultCanteen || playerRef.GetItemCount rPreordVaultCanteen == 0
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
let iNewDrink := ListGetFormIndex EBxCanteenEffects rNewDrink
|
|
||||||
|
|
||||||
if iNewDrink == -1 ; unknown type, fallback to Purified Water
|
|
||||||
set rNewDrink to WaterPurified
|
|
||||||
set iNewDrink to ListGetFormIndex EBxCanteenEffects rNewDrink
|
|
||||||
endif
|
|
||||||
|
|
||||||
let rCurrentDrink := ListGetNthForm EBxCanteenEffects EBxCanteenDrink
|
|
||||||
|
|
||||||
if IsFormValid rCurrentDrink == 0 ; invalid EBxCanteenDrink value, also fallback to Purified Water
|
|
||||||
set rCurrentDrink to WaterPurified
|
|
||||||
set EBxCanteenDrink to ListGetFormIndex EBxCanteenEffects rCurrentDrink
|
|
||||||
endif
|
|
||||||
|
|
||||||
if rNewDrink == rCurrentDrink
|
|
||||||
elseif rCurrentDrink == IrradiatedWaterUnpurified ; any replacement will do
|
|
||||||
elseif (rCurrentDrink != WaterPurified && rCurrentDrink != EBxBrahminMilk) && (rNewDrink == WaterPurified || rNewDrink == EBxBrahminMilk)
|
|
||||||
elseif playerRef.GetItemCount EBxVault13Canteen > 0
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let iCount := EBxCanteenSipsMax - playerRef.GetItemCount EBxVault13Canteen
|
|
||||||
|
|
||||||
if bCheckOnly
|
|
||||||
SetFunctionValue (EBxCanteenDrink != iNewDrink || iCount > 0)
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
if iCount > 0
|
|
||||||
let rPreordVaultCanteen := GetFormFromMod "FalloutNV.esm" "1735D2" ; PreordVaultCanteen
|
|
||||||
if IsFormValid rPreordVaultCanteen
|
|
||||||
playerRef.RemoveItem rPreordVaultCanteen 1 1
|
|
||||||
endif
|
|
||||||
playerRef.AddItem EBxVault13Canteen iCount 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
set rCanteen to EBxVault13CanteenEffect
|
|
||||||
SetNameEx "%n" rNewDrink rCanteen
|
|
||||||
|
|
||||||
if EBxCanteenDrink != iNewDrink || iCount > 0
|
|
||||||
PlaySound ITMBottleDown 1
|
|
||||||
set rCanteen to EBxVault13Canteen
|
|
||||||
MessageEx "%n has been replenished with %n." rCanteen rNewDrink
|
|
||||||
endif
|
|
||||||
|
|
||||||
set EBxCanteenDrink to iNewDrink
|
|
||||||
|
|
||||||
end
|
|
||||||
Loading…
x
Reference in New Issue
Block a user