mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-14 09:29:09 +00:00
automatically action for random bots
This commit is contained in:
24
src/strategy/actions/AutoTeleportForLevelAction.cpp
Normal file
24
src/strategy/actions/AutoTeleportForLevelAction.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "AutoTeleportForLevelAction.h"
|
||||
#include "PlayerbotAIConfig.h"
|
||||
#include "PlayerbotFactory.h"
|
||||
#include "RandomPlayerbotMgr.h"
|
||||
#include "Playerbots.h"
|
||||
#include "SharedDefines.h"
|
||||
|
||||
bool AutoTeleportForLevelAction::Execute(Event event) {
|
||||
AutoUpgradeEquip();
|
||||
|
||||
if (!sPlayerbotAIConfig->autoTeleportForLevel || !sRandomPlayerbotMgr->IsRandomBot(bot)) {
|
||||
return false;
|
||||
}
|
||||
sRandomPlayerbotMgr->RandomTeleportForLevel(bot);
|
||||
return true;
|
||||
}
|
||||
|
||||
void AutoTeleportForLevelAction::AutoUpgradeEquip() {
|
||||
if (!sPlayerbotAIConfig->autoUpgradeEquip || !sRandomPlayerbotMgr->IsRandomBot(bot)) {
|
||||
return;
|
||||
}
|
||||
PlayerbotFactory factory(bot, bot->GetLevel(), ITEM_QUALITY_RARE);
|
||||
factory.InitEquipment(true);
|
||||
}
|
||||
Reference in New Issue
Block a user