mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Bots] Save Bot Toggle Archer Setting between Loads. (#2612)
* [Bots] Save Bot Toggle Archer Setting between Loads. * [Bots] Save Bot Toggle Archer Setting between Loads. * Typo
This commit is contained in:
+20
-4
@@ -72,7 +72,6 @@ Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm
|
||||
SetBotID(0);
|
||||
SetBotSpellID(0);
|
||||
SetSpawnStatus(false);
|
||||
SetBotArcher(false);
|
||||
SetBotCharmer(false);
|
||||
SetPetChooser(false);
|
||||
SetRangerAutoWeaponSelect(false);
|
||||
@@ -167,7 +166,6 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to
|
||||
SetBotID(botID);
|
||||
SetBotSpellID(botSpellsID);
|
||||
SetSpawnStatus(false);
|
||||
SetBotArcher(false);
|
||||
SetBotCharmer(false);
|
||||
SetPetChooser(false);
|
||||
SetRangerAutoWeaponSelect(false);
|
||||
@@ -3164,12 +3162,12 @@ void Bot::AI_Process()
|
||||
|
||||
if (atArcheryRange && !IsBotArcher()) {
|
||||
|
||||
SetBotArcher(true);
|
||||
SetBotArcherySetting(true);
|
||||
changeWeapons = true;
|
||||
}
|
||||
else if (!atArcheryRange && IsBotArcher()) {
|
||||
|
||||
SetBotArcher(false);
|
||||
SetBotArcherySetting(false);
|
||||
changeWeapons = true;
|
||||
}
|
||||
|
||||
@@ -10867,6 +10865,24 @@ std::string Bot::GetHPString(int8 min_hp, int8 max_hp)
|
||||
return hp_string;
|
||||
}
|
||||
|
||||
void Bot::SetBotArcherySetting(bool bot_archer_setting, bool save)
|
||||
{
|
||||
m_bot_archery_setting = bot_archer_setting;
|
||||
if (save) {
|
||||
if (!database.botdb.SaveBotArcherSetting(GetBotID(), bot_archer_setting)) {
|
||||
if (GetBotOwner() && GetBotOwner()->IsClient()) {
|
||||
GetBotOwner()->CastToClient()->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Failed to save archery settings for {}.",
|
||||
GetCleanName()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint8 Bot::spell_casting_chances[SPELL_TYPE_COUNT][PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND] = { 0 };
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user