From dce11e8781f27f1cb68227e44b5e45da3de37071 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Mon, 31 Jul 2023 12:49:39 +0800 Subject: [PATCH] ranged and group heal --- src/strategy/generic/RangedCombatStrategy.cpp | 2 +- src/strategy/triggers/HealthTriggers.cpp | 2 +- src/strategy/warlock/GenericWarlockStrategy.cpp | 6 +++--- src/strategy/warlock/GenericWarlockStrategy.h | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/strategy/generic/RangedCombatStrategy.cpp b/src/strategy/generic/RangedCombatStrategy.cpp index 271dbc3c..98368a69 100644 --- a/src/strategy/generic/RangedCombatStrategy.cpp +++ b/src/strategy/generic/RangedCombatStrategy.cpp @@ -10,5 +10,5 @@ void RangedCombatStrategy::InitTriggers(std::vector &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))); } diff --git a/src/strategy/triggers/HealthTriggers.cpp b/src/strategy/triggers/HealthTriggers.cpp index d4146eab..026ec30a 100644 --- a/src/strategy/triggers/HealthTriggers.cpp +++ b/src/strategy/triggers/HealthTriggers.cpp @@ -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); } \ No newline at end of file diff --git a/src/strategy/warlock/GenericWarlockStrategy.cpp b/src/strategy/warlock/GenericWarlockStrategy.cpp index 39648405..729d0d57 100644 --- a/src/strategy/warlock/GenericWarlockStrategy.cpp +++ b/src/strategy/warlock/GenericWarlockStrategy.cpp @@ -31,7 +31,7 @@ class GenericWarlockStrategyActionNodeFactory : public NamedObjectFactory& 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& triggers) diff --git a/src/strategy/warlock/GenericWarlockStrategy.h b/src/strategy/warlock/GenericWarlockStrategy.h index a154a3f4..aeffabfb 100644 --- a/src/strategy/warlock/GenericWarlockStrategy.h +++ b/src/strategy/warlock/GenericWarlockStrategy.h @@ -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);