mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Merge pull request #804 from kadeshar/worldbuff-strategy
Added worldbuff strategy
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user