OK, after some additional testing I found that I had completely forgotten to enable equipment for the newly added non-standard race bots. Since bots have only the most basic of stats without equipment, being able to equip them is fairly critical. So here are some additional instructions on how to make the system allow you to equip bots that are of a non-standard race...
Basically, you have to tell the system the bot is allowed to equip and use items even though its race doesn't match the races allowed to use the item (all items are limited to standard races only, or a subset of the standard races).
So first, let's set the system up to allow you to equip the items. Open up the bot.cpp file again. Now find the "Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* client)" function. Navigate through that function until you find the line that reads "if(!failedLoreCheck && mWeaponItem && inst->IsEquipable(GetBaseRace(), GetClass()) && (GetLevel() >= mWeaponItem->ReqLevel)) {". This section of the code is called when you use the #bot giveitem command, and it checks to see if the bot is allowed to equip the item based on the item's race/class limitations compared to the bot's race and class. Since all items are limited to standard races only (or a subset), this check will always fail for bots of non-standard race, and your bot will tell you they cannot use the item you've given them. You need to change the check so that if the bot is of a non-standard race, it doesn't check against the bot's actual race. To accomplish this, replace that entire line with the following...
Code:
uint16 checkRace = GetBaseRace(); // get the current base race for the current MOB
if((checkRace > 12) && (checkRace != 128) && (checkRace != 130) && (checkRace != 330) && (checkRace != 522)) // if the race is a non-standard race, then...
{
checkRace = 1; // set race used for check to 1 (Human)
}
if(!failedLoreCheck && mWeaponItem && inst->IsEquipable(checkRace, GetClass()) && (GetLevel() >= mWeaponItem->ReqLevel)) {
This tells the system that when the bot's actual race is non-standard, to assume the bot is Human for the item check.
Now this does still leave some limitations. Specifically, if the bot is of a class that Humans are not allowed to be, then there is the possibility that some items may still be unusable. For example, any items that are Shaman-only are also possibly only usable by races that can be Shamans, and since Humans cannot be Shamans, this would prevent Shaman bots of non-standard races from being able to use such items. The number of such items should be quite limited, so this may be an acceptable problem. But if you want to make the system work for more or less all items, then you could also check for the bot's class, and if their class is one that Humans cannot be, then change the checkRace to a raceID value other than 1. For example, you could check for class, and if class is Shaman, then set race to be Barbarian instead of Human.
But that will only get you part of the way. You should now be able to equip items on your bots that are of non-standard race, and you should gain all of the stats from those items. However, using weapons adds in another check, and you need to adjust that one as well, or your bots of non-standard race will always be unarmed (which will not only limit their damage output, but will also prevent them from being able to strike a target that is immune to non-magic melee, at least for non-monks anyway).
So this time, open up the attack.cpp file. Then find the "Mob::GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate)" function. Please note that the Mob::GetWeaponDamage function is an overloaded function and you need this specific version of it. Now navigate through the function to find the line that reads "if(!weapon_item->IsEquipable(GetBaseRace(), GetClass())){". This is the check that needs to be changed so your bots of non-standard race can use weapons. Replace the line with the following...
Code:
uint16 checkRace = GetBaseRace();
if(((checkRace > 12) && (checkRace != 128) && (checkRace != 130) && (checkRace != 330) && (checkRace != 522)) && this->IsBot())
{
checkRace = 1; // DrakePhoenix: if MOB is a bot, and mob race is non-standard, treat as race 1 (Human) for equippable weapon check...
}
if(!weapon_item->IsEquipable(checkRace, GetClass())){
Again, I've set this up to assume a race of Human, so this could result in limitations as noted above.
Now recompile, and that's it. If you make those changes, then bots of non-standard race should be able to equip any item usable by a Human of the same class as the bot, and should be able to *use* them as well.
Have Fun,
Drake Phoenix