From 0be6cc11aa9ca34a20b671305cc060a6d91efeb7 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sun, 3 Sep 2023 14:36:40 +0800 Subject: [PATCH] miscs --- conf/playerbots.conf.dist | 6 +++--- src/PlayerbotFactory.cpp | 4 ++-- src/PlayerbotMgr.cpp | 7 +++++-- src/strategy/actions/ChooseTargetActions.cpp | 6 +++--- src/strategy/actions/MovementActions.cpp | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 38ee5509..bf20e63a 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -717,11 +717,11 @@ AiPlayerbot.DefaultTalentsOrder.5.1 = AiPlayerbot.RandomClassSpecProbability.5.2 = 30 AiPlayerbot.DefaultTalentsOrder.5.2 = # DeathKnight -AiPlayerbot.RandomClassSpecProbability.6.0 = 33 +AiPlayerbot.RandomClassSpecProbability.6.0 = 30 AiPlayerbot.DefaultTalentsOrder.6.0 = -AiPlayerbot.RandomClassSpecProbability.6.1 = 33 +AiPlayerbot.RandomClassSpecProbability.6.1 = 40 AiPlayerbot.DefaultTalentsOrder.6.1 = -AiPlayerbot.RandomClassSpecProbability.6.2 = 33 +AiPlayerbot.RandomClassSpecProbability.6.2 = 30 AiPlayerbot.DefaultTalentsOrder.6.2 = # Shaman AiPlayerbot.RandomClassSpecProbability.7.0 = 33 diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 6e5c77ed..4aa98b60 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -1221,9 +1221,9 @@ void PlayerbotFactory::InitEquipment(bool incremental) items[slot].push_back(itemId); } } - if (items[slot].size() >= 10) break; + if (items[slot].size() >= 25) break; } - } while (items[slot].size() < 10 && desiredQuality-- > ITEM_QUALITY_NORMAL); + } while (items[slot].size() < 25 && desiredQuality-- > ITEM_QUALITY_NORMAL); } for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; ++slot) diff --git a/src/PlayerbotMgr.cpp b/src/PlayerbotMgr.cpp index 77583796..40bb250a 100644 --- a/src/PlayerbotMgr.cpp +++ b/src/PlayerbotMgr.cpp @@ -641,8 +641,7 @@ std::vector PlayerbotHolder::HandlePlayerbotCommand(char const* arg char* charname = strtok (nullptr, " "); if (!cmd) { - messages.push_back("usage: list/reload/tweak/self or add/init/remove PLAYERNAME"); - messages.push_back(" addclass CLASSNAME"); + messages.push_back("usage: list/reload/tweak/self or add/init/remove PLAYERNAME or addclass CLASSNAME"); return messages; } @@ -714,6 +713,10 @@ std::vector PlayerbotHolder::HandlePlayerbotCommand(char const* arg if (!strcmp(cmd, "addclass")) { + if (!charname) { + messages.push_back("addclass: invalid CLASSNAME(warrior/paladin/hunter/rogue/priest/shaman/mage/warlock/druid/dk)"); + return messages; + } uint8 claz; if (!strcmp(charname, "warrior")) { diff --git a/src/strategy/actions/ChooseTargetActions.cpp b/src/strategy/actions/ChooseTargetActions.cpp index 8bf0faf5..57e5a1a5 100644 --- a/src/strategy/actions/ChooseTargetActions.cpp +++ b/src/strategy/actions/ChooseTargetActions.cpp @@ -36,9 +36,9 @@ bool AttackAnythingAction::isUseful() if (context->GetValue("travel target")->Get()->isTraveling() && ChooseRpgTargetAction::isFollowValid(bot, *context->GetValue("travel target")->Get()->getPosition())) //Bot is traveling return false; - if (bot->IsInCombat()) { - return false; - } + // if (bot->IsInCombat()) { + // return false; + // } Unit* target = GetTarget(); if (!target) diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index 6ce90a3a..e44483d9 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -755,7 +755,7 @@ bool MovementAction::IsMovingAllowed() bot->HasUnitState(UNIT_STATE_LOST_CONTROL)) return false; - if (bot->GetMotionMaster()->GetMotionSlot(MOTION_SLOT_CONTROLLED)) { + if (bot->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_CONTROLLED) != NULL_MOTION_TYPE) { return false; }