Assuming you only want the randomness to come into play when the Pokemon is released from the Pokeball and not when you listen to the cry on the Pokedex or if you play the cry through some other script outside of battle, we just need to look at src/pokemon.c. Within src/pokemon.c, there's a function called "DoMonFrontSpriteAnimation". Within this method, you'll see a couple of calls for these lines:
Code:
if (!noCry)
PlayCry1(species, pan);
We are now going to replace "PlayCry1(species, pan);" with an if-else statement. (When you do this, make sure to add curly braces to the "if (!noCry)" statement if it doesn't already have them.) This new if statement should check to see if the current species that is doing the cry is this particular species that you want to have multiple cries. If it isn't things should run as normal. For example, if you wanted to make Bulbasaur have multiple cries, you'd have something like:
Code:
if (!noCry)
{
if (species == 1)
{
(The stuff we'll be adding)
}
else
{
PlayCry1(species, pan);
}
}
Now, within the "if (species == 1)" statement, you'll have to generate your random number, which will then determine which cry to use. Something like this will work quite nicely:
Code:
if (species == 1)
{
switch(Random() % 3)
{
case 0:
PlayCry1(species, pan);
break;
case 1:
PlayCry1(CRY_2_POSITION, pan);
break;
case 2:
PlayCry1(CRY_3_POSITION, pan);
break;
}
}
So first, that "Random() % 3" within the switch statement will generate a random number between 0 and 2. If it's 0, then whatever cry was placed at the Pokemon's proper position will play. This is basically having the game run as normal. If the random number was 1, it would then play the second cry, which would be one of the cries that you placed at the bottom of the cry table. Similarly, if the random number is 2, then the other cry that was placed at the bottom would be played. Just replace CRY_2/3_POSITION with whatever the proper number is for those cries. IMPORTANT TO REMEMBER: for the "species == 1" bit, make sure 1 is whatever number your species is. Otherwise you're just messing with little ol' Bulbasaur's cries.
The reason I said this may not be 100% efficient was because I'm nervous about how this method is named DoMon
FRONTSpriteAnimation. It makes me think that there may be different code for when a Pokemon makes a cry while their back sprite animation is playing. I don't know if there is, and I didn't find it when I made a quick search.