Skip to content

Commit

Permalink
PremadeSpecGlyph config (unimplemented)
Browse files Browse the repository at this point in the history
  • Loading branch information
liyunfan1223 committed Mar 4, 2024
1 parent d99e6d9 commit b7b334a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/core-build.yml
Original file line number Diff line number Diff line change
@@ -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.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: CMake on multiple platforms
name: ubuntu-build

on:
push:
Expand All @@ -24,7 +24,11 @@ jobs:
c_compiler: gcc
cpp_compiler: g++
build_type: Release

- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
build_type: Release

runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}-${{ matrix.cpp_compiler }}

Expand Down
10 changes: 10 additions & 0 deletions src/PlayerbotAIConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ bool PlayerbotAIConfig::Initialize()
std::ostringstream os;
os << "AiPlayerbot.PremadeSpecName." << cls << "." << spec;
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) {
std::ostringstream os;
os << "AiPlayerbot.PremadeSpecLink." << cls << "." << spec << "." << level;
Expand Down
2 changes: 2 additions & 0 deletions src/PlayerbotAIConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ class PlayerbotAIConfig
// ClassSpecs classSpecs[MAX_CLASSES];

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::vector<std::vector<uint32>> parsedSpecLinkOrder[MAX_CLASSES][MAX_SPECNO][MAX_LEVEL];
uint32 randomClassSpecProb[MAX_CLASSES][MAX_SPECNO];
Expand Down
2 changes: 1 addition & 1 deletion src/strategy/actions/LfgActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ uint32 LfgJoinAction::GetRoles()
case CLASS_DRUID:
if (spec == 2)
return PLAYER_ROLE_HEALER;
else if (spec == 1 && bot->getLevel() >= 20)
else if (spec == 1)
return (PLAYER_ROLE_TANK | PLAYER_ROLE_DAMAGE);
else
return PLAYER_ROLE_DAMAGE;
Expand Down
2 changes: 1 addition & 1 deletion src/strategy/actions/LootRollAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bool LootRollAction::Execute(Event event)
{
case ITEM_CLASS_WEAPON:
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;
}
else if (usage != ITEM_USAGE_NONE) {
Expand Down
10 changes: 10 additions & 0 deletions src/strategy/priest/ShadowPriestStrategyActionNodeFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class ShadowPriestStrategyActionNodeFactory : public NamedObjectFactory<ActionNo
creators["mind blast"] = &mind_blast;
creators["dispersion"] = &dispersion;
creators["mind flay"] = &mind_flay;
creators["smite"] = &smite;
}

private:
Expand All @@ -32,10 +33,19 @@ class ShadowPriestStrategyActionNodeFactory : public NamedObjectFactory<ActionNo
static ActionNode* mind_flay(PlayerbotAI* botAI)
{
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,
/*A*/ NextAction::array(0, new NextAction("shoot"), nullptr),
/*C*/ nullptr);
}

static ActionNode* dispersion(PlayerbotAI* botAI)
{
return new ActionNode ("dispersion",
Expand Down

0 comments on commit b7b334a

Please sign in to comment.