From 8c914e5723294f22b688a0c851247387f367e512 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Mon, 24 Jul 2023 15:58:48 +0800 Subject: [PATCH] sapphiron strategy fix --- src/strategy/actions/MovementActions.cpp | 10 +--------- src/strategy/druid/HealDruidStrategy.h | 3 ++- src/strategy/hunter/GenericHunterStrategy.h | 2 ++ src/strategy/mage/GenericMageStrategy.h | 1 + src/strategy/priest/ShadowPriestStrategy.h | 2 +- src/strategy/raids/naxxramas/RaidNaxxActions.cpp | 12 +++++------- src/strategy/shaman/HealShamanStrategy.h | 3 ++- 7 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index 97ed460b..054f2f87 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -150,15 +150,7 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle, !bot->IsFlying() && !bot->IsUnderWater(); MotionMaster &mm = *bot->GetMotionMaster(); mm.Clear(); - - // float botZ = bot->GetPositionZ(); - // if (!bot->InBattleground() && z - botZ > 0.5f && bot->GetDistance2d(x, y) <= 5.0f) - // { - // float speed = bot->GetSpeed(MOVE_RUN); - // mm.MoveJump(x, y, botZ + 0.5f, speed, speed, 1); - // } - // else - mm.MovePoint(mapId, x, y, z, generatePath); + mm.MovePoint(mapId, x, y, z, generatePath); AI_VALUE(LastMovement&, "last movement").Set(mapId, x, y, z, bot->GetOrientation()); return true; diff --git a/src/strategy/druid/HealDruidStrategy.h b/src/strategy/druid/HealDruidStrategy.h index d3240364..1547c64a 100644 --- a/src/strategy/druid/HealDruidStrategy.h +++ b/src/strategy/druid/HealDruidStrategy.h @@ -6,6 +6,7 @@ #define _PLAYERBOT_HEALDRUIDSTRATEGY_H #include "GenericDruidStrategy.h" +#include "Strategy.h" class PlayerbotAI; @@ -16,7 +17,7 @@ class HealDruidStrategy : public GenericDruidStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "heal"; } - uint32 GetType() const override { return STRATEGY_TYPE_HEAL; } + uint32 GetType() const override { return STRATEGY_TYPE_RANGED | STRATEGY_TYPE_HEAL; } }; #endif diff --git a/src/strategy/hunter/GenericHunterStrategy.h b/src/strategy/hunter/GenericHunterStrategy.h index 018a4243..23e47ddc 100644 --- a/src/strategy/hunter/GenericHunterStrategy.h +++ b/src/strategy/hunter/GenericHunterStrategy.h @@ -6,6 +6,7 @@ #define _PLAYERBOT_GENERICHUNTERSTRATEGY_H #include "CombatStrategy.h" +#include "Strategy.h" class PlayerbotAI; @@ -16,6 +17,7 @@ class GenericHunterStrategy : public CombatStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "hunter"; } + uint32 GetType() const override { return CombatStrategy::GetType() | STRATEGY_TYPE_RANGED | STRATEGY_TYPE_DPS; } }; class HunterBoostStrategy : public Strategy diff --git a/src/strategy/mage/GenericMageStrategy.h b/src/strategy/mage/GenericMageStrategy.h index a19b8dea..1e710a61 100644 --- a/src/strategy/mage/GenericMageStrategy.h +++ b/src/strategy/mage/GenericMageStrategy.h @@ -16,6 +16,7 @@ class GenericMageStrategy : public CombatStrategy std::string const getName() override { return "mage"; } void InitTriggers(std::vector& triggers) override; + uint32 GetType() const override { return CombatStrategy::GetType() | STRATEGY_TYPE_RANGED | STRATEGY_TYPE_DPS; } }; class MageCureStrategy : public Strategy diff --git a/src/strategy/priest/ShadowPriestStrategy.h b/src/strategy/priest/ShadowPriestStrategy.h index 2406e395..7167f696 100644 --- a/src/strategy/priest/ShadowPriestStrategy.h +++ b/src/strategy/priest/ShadowPriestStrategy.h @@ -17,7 +17,7 @@ class ShadowPriestStrategy : public GenericPriestStrategy NextAction** getDefaultActions() override; void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "shadow"; } - uint32 GetType() const override { return STRATEGY_TYPE_DPS|STRATEGY_TYPE_RANGED; } + uint32 GetType() const override { return STRATEGY_TYPE_DPS | STRATEGY_TYPE_RANGED; } }; class ShadowPriestAoeStrategy : public CombatStrategy diff --git a/src/strategy/raids/naxxramas/RaidNaxxActions.cpp b/src/strategy/raids/naxxramas/RaidNaxxActions.cpp index c82b15ed..27c48ea4 100644 --- a/src/strategy/raids/naxxramas/RaidNaxxActions.cpp +++ b/src/strategy/raids/naxxramas/RaidNaxxActions.cpp @@ -543,16 +543,14 @@ bool SapphironGroundPositionAction::Execute(Event event) float offset_angle = M_PI * 0.02 * index; float angle = start_angle + offset_angle; float distance; - if (botAI->IsRangedDps(bot)) { - distance = rand_norm() * 5 + 30.0f; + if (botAI->IsRanged(bot)) { + distance = 35.0f; } else if (botAI->IsHeal(bot)) { - distance = rand_norm() * 5 + 20.0f; + distance = 30.0f; } else { - distance = rand_norm() * 10; - } - if (MoveTo(NAXX_MAP_ID, helper.center.first + cos(angle) * distance, helper.center.second + sin(angle) * distance, helper.GENERIC_HEIGHT)) { - return true; + distance = 5.0f; } + return MoveTo(NAXX_MAP_ID, helper.center.first + cos(angle) * distance, helper.center.second + sin(angle) * distance, helper.GENERIC_HEIGHT); } else { std::vector dest; if (helper.FindPosToAvoidChill(dest)) { diff --git a/src/strategy/shaman/HealShamanStrategy.h b/src/strategy/shaman/HealShamanStrategy.h index 1e9e77a2..e41cc2e1 100644 --- a/src/strategy/shaman/HealShamanStrategy.h +++ b/src/strategy/shaman/HealShamanStrategy.h @@ -6,6 +6,7 @@ #define _PLAYERBOT_HEALSHAMANSTRATEGY_H #include "GenericShamanStrategy.h" +#include "Strategy.h" class PlayerbotAI; @@ -16,7 +17,7 @@ class HealShamanStrategy : public GenericShamanStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "heal"; } - uint32 GetType() const override { return STRATEGY_TYPE_HEAL; } + uint32 GetType() const override { return STRATEGY_TYPE_RANGED | STRATEGY_TYPE_HEAL; } }; #endif