Merge pull request #804 from kadeshar/worldbuff-strategy

Added worldbuff strategy
This commit is contained in:
Revision
2024-12-21 14:50:00 +01:00
committed by GitHub
3 changed files with 17 additions and 1 deletions

View File

@@ -119,6 +119,7 @@ public:
creators["move random"] = &StrategyContext::move_random;
creators["formation"] = &StrategyContext::combat_formation;
creators["move from group"] = &StrategyContext::move_from_group;
creators["worldbuff"] = &StrategyContext::world_buff;
}
private:
@@ -186,6 +187,7 @@ private:
static Strategy* move_random(PlayerbotAI* ai) { return new MoveRandomStrategy(ai); }
static Strategy* combat_formation(PlayerbotAI* ai) { return new CombatFormationStrategy(ai); }
static Strategy* move_from_group(PlayerbotAI* botAI) { return new MoveFromGroupStrategy(botAI); }
static Strategy* world_buff(PlayerbotAI* botAI) { return new WorldBuffStrategy(botAI); }
};
class MovementStrategyContext : public NamedObjectContext<Strategy>

View File

@@ -16,7 +16,6 @@ void NonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
// triggers.push_back(new TriggerNode("near dark portal", NextAction::array(0, new NextAction("move to dark portal", 1.0f), nullptr)));
// triggers.push_back(new TriggerNode("at dark portal azeroth", NextAction::array(0, new NextAction("use dark portal azeroth", 1.0f), nullptr)));
// triggers.push_back(new TriggerNode("at dark portal outland", NextAction::array(0, new NextAction("move from dark portal", 1.0f), nullptr)));
// triggers.push_back(new TriggerNode("need world buff", NextAction::array(0, new NextAction("world buff", 1.0f), nullptr)));
// triggers.push_back(new TriggerNode("vehicle near", NextAction::array(0, new NextAction("enter vehicle", 10.0f), nullptr)));
}
@@ -33,3 +32,8 @@ void MountStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
nullptr)));*/
/*triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("mount", 4.0f), nullptr)));*/
}
void WorldBuffStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode("need world buff", NextAction::array(0, new NextAction("world buff", 1.0f), NULL)));
}

View File

@@ -48,4 +48,14 @@ public:
std::string const getName() override { return "attack tagged"; }
};
class WorldBuffStrategy : public Strategy
{
public:
WorldBuffStrategy(PlayerbotAI* ai) : Strategy(ai) {}
uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
std::string const getName() override { return "worldbuff"; }
};
#endif