Compare commits

..

5 Commits

Author SHA1 Message Date
bash
35b52b65ba Revert "core eventMap has been refactored"
This reverts commit 4c87a04201.
2025-10-19 10:03:38 +02:00
bash
0a88aa9abe Revert "another related core refactor fixes"
This reverts commit bcc173d920.
2025-10-19 03:27:04 +02:00
bash
bcc173d920 another related core refactor fixes 2025-10-18 00:52:29 +02:00
bash
24d4c1f0a0 MovePoint core refactor and had a bug aswell 2025-10-17 21:06:03 +02:00
bash
4c87a04201 core eventMap has been refactored 2025-10-17 20:17:45 +02:00
10 changed files with 17 additions and 34 deletions

View File

@@ -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.
- **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
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:

View File

@@ -57,7 +57,7 @@ void LoadListString(std::string const value, T& list)
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);
if (!enabled)

View File

@@ -92,18 +92,9 @@ float StatsWeightCalculator::CalculateItem(uint32 itemId, int32 randomPropertyId
CalculateSocketBonus(player_, proto);
if (enable_quality_blend_)
{
// Heirloom items scale with player level
// Use player level as effective item level for heirlooms - Quality EPIC
// Else - Blend with item quality and level for normal items
if (proto->Quality == ITEM_QUALITY_HEIRLOOM)
weight_ *= PlayerbotFactory::CalcMixedGearScore(lvl, ITEM_QUALITY_EPIC);
else
weight_ *= PlayerbotFactory::CalcMixedGearScore(proto->ItemLevel, proto->Quality);
// Blend with item quality and level
weight_ *= PlayerbotFactory::CalcMixedGearScore(proto->ItemLevel, proto->Quality);
return weight_;
}
// If quality/level blending is disabled, also return the calculated weight.
return weight_;
}

View File

@@ -82,7 +82,7 @@
#include "TameAction.h"
#include "TellGlyphsAction.h"
#include "EquipGlyphsAction.h"
#include "PetsAction.h"
#include "PetAction.h"
class ChatActionContext : public NamedObjectContext<Action>
{
@@ -307,8 +307,8 @@ private:
static Action* tame(PlayerbotAI* botAI) { return new TameAction(botAI); }
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* pet(PlayerbotAI* botAI) { return new PetsAction(botAI); }
static Action* pet_attack(PlayerbotAI* botAI) { return new PetsAction(botAI, "attack"); }
static Action* pet(PlayerbotAI* botAI) { return new PetAction(botAI); }
static Action* pet_attack(PlayerbotAI* botAI) { return new PetAction(botAI, "attack"); }
static Action* roll_action(PlayerbotAI* botAI) { return new RollAction(botAI); }
};

View File

@@ -3,7 +3,7 @@
* 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 "Creature.h"
@@ -13,7 +13,7 @@
#include "PlayerbotAI.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.)
std::string param = event.getParam();

View File

@@ -3,8 +3,8 @@
* and/or modify it under version 3 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_PETSACTION_H
#define _PLAYERBOT_PETSACTION_H
#ifndef _PLAYERBOT_PETACTION_H
#define _PLAYERBOT_PETACTION_H
#include <string>
@@ -14,10 +14,10 @@
class PlayerbotAI;
class PetsAction : public Action
class PetAction : public Action
{
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;

View File

@@ -41,7 +41,7 @@
#include "UseMeetingStoneAction.h"
#include "NamedObjectContext.h"
#include "ReleaseSpiritAction.h"
#include "PetsAction.h"
#include "PetAction.h"
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_cannot_equip(PlayerbotAI* botAI) { return new InventoryChangeFailureAction(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
static Action* quest_update_add_kill(PlayerbotAI* ai) { return new QuestUpdateAddKillAction(ai); }

View File

@@ -472,6 +472,7 @@ float IccBqlMultiplier::GetValue(Action* action)
else
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) &&
botAI->IsRanged(bot) && !((boss->GetPositionZ() - bot->GetPositionZ()) > 5.0f))
@@ -480,7 +481,6 @@ float IccBqlMultiplier::GetValue(Action* action)
return 0.0f;
}
return 1.0f;
}
//VDW

View File

@@ -41,11 +41,6 @@ class ShamanCombatStrategyFactoryInternal : public NamedObjectContext<Strategy>
public:
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["enh"] = &ShamanCombatStrategyFactoryInternal::enh;
creators["ele"] = &ShamanCombatStrategyFactoryInternal::ele;

View File

@@ -102,7 +102,7 @@ std::vector<CreatureData const*> BgMastersValue::Calculate()
}
}
return bmGuids;
return std::move(bmGuids);
}
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);
float rDist = 0.0f;
float rDist;
CreatureData const* rbmPair = nullptr;
for (auto& bmPair : bmPairs)