This is the original case statement before I butchered it. Copying from VS and pasting here does not work that well.
Code:
case SpellType_Pet: {
//keep mobs from recasting pets when they have them.
if (!IsPet() && !GetPetID() && !IsBotCharmer()) {
if(botClass == MAGICIAN) {
// have the magician bot randomly summon
// the air, earth, fire or water pet
// include monster summoning after they
// become level 30 magicians
int randpets;
if(botLevel >= 30) {
randpets = 4;
}
else {
randpets = 3;
}
i = MakeRandomInt(i-randpets, i);
}
AIDoSpellCast(i, tar, mana_cost);
return true;
}
break;