summon when group config

This commit is contained in:
Yunfan Li
2023-12-17 23:04:05 +08:00
parent cf4f2d7309
commit ced051b16c
5 changed files with 12 additions and 2 deletions

View File

@@ -78,6 +78,9 @@ AiPlayerbot.RandombotsWalkingRPG.InDoors = 0
# Bots greet to the players
AiPlayerbot.EnableGreet = 0
# Bots will be summoned to player when accept group invitation
AiPlayerbot.SummonWhenGroup = 1
# Show helmet and cloak on randombots (reset required)
AiPlayerbot.RandomBotShowHelmet = 1
AiPlayerbot.RandomBotShowCloak = 1

View File

@@ -310,6 +310,7 @@ bool PlayerbotAIConfig::Initialize()
// SPP switches
enableGreet = sConfigMgr->GetOption<bool>("AiPlayerbot.EnableGreet", true);
summonWhenGroup = sConfigMgr->GetOption<bool>("AiPlayerbot.SummonWhenGroup", true);
disableRandomLevels = sConfigMgr->GetOption<bool>("AiPlayerbot.DisableRandomLevels", false);
randomBotRandomPassword = sConfigMgr->GetOption<bool>("AiPlayerbot.RandomBotRandomPassword", true);
downgradeMaxLevelBot = sConfigMgr->GetOption<bool>("AiPlayerbot.DowngradeMaxLevelBot", true);

View File

@@ -142,6 +142,7 @@ class PlayerbotAIConfig
bool perfMonEnabled;
bool enableGreet;
bool summonWhenGroup;
bool randomBotShowHelmet;
bool randomBotShowCloak;
bool disableRandomLevels;

View File

@@ -41,5 +41,9 @@ bool AcceptInvitationAction::Execute(Event event)
botAI->Reset();
botAI->TellMaster("Hello");
if (sPlayerbotAIConfig->summonWhenGroup) {
Teleport(inviter, bot);
}
return true;
}

View File

@@ -6,13 +6,14 @@
#define _PLAYERBOT_ACCEPTINVITATIONACTION_H
#include "Action.h"
#include "UseMeetingStoneAction.h"
class PlayerbotAI;
class AcceptInvitationAction : public Action
class AcceptInvitationAction : public SummonAction
{
public:
AcceptInvitationAction(PlayerbotAI* botAI) : Action(botAI, "accept invitation") { }
AcceptInvitationAction(PlayerbotAI* botAI) : SummonAction(botAI, "accept invitation") { }
bool Execute(Event event) override;
};