mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Better performance
This commit is contained in:
@@ -1388,7 +1388,7 @@ bool PlayerbotAI::IsCombo(Player* player)
|
|||||||
{
|
{
|
||||||
int tab = AiFactory::GetPlayerSpecTab(player);
|
int tab = AiFactory::GetPlayerSpecTab(player);
|
||||||
return player->getClass() == CLASS_ROGUE ||
|
return player->getClass() == CLASS_ROGUE ||
|
||||||
(player->getClass() == CLASS_DRUID && tab == DRUID_TAB_FERAL && !IsTank(bot));
|
(player->getClass() == CLASS_DRUID && player->HasAura(768)); // cat druid
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlayerbotAI::IsRangedDps(Player* player)
|
bool PlayerbotAI::IsRangedDps(Player* player)
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle,
|
|||||||
// }
|
// }
|
||||||
bool generatePath = !bot->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) &&
|
bool generatePath = !bot->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) &&
|
||||||
!bot->IsFlying() && !bot->HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING) && !bot->IsInWater();
|
!bot->IsFlying() && !bot->HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING) && !bot->IsInWater();
|
||||||
float modifiedZ = SearchBestGroundZForPath(x, y, z, generatePath, 20.0f, normal_only);
|
float modifiedZ = SearchBestGroundZForPath(x, y, z, generatePath, 20.0f, normal_only, 8.0f);
|
||||||
if (modifiedZ == INVALID_HEIGHT) {
|
if (modifiedZ == INVALID_HEIGHT) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class MovementAction : public Action
|
|||||||
bool MoveInside(uint32 mapId, float x, float y, float z, float distance = sPlayerbotAIConfig->followDistance);
|
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);
|
void CreateWp(Player* wpOwner, float x, float y, float z, float o, uint32 entry, bool important = false);
|
||||||
private:
|
private:
|
||||||
float SearchBestGroundZForPath(float x, float y, float z, bool generatePath, float range = 15.0f, bool normal_only = false, float step = 3.0f);
|
float SearchBestGroundZForPath(float x, float y, float z, bool generatePath, float range = 20.0f, bool normal_only = false, float step = 8.0f);
|
||||||
};
|
};
|
||||||
|
|
||||||
class FleeAction : public MovementAction
|
class FleeAction : public MovementAction
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#ifndef _PLAYERBOT_ENEMYPLAYERVALUE_H
|
#ifndef _PLAYERBOT_ENEMYPLAYERVALUE_H
|
||||||
#define _PLAYERBOT_ENEMYPLAYERVALUE_H
|
#define _PLAYERBOT_ENEMYPLAYERVALUE_H
|
||||||
|
|
||||||
|
#include "PlayerbotAIConfig.h"
|
||||||
#include "TargetValue.h"
|
#include "TargetValue.h"
|
||||||
#include "PossibleTargetsValue.h"
|
#include "PossibleTargetsValue.h"
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ class Unit;
|
|||||||
class NearestEnemyPlayersValue : public PossibleTargetsValue
|
class NearestEnemyPlayersValue : public PossibleTargetsValue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NearestEnemyPlayersValue(PlayerbotAI* botAI, float range = 120.0f) :
|
NearestEnemyPlayersValue(PlayerbotAI* botAI, float range = sPlayerbotAIConfig->grindDistance) :
|
||||||
PossibleTargetsValue(botAI, "nearest enemy players", range) { }
|
PossibleTargetsValue(botAI, "nearest enemy players", range) { }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user