Merge pull request #326 from noisiver/cleanup-summon-options

Summon cleanup
This commit is contained in:
Revision
2024-07-12 17:49:56 +02:00
committed by GitHub
4 changed files with 6 additions and 6 deletions

View File

@@ -139,9 +139,9 @@ AiPlayerbot.AllowSummonWhenMasterIsDead = 1
# default: 1 (always)
AiPlayerbot.AllowSummonWhenBotIsDead = 1
# Enable/Disable bot revive when summon (0 = never, 1 = enable when non-combat, 2 = enable always)
# default: 1 (enable for non-combat)
AiPlayerbot.BotReviveWhenSummon = 1
# Enable/Disable reviving the bots when summoning them
# default: 1 (enable)
AiPlayerbot.ReviveBotWhenSummoned = 1
# Enable/Disable bot repair gear when summon (0 = no, 1 = yes)
# default: 1

View File

@@ -276,7 +276,7 @@ bool PlayerbotAIConfig::Initialize()
allowSummonInCombat = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowSummonInCombat", true);
allowSummonWhenMasterIsDead = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowSummonWhenMasterIsDead", true);
allowSummonWhenBotIsDead = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowSummonWhenBotIsDead", true);
botReviveWhenSummon = sConfigMgr->GetOption<int>("AiPlayerbot.BotReviveWhenSummon", 1);
reviveBotWhenSummoned = sConfigMgr->GetOption<bool>("AiPlayerbot.ReviveBotWhenSummoned", true);
botRepairWhenSummon = sConfigMgr->GetOption<bool>("AiPlayerbot.BotRepairWhenSummon", true);
autoInitOnly = sConfigMgr->GetOption<bool>("AiPlayerbot.AutoInitOnly", false);
autoInitEquipLevelLimitRatio = sConfigMgr->GetOption<float>("AiPlayerbot.AutoInitEquipLevelLimitRatio", 1.0);

View File

@@ -217,7 +217,7 @@ class PlayerbotAIConfig
bool allowSummonInCombat;
bool allowSummonWhenMasterIsDead;
bool allowSummonWhenBotIsDead;
int32 botReviveWhenSummon;
bool reviveBotWhenSummoned;
bool botRepairWhenSummon;
bool autoInitOnly;
float autoInitEquipLevelLimitRatio;

View File

@@ -197,7 +197,7 @@ bool SummonAction::Teleport(Player* summoner, Player* player)
return false;
}
if (sPlayerbotAIConfig->botReviveWhenSummon == 2 || (sPlayerbotAIConfig->botReviveWhenSummon == 1 && !master->IsInCombat() && master->IsAlive()))
if (bot->isDead() && sPlayerbotAIConfig->reviveBotWhenSummoned)
{
bot->ResurrectPlayer(1.0f, false);
botAI->TellMasterNoFacing("I live, again!");