Make Breeding Random?

Forum
Last Post
Threads / Messages
As in an adoptable in class 'Avian' has a 50/50 change of being able to breed with other 'Avian' class adoptables?
 
You COULD always make a little bit of script that picks a random number, and adds it to the end of 'Avian' like 'Avian9385' or 'Avian2468' Then theres what.... 1 in 10,000 chance that same person would HAPPEN to get the same numbered 'Avian' class.
 
Well you can create a new field called 'breedchance' in table prefix_adoptables, which stores the probability of successful breeding(from 0 to 100). Then modify the breeding.php to add another if...else statement. Inside this conditional statement will you need to define a new variable that generates random number from 0 to 100. What you should do next is to insert another if...else statement that checks if this random number is greater or smaller than the value in field 'breedchance'. Breeding will be successful if the random number is smaller than the value 'breedchance', or it will fail.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,132
Members
1,603
Latest member
Monako
BETA

Latest Threads

Top