Script Name: Breeding (Multiplying) Monsters

What it does: Allows a monster to multiply after so many heart beats. Several variables in place for adjustments. It provides a unique trap that really isnt a trap. Done well, its very interesting. If set up incorrectly, however, can be quite brutal (read impossible).

NOTES:
This is the making of a pretty unique trap that has no triggers or anything (of course you could link it to a trigger if you wanted). For a single PC that cannot kill one of these monsters rather quickly (less than BREED_STATE_MAX heartbeats), it will be viscious. For a group of players this could prove to be quite a fun "trap" to deal with. I suggest the monster(s) you attach this script to be on the easy to very-easy scale for the players you intend it for. Its completely adjustable. This could be adjusted so that there was one alpha-monster that when killed, every thing stopped breeding. In this example, however, they dont stop until you kill them all.

**WARNING**:
Its a good idea NOT to set so many creatures to spawn that it takes more than a heartbeat to spawn them, that could get NASTY. Its best to keep the number of creatures spawned VERY low, like 2. For example, with the BREED_AMOUNT set to the constant of 2, if no monsters are killed, but the spawn conditions are met and they are set to breed every heartbeat, 1 monster makes 2 more for a total of 3. Those 3 each make 2 more for a total of (3 + 3*2) 9. Those 9 each spawn 2 more, for a total of (9 + 9*2) = 27. The growth rate formula is as follows:

n = starting number of creatures
b = number of successful breeds thus far

n * ((BREED_AMOUNT + 1)^b)

in the example above, BREED_AMOUNT is 2 and we started with 1 creature. So for the 3rd successful breeding we would get (assuming NONE died):

1 * ((2+1)^3) = 1 * (3^3) = 27.

Continuing on with one more breeding in above example, you get:

1 * ((2+1)^4) = 1 * (3^4) = 81.

And once more you get:

1 * ((2+1)^5) = 1 * (3^5) = 243 (Yikes)

This is why i put the MAX_MONSTERS in the area so that it cant get out of hand. This is also why i put the BREED_STATE-- in when it cant successfully breed but the other conditions are met. This aleviates some of the race condition and explosive population growth. If the variables are not set correctly and with extreme care, the players will easily get into the situation where they cannot kill the monsters fast enough. This makes for an interesting situation, and will more than likely force the players to run or die.

The script and all the above text can be found here:

Click Here

Enjoy