sapphiron strategy fix

This commit is contained in:
Yunfan Li
2023-07-24 15:58:48 +08:00
parent d80aa5223b
commit 8c914e5723
7 changed files with 14 additions and 19 deletions

View File

@@ -150,14 +150,6 @@ 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);
AI_VALUE(LastMovement&, "last movement").Set(mapId, x, y, z, bot->GetOrientation());

View File

@@ -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<TriggerNode*>& 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

View File

@@ -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<TriggerNode*>& 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

View File

@@ -16,6 +16,7 @@ class GenericMageStrategy : public CombatStrategy
std::string const getName() override { return "mage"; }
void InitTriggers(std::vector<TriggerNode*>& triggers) override;
uint32 GetType() const override { return CombatStrategy::GetType() | STRATEGY_TYPE_RANGED | STRATEGY_TYPE_DPS; }
};
class MageCureStrategy : public Strategy

View File

@@ -17,7 +17,7 @@ class ShadowPriestStrategy : public GenericPriestStrategy
NextAction** getDefaultActions() override;
void InitTriggers(std::vector<TriggerNode*>& 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

View File

@@ -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<float> dest;
if (helper.FindPosToAvoidChill(dest)) {

View File

@@ -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<TriggerNode*>& 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