poly
New member
Hi all,
I'm trying to create a buff whereby a player has a small chance to get drunk when crafting specific items - e.g. items related to beer brewing
Here's what I am trying, can somebody advise if this is correct, or what a better way to go about it would be?
<buff name="RandomDrunk" hidden="true">
<update_rate value="1"/>
<stack_type value="ignore"/>
<effect_group>
<!-- 1 --><passive_effect name="CraftingIngredientCount" operation="base_set" value="@$randomdrunk" tags="randomdrunk"/>
<!-- this needs to be ingredient count/crafting count in order to carry over a specific number to the random roll -->
<!-- 3 --><triggered_effect trigger="onSelfBuffStart" action="AddBuff" buff="buffBeer">
<!-- 2 --><requirement name="RandomRoll" seed_type="Random" min_max="1,4" operation="Equals" value="@$randomdrunk"/>
</triggered_effect>
</effect_group>
</buff>
So the buff has 3 parts...
Part 1: Player crafts an item with an ingredient count of 1, 2, 3 or 4 (there will be 4 recipes)
Part 2: Buff randomly rolls a number between 1 and 4.
Part 3: If the randomly rolled number is the same as the crafting ingredient count then the drunken buff is added. If the numbers are different no buff is added.
To me, a novice with coding, this makes sense?
However when I craft an item nothing happens - besides the item being crafted. Which leads me to think I'm missing a crucial step somewhere.
Can anyone help?
Thank you
I'm trying to create a buff whereby a player has a small chance to get drunk when crafting specific items - e.g. items related to beer brewing

Here's what I am trying, can somebody advise if this is correct, or what a better way to go about it would be?
<buff name="RandomDrunk" hidden="true">
<update_rate value="1"/>
<stack_type value="ignore"/>
<effect_group>
<!-- 1 --><passive_effect name="CraftingIngredientCount" operation="base_set" value="@$randomdrunk" tags="randomdrunk"/>
<!-- this needs to be ingredient count/crafting count in order to carry over a specific number to the random roll -->
<!-- 3 --><triggered_effect trigger="onSelfBuffStart" action="AddBuff" buff="buffBeer">
<!-- 2 --><requirement name="RandomRoll" seed_type="Random" min_max="1,4" operation="Equals" value="@$randomdrunk"/>
</triggered_effect>
</effect_group>
</buff>
So the buff has 3 parts...
Part 1: Player crafts an item with an ingredient count of 1, 2, 3 or 4 (there will be 4 recipes)
Part 2: Buff randomly rolls a number between 1 and 4.
Part 3: If the randomly rolled number is the same as the crafting ingredient count then the drunken buff is added. If the numbers are different no buff is added.
To me, a novice with coding, this makes sense?
However when I craft an item nothing happens - besides the item being crafted. Which leads me to think I'm missing a crucial step somewhere.
Can anyone help?
Thank you