Fixed PCH warnings and bot add command
This commit is contained in:
parent
7fb0d3631e
commit
dab1c06b4e
@ -1,4 +1,4 @@
|
||||
#include "ConsumableCategory.h"
|
||||
#include "ItemBag.h"
|
||||
//#include "ItemBag.h"
|
||||
|
||||
using namespace ahbot;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "TradeCategory.h"
|
||||
#include "ItemBag.h"
|
||||
//#include "ItemBag.h"
|
||||
|
||||
using namespace ahbot;
|
||||
|
@ -291,7 +291,6 @@ void PlayerbotAI::HandleBotOutgoingPacket(const WorldPacket& packet)
|
||||
if (casterGuid != bot->GetObjectGuid())
|
||||
return;
|
||||
|
||||
uint8 castCount;
|
||||
uint32 spellId;
|
||||
p >> spellId;
|
||||
SpellInterrupted(spellId);
|
||||
@ -332,7 +331,7 @@ void PlayerbotAI::SpellInterrupted(uint32 spellid)
|
||||
|
||||
uint32 castTimeSpent = 1000 * (now - lastSpell.time);
|
||||
|
||||
int32 globalCooldown = CalculateGlobalCooldown(lastSpell.id);
|
||||
uint32 globalCooldown = CalculateGlobalCooldown(lastSpell.id);
|
||||
if (castTimeSpent < globalCooldown)
|
||||
SetNextCheckDelay(globalCooldown - castTimeSpent);
|
||||
else
|
||||
@ -341,7 +340,7 @@ void PlayerbotAI::SpellInterrupted(uint32 spellid)
|
||||
lastSpell.id = 0;
|
||||
}
|
||||
|
||||
int32 PlayerbotAI::CalculateGlobalCooldown(uint32 spellid)
|
||||
uint32 PlayerbotAI::CalculateGlobalCooldown(uint32 spellid)
|
||||
{
|
||||
if (!spellid)
|
||||
return 0;
|
||||
|
@ -133,7 +133,7 @@ public:
|
||||
bool TellMaster(string text, PlayerbotSecurityLevel securityLevel = PLAYERBOT_SECURITY_ALLOW_ALL);
|
||||
bool TellMasterNoFacing(string text, PlayerbotSecurityLevel securityLevel = PLAYERBOT_SECURITY_ALLOW_ALL);
|
||||
void SpellInterrupted(uint32 spellid);
|
||||
int32 CalculateGlobalCooldown(uint32 spellid);
|
||||
uint32 CalculateGlobalCooldown(uint32 spellid);
|
||||
void InterruptSpell();
|
||||
void RemoveAura(string name);
|
||||
void RemoveShapeshift();
|
||||
|
@ -67,8 +67,8 @@ bool PlayerbotAIConfig::Initialize()
|
||||
lowMana = config.GetIntDefault("AiPlayerbot.LowMana", 15);
|
||||
mediumMana = config.GetIntDefault("AiPlayerbot.MediumMana", 40);
|
||||
|
||||
randomGearLoweringChance = config.GetFloatDefault("AiPlayerbot.RandomGearLoweringChance", 0.15);
|
||||
randomBotMaxLevelChance = config.GetFloatDefault("AiPlayerbot.RandomBotMaxLevelChance", 0.4);
|
||||
randomGearLoweringChance = config.GetFloatDefault("AiPlayerbot.RandomGearLoweringChance", 0.15f);
|
||||
randomBotMaxLevelChance = config.GetFloatDefault("AiPlayerbot.RandomBotMaxLevelChance", 0.4f);
|
||||
|
||||
iterationsPerTick = config.GetIntDefault("AiPlayerbot.IterationsPerTick", 4);
|
||||
|
||||
@ -220,7 +220,7 @@ void PlayerbotAIConfig::SetValue(string name, string value)
|
||||
void PlayerbotAIConfig::CreateRandomBots()
|
||||
{
|
||||
string randomBotAccountPrefix = config.GetStringDefault("AiPlayerbot.RandomBotAccountPrefix", "rndbot");
|
||||
uint32 randomBotAccountCount = config.GetIntDefault("AiPlayerbot.RandomBotAccountCount", 50);
|
||||
int32 randomBotAccountCount = config.GetIntDefault("AiPlayerbot.RandomBotAccountCount", 50);
|
||||
|
||||
if (config.GetBoolDefault("AiPlayerbot.DeleteRandomBotAccounts", false))
|
||||
{
|
||||
|
@ -802,7 +802,7 @@ void PlayerbotFactory::EnchantItem(Item* item)
|
||||
int32 itemLevel = proto->ItemLevel;
|
||||
|
||||
vector<uint32> ids;
|
||||
for (int id = 0; id < sSpellStore.GetNumRows(); ++id)
|
||||
for (uint32 id = 0; id < sSpellStore.GetNumRows(); ++id)
|
||||
{
|
||||
SpellEntry const *entry = sSpellStore.LookupEntry(id);
|
||||
if (!entry)
|
||||
|
@ -120,51 +120,39 @@ void PlayerbotHolder::OnBotLogin(Player * const bot)
|
||||
ai->TellMaster("Hello!");
|
||||
}
|
||||
|
||||
string PlayerbotHolder::ProcessBotCommand(string cmd, ObjectGuid guid, bool admin, uint32 masterAccountId, uint32 masterGuildId)
|
||||
bool PlayerbotHolder::ProcessBotCommand(string cmd, ObjectGuid guid, bool admin, uint32 masterAccountId)
|
||||
{
|
||||
if (!sPlayerbotAIConfig.enabled || guid.IsEmpty())
|
||||
return "bot system is disabled";
|
||||
return false;
|
||||
|
||||
uint32 botAccount = sObjectMgr.GetPlayerAccountIdByGUID(guid);
|
||||
bool isRandomBot = sRandomPlayerbotMgr.IsRandomBot(guid);
|
||||
bool isRandomAccount = sPlayerbotAIConfig.IsInRandomAccountList(botAccount);
|
||||
bool isMasterAccount = (masterAccountId == botAccount);
|
||||
bool isRandomAccount = sPlayerbotAIConfig.IsInRandomAccountList(sObjectMgr.GetPlayerAccountIdByGUID(guid));
|
||||
|
||||
if (isRandomAccount && !isRandomBot && !admin)
|
||||
{
|
||||
Player* bot = sObjectMgr.GetPlayer(guid, false);
|
||||
if (bot->GetGuildId() != masterGuildId)
|
||||
return "not in your guild";
|
||||
}
|
||||
|
||||
if (!isRandomAccount && !isMasterAccount && !admin)
|
||||
return "not in your account";
|
||||
return false;
|
||||
|
||||
if (cmd == "add" || cmd == "login")
|
||||
{
|
||||
if (sObjectMgr.GetPlayer(guid, true))
|
||||
return "player already logged in";
|
||||
if (sObjectMgr.GetPlayer(guid))
|
||||
return false;
|
||||
|
||||
AddPlayerBot(guid.GetRawValue(), masterAccountId);
|
||||
return "ok";
|
||||
return true;
|
||||
}
|
||||
else if (cmd == "remove" || cmd == "logout" || cmd == "rm")
|
||||
{
|
||||
if (!sObjectMgr.GetPlayer(guid, true))
|
||||
return "player is offline";
|
||||
|
||||
if (!GetPlayerBot(guid.GetRawValue()))
|
||||
return "not your bot";
|
||||
return false;
|
||||
|
||||
LogoutPlayerBot(guid.GetRawValue());
|
||||
return "ok";
|
||||
return true;
|
||||
}
|
||||
|
||||
if (admin)
|
||||
{
|
||||
Player* bot = GetPlayerBot(guid.GetRawValue());
|
||||
if (!bot)
|
||||
return "bot not found";
|
||||
return false;
|
||||
|
||||
Player* master = bot->GetPlayerbotAI()->GetMaster();
|
||||
if (master)
|
||||
@ -173,25 +161,25 @@ string PlayerbotHolder::ProcessBotCommand(string cmd, ObjectGuid guid, bool admi
|
||||
{
|
||||
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_NORMAL);
|
||||
factory.CleanRandomize();
|
||||
return "ok";
|
||||
return true;
|
||||
}
|
||||
else if (cmd == "init=green" || cmd == "init=uncommon")
|
||||
{
|
||||
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_UNCOMMON);
|
||||
factory.CleanRandomize();
|
||||
return "ok";
|
||||
return true;
|
||||
}
|
||||
else if (cmd == "init=blue" || cmd == "init=rare")
|
||||
{
|
||||
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_RARE);
|
||||
factory.CleanRandomize();
|
||||
return "ok";
|
||||
return true;
|
||||
}
|
||||
else if (cmd == "init=epic" || cmd == "init=purple")
|
||||
{
|
||||
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_EPIC);
|
||||
factory.CleanRandomize();
|
||||
return "ok";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,16 +187,16 @@ string PlayerbotHolder::ProcessBotCommand(string cmd, ObjectGuid guid, bool admi
|
||||
{
|
||||
PlayerbotFactory factory(bot, bot->getLevel());
|
||||
factory.Refresh();
|
||||
return "ok";
|
||||
return true;
|
||||
}
|
||||
else if (cmd == "random")
|
||||
{
|
||||
sRandomPlayerbotMgr.Randomize(bot);
|
||||
return "ok";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return "unknown command";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandlePlayerbotCommand(char* args)
|
||||
@ -338,23 +326,17 @@ list<string> PlayerbotHolder::HandlePlayerbotCommand(char* args, Player* master)
|
||||
out << cmdStr << ": " << bot << " - ";
|
||||
|
||||
ObjectGuid member = sObjectMgr.GetPlayerGuidByName(bot);
|
||||
if (!member)
|
||||
bool result = false;
|
||||
if (master && member != master->GetObjectGuid())
|
||||
{
|
||||
out << "character not found";
|
||||
}
|
||||
else if (master && member != master->GetObjectGuid())
|
||||
{
|
||||
out << ProcessBotCommand(cmdStr, member,
|
||||
master->GetSession()->GetSecurity() >= SEC_GAMEMASTER,
|
||||
master->GetSession()->GetAccountId(),
|
||||
master->GetGuildId());
|
||||
result = ProcessBotCommand(cmdStr, member, master->GetSession()->GetSecurity() >= SEC_GAMEMASTER, master->GetSession()->GetAccountId());
|
||||
}
|
||||
else if (!master)
|
||||
{
|
||||
out << ProcessBotCommand(cmdStr, member, true, -1, -1);
|
||||
result = ProcessBotCommand(cmdStr, member, true, -1);
|
||||
}
|
||||
|
||||
out << (result ? "ok" : "not allowed");
|
||||
messages.push_back(out.str());
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
void OnBotLogin(Player * const bot);
|
||||
|
||||
list<string> HandlePlayerbotCommand(char* args, Player* master = NULL);
|
||||
string ProcessBotCommand(string cmd, ObjectGuid guid, bool admin, uint32 masterAccountId, uint32 masterGuildId);
|
||||
bool ProcessBotCommand(string cmd, ObjectGuid guid, bool admin, uint32 masterAccountId);
|
||||
uint32 GetAccountId(string name);
|
||||
|
||||
protected:
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "GenericActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "GenericActions.h"
|
||||
|
||||
using namespace ai;
|
||||
|
@ -45,7 +45,7 @@ bool GossipHelloAction::Execute(Event event)
|
||||
ai->TellMasterNoFacing(out.str());
|
||||
|
||||
GossipMenu& menu = bot->PlayerTalkClass->GetGossipMenu();
|
||||
int i = 0, loops = 0;
|
||||
unsigned int i = 0, loops = 0;
|
||||
set<uint32> alreadyTalked;
|
||||
while (i < menu.MenuItemCount() && loops++ < 100)
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "GuildBankAction.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "GuildBankAction.h"
|
||||
|
||||
#include "../values/ItemCountValue.h"
|
||||
//#include "../values/ItemCountValue.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace ai;
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "LfgActions.h"
|
||||
#include "../../AiFactory.h"
|
||||
#include "../../PlayerbotAIConfig.h"
|
||||
#include "../ItemVisitors.h"
|
||||
#include "../../RandomPlayerbotMgr.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "LfgActions.h"
|
||||
//#include "../../AiFactory.h"
|
||||
//#include "../../PlayerbotAIConfig.h"
|
||||
//#include "../ItemVisitors.h"
|
||||
//#include "../../RandomPlayerbotMgr.h"
|
||||
//#include "../../../../game/LFGMgr.h"
|
||||
|
||||
using namespace ai;
|
@ -1,6 +1,6 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "NonCombatActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "NonCombatActions.h"
|
||||
|
||||
using namespace ai;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "DruidMultipliers.h"
|
||||
#include "DruidActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "DruidMultipliers.h"
|
||||
//#include "DruidActions.h"
|
||||
|
||||
using namespace ai;
|
@ -1,7 +1,7 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "DruidTriggers.h"
|
||||
#include "DruidActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "DruidTriggers.h"
|
||||
//#include "DruidActions.h"
|
||||
|
||||
using namespace ai;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "MageMultipliers.h"
|
||||
#include "MageActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "MageMultipliers.h"
|
||||
//#include "MageActions.h"
|
||||
|
||||
using namespace ai;
|
@ -1,6 +1,6 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "PaladinActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "PaladinActions.h"
|
||||
|
||||
using namespace ai;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "PaladinMultipliers.h"
|
||||
#include "PaladinActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "PaladinMultipliers.h"
|
||||
//#include "PaladinActions.h"
|
||||
|
||||
using namespace ai;
|
@ -1,6 +1,6 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "PriestMultipliers.h"
|
||||
#include "PriestActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "PriestMultipliers.h"
|
||||
//#include "PriestActions.h"
|
||||
|
||||
using namespace ai;
|
@ -1,7 +1,7 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "PriestTriggers.h"
|
||||
#include "PriestActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "PriestTriggers.h"
|
||||
//#include "PriestActions.h"
|
||||
|
||||
using namespace ai;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "RogueActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "RogueActions.h"
|
||||
|
||||
using namespace ai;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "RogueMultipliers.h"
|
||||
#include "RogueActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "RogueMultipliers.h"
|
||||
//#include "RogueActions.h"
|
||||
|
||||
using namespace ai;
|
@ -1,7 +1,7 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "RogueTriggers.h"
|
||||
#include "RogueActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "RogueTriggers.h"
|
||||
//#include "RogueActions.h"
|
||||
|
||||
using namespace ai;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "ShamanActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "ShamanActions.h"
|
||||
|
||||
using namespace ai;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "ShamanMultipliers.h"
|
||||
#include "ShamanActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "ShamanMultipliers.h"
|
||||
//#include "ShamanActions.h"
|
||||
|
||||
using namespace ai;
|
@ -1,5 +1,5 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "WarlockActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "WarlockActions.h"
|
||||
|
||||
using namespace ai;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "WarlockMultipliers.h"
|
||||
#include "WarlockActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "WarlockMultipliers.h"
|
||||
//#include "WarlockActions.h"
|
||||
|
||||
using namespace ai;
|
@ -1,6 +1,6 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "WarriorMultipliers.h"
|
||||
#include "WarriorActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "WarriorMultipliers.h"
|
||||
//#include "WarriorActions.h"
|
||||
|
||||
using namespace ai;
|
@ -1,7 +1,7 @@
|
||||
#include "botpch.h"
|
||||
#include "../../playerbot.h"
|
||||
#include "WarriorTriggers.h"
|
||||
#include "WarriorActions.h"
|
||||
//#include "../../playerbot.h"
|
||||
//#include "WarriorTriggers.h"
|
||||
//#include "WarriorActions.h"
|
||||
|
||||
using namespace ai;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user