mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Configuration] Make more options for ReviveBotWhenSummoned
This commit is contained in:
@@ -172,8 +172,8 @@ AiPlayerbot.AllowSummonWhenMasterIsDead = 1
|
|||||||
# default: 1 (always)
|
# default: 1 (always)
|
||||||
AiPlayerbot.AllowSummonWhenBotIsDead = 1
|
AiPlayerbot.AllowSummonWhenBotIsDead = 1
|
||||||
|
|
||||||
# Enable/Disable reviving the bots when summoning them
|
# Enable/Disable reviving the bots when summoning them (0 = disable, 1 = disable in combat, 2 = enable)
|
||||||
# default: 1 (enable)
|
# default: 1 (disable in combat)
|
||||||
AiPlayerbot.ReviveBotWhenSummoned = 1
|
AiPlayerbot.ReviveBotWhenSummoned = 1
|
||||||
|
|
||||||
# Enable/Disable bot repair gear when summon (0 = no, 1 = yes)
|
# Enable/Disable bot repair gear when summon (0 = no, 1 = yes)
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ bool PlayerbotAIConfig::Initialize()
|
|||||||
allowSummonInCombat = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowSummonInCombat", true);
|
allowSummonInCombat = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowSummonInCombat", true);
|
||||||
allowSummonWhenMasterIsDead = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowSummonWhenMasterIsDead", true);
|
allowSummonWhenMasterIsDead = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowSummonWhenMasterIsDead", true);
|
||||||
allowSummonWhenBotIsDead = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowSummonWhenBotIsDead", true);
|
allowSummonWhenBotIsDead = sConfigMgr->GetOption<bool>("AiPlayerbot.AllowSummonWhenBotIsDead", true);
|
||||||
reviveBotWhenSummoned = sConfigMgr->GetOption<bool>("AiPlayerbot.ReviveBotWhenSummoned", true);
|
reviveBotWhenSummoned = sConfigMgr->GetOption<int32>("AiPlayerbot.ReviveBotWhenSummoned", 1);
|
||||||
botRepairWhenSummon = sConfigMgr->GetOption<bool>("AiPlayerbot.BotRepairWhenSummon", true);
|
botRepairWhenSummon = sConfigMgr->GetOption<bool>("AiPlayerbot.BotRepairWhenSummon", true);
|
||||||
autoInitOnly = sConfigMgr->GetOption<bool>("AiPlayerbot.AutoInitOnly", false);
|
autoInitOnly = sConfigMgr->GetOption<bool>("AiPlayerbot.AutoInitOnly", false);
|
||||||
autoInitEquipLevelLimitRatio = sConfigMgr->GetOption<float>("AiPlayerbot.AutoInitEquipLevelLimitRatio", 1.0);
|
autoInitEquipLevelLimitRatio = sConfigMgr->GetOption<float>("AiPlayerbot.AutoInitEquipLevelLimitRatio", 1.0);
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ class PlayerbotAIConfig
|
|||||||
bool allowSummonInCombat;
|
bool allowSummonInCombat;
|
||||||
bool allowSummonWhenMasterIsDead;
|
bool allowSummonWhenMasterIsDead;
|
||||||
bool allowSummonWhenBotIsDead;
|
bool allowSummonWhenBotIsDead;
|
||||||
bool reviveBotWhenSummoned;
|
int reviveBotWhenSummoned;
|
||||||
bool botRepairWhenSummon;
|
bool botRepairWhenSummon;
|
||||||
bool autoInitOnly;
|
bool autoInitOnly;
|
||||||
float autoInitEquipLevelLimitRatio;
|
float autoInitEquipLevelLimitRatio;
|
||||||
|
|||||||
@@ -206,7 +206,8 @@ bool SummonAction::Teleport(Player* summoner, Player* player)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bot->isDead() && sPlayerbotAIConfig->reviveBotWhenSummoned)
|
bool revive = sPlayerbotAIConfig->reviveBotWhenSummoned == 2 || (sPlayerbotAIConfig->reviveBotWhenSummoned == 1 && !master->IsInCombat());
|
||||||
|
if (bot->isDead() && revive)
|
||||||
{
|
{
|
||||||
bot->ResurrectPlayer(1.0f, false);
|
bot->ResurrectPlayer(1.0f, false);
|
||||||
botAI->TellMasterNoFacing("I live, again!");
|
botAI->TellMasterNoFacing("I live, again!");
|
||||||
|
|||||||
Reference in New Issue
Block a user