From 45d0ae00ab95cae2b078b00f1a09d04955e197a4 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sun, 22 Oct 2023 12:50:17 +0800 Subject: [PATCH] default actions --- src/strategy/Engine.cpp | 19 ++++++++++--------- src/strategy/actions/MovementActions.cpp | 15 +++++++++++---- src/strategy/actions/MovementActions.h | 4 ++-- src/strategy/druid/BearTankDruidStrategy.cpp | 12 ++++++------ src/strategy/druid/CasterDruidStrategy.cpp | 4 ++-- src/strategy/druid/CatDpsDruidStrategy.cpp | 2 +- src/strategy/druid/MeleeDruidStrategy.cpp | 4 ++-- src/strategy/generic/GrindingStrategy.cpp | 6 +++--- src/strategy/hunter/DpsHunterStrategy.cpp | 14 +++++++------- src/strategy/mage/ArcaneMageStrategy.cpp | 5 ++++- src/strategy/mage/FireMageStrategy.cpp | 5 ++++- src/strategy/mage/FrostMageStrategy.cpp | 6 +++++- src/strategy/paladin/DpsPaladinStrategy.cpp | 10 +++++----- src/strategy/paladin/HealPaladinStrategy.cpp | 2 +- src/strategy/paladin/TankPaladinStrategy.cpp | 8 ++++---- src/strategy/priest/HealPriestStrategy.cpp | 2 +- src/strategy/priest/HolyPriestStrategy.cpp | 2 +- src/strategy/priest/ShadowPriestStrategy.cpp | 6 +++--- .../rogue/AssassinationRogueStrategy.cpp | 2 +- src/strategy/rogue/DpsRogueStrategy.cpp | 4 ++-- src/strategy/shaman/CasterShamanStrategy.cpp | 4 ++-- src/strategy/shaman/MeleeShamanStrategy.cpp | 10 +++++----- src/strategy/triggers/TriggerContext.h | 2 +- src/strategy/warlock/DpsWarlockStrategy.cpp | 7 ++++--- src/strategy/warlock/TankWarlockStrategy.cpp | 2 +- src/strategy/warrior/ArmsWarriorStrategy.cpp | 2 +- src/strategy/warrior/FuryWarriorStrategy.cpp | 12 ++++++------ src/strategy/warrior/TankWarriorStrategy.cpp | 6 +++--- 28 files changed, 98 insertions(+), 79 deletions(-) diff --git a/src/strategy/Engine.cpp b/src/strategy/Engine.cpp index 55bd712a..12328b6d 100644 --- a/src/strategy/Engine.cpp +++ b/src/strategy/Engine.cpp @@ -146,7 +146,8 @@ bool Engine::DoNextAction(Unit* unit, uint32 depth, bool minimal) time_t currentTime = time(nullptr); aiObjectContext->Update(); ProcessTriggers(minimal); - + PushDefaultActions(); + uint32 iterations = 0; uint32 iterationsPerTick = queue.Size() * (minimal ? 2 : sPlayerbotAIConfig->iterationsPerTick); do @@ -265,15 +266,15 @@ bool Engine::DoNextAction(Unit* unit, uint32 depth, bool minimal) } while (basket && ++iterations <= iterationsPerTick); - if (!basket) - { - lastRelevance = 0.0f; - PushDefaultActions(); + // if (!basket) + // { + // lastRelevance = 0.0f; + // PushDefaultActions(); - // prevent the delay after pushing default actions - if (queue.Peek() && depth < 1 && !minimal) - return DoNextAction(unit, depth + 1, minimal); - } + // // prevent the delay after pushing default actions + // if (queue.Peek() && depth < 1 && !minimal) + // return DoNextAction(unit, depth + 1, minimal); + // } // MEMORY FIX TEST /* diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index 3919df3f..919b7707 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -132,7 +132,7 @@ bool MovementAction::MoveToLOS(WorldObject* target, bool ranged) return false; } -bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle, bool react) +bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle, bool react, bool normal_only) { UpdateMovementState(); if (!IsMovingAllowed(mapId, x, y, z)) { @@ -166,7 +166,11 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle, MotionMaster &mm = *bot->GetMotionMaster(); mm.Clear(); - mm.MovePoint(mapId, x, y, SearchBestGroundZForPath(x, y, z, generatePath), generatePath); + float modifiedZ = SearchBestGroundZForPath(x, y, z, generatePath, normal_only); + if (modifiedZ == INVALID_HEIGHT) { + return false; + } + mm.MovePoint(mapId, x, y, modifiedZ, generatePath); AI_VALUE(LastMovement&, "last movement").Set(mapId, x, y, z, bot->GetOrientation()); return true; } @@ -1257,7 +1261,7 @@ bool MovementAction::MoveAway(Unit* target) float dx = bot->GetPositionX() + cos(angle) * sPlayerbotAIConfig->fleeDistance; float dy = bot->GetPositionY() + sin(angle) * sPlayerbotAIConfig->fleeDistance; float dz = bot->GetPositionZ(); - return MoveTo(target->GetMapId(), dx, dy, dz); + return MoveTo(target->GetMapId(), dx, dy, dz, false, false, true); } bool MovementAction::MoveInside(uint32 mapId, float x, float y, float z, float distance) @@ -1268,7 +1272,7 @@ bool MovementAction::MoveInside(uint32 mapId, float x, float y, float z, float d return MoveNear(mapId, x, y, z, distance); } -float MovementAction::SearchBestGroundZForPath(float x, float y, float z, bool generatePath, float range) +float MovementAction::SearchBestGroundZForPath(float x, float y, float z, bool generatePath, float range, bool normal_only) { if (!generatePath) { return z; @@ -1299,6 +1303,9 @@ float MovementAction::SearchBestGroundZForPath(float x, float y, float z, bool g return modified_z; } } + if (normal_only) { + return INVALID_HEIGHT; + } return z; } diff --git a/src/strategy/actions/MovementActions.h b/src/strategy/actions/MovementActions.h index b442c3f1..ce437e9c 100644 --- a/src/strategy/actions/MovementActions.h +++ b/src/strategy/actions/MovementActions.h @@ -22,7 +22,7 @@ class MovementAction : public Action protected: bool MoveNear(uint32 mapId, float x, float y, float z, float distance = sPlayerbotAIConfig->contactDistance); bool MoveToLOS(WorldObject* target, bool ranged = false); - bool MoveTo(uint32 mapId, float x, float y, float z, bool idle = false, bool react = false); + bool MoveTo(uint32 mapId, float x, float y, float z, bool idle = false, bool react = false, bool normal_only = false); bool MoveTo(Unit* target, float distance = 0.0f); bool MoveNear(WorldObject* target, float distance = sPlayerbotAIConfig->contactDistance); float GetFollowAngle(); @@ -41,7 +41,7 @@ class MovementAction : public Action bool MoveInside(uint32 mapId, float x, float y, float z, float distance = sPlayerbotAIConfig->followDistance); void CreateWp(Player* wpOwner, float x, float y, float z, float o, uint32 entry, bool important = false); private: - float SearchBestGroundZForPath(float x, float y, float z, bool generatePath, float range = 10.0f); + float SearchBestGroundZForPath(float x, float y, float z, bool generatePath, float range = 10.0f, bool normal_only = false); }; class FleeAction : public MovementAction diff --git a/src/strategy/druid/BearTankDruidStrategy.cpp b/src/strategy/druid/BearTankDruidStrategy.cpp index 7f0ed5bf..d3d49ce5 100644 --- a/src/strategy/druid/BearTankDruidStrategy.cpp +++ b/src/strategy/druid/BearTankDruidStrategy.cpp @@ -140,12 +140,12 @@ BearTankDruidStrategy::BearTankDruidStrategy(PlayerbotAI* botAI) : FeralDruidStr NextAction** BearTankDruidStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("mangle (bear)", ACTION_NORMAL + 5), - new NextAction("faerie fire (feral)", ACTION_NORMAL + 4), - new NextAction("lacerate", ACTION_NORMAL + 3), - new NextAction("maul", ACTION_NORMAL + 2), - new NextAction("enrage", ACTION_NORMAL + 1), - new NextAction("melee", ACTION_NORMAL), + new NextAction("mangle (bear)", ACTION_DEFAULT + 0.5f), + new NextAction("faerie fire (feral)", ACTION_DEFAULT + 0.4f), + new NextAction("lacerate", ACTION_DEFAULT + 0.3f), + new NextAction("maul", ACTION_DEFAULT + 0.2f), + new NextAction("enrage", ACTION_DEFAULT + 0.1f), + new NextAction("melee", ACTION_DEFAULT), nullptr); } diff --git a/src/strategy/druid/CasterDruidStrategy.cpp b/src/strategy/druid/CasterDruidStrategy.cpp index 03e1ffd5..51c2692e 100644 --- a/src/strategy/druid/CasterDruidStrategy.cpp +++ b/src/strategy/druid/CasterDruidStrategy.cpp @@ -105,8 +105,8 @@ CasterDruidStrategy::CasterDruidStrategy(PlayerbotAI* botAI) : GenericDruidStrat NextAction** CasterDruidStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("starfall", ACTION_NORMAL + 2), - new NextAction("wrath", ACTION_NORMAL + 1), + new NextAction("starfall", ACTION_DEFAULT + 0.2f), + new NextAction("wrath", ACTION_DEFAULT + 0.1f), // new NextAction("starfire", ACTION_NORMAL), nullptr); } diff --git a/src/strategy/druid/CatDpsDruidStrategy.cpp b/src/strategy/druid/CatDpsDruidStrategy.cpp index a3f15140..5b9dc170 100644 --- a/src/strategy/druid/CatDpsDruidStrategy.cpp +++ b/src/strategy/druid/CatDpsDruidStrategy.cpp @@ -120,7 +120,7 @@ CatDpsDruidStrategy::CatDpsDruidStrategy(PlayerbotAI* botAI) : FeralDruidStrateg NextAction** CatDpsDruidStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("mangle (cat)", ACTION_NORMAL + 1), nullptr); + return NextAction::array(0, new NextAction("mangle (cat)", ACTION_DEFAULT + 0.1f), nullptr); } void CatDpsDruidStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/druid/MeleeDruidStrategy.cpp b/src/strategy/druid/MeleeDruidStrategy.cpp index 39b3b027..7a017821 100644 --- a/src/strategy/druid/MeleeDruidStrategy.cpp +++ b/src/strategy/druid/MeleeDruidStrategy.cpp @@ -12,8 +12,8 @@ MeleeDruidStrategy::MeleeDruidStrategy(PlayerbotAI* botAI) : CombatStrategy(botA NextAction** MeleeDruidStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("faerie fire", ACTION_NORMAL + 1), - new NextAction("melee", ACTION_NORMAL), + new NextAction("faerie fire", ACTION_DEFAULT + 0.1f), + new NextAction("melee", ACTION_DEFAULT), nullptr); } diff --git a/src/strategy/generic/GrindingStrategy.cpp b/src/strategy/generic/GrindingStrategy.cpp index a7cf3bbd..ffbe8300 100644 --- a/src/strategy/generic/GrindingStrategy.cpp +++ b/src/strategy/generic/GrindingStrategy.cpp @@ -12,9 +12,9 @@ NextAction** GrindingStrategy::getDefaultActions() void GrindingStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("drink", 7.0f), nullptr))); - triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("food", 6.0f), nullptr))); - triggers.push_back(new TriggerNode("no target", NextAction::array(0, new NextAction("attack anything", 5.0f), nullptr))); + triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("drink", 4.2f), nullptr))); + triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("food", 4.1f), nullptr))); + triggers.push_back(new TriggerNode("no target", NextAction::array(0, new NextAction("attack anything", 4.0f), nullptr))); } void MoveRandomStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/hunter/DpsHunterStrategy.cpp b/src/strategy/hunter/DpsHunterStrategy.cpp index 4ef8a3f0..891190da 100644 --- a/src/strategy/hunter/DpsHunterStrategy.cpp +++ b/src/strategy/hunter/DpsHunterStrategy.cpp @@ -31,13 +31,13 @@ DpsHunterStrategy::DpsHunterStrategy(PlayerbotAI* botAI) : GenericHunterStrategy NextAction** DpsHunterStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("kill shot", 16.0f), - new NextAction("chimera shot", 15.0f), - new NextAction("explosive shot", 15.0f), - new NextAction("aimed shot", 14.0f), - new NextAction("arcane shot", 13.0f), - new NextAction("steady shot", 12.0f), - new NextAction("auto shot", 10.0f), + new NextAction("kill shot", ACTION_DEFAULT + 0.6f), + new NextAction("chimera shot", ACTION_DEFAULT + 0.5f), + new NextAction("explosive shot", ACTION_DEFAULT + 0.4f), + new NextAction("aimed shot", ACTION_DEFAULT + 0.3f), + new NextAction("arcane shot", ACTION_DEFAULT + 0.2f), + new NextAction("steady shot", ACTION_DEFAULT + 0.1f), + new NextAction("auto shot", ACTION_DEFAULT), nullptr); // return NextAction::array(0, new NextAction("explosive shot", 11.0f), new NextAction("auto shot", 10.0f), new NextAction("auto attack", 9.0f), nullptr); } diff --git a/src/strategy/mage/ArcaneMageStrategy.cpp b/src/strategy/mage/ArcaneMageStrategy.cpp index c5c46aa4..db97a4da 100644 --- a/src/strategy/mage/ArcaneMageStrategy.cpp +++ b/src/strategy/mage/ArcaneMageStrategy.cpp @@ -57,7 +57,10 @@ ArcaneMageStrategy::ArcaneMageStrategy(PlayerbotAI* botAI) : GenericMageStrategy NextAction** ArcaneMageStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("arcane blast", 10.0f), NULL); + return NextAction::array(0, + new NextAction("arcane blast", ACTION_DEFAULT + 0.1f), + new NextAction("shoot", ACTION_DEFAULT), + NULL); } void ArcaneMageStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/mage/FireMageStrategy.cpp b/src/strategy/mage/FireMageStrategy.cpp index 56503175..8382c3b1 100644 --- a/src/strategy/mage/FireMageStrategy.cpp +++ b/src/strategy/mage/FireMageStrategy.cpp @@ -7,7 +7,10 @@ NextAction** FireMageStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("fireball", ACTION_NORMAL + 1), NULL); + return NextAction::array(0, + new NextAction("fireball", ACTION_DEFAULT + 0.1f), + new NextAction("shoot", ACTION_DEFAULT), + NULL); } void FireMageStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/mage/FrostMageStrategy.cpp b/src/strategy/mage/FrostMageStrategy.cpp index 77ee30eb..39822aa1 100644 --- a/src/strategy/mage/FrostMageStrategy.cpp +++ b/src/strategy/mage/FrostMageStrategy.cpp @@ -11,7 +11,11 @@ FrostMageStrategy::FrostMageStrategy(PlayerbotAI* botAI) : GenericMageStrategy(b NextAction** FrostMageStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("frostbolt", 7.0f), nullptr); + return NextAction::array(0, + new NextAction("frostbolt", ACTION_DEFAULT + 0.1f), + new NextAction("shoot", ACTION_DEFAULT), + nullptr); + } void FrostMageStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/paladin/DpsPaladinStrategy.cpp b/src/strategy/paladin/DpsPaladinStrategy.cpp index 0662660e..907d9411 100644 --- a/src/strategy/paladin/DpsPaladinStrategy.cpp +++ b/src/strategy/paladin/DpsPaladinStrategy.cpp @@ -80,11 +80,11 @@ DpsPaladinStrategy::DpsPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrat NextAction** DpsPaladinStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("judgement of wisdom", ACTION_NORMAL + 6), - new NextAction("crusader strike", ACTION_NORMAL + 5), - new NextAction("divine storm", ACTION_NORMAL + 4), - new NextAction("consecration", ACTION_NORMAL + 3), - new NextAction("melee", ACTION_NORMAL), + new NextAction("judgement of wisdom", ACTION_DEFAULT + 0.4f), + new NextAction("crusader strike", ACTION_DEFAULT + 0.3f), + new NextAction("divine storm", ACTION_DEFAULT + 0.2f), + new NextAction("consecration", ACTION_DEFAULT + 0.1f), + new NextAction("melee", ACTION_DEFAULT), NULL); } diff --git a/src/strategy/paladin/HealPaladinStrategy.cpp b/src/strategy/paladin/HealPaladinStrategy.cpp index 6f651039..15215026 100644 --- a/src/strategy/paladin/HealPaladinStrategy.cpp +++ b/src/strategy/paladin/HealPaladinStrategy.cpp @@ -25,7 +25,7 @@ HealPaladinStrategy::HealPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStr NextAction** HealPaladinStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("judgement of light", ACTION_NORMAL + 2), nullptr); + return NextAction::array(0, new NextAction("judgement of light", ACTION_DEFAULT + 2), nullptr); } void HealPaladinStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/paladin/TankPaladinStrategy.cpp b/src/strategy/paladin/TankPaladinStrategy.cpp index 3c03d7ac..d8b3f9a1 100644 --- a/src/strategy/paladin/TankPaladinStrategy.cpp +++ b/src/strategy/paladin/TankPaladinStrategy.cpp @@ -59,12 +59,12 @@ TankPaladinStrategy::TankPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStr NextAction** TankPaladinStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("shield of righteousness", ACTION_NORMAL + 6), - new NextAction("hammer of the righteous", ACTION_NORMAL + 5), - new NextAction("judgement of wisdom", ACTION_NORMAL + 4), + new NextAction("shield of righteousness", ACTION_DEFAULT + 0.6f), + new NextAction("hammer of the righteous", ACTION_DEFAULT + 0.5f), + new NextAction("judgement of wisdom", ACTION_DEFAULT + 0.4f), // new NextAction("avenger's shield", ACTION_NORMAL + 3), // new NextAction("consecration", ACTION_NORMAL + 2), - new NextAction("melee", ACTION_NORMAL), + new NextAction("melee", ACTION_DEFAULT), NULL); } diff --git a/src/strategy/priest/HealPriestStrategy.cpp b/src/strategy/priest/HealPriestStrategy.cpp index 7f15dd35..322de685 100644 --- a/src/strategy/priest/HealPriestStrategy.cpp +++ b/src/strategy/priest/HealPriestStrategy.cpp @@ -13,7 +13,7 @@ HealPriestStrategy::HealPriestStrategy(PlayerbotAI* botAI) : GenericPriestStrate NextAction** HealPriestStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("shoot", 10.0f), nullptr); + return NextAction::array(0, new NextAction("shoot", ACTION_DEFAULT), nullptr); } void HealPriestStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/priest/HolyPriestStrategy.cpp b/src/strategy/priest/HolyPriestStrategy.cpp index 72b216a1..ba24d730 100644 --- a/src/strategy/priest/HolyPriestStrategy.cpp +++ b/src/strategy/priest/HolyPriestStrategy.cpp @@ -30,7 +30,7 @@ HolyPriestStrategy::HolyPriestStrategy(PlayerbotAI* botAI) : HealPriestStrategy( NextAction** HolyPriestStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("smite", 10.0f), new NextAction("mana burn", 9.0f), new NextAction("starshards", 8.0f), nullptr); + return NextAction::array(0, new NextAction("smite", ACTION_DEFAULT + 0.2f), new NextAction("mana burn", ACTION_DEFAULT + 0.1f), new NextAction("starshards", ACTION_DEFAULT), nullptr); } void HolyPriestStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/priest/ShadowPriestStrategy.cpp b/src/strategy/priest/ShadowPriestStrategy.cpp index a4560d68..e2fae3c0 100644 --- a/src/strategy/priest/ShadowPriestStrategy.cpp +++ b/src/strategy/priest/ShadowPriestStrategy.cpp @@ -14,10 +14,10 @@ ShadowPriestStrategy::ShadowPriestStrategy(PlayerbotAI* botAI) : GenericPriestSt NextAction** ShadowPriestStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("mind blast", 13.0f), + new NextAction("mind blast", ACTION_DEFAULT + 0.2f), // new NextAction("shadow word: death", 12.0f), - new NextAction("mind flay", 11.0f), - // new NextAction("shoot", 10.0f), + new NextAction("mind flay", ACTION_DEFAULT + 0.1f), + new NextAction("shoot", ACTION_DEFAULT), NULL); } diff --git a/src/strategy/rogue/AssassinationRogueStrategy.cpp b/src/strategy/rogue/AssassinationRogueStrategy.cpp index 990264d7..6510e72d 100644 --- a/src/strategy/rogue/AssassinationRogueStrategy.cpp +++ b/src/strategy/rogue/AssassinationRogueStrategy.cpp @@ -35,7 +35,7 @@ AssassinationRogueStrategy::AssassinationRogueStrategy(PlayerbotAI* ai) : MeleeC NextAction** AssassinationRogueStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("melee", ACTION_NORMAL), + new NextAction("melee", ACTION_DEFAULT), NULL); } diff --git a/src/strategy/rogue/DpsRogueStrategy.cpp b/src/strategy/rogue/DpsRogueStrategy.cpp index 8ff13bbe..cf26ec08 100644 --- a/src/strategy/rogue/DpsRogueStrategy.cpp +++ b/src/strategy/rogue/DpsRogueStrategy.cpp @@ -71,8 +71,8 @@ DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : MeleeCombatStrategy(bot NextAction** DpsRogueStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("killing spree", ACTION_NORMAL + 1), - new NextAction("melee", ACTION_NORMAL), NULL); + new NextAction("killing spree", ACTION_DEFAULT + 0.1f), + new NextAction("melee", ACTION_DEFAULT), NULL); } void DpsRogueStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/shaman/CasterShamanStrategy.cpp b/src/strategy/shaman/CasterShamanStrategy.cpp index 6dfb015a..6455dee3 100644 --- a/src/strategy/shaman/CasterShamanStrategy.cpp +++ b/src/strategy/shaman/CasterShamanStrategy.cpp @@ -39,8 +39,8 @@ CasterShamanStrategy::CasterShamanStrategy(PlayerbotAI* botAI) : GenericShamanSt NextAction** CasterShamanStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("lava burst", 11.0f), - new NextAction("lightning bolt", 10.0f), + new NextAction("lava burst", ACTION_DEFAULT + 0.1f), + new NextAction("lightning bolt", ACTION_DEFAULT), NULL); } diff --git a/src/strategy/shaman/MeleeShamanStrategy.cpp b/src/strategy/shaman/MeleeShamanStrategy.cpp index c514dc33..54db4dac 100644 --- a/src/strategy/shaman/MeleeShamanStrategy.cpp +++ b/src/strategy/shaman/MeleeShamanStrategy.cpp @@ -50,11 +50,11 @@ MeleeShamanStrategy::MeleeShamanStrategy(PlayerbotAI* botAI) : GenericShamanStra NextAction** MeleeShamanStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("stormstrike", ACTION_NORMAL + 6), - new NextAction("earth shock", ACTION_NORMAL + 5), - new NextAction("fire nova", ACTION_NORMAL + 4), - new NextAction("lava lash", ACTION_NORMAL + 1), - new NextAction("melee", ACTION_NORMAL), + new NextAction("stormstrike", ACTION_DEFAULT + 0.4f), + new NextAction("earth shock", ACTION_DEFAULT + 0.3f), + new NextAction("fire nova", ACTION_DEFAULT + 0.2f), + new NextAction("lava lash", ACTION_DEFAULT + 0.1f), + new NextAction("melee", ACTION_DEFAULT), NULL); } diff --git a/src/strategy/triggers/TriggerContext.h b/src/strategy/triggers/TriggerContext.h index d030a9ba..0859d706 100644 --- a/src/strategy/triggers/TriggerContext.h +++ b/src/strategy/triggers/TriggerContext.h @@ -217,7 +217,7 @@ class TriggerContext : public NamedObjectContext static Trigger* critical_aoe_heal(PlayerbotAI* botAI) { return new AoeHealTrigger(botAI, "critical aoe heal", "critical", 2); } static Trigger* low_aoe_heal(PlayerbotAI* botAI) { return new AoeHealTrigger(botAI, "low aoe heal", "low", 2); } static Trigger* medium_aoe_heal(PlayerbotAI* botAI) { return new AoeHealTrigger(botAI, "medium aoe heal", "medium", 2); } - static Trigger* group_heal_occasion(PlayerbotAI* ai) { return new AoeInGroupTrigger(ai, "group heal occasion", "almost full", 0.4); } + static Trigger* group_heal_occasion(PlayerbotAI* ai) { return new AoeInGroupTrigger(ai, "group heal occasion", "almost full", 0.6); } static Trigger* medium_group_heal_occasion(PlayerbotAI* ai) { return new AoeInGroupTrigger(ai, "group heal occasion", "medium", 0.4); } static Trigger* target_changed(PlayerbotAI* botAI) { return new TargetChangedTrigger(botAI); } static Trigger* swimming(PlayerbotAI* botAI) { return new IsSwimmingTrigger(botAI); } diff --git a/src/strategy/warlock/DpsWarlockStrategy.cpp b/src/strategy/warlock/DpsWarlockStrategy.cpp index b5978198..f5247c3f 100644 --- a/src/strategy/warlock/DpsWarlockStrategy.cpp +++ b/src/strategy/warlock/DpsWarlockStrategy.cpp @@ -47,9 +47,10 @@ DpsWarlockStrategy::DpsWarlockStrategy(PlayerbotAI* botAI) : GenericWarlockStrat NextAction** DpsWarlockStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("haunt", 14.0f), - new NextAction("demonic empowerment", 13.0f), - new NextAction("shadow bolt", 10.0f), + new NextAction("haunt", ACTION_DEFAULT + 0.3f), + new NextAction("demonic empowerment", ACTION_DEFAULT + 0.2f), + new NextAction("shadow bolt", ACTION_DEFAULT + 0.1f), + new NextAction("shoot", ACTION_DEFAULT), nullptr); } diff --git a/src/strategy/warlock/TankWarlockStrategy.cpp b/src/strategy/warlock/TankWarlockStrategy.cpp index ca1fae48..a828fdec 100644 --- a/src/strategy/warlock/TankWarlockStrategy.cpp +++ b/src/strategy/warlock/TankWarlockStrategy.cpp @@ -57,7 +57,7 @@ TankWarlockStrategy::TankWarlockStrategy(PlayerbotAI* botAI) : GenericWarlockStr NextAction** TankWarlockStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("shoot", 10.0f), nullptr); + return NextAction::array(0, new NextAction("shoot", ACTION_DEFAULT), nullptr); } void TankWarlockStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/warrior/ArmsWarriorStrategy.cpp b/src/strategy/warrior/ArmsWarriorStrategy.cpp index 4643ff63..c6314bae 100644 --- a/src/strategy/warrior/ArmsWarriorStrategy.cpp +++ b/src/strategy/warrior/ArmsWarriorStrategy.cpp @@ -32,7 +32,7 @@ ArmsWarriorStrategy::ArmsWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStr NextAction** ArmsWarriorStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("heroic strike", ACTION_NORMAL), nullptr); + return NextAction::array(0, new NextAction("heroic strike", ACTION_DEFAULT), nullptr); } void ArmsWarriorStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/warrior/FuryWarriorStrategy.cpp b/src/strategy/warrior/FuryWarriorStrategy.cpp index 3894b459..1f8c3aee 100644 --- a/src/strategy/warrior/FuryWarriorStrategy.cpp +++ b/src/strategy/warrior/FuryWarriorStrategy.cpp @@ -35,12 +35,12 @@ FuryWarriorStrategy::FuryWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStr NextAction** FuryWarriorStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("bloodthirst", ACTION_NORMAL + 5), - new NextAction("whirlwind", ACTION_NORMAL + 4), - new NextAction("sunder armor", ACTION_NORMAL + 3), - new NextAction("execute", ACTION_NORMAL + 2), - new NextAction("overpower", ACTION_NORMAL + 1), - new NextAction("melee", ACTION_NORMAL), + new NextAction("bloodthirst", ACTION_DEFAULT + 0.5f), + new NextAction("whirlwind", ACTION_DEFAULT + 0.4f), + new NextAction("sunder armor", ACTION_DEFAULT + 0.3f), + new NextAction("execute", ACTION_DEFAULT + 0.2f), + new NextAction("overpower", ACTION_DEFAULT + 0.1f), + new NextAction("melee", ACTION_DEFAULT), NULL); } diff --git a/src/strategy/warrior/TankWarriorStrategy.cpp b/src/strategy/warrior/TankWarriorStrategy.cpp index 0eaf3553..e9beec2d 100644 --- a/src/strategy/warrior/TankWarriorStrategy.cpp +++ b/src/strategy/warrior/TankWarriorStrategy.cpp @@ -43,9 +43,9 @@ TankWarriorStrategy::TankWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStr NextAction** TankWarriorStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("devastate", ACTION_NORMAL + 2), - new NextAction("revenge", ACTION_NORMAL + 1), - new NextAction("melee", ACTION_NORMAL), + new NextAction("devastate", ACTION_DEFAULT + 0.2f), + new NextAction("revenge", ACTION_DEFAULT + 0.1f), + new NextAction("melee", ACTION_DEFAULT), NULL); }