PremadeSpecGlyph config (unimplemented)

This commit is contained in:
Yunfan Li
2024-03-05 00:11:53 +08:00
parent d99e6d9fbb
commit b7b334af99
6 changed files with 30 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. # This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml # See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: CMake on multiple platforms name: ubuntu-build
on: on:
push: push:
@@ -24,7 +24,11 @@ jobs:
c_compiler: gcc c_compiler: gcc
cpp_compiler: g++ cpp_compiler: g++
build_type: Release build_type: Release
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
build_type: Release
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}-${{ matrix.cpp_compiler }} name: ${{ matrix.os }}-${{ matrix.cpp_compiler }}

View File

@@ -172,6 +172,16 @@ bool PlayerbotAIConfig::Initialize()
std::ostringstream os; std::ostringstream os;
os << "AiPlayerbot.PremadeSpecName." << cls << "." << spec; os << "AiPlayerbot.PremadeSpecName." << cls << "." << spec;
premadeSpecName[cls][spec] = sConfigMgr->GetOption<std::string>(os.str().c_str(), "", false); premadeSpecName[cls][spec] = sConfigMgr->GetOption<std::string>(os.str().c_str(), "", false);
os.str("");
os.clear();
os << "AiPlayerbot.PremadeSpecGlyph." << cls << "." << spec;
premadeSpecGlyph[cls][spec] = sConfigMgr->GetOption<std::string>(os.str().c_str(), "", false);
std::vector<std::string> splitSpecGlyph = split(premadeSpecGlyph[cls][spec], ',');
for (std::string &split : splitSpecGlyph) {
if (split.size() != 0) {
parsedSpecGlyph[cls][spec].push_back(atoi(split.c_str()));
}
}
for (uint32 level = 0; level < MAX_LEVEL; ++level) { for (uint32 level = 0; level < MAX_LEVEL; ++level) {
std::ostringstream os; std::ostringstream os;
os << "AiPlayerbot.PremadeSpecLink." << cls << "." << spec << "." << level; os << "AiPlayerbot.PremadeSpecLink." << cls << "." << spec << "." << level;

View File

@@ -97,6 +97,8 @@ class PlayerbotAIConfig
// ClassSpecs classSpecs[MAX_CLASSES]; // ClassSpecs classSpecs[MAX_CLASSES];
std::string premadeSpecName[MAX_CLASSES][MAX_SPECNO]; std::string premadeSpecName[MAX_CLASSES][MAX_SPECNO];
std::string premadeSpecGlyph[MAX_CLASSES][MAX_SPECNO];
std::vector<uint32> parsedSpecGlyph[MAX_CLASSES][MAX_SPECNO];
std::string premadeSpecLink[MAX_CLASSES][MAX_SPECNO][MAX_LEVEL]; std::string premadeSpecLink[MAX_CLASSES][MAX_SPECNO][MAX_LEVEL];
std::vector<std::vector<uint32>> parsedSpecLinkOrder[MAX_CLASSES][MAX_SPECNO][MAX_LEVEL]; std::vector<std::vector<uint32>> parsedSpecLinkOrder[MAX_CLASSES][MAX_SPECNO][MAX_LEVEL];
uint32 randomClassSpecProb[MAX_CLASSES][MAX_SPECNO]; uint32 randomClassSpecProb[MAX_CLASSES][MAX_SPECNO];

View File

@@ -33,7 +33,7 @@ uint32 LfgJoinAction::GetRoles()
case CLASS_DRUID: case CLASS_DRUID:
if (spec == 2) if (spec == 2)
return PLAYER_ROLE_HEALER; return PLAYER_ROLE_HEALER;
else if (spec == 1 && bot->getLevel() >= 20) else if (spec == 1)
return (PLAYER_ROLE_TANK | PLAYER_ROLE_DAMAGE); return (PLAYER_ROLE_TANK | PLAYER_ROLE_DAMAGE);
else else
return PLAYER_ROLE_DAMAGE; return PLAYER_ROLE_DAMAGE;

View File

@@ -36,7 +36,7 @@ bool LootRollAction::Execute(Event event)
{ {
case ITEM_CLASS_WEAPON: case ITEM_CLASS_WEAPON:
case ITEM_CLASS_ARMOR: case ITEM_CLASS_ARMOR:
if (usage == ITEM_USAGE_EQUIP || usage == ITEM_USAGE_REPLACE) { if (usage == ITEM_USAGE_EQUIP || usage == ITEM_USAGE_REPLACE || usage == ITEM_USAGE_BAD_EQUIP) {
vote = NEED; vote = NEED;
} }
else if (usage != ITEM_USAGE_NONE) { else if (usage != ITEM_USAGE_NONE) {

View File

@@ -18,6 +18,7 @@ class ShadowPriestStrategyActionNodeFactory : public NamedObjectFactory<ActionNo
creators["mind blast"] = &mind_blast; creators["mind blast"] = &mind_blast;
creators["dispersion"] = &dispersion; creators["dispersion"] = &dispersion;
creators["mind flay"] = &mind_flay; creators["mind flay"] = &mind_flay;
creators["smite"] = &smite;
} }
private: private:
@@ -32,10 +33,19 @@ class ShadowPriestStrategyActionNodeFactory : public NamedObjectFactory<ActionNo
static ActionNode* mind_flay(PlayerbotAI* botAI) static ActionNode* mind_flay(PlayerbotAI* botAI)
{ {
return new ActionNode ("mind flay", return new ActionNode ("mind flay",
/*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("smite"), nullptr),
/*C*/ nullptr);
}
static ActionNode* smite(PlayerbotAI* botAI)
{
return new ActionNode ("smite",
/*P*/ nullptr, /*P*/ nullptr,
/*A*/ NextAction::array(0, new NextAction("shoot"), nullptr), /*A*/ NextAction::array(0, new NextAction("shoot"), nullptr),
/*C*/ nullptr); /*C*/ nullptr);
} }
static ActionNode* dispersion(PlayerbotAI* botAI) static ActionNode* dispersion(PlayerbotAI* botAI)
{ {
return new ActionNode ("dispersion", return new ActionNode ("dispersion",