JIT
Code to extinguish indoor campfires in rain
Create a code that when it is raining, all indoor campfires will be put out

lua -- No code provided, cannot fulfill request.

Use this as your guide, though it is all randomly jumbled together and not everything pertains to campfires or the weather

Okay, I will create the structure for managing weather and campfires, implementing the logic to extinguish indoor campfires when it starts raining.

Updated files
v1
Here, use these code words: --- only run on server if isClient() then return end --check every ten minutes Events.EveryTenMinutes.Add(function () local instance = SCampfireSystem.instance local isRaining = getClimateManager():isRaining() ---loop all objects for i = 0, instance.system:getObjectCount() - 1 do local luaObject = instance.system:getObjectByIndex(i):getModData() if isRaining and luaObject.exterior then luaObject:putOut() end end end) function Utils.getWeather() local currentWeather = "normal" local rainIntensity = getClimateManager():getRainIntensity() local currentWeatherPeriod = getClimateManager():getWeatherPeriod():getCurrentStageID() --Check weather if (currentWeatherPeriod == 3) or (currentWeatherPeriod == 8) or (rainIntensity >= 0.75) then --3: Storm | 8: Tropical Storm | 7: Blizzard (not used) currentWeather = "extreme" end local modID = "ReactiveSoundEvents" -- The modID for Reactive Sound Events local WorldSoundManager = getWorldSoundManager() -- Sound Manager local Utils = require("ReactiveSoundEvents/Utils") -- Utils call local function onEveryTenMinutes() local modData = ModData.getOrCreate(modID) if (modData.baseEventChance == nil) or (modData.eventChance == nil) or (modData.eventCD == nil) then --print("Reactive Sound Events: modData still not set") return end local weather = Utils.getWeather() if weather == "extreme" then if bWeatherEvents then local doEvent = Utils.getProbability(10) if doEvent then --print("Reactive Sound Events: weather event will play!") createEvent(false) end --Climate Probabilities: if climate == "extreme" then local objects = Square:getObjects() for i=0, objects:size() - 1 do local name = objects:get(i):getName() if name and name == "Campfire" then squareProp:UnSet(IsoFlagType.burning) end

Okay, I will integrate the provided snippets to create a server-side script that extinguishes outdoor campfires during extreme weather conditions, checking every ten minutes.

This assumes a Project Zomboid modding environment based on the API calls like getClimateManager, Events.EveryTenMinutes, SCampfireSystem, and IsoFlagType.

Updated files
v2
simplify the system. Only should contain one function: When it is raining, all lit campfires will be put out. Thats it

Okay, here is a simplified version that extinguishes all lit campfires when it's raining, checked every ten minutes on the server.

Updated files
v3