Project Zomboid

Project Zomboid

30 ratings
Randomized Cigarettes Count
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
132.178 KB
14 Jul, 2022 @ 3:30am
1 Change Note ( view )

Subscribe to download
Randomized Cigarettes Count

Description
This mod randomizes the number of cigarettes you find.

The details :

Basically for each container it generates a random chance, and then for each cigarette in that container it checks that random chance, and if it passes, it removes that cigarette.

So the max count of cigarettes you can find in a container is still 20 (or whatever the cigarette count is set as, it can be modified by other mods.), but finding a stack of 20 cigarettes will be pretty rare.

The average number of cigarettes you find is 10, not 20. You will never find more than 20 cigarettes (unless you find two stacks). But if somehow you get a mod that tweaks the cigarettes item count, the average number of cigs you will find will be half that number.

This doesn't only target cigarettes but also anything that can be smoked, which means all kinds of modded cigarettes as well.
Of course if an affected item has a count of 1, you will find either 0 or 1 of that item, there's no in-between, but the random chance to remove it will still be applied properly even if it's only one item.

This mod uses the same mechanic as my other mod "Item Remover", which does more or less the same thing, but to ALL items.

This will be added as a sandbox setting to "More Loot Settings" in its next update.

Multiplayer :
Should work in multiplayer.

Compatibility :
Compatible with "Ridiculously Rare", "75% less loot", "More Loot Settings", and "Item Remover" (chance will be applied twice to cigarettes)

Workshop ID: 2835043697
Mod ID: CigarettesRandomizer
10 Comments
itsmars 14 Feb, 2024 @ 4:47am 
I thought this mod was bugged, but I found the mod conflict. MaD's Awesome Zombie Loot has a sandbox option 'minimum drainable' set to 20, by default, which basically turns this mod off. Oops. I've set that value to 0, and we're good!
Champy  [author] 24 Mar, 2023 @ 5:19am 
@Odie Go ahead
maemento mori 23 Mar, 2023 @ 10:40pm 
Hi, I was wondering if I could have permission to modify your code to work with a cigarette mod that I made. Credit would be given, of course. :)
Champy  [author] 22 Jan, 2023 @ 7:34am 
@Night Fox This mod doesn't spawn anything. It only removes cigarettes.
Night Fox 22 Jan, 2023 @ 7:15am 
Can this mod be edited to spawn between 1 and 20 without the chance of 0?
Champy  [author] 15 Nov, 2022 @ 7:46am 
@K.Plotnikof As long as it can be smoked, it will be randomized. If it's a pack of cigarettes that need to be opened, it won't be randomized because you can't smoke the pack itself.
K.Plotnikof 18 Oct, 2022 @ 9:21pm 
Will this work with other mods that add different kinds of cigarettes?
OldFishPool 12 Sep, 2022 @ 2:45am 
it took way too fucking long for this mod to be made
so hyped for cigs to actually be a valued loot item rather than having 380+ of them at my base
Champy  [author] 26 Aug, 2022 @ 4:26am 
@sapepepino yes
sapepepino 25 Aug, 2022 @ 10:14am 
can i use an existing run?