this isn't fully done, but to give you an idea of how it looks in code:
// you'll probably want the conditions as separate layered nested lines, so you can give different (else if~else) messages, I just combined them all into a single line instead, in laziness:
if (animal_name.parent = room_name and trap_name.parent = room_name and trap_name.setted = true and RandomChance (Value: 0 to 100; or use for your 0 to 100 Value: trap_name.skill_level_integer) = true) {
animal_name.ensnared = true // this is a condition for that so in the other script block, preventing or allowing the animal to change rooms or not, and it'll allow or disallow the player from taking the animal or not.
trap_name.setted = false
} else {
// blah
}
RandomChance (Value: 0 to 100) = true_or_false
Conceptually:
if (RandomChance (100) = true) // then it always does: (your nested scripts)
// if (100% of being true = true) // ...
// if (true = true -> yes) // ...
if (RandomChance (100) = false) // then it never does: (your nested scripts)
// if (100% of being true = false // ...
// if (true = false -> no) // ...
if (RandomChance (0) = true) // then it never does: (your nested scripts)
// if (0% of being true = true) // ...
// if (false = true -> no) // ...
if (RandomChance (0) = false) // then it always does: (your nested scripts)
// if (0% of being true = false) // ...
// if (false = false -> yes) // ...
if (RandomChance (75) = true) // then it 'often' (75% of the time) does: (your nested scripts)
// if (75% of being true = true) // ...
// if (true = true -> yes: 75% of the time) // ...
// or
// if (false = true -> no: 25% of the time) // (rarely: 25% of the time) does NOT: (your nested scripts)
// hopefully you get the idea now of how it works
if (RandomChance (75) = false) // then it 'rarely' (25% of the time) does: (your nested scripts)
// if (75% of being true = false) // ...
if (RandomChance (25) = true) // then it 'rarely' (25% of the time) does: (your nested scripts)
// if (25% of being true = true) // then it 'rarely' (25% of the time) does: (your nested scripts)
if (RandomChance (25) = false) // then it 'often' (75% of the time) does: (your nested scripts)
// if (25% of being true = false) // then it 'often' (75% of the time) does: (your nested scripts)
if (RandomChance (50) = true) // then it 'sometimes' (50% of the time) does: (your nested scripts)
// if (50% of being true = true) // then it 'sometimes' (50% of the time) does: (your nested scripts)
if (RandomChance (50) = false) // then it 'sometimes' (50% of the time) does: (your nested scripts)
// if (50% of being true = false) // then it 'sometimes' (50% of the time) does: (your nested scripts)
hopefully, this explains the 'RandomChance' code.