Added optional rule for allowing bots to auto-update with their owner.

(Run the optional sql script to activate this feature)
This commit is contained in:
Uleat
2014-03-31 09:31:49 -04:00
parent d939820918
commit 955f164efb
7 changed files with 69 additions and 9 deletions
+22
View File
@@ -5284,6 +5284,28 @@ uint32 Bot::GetBotOwnerCharacterID(uint32 botID, std::string* errorMessage) {
return Result;
}
void Bot::LevelBotWithClient(Client* client, uint8 level, bool sendlvlapp) {
// This essentially performs a '#bot update,' with appearance packets, based on the current methods.
// This should not be called outside of Client::SetEXP() due to it's lack of rule checks.
if(client) {
std::list<Bot*> blist = entity_list.GetBotsByBotOwnerCharacterID(client->CharacterID());
for(std::list<Bot*>::iterator biter = blist.begin(); biter != blist.end(); ++biter) {
Bot* bot = *biter;
if(bot && (bot->GetLevel() != client->GetLevel())) {
bot->SetPetChooser(false); // not sure what this does, but was in bot 'update' code
bot->CalcBotStats(false);
if(sendlvlapp)
bot->SendLevelAppearance();
// modified from Client::SetLevel()
bot->SendAppearancePacket(AT_WhoLevel, level, true, true); // who level change
}
}
blist.clear();
}
}
std::string Bot::ClassIdToString(uint16 classId) {
std::string Result;