From 36c84d55f273bf60d5959ffb7a98563db96d6aef Mon Sep 17 00:00:00 2001 From: Chromie-WoW Date: Wed, 10 Jul 2024 15:13:22 -0700 Subject: [PATCH 1/2] Add option --- conf/playerbots.conf.dist | 6 +++++- src/PlayerbotAIConfig.cpp | 1 + src/PlayerbotAIConfig.h | 1 + src/strategy/actions/UseMeetingStoneAction.cpp | 4 +++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 3a3c2736..1aa0d97b 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -127,10 +127,14 @@ AiPlayerbot.EquipmentPersistenceLevel = 80 # default: 1 (accept based on level) AiPlayerbot.GroupInvitationPermission = 1 -# Enable/Disable bot revive and repair gear when summon (0 = never, 1 = enable when non-combat and alive, 2 = enable always) +# Enable/Disable bot revive when summon (0 = never, 1 = enable when non-combat and alive, 2 = enable always) # default: 1 (enable for non-combat) AiPlayerbot.BotReviveWhenSummon = 1 +# Enable/Disable bot repair gear when summon (0 = no, 1 = yes) +# default: 1 (enable for non-combat) +AiPlayerbot.BotRepairWhenSummon = 1 + # Non-GM player can only use init=auto to initialize bots based on their own level and gear score # default: 0 (non-gm player can use any intialization commands) AiPlayerbot.AutoInitOnly = 0 diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index ed840e9c..02d20e17 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -273,6 +273,7 @@ bool PlayerbotAIConfig::Initialize() equipmentPersistenceLevel = sConfigMgr->GetOption("AiPlayerbot.EquipmentPersistenceLevel", 80); groupInvitationPermission = sConfigMgr->GetOption("AiPlayerbot.GroupInvitationPermission", 1); botReviveWhenSummon = sConfigMgr->GetOption("AiPlayerbot.BotReviveWhenSummon", 1); + botRepairWhenSummon = sConfigMgr->GetOption("AiPlayerbot.BotRepairWhenSummon", false); autoInitOnly = sConfigMgr->GetOption("AiPlayerbot.AutoInitOnly", false); autoInitEquipLevelLimitRatio = sConfigMgr->GetOption("AiPlayerbot.AutoInitEquipLevelLimitRatio", 1.0); addClassCommand = sConfigMgr->GetOption("AiPlayerbot.AddClassCommand", 1); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index 40a66034..d2488458 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -215,6 +215,7 @@ class PlayerbotAIConfig int32 equipmentPersistenceLevel; int32 groupInvitationPermission; int32 botReviveWhenSummon; + bool botRepairWhenSummon; bool autoInitOnly; float autoInitEquipLevelLimitRatio; int32 addClassCommand; diff --git a/src/strategy/actions/UseMeetingStoneAction.cpp b/src/strategy/actions/UseMeetingStoneAction.cpp index 81093a80..0f908530 100644 --- a/src/strategy/actions/UseMeetingStoneAction.cpp +++ b/src/strategy/actions/UseMeetingStoneAction.cpp @@ -176,6 +176,9 @@ bool SummonAction::Teleport(Player* summoner, Player* player) if (summoner->IsWithinLOS(x, y, z)) { + if (sPlayerbotAIConfig->botRepairWhenSummon) // .conf option to repair bot gear when summoned 0 = off, 1 = on + bot->DurabilityRepairAll(false, 1.0f, false); + if (sPlayerbotAIConfig->botReviveWhenSummon < 2) { if (master->IsInCombat()) @@ -200,7 +203,6 @@ bool SummonAction::Teleport(Player* summoner, Player* player) if (sPlayerbotAIConfig->botReviveWhenSummon > 0 && bot->isDead()) { bot->ResurrectPlayer(1.0f, false); - bot->DurabilityRepairAll(false, 1.0f, false); botAI->TellMasterNoFacing("I live, again!"); } From be83a1b35fc5e5bb5397e372d738ce8b5463bfa5 Mon Sep 17 00:00:00 2001 From: Chromie-WoW Date: Thu, 11 Jul 2024 04:52:48 -0700 Subject: [PATCH 2/2] Repaironsummon change Removed repair on summon and added it as an option in .conf to turn off and on. --- conf/playerbots.conf.dist | 2 +- src/PlayerbotAIConfig.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 1aa0d97b..d91063a8 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -132,7 +132,7 @@ AiPlayerbot.GroupInvitationPermission = 1 AiPlayerbot.BotReviveWhenSummon = 1 # Enable/Disable bot repair gear when summon (0 = no, 1 = yes) -# default: 1 (enable for non-combat) +# default: 1 AiPlayerbot.BotRepairWhenSummon = 1 # Non-GM player can only use init=auto to initialize bots based on their own level and gear score diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 02d20e17..91e69210 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -273,7 +273,7 @@ bool PlayerbotAIConfig::Initialize() equipmentPersistenceLevel = sConfigMgr->GetOption("AiPlayerbot.EquipmentPersistenceLevel", 80); groupInvitationPermission = sConfigMgr->GetOption("AiPlayerbot.GroupInvitationPermission", 1); botReviveWhenSummon = sConfigMgr->GetOption("AiPlayerbot.BotReviveWhenSummon", 1); - botRepairWhenSummon = sConfigMgr->GetOption("AiPlayerbot.BotRepairWhenSummon", false); + botRepairWhenSummon = sConfigMgr->GetOption("AiPlayerbot.BotRepairWhenSummon", true); autoInitOnly = sConfigMgr->GetOption("AiPlayerbot.AutoInitOnly", false); autoInitEquipLevelLimitRatio = sConfigMgr->GetOption("AiPlayerbot.AutoInitEquipLevelLimitRatio", 1.0); addClassCommand = sConfigMgr->GetOption("AiPlayerbot.AddClassCommand", 1);