ranged and group heal

This commit is contained in:
Yunfan Li
2023-07-31 12:49:39 +08:00
parent 0cd1fa4db3
commit dce11e8781
4 changed files with 7 additions and 6 deletions

View File

@@ -10,5 +10,5 @@ void RangedCombatStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
CombatStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", ACTION_HIGH), nullptr)));
triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", ACTION_MOVE + 7), nullptr)));
// triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", ACTION_MOVE + 7), nullptr)));
}

View File

@@ -38,5 +38,5 @@ bool AoeHealTrigger::IsActive()
bool AoeInGroupTrigger::IsActive()
{
Group *group = bot->GetGroup();
return group && AI_VALUE2(uint8, "aoe heal", type) >= (group->GetMembersCount() * ratio);
return group && group->GetMembersCount() >= 5 && AI_VALUE2(uint8, "aoe heal", type) >= (group->GetMembersCount() * ratio);
}

View File

@@ -31,7 +31,7 @@ class GenericWarlockStrategyActionNodeFactory : public NamedObjectFactory<Action
}
};
GenericWarlockStrategy::GenericWarlockStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI)
GenericWarlockStrategy::GenericWarlockStrategy(PlayerbotAI* botAI) : RangedCombatStrategy(botAI)
{
actionNodeFactories.Add(new GenericWarlockStrategyActionNodeFactory());
}
@@ -43,14 +43,14 @@ NextAction** GenericWarlockStrategy::getDefaultActions()
void GenericWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
CombatStrategy::InitTriggers(triggers);
RangedCombatStrategy::InitTriggers(triggers);
// triggers.push_back(new TriggerNode("shadow trance", NextAction::array(0, new NextAction("shadow bolt", 20.0f), nullptr)));
// triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("drain life", 40.0f), nullptr)));
triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("life tap", ACTION_EMERGENCY + 5), nullptr)));
triggers.push_back(new TriggerNode("target critical health", NextAction::array(0, new NextAction("drain soul", 30.0f), nullptr)));
// triggers.push_back(new TriggerNode("immolate", NextAction::array(0, new NextAction("immolate", 13.0f), new NextAction("conflagrate", 13.0f), nullptr)));
triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", 49.0f), NULL)));
// triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", 49.0f), NULL)));
}
void WarlockBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)

View File

@@ -6,10 +6,11 @@
#define _PLAYERBOT_GENERICWARLOCKSTRATEGY_H
#include "CombatStrategy.h"
#include "RangedCombatStrategy.h"
class PlayerbotAI;
class GenericWarlockStrategy : public CombatStrategy
class GenericWarlockStrategy : public RangedCombatStrategy
{
public:
GenericWarlockStrategy(PlayerbotAI* botAI);