mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Compare commits
1 Commits
hermensbas
...
hermensbas
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7f4b4f61f |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -48,5 +48,4 @@ local.properties
|
|||||||
.loadpath
|
.loadpath
|
||||||
.project
|
.project
|
||||||
.cproject
|
.cproject
|
||||||
.vscode
|
.vscode
|
||||||
.idea
|
|
||||||
@@ -93,9 +93,6 @@ The [Playerbots Wiki](https://github.com/mod-playerbots/mod-playerbots/wiki) con
|
|||||||
- **What platforms are supported?** We support Ubuntu, Windows, and macOS. Other Linux distros may work, but will not receive support.
|
- **What platforms are supported?** We support Ubuntu, Windows, and macOS. Other Linux distros may work, but will not receive support.
|
||||||
- **Why isn't my source compiling?** Please ensure that you are compiling with the required [custom branch of AzerothCore](https://github.com/mod-playerbots/azerothcore-wotlk/tree/Playerbot). Additionally, please [check the build status of our CI](https://github.com/mod-playerbots/mod-playerbots/actions). If the latest build is failing, rever to the last successful commit until we address the issue.
|
- **Why isn't my source compiling?** Please ensure that you are compiling with the required [custom branch of AzerothCore](https://github.com/mod-playerbots/azerothcore-wotlk/tree/Playerbot). Additionally, please [check the build status of our CI](https://github.com/mod-playerbots/mod-playerbots/actions). If the latest build is failing, rever to the last successful commit until we address the issue.
|
||||||
|
|
||||||
## Code standards
|
|
||||||
- https://www.azerothcore.org/wiki/cpp-code-standards
|
|
||||||
|
|
||||||
## Addons
|
## Addons
|
||||||
|
|
||||||
Typically, bots are controlled via chat commands. For larger bot groups, this can be unwieldy. As an alternative, community members have developed client Add-Ons to allow controlling bots through the in-game UI. We recommend you check out their projects:
|
Typically, bots are controlled via chat commands. For larger bot groups, this can be unwieldy. As an alternative, community members have developed client Add-Ons to allow controlling bots through the in-game UI. We recommend you check out their projects:
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ void LoadListString(std::string const value, T& list)
|
|||||||
|
|
||||||
bool PlayerbotAIConfig::Initialize()
|
bool PlayerbotAIConfig::Initialize()
|
||||||
{
|
{
|
||||||
LOG_INFO("server.loading", "Initializing mod-playerbots, based on AI Playerbots by ike3 and the original Playerbots by blueboy");
|
LOG_INFO("server.loading", "Initializing mod-playerbots, based on AI Playerbots by ike and the original Playerbots by blueboy");
|
||||||
|
|
||||||
enabled = sConfigMgr->GetOption<bool>("AiPlayerbot.Enabled", true);
|
enabled = sConfigMgr->GetOption<bool>("AiPlayerbot.Enabled", true);
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
|
|||||||
@@ -220,8 +220,7 @@ public:
|
|||||||
|
|
||||||
bool OnPlayerBeforeAchievementComplete(Player* player, AchievementEntry const* achievement) override
|
bool OnPlayerBeforeAchievementComplete(Player* player, AchievementEntry const* achievement) override
|
||||||
{
|
{
|
||||||
if ((sRandomPlayerbotMgr->IsRandomBot(player) || sRandomPlayerbotMgr->IsAddclassBot(player)) &&
|
if (sRandomPlayerbotMgr->IsRandomBot(player) && (achievement->flags == 256 || achievement->flags == 768))
|
||||||
(achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL)))
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,8 +103,7 @@ float StatsWeightCalculator::CalculateItem(uint32 itemId, int32 randomPropertyId
|
|||||||
|
|
||||||
return weight_;
|
return weight_;
|
||||||
}
|
}
|
||||||
// If quality/level blending is disabled, also return the calculated weight.
|
|
||||||
return weight_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float StatsWeightCalculator::CalculateEnchant(uint32 enchantId)
|
float StatsWeightCalculator::CalculateEnchant(uint32 enchantId)
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
#include "TameAction.h"
|
#include "TameAction.h"
|
||||||
#include "TellGlyphsAction.h"
|
#include "TellGlyphsAction.h"
|
||||||
#include "EquipGlyphsAction.h"
|
#include "EquipGlyphsAction.h"
|
||||||
#include "PetsAction.h"
|
#include "PetAction.h"
|
||||||
|
|
||||||
class ChatActionContext : public NamedObjectContext<Action>
|
class ChatActionContext : public NamedObjectContext<Action>
|
||||||
{
|
{
|
||||||
@@ -307,8 +307,8 @@ private:
|
|||||||
static Action* tame(PlayerbotAI* botAI) { return new TameAction(botAI); }
|
static Action* tame(PlayerbotAI* botAI) { return new TameAction(botAI); }
|
||||||
static Action* glyphs(PlayerbotAI* botAI) { return new TellGlyphsAction(botAI); } // Added for custom Glyphs
|
static Action* glyphs(PlayerbotAI* botAI) { return new TellGlyphsAction(botAI); } // Added for custom Glyphs
|
||||||
static Action* glyph_equip(PlayerbotAI* ai) { return new EquipGlyphsAction(ai); } // Added for custom Glyphs
|
static Action* glyph_equip(PlayerbotAI* ai) { return new EquipGlyphsAction(ai); } // Added for custom Glyphs
|
||||||
static Action* pet(PlayerbotAI* botAI) { return new PetsAction(botAI); }
|
static Action* pet(PlayerbotAI* botAI) { return new PetAction(botAI); }
|
||||||
static Action* pet_attack(PlayerbotAI* botAI) { return new PetsAction(botAI, "attack"); }
|
static Action* pet_attack(PlayerbotAI* botAI) { return new PetAction(botAI, "attack"); }
|
||||||
static Action* roll_action(PlayerbotAI* botAI) { return new RollAction(botAI); }
|
static Action* roll_action(PlayerbotAI* botAI) { return new RollAction(botAI); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -199,8 +199,7 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle,
|
|||||||
{
|
{
|
||||||
VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(bot);
|
VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(bot);
|
||||||
Unit* vehicleBase = vehicle->GetBase();
|
Unit* vehicleBase = vehicle->GetBase();
|
||||||
// If the mover (vehicle) can fly, we DO NOT want an mmaps path (2D ground) => disable pathfinding
|
generatePath = vehicleBase->CanFly();
|
||||||
generatePath = !vehicleBase || !vehicleBase->CanFly();
|
|
||||||
if (!vehicleBase || !seat || !seat->CanControl()) // is passenger and cant move anyway
|
if (!vehicleBase || !seat || !seat->CanControl()) // is passenger and cant move anyway
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -208,20 +207,14 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle,
|
|||||||
if (distance > 0.01f)
|
if (distance > 0.01f)
|
||||||
{
|
{
|
||||||
MotionMaster& mm = *vehicleBase->GetMotionMaster(); // need to move vehicle, not bot
|
MotionMaster& mm = *vehicleBase->GetMotionMaster(); // need to move vehicle, not bot
|
||||||
// Disable ground pathing if the bot/master/vehicle are flying
|
|
||||||
auto isFlying = [](Unit* u){ return u && (u->HasUnitMovementFlag(MOVEMENTFLAG_FLYING) || u->IsInFlight()); };
|
|
||||||
bool allowPathVeh = generatePath;
|
|
||||||
Unit* masterVeh = botAI ? botAI->GetMaster() : nullptr;
|
|
||||||
if (isFlying(vehicleBase) || isFlying(bot) || isFlying(masterVeh))
|
|
||||||
allowPathVeh = false;
|
|
||||||
mm.Clear();
|
mm.Clear();
|
||||||
if (!backwards)
|
if (!backwards)
|
||||||
{
|
{
|
||||||
mm.MovePoint(0, x, y, z, FORCED_MOVEMENT_NONE, 0.0f, 0.0f, allowPathVeh);
|
mm.MovePoint(0, x, y, z, generatePath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mm.MovePointBackwards(0, x, y, z, allowPathVeh);
|
mm.MovePointBackwards(0, x, y, z, generatePath);
|
||||||
}
|
}
|
||||||
float speed = backwards ? vehicleBase->GetSpeed(MOVE_RUN_BACK) : vehicleBase->GetSpeed(MOVE_RUN);
|
float speed = backwards ? vehicleBase->GetSpeed(MOVE_RUN_BACK) : vehicleBase->GetSpeed(MOVE_RUN);
|
||||||
float delay = 1000.0f * (distance / speed);
|
float delay = 1000.0f * (distance / speed);
|
||||||
@@ -248,22 +241,15 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle,
|
|||||||
// bot->CastStop();
|
// bot->CastStop();
|
||||||
// botAI->InterruptSpell();
|
// botAI->InterruptSpell();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
MotionMaster& mm = *bot->GetMotionMaster();
|
MotionMaster& mm = *bot->GetMotionMaster();
|
||||||
// No ground pathfinding if the bot/master are flying => allow true 3D (Z) movement
|
|
||||||
auto isFlying = [](Unit* u){ return u && (u->HasUnitMovementFlag(MOVEMENTFLAG_FLYING) || u->IsInFlight()); };
|
|
||||||
bool allowPath = generatePath;
|
|
||||||
Unit* master = botAI ? botAI->GetMaster() : nullptr;
|
|
||||||
if (isFlying(bot) || isFlying(master))
|
|
||||||
allowPath = false;
|
|
||||||
mm.Clear();
|
mm.Clear();
|
||||||
if (!backwards)
|
if (!backwards)
|
||||||
{
|
{
|
||||||
mm.MovePoint(0, x, y, z, FORCED_MOVEMENT_NONE, 0.0f, 0.0f, allowPath);
|
mm.MovePoint(0, x, y, z, generatePath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mm.MovePointBackwards(0, x, y, z, allowPath);
|
mm.MovePointBackwards(0, x, y, z, generatePath);
|
||||||
}
|
}
|
||||||
float delay = 1000.0f * MoveDelay(distance, backwards);
|
float delay = 1000.0f * MoveDelay(distance, backwards);
|
||||||
if (lessDelay)
|
if (lessDelay)
|
||||||
@@ -296,23 +282,16 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle,
|
|||||||
// bot->CastStop();
|
// bot->CastStop();
|
||||||
// botAI->InterruptSpell();
|
// botAI->InterruptSpell();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
MotionMaster& mm = *bot->GetMotionMaster();
|
MotionMaster& mm = *bot->GetMotionMaster();
|
||||||
G3D::Vector3 endP = path.back();
|
G3D::Vector3 endP = path.back();
|
||||||
// No ground pathfinding if the bot/master are flying => allow true 3D (Z) movement
|
|
||||||
auto isFlying = [](Unit* u){ return u && (u->HasUnitMovementFlag(MOVEMENTFLAG_FLYING) || u->IsInFlight()); };
|
|
||||||
bool allowPath = generatePath;
|
|
||||||
Unit* master = botAI ? botAI->GetMaster() : nullptr;
|
|
||||||
if (isFlying(bot) || isFlying(master))
|
|
||||||
allowPath = false;
|
|
||||||
mm.Clear();
|
mm.Clear();
|
||||||
if (!backwards)
|
if (!backwards)
|
||||||
{
|
{
|
||||||
mm.MovePoint(0, x, y, z, FORCED_MOVEMENT_NONE, 0.0f, 0.0f, allowPath);
|
mm.MovePoint(0, x, y, z, generatePath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mm.MovePointBackwards(0, x, y, z, allowPath);
|
mm.MovePointBackwards(0, x, y, z, generatePath);
|
||||||
}
|
}
|
||||||
float delay = 1000.0f * MoveDelay(distance, backwards);
|
float delay = 1000.0f * MoveDelay(distance, backwards);
|
||||||
if (lessDelay)
|
if (lessDelay)
|
||||||
@@ -1034,49 +1013,18 @@ void MovementAction::UpdateMovementState()
|
|||||||
bot->GetMapWaterOrGroundLevel(bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ()) + 1.0f;
|
bot->GetMapWaterOrGroundLevel(bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ()) + 1.0f;
|
||||||
|
|
||||||
// Keep bot->SendMovementFlagUpdate() withing the if statements to not intefere with bot behavior on ground/(shallow) waters
|
// Keep bot->SendMovementFlagUpdate() withing the if statements to not intefere with bot behavior on ground/(shallow) waters
|
||||||
|
if (!bot->HasUnitMovementFlag(MOVEMENTFLAG_FLYING) &&
|
||||||
bool hasFlightAura = bot->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || bot->HasAuraType(SPELL_AURA_FLY);
|
bot->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !onGround)
|
||||||
if (hasFlightAura)
|
|
||||||
{
|
{
|
||||||
bool changed = false;
|
bot->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||||
if (!bot->HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY))
|
bot->SendMovementFlagUpdate();
|
||||||
{
|
|
||||||
bot->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY);
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
if (!bot->HasUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY))
|
|
||||||
{
|
|
||||||
bot->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
if (!bot->HasUnitMovementFlag(MOVEMENTFLAG_FLYING))
|
|
||||||
{
|
|
||||||
bot->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
if (changed)
|
|
||||||
bot->SendMovementFlagUpdate();
|
|
||||||
}
|
}
|
||||||
else if (!hasFlightAura)
|
|
||||||
|
else if (bot->HasUnitMovementFlag(MOVEMENTFLAG_FLYING) &&
|
||||||
|
(!bot->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || onGround))
|
||||||
{
|
{
|
||||||
bool changed = false;
|
bot->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||||
if (bot->HasUnitMovementFlag(MOVEMENTFLAG_FLYING))
|
bot->SendMovementFlagUpdate();
|
||||||
{
|
|
||||||
bot->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
if (bot->HasUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY))
|
|
||||||
{
|
|
||||||
bot->RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
if (bot->HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY))
|
|
||||||
{
|
|
||||||
bot->RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY);
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
if (changed)
|
|
||||||
bot->SendMovementFlagUpdate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// See if the bot is currently slowed, rooted, or otherwise unable to move
|
// See if the bot is currently slowed, rooted, or otherwise unable to move
|
||||||
@@ -1174,6 +1122,13 @@ bool MovementAction::Follow(Unit* target, float distance, float angle)
|
|||||||
if (!target)
|
if (!target)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!bot->InBattleground() && sServerFacade->IsDistanceLessOrEqualThan(sServerFacade->GetDistance2d(bot, target),
|
||||||
|
sPlayerbotAIConfig->followDistance))
|
||||||
|
{
|
||||||
|
// botAI->TellError("No need to follow");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (!bot->InBattleground()
|
if (!bot->InBattleground()
|
||||||
&& sServerFacade->IsDistanceLessOrEqualThan(sServerFacade->GetDistance2d(bot, target->GetPositionX(),
|
&& sServerFacade->IsDistanceLessOrEqualThan(sServerFacade->GetDistance2d(bot, target->GetPositionX(),
|
||||||
@@ -1291,17 +1246,21 @@ bool MovementAction::Follow(Unit* target, float distance, float angle)
|
|||||||
return MoveTo(target, sPlayerbotAIConfig->followDistance);
|
return MoveTo(target, sPlayerbotAIConfig->followDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sServerFacade->IsDistanceLessOrEqualThan(sServerFacade->GetDistance2d(bot, target),
|
||||||
|
sPlayerbotAIConfig->followDistance))
|
||||||
|
{
|
||||||
|
// botAI->TellError("No need to follow");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (target->IsFriendlyTo(bot) && bot->IsMounted() && AI_VALUE(GuidVector, "all targets").empty())
|
if (target->IsFriendlyTo(bot) && bot->IsMounted() && AI_VALUE(GuidVector, "all targets").empty())
|
||||||
distance += angle;
|
distance += angle;
|
||||||
|
|
||||||
// Do not cancel follow if the 2D distance is short but the Z still differs (e.g., master above).
|
if (!bot->InBattleground() && sServerFacade->IsDistanceLessOrEqualThan(sServerFacade->GetDistance2d(bot, target),
|
||||||
float dz1 = fabs(bot->GetPositionZ() - target->GetPositionZ());
|
sPlayerbotAIConfig->followDistance))
|
||||||
if (!bot->InBattleground()
|
|
||||||
&& sServerFacade->IsDistanceLessOrEqualThan(sServerFacade->GetDistance2d(bot, target), sPlayerbotAIConfig->followDistance)
|
|
||||||
&& dz1 < sPlayerbotAIConfig->contactDistance)
|
|
||||||
{
|
{
|
||||||
// botAI->TellError("No need to follow");
|
// botAI->TellError("No need to follow");
|
||||||
return false; // truly in range (2D and Z) => no need to move
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bot->HandleEmoteCommand(0);
|
bot->HandleEmoteCommand(0);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PetsAction.h"
|
#include "PetAction.h"
|
||||||
|
|
||||||
#include "CharmInfo.h"
|
#include "CharmInfo.h"
|
||||||
#include "Creature.h"
|
#include "Creature.h"
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "PlayerbotAI.h"
|
#include "PlayerbotAI.h"
|
||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
|
|
||||||
bool PetsAction::Execute(Event event)
|
bool PetAction::Execute(Event event)
|
||||||
{
|
{
|
||||||
// Extract the command parameter from the event (e.g., "aggressive", "defensive", "attack", etc.)
|
// Extract the command parameter from the event (e.g., "aggressive", "defensive", "attack", etc.)
|
||||||
std::string param = event.getParam();
|
std::string param = event.getParam();
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _PLAYERBOT_PETSACTION_H
|
#ifndef _PLAYERBOT_PETACTION_H
|
||||||
#define _PLAYERBOT_PETSACTION_H
|
#define _PLAYERBOT_PETACTION_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -14,10 +14,10 @@
|
|||||||
|
|
||||||
class PlayerbotAI;
|
class PlayerbotAI;
|
||||||
|
|
||||||
class PetsAction : public Action
|
class PetAction : public Action
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PetsAction(PlayerbotAI* botAI, const std::string& defaultCmd = "") : Action(botAI, "pet"), defaultCmd(defaultCmd) {}
|
PetAction(PlayerbotAI* botAI, const std::string& defaultCmd = "") : Action(botAI, "pet"), defaultCmd(defaultCmd) {}
|
||||||
|
|
||||||
bool Execute(Event event) override;
|
bool Execute(Event event) override;
|
||||||
|
|
||||||
@@ -205,18 +205,17 @@ void TalkToQuestGiverAction::RewardMultipleItem(Quest const* quest, Object* ques
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Try to pick the usable item. If multiple, list usable rewards.
|
// Try to pick the usable item. If multiple list usable rewards.
|
||||||
bestIds = BestRewards(quest);
|
bestIds = BestRewards(quest);
|
||||||
|
if (!bestIds.empty())
|
||||||
if (bestIds.size() > 1)
|
{
|
||||||
AskToSelectReward(quest, out, true);
|
AskToSelectReward(quest, out, true);
|
||||||
|
}
|
||||||
else if (!bestIds.empty())
|
else
|
||||||
{
|
{
|
||||||
// Pick the first item
|
// Pick the first item
|
||||||
uint32 firstId = *bestIds.begin();
|
ItemTemplate const* item = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[*bestIds.begin()]);
|
||||||
ItemTemplate const* item = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[firstId]);
|
bot->RewardQuest(quest, *bestIds.begin(), questGiver, true);
|
||||||
bot->RewardQuest(quest, firstId, questGiver, true);
|
|
||||||
|
|
||||||
out << "Rewarded " << ChatHelper::FormatItem(item);
|
out << "Rewarded " << ChatHelper::FormatItem(item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
#include "UseMeetingStoneAction.h"
|
#include "UseMeetingStoneAction.h"
|
||||||
#include "NamedObjectContext.h"
|
#include "NamedObjectContext.h"
|
||||||
#include "ReleaseSpiritAction.h"
|
#include "ReleaseSpiritAction.h"
|
||||||
#include "PetsAction.h"
|
#include "PetAction.h"
|
||||||
|
|
||||||
class PlayerbotAI;
|
class PlayerbotAI;
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ private:
|
|||||||
static Action* tell_not_enough_reputation(PlayerbotAI* botAI) { return new TellMasterAction(botAI, "Not enough reputation"); }
|
static Action* tell_not_enough_reputation(PlayerbotAI* botAI) { return new TellMasterAction(botAI, "Not enough reputation"); }
|
||||||
static Action* tell_cannot_equip(PlayerbotAI* botAI) { return new InventoryChangeFailureAction(botAI); }
|
static Action* tell_cannot_equip(PlayerbotAI* botAI) { return new InventoryChangeFailureAction(botAI); }
|
||||||
static Action* self_resurrect(PlayerbotAI* botAI) { return new SelfResurrectAction(botAI); }
|
static Action* self_resurrect(PlayerbotAI* botAI) { return new SelfResurrectAction(botAI); }
|
||||||
static Action* pet(PlayerbotAI* botAI) { return new PetsAction(botAI); }
|
static Action* pet(PlayerbotAI* botAI) { return new PetAction(botAI); }
|
||||||
|
|
||||||
// quest
|
// quest
|
||||||
static Action* quest_update_add_kill(PlayerbotAI* ai) { return new QuestUpdateAddKillAction(ai); }
|
static Action* quest_update_add_kill(PlayerbotAI* ai) { return new QuestUpdateAddKillAction(ai); }
|
||||||
|
|||||||
@@ -472,6 +472,7 @@ float IccBqlMultiplier::GetValue(Action* action)
|
|||||||
else
|
else
|
||||||
return 0.0f; // Cancel all other actions when we need to handle Swarming Shadows
|
return 0.0f; // Cancel all other actions when we need to handle Swarming Shadows
|
||||||
}
|
}
|
||||||
|
return 1.0f;
|
||||||
|
|
||||||
if ((boss->GetExactDist2d(ICC_BQL_TANK_POSITION.GetPositionX(), ICC_BQL_TANK_POSITION.GetPositionY()) > 10.0f) &&
|
if ((boss->GetExactDist2d(ICC_BQL_TANK_POSITION.GetPositionX(), ICC_BQL_TANK_POSITION.GetPositionY()) > 10.0f) &&
|
||||||
botAI->IsRanged(bot) && !((boss->GetPositionZ() - bot->GetPositionZ()) > 5.0f))
|
botAI->IsRanged(bot) && !((boss->GetPositionZ() - bot->GetPositionZ()) > 5.0f))
|
||||||
@@ -480,7 +481,6 @@ float IccBqlMultiplier::GetValue(Action* action)
|
|||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1.0f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//VDW
|
//VDW
|
||||||
|
|||||||
@@ -41,11 +41,6 @@ class ShamanCombatStrategyFactoryInternal : public NamedObjectContext<Strategy>
|
|||||||
public:
|
public:
|
||||||
ShamanCombatStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
|
ShamanCombatStrategyFactoryInternal() : NamedObjectContext<Strategy>(false, true)
|
||||||
{
|
{
|
||||||
creators["heal"] = &ShamanCombatStrategyFactoryInternal::resto;
|
|
||||||
creators["melee"] = &ShamanCombatStrategyFactoryInternal::enh;
|
|
||||||
creators["dps"] = &ShamanCombatStrategyFactoryInternal::enh;
|
|
||||||
creators["caster"] = &ShamanCombatStrategyFactoryInternal::ele;
|
|
||||||
//creators["offheal"] = &ShamanCombatStrategyFactoryInternal::offheal;
|
|
||||||
creators["resto"] = &ShamanCombatStrategyFactoryInternal::resto;
|
creators["resto"] = &ShamanCombatStrategyFactoryInternal::resto;
|
||||||
creators["enh"] = &ShamanCombatStrategyFactoryInternal::enh;
|
creators["enh"] = &ShamanCombatStrategyFactoryInternal::enh;
|
||||||
creators["ele"] = &ShamanCombatStrategyFactoryInternal::ele;
|
creators["ele"] = &ShamanCombatStrategyFactoryInternal::ele;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ std::vector<CreatureData const*> BgMastersValue::Calculate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return bmGuids;
|
return std::move(bmGuids);
|
||||||
}
|
}
|
||||||
|
|
||||||
CreatureData const* BgMasterValue::Calculate()
|
CreatureData const* BgMasterValue::Calculate()
|
||||||
@@ -120,7 +120,7 @@ CreatureData const* BgMasterValue::NearestBm(bool allowDead)
|
|||||||
|
|
||||||
std::vector<CreatureData const*> bmPairs = AI_VALUE2(std::vector<CreatureData const*>, "bg masters", qualifier);
|
std::vector<CreatureData const*> bmPairs = AI_VALUE2(std::vector<CreatureData const*>, "bg masters", qualifier);
|
||||||
|
|
||||||
float rDist = 0.0f;
|
float rDist;
|
||||||
CreatureData const* rbmPair = nullptr;
|
CreatureData const* rbmPair = nullptr;
|
||||||
|
|
||||||
for (auto& bmPair : bmPairs)
|
for (auto& bmPair : bmPairs)
|
||||||
|
|||||||
Reference in New Issue
Block a user