287 Commits

Author SHA1 Message Date
kadeshar
ffa8c6d94a
Merge pull request #1623 from brighton-chi/karazhan
Implement Karazhan strategy
2025-10-03 06:30:39 +02:00
bash
0cc15411c1
license update (#1674) 2025-09-30 15:19:44 +02:00
crow
0afeca4300 Merge remote-tracking branch 'upstream/master' into karazhan 2025-09-28 17:06:55 -05:00
crow
e525c22d85 Fix SPEC_TAB names 2025-09-27 23:11:47 -05:00
crow
bdfd45c9a0 Merge remote-tracking branch 'upstream/master' into karazhan 2025-09-27 03:22:50 -05:00
crow
22d1cc9d57 BBW and other edits 2025-09-21 15:42:55 -05:00
Revision
fcb956ec1b Removed unnecessary spaces 2025-09-19 22:43:50 +02:00
Revision
ace813516d Replaced tabs with spaces 2025-09-19 21:00:09 +02:00
Revision
19399c6f57 Implement Karazhan strategy 2025-09-09 21:23:27 -05:00
Spargel
c218dbe653
Fix uses of restrictHealerDPS and randomBotCombatStrategies. (#1570) 2025-09-01 19:05:07 +02:00
bash
c9b4cfa184
[Revert] Threading leftover which belonged to other related PRs's (once green needs be merged) (#1583)
* Revert "Correct side effects of  merge f5ef5bd1c2039290be1b1108872d046e1e65ebe1 (#1512)"

This reverts commit 966bf1d6afbf946ac92931b7d572fd76d79c56b0.

* Revert "Fix ACCESS_VIOLATION in mod-playerbots: purge stale AIs, add thread-safety, and harden HasRealPlayerMaster (#1507)"

This reverts commit f5ef5bd1c2039290be1b1108872d046e1e65ebe1.
2025-08-20 20:13:45 +02:00
kadeshar
77c2354c3f
Yogg-Saron strategy (#1565)
* - wip

* - Added Yogg-Saron strategy

* - Added Yogg-Saron sanity strategy

* - WIP

* - WIP

* - WIP

* - WIP

* - Added Yogg-Saron strategy

* - code refactoring

* - Code fix after pr
2025-08-18 12:02:19 +02:00
bash
8d51092d42
As requested revert for threadfixes last few days (#1552)
* Revert "[Large server fix] #1537 Serialize playerBots/botLoading with a mutex and use snapshot-based loops to fix concurrency crashes (#1540)"

This reverts commit 3fff58df1a2058894e9b758be07869aec87c2c70.

* Revert "[Fix] teleport to invalid map or invalid coordinates (x , y , z  200000, o ) given when teleporting player (g UI d full type player low , name , map , x , y , z , o )  (#1538)"

This reverts commit ca2e2ef0dbd8dcfb16123db65ae638424550e50c.

* Revert "Fix: prevent MoveSplineInitArgs::Validate velocity asserts (velocity > 0.01f) for bots, pets, and charmed units (#1534)"

This reverts commit 4e3ac609bd23d991150d956d4e69ee6de2fcf2bf.

* Revert "[Fix issue #1527] : startup crash in tank target selection — add TOCTOU & null-safety guards (#1532)"

This reverts commit c6b0424c29b6a1bf5b3574135128d30d19838411.

* Revert "[Fix issue #1528] Close small window where the “in a BG/arena” state can change between the check (InBattleground() / InArena()) and grabbing the pointer (GetBattleground()), which leads to a null dereference. (#1530)"

This reverts commit 2e0a161623eaa97b7d9ceea076779ae0cabeb877.

* Revert "Harden playerbot logout & packet dispatch; add null-safety in chat hooks and RPG checks (#1529)"

This reverts commit e4ea8e2694b0f6d098a945c6f863526cd14f9b3f.

* Revert "Dont wait to travel when in combat. (#1524)"

This reverts commit ddfa919154529fee59e7ba30d2ebe29c0ae4abdf.

* Revert "nullptr fix (#1523)"

This reverts commit 380312ffd231fd5e663a8a17daa80dd39906e3f0.

* Revert "Playerbots/LFG: fix false not eligible & dungeon 0/type 0, add clear diagnostics (#1521)"

This reverts commit 872e4176137b66c83ebcb03932fa8ff1e39fd791.

* Revert "nullptr exception (#1520)"

This reverts commit 3d28a815089fd0a878a6a1d469db657c6030d4b2.

* Revert "Removed bot freezing at startup and system message, not relevant anymore (#1519)"

This reverts commit bcd6f5bc066d5e8a54f2d37b7dfc54e5db0dd2d1.
2025-08-12 22:10:47 +02:00
Alex Dcnh
ca2e2ef0db
[Fix] teleport to invalid map or invalid coordinates (x , y , z 200000, o ) given when teleporting player (g UI d full type player low , name , map , x , y , z , o ) (#1538)
* MoveSplineInitArgs::Validate: expression 'velocity > 0.01f' failed for GUID Full

* Update BotMovementUtils.h

* Playerbots: guard against invalid-Z teleports
2025-08-12 01:54:17 +02:00
Alex Dcnh
4e3ac609bd
Fix: prevent MoveSplineInitArgs::Validate velocity asserts (velocity > 0.01f) for bots, pets, and charmed units (#1534)
* MoveSplineInitArgs::Validate: expression 'velocity > 0.01f' failed for GUID Full

* Update BotMovementUtils.h
2025-08-12 01:53:48 +02:00
Alex Dcnh
e4ea8e2694
Harden playerbot logout & packet dispatch; add null-safety in chat hooks and RPG checks (#1529) 2025-08-11 16:27:25 +02:00
bash
bcd6f5bc06
Removed bot freezing at startup and system message, not relevant anymore (#1519) 2025-08-10 19:11:39 +02:00
Alex Dcnh
f5ef5bd1c2
Fix ACCESS_VIOLATION in mod-playerbots: purge stale AIs, add thread-safety, and harden HasRealPlayerMaster (#1507) 2025-08-07 00:31:00 +02:00
brighton-chi
938872564a
Revise bot logic for initializing and using consumables (#1483)
Bots will now add level- and spec-appropriate oils and stones when maintaining and, with respect to randombots, leveling. All bots (other than those with class-specific temporary weapon enchants) will apply oils and stones to their weapons. General clean-ups to associated code were made.
2025-08-01 19:28:13 +02:00
kadeshar
f76435b4c4
Merge pull request #1473 from Tierisch/master
Add option to remove 'healer dps' strategy based on specified map.
2025-07-31 16:50:06 +02:00
ThePenguinMan96
de9f8fbbea Druid Flight Form Bug Fix
Hello everyone,

This is a fix for issue #1233

I have added a clause in the CanCastSpell check that checks if the bot is in flight form/swift flight form & not in combat. It will no longer attempt to shift into a caster form  and repetitively try and heal/buff party members while flying. Tested on my PC with the changes and druid now successfully flies as fast as the player with no stopping.

This was causing the issue:

static ActionNode* thorns([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("thorns",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ nullptr,
                          /*C*/ nullptr);
}

static ActionNode* thorns_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("thorns on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ nullptr,
                          /*C*/ nullptr);
}

static ActionNode* mark_of_the_wild([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("mark of the wild",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ nullptr,
                          /*C*/ nullptr);
}

static ActionNode* mark_of_the_wild_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("mark of the wild on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ nullptr,
                          /*C*/ nullptr);
}
static ActionNode* regrowth_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("regrowth on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ NULL,
                          /*C*/ NULL);
}
static ActionNode* rejuvenation_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("rejuvenation on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ NULL,
                          /*C*/ NULL);
}
static ActionNode* remove_curse_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("remove curse on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ NULL,
                          /*C*/ NULL);
}
static ActionNode* abolish_poison_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("abolish poison on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ NULL,
                          /*C*/ NULL);
}
static ActionNode* revive([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("revive",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ NULL,
                          /*C*/ NULL);
}

The *P* stands for prior, aka before this action is taken, do this other action "caster form". This is the Caster Form action:

class CastCasterFormAction : public CastBuffSpellAction
{
public:
    CastCasterFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "caster form") {}

    bool isUseful() override;
    bool isPossible() override { return true; }
    bool Execute(Event event) override;
};

And this:

bool CastCasterFormAction::isUseful()
{
    return botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form", "aquatic form",
                               "flight form", "swift flight form", "moonkin form", nullptr) &&
           AI_VALUE2(uint8, "mana", "self target") > sPlayerbotAIConfig->mediumHealth;
}

bool CastCasterFormAction::Execute(Event event)
{
    botAI->RemoveShapeshift();
    return true;
}

So basically, the druid was triggering to heal/buff the party, and before it could do that, it had to switch into "caster form" which executed RemoveShapeshift(). After it did that, mounting back up into flight form/swift flight form had the highest priority, so it would loop the triggers/actions.
2025-07-27 01:10:31 -07:00
Spargel
66b326d79e
Merge branch 'master' into master 2025-07-27 02:57:03 -05:00
Spargel
0d8e8fbd61 Second pass for adding 'healer dps' check based on map ID. Now works when teleporting in addition to on init. 2025-07-27 02:29:07 -05:00
ThePenguinMan96
ee245f73b5 Mage Overhaul
Hello everyone,

Back again with another class overhaul. Here is a list of what changes have been made:
1. Consolidated the AoE strategies into "aoe". For light aoe (2+ enemies) the mage will use Cone of Cold (frost)/Arcane Explosion (Arcane)/Multi-Dot with Living Bomb (Fire/Frostfire). For medium aoe (3+ enemies) they will use Flamestrike -> Blizzard. Also, the mage will automatically cancel channeling their blizzard if there is less than 2 enemies around. This is huge, since the mage would often stand there and finish their entire channel during a boss fight after the adds died.
2. Organized actions, triggers, and the aiobjectcontext
3. Enabled Deep Freeze to be casted on bosses regardless of their immune status. Big benefit for frost dps on boss fights.
4. Slight tweaks in the conf so Arcane gets Arcane Barrage and Frostfire gets 2/2 Firestarter
5. Streamlined Arcane DPS to use Missile Barrage proc when at 4 stacks of Arcane Blast
5. Streamlined Fire/Frostfire DPS to keep Improved Scorch active (5% spell crit) unless there is a debuff of equal type
6. Added "firestarter" strategy, that utilizes the Fire talent Firestarter better. The mage will multi-dot Living Bomb while running towards melee, and cast Dragon's Breath -> instant cast Flamestrike -> Blast Wave -> instant cast Flamestrike -> Blizzard for bonkers damage. Disabled by default - not everyone wants their mages running into melee. Enable by typing "co +firestarter" on fire and frostfire mages.
7. Streamlined Frost DPS by finally adding support for Cold Snap for mages. It will proc when both Icy Veins and Deep Freeze are on cooldown. There is an exception to this - if the mage is level 30-59, it will not check for Deep Freeze - only Icy Veins.
8. Added Conjure Mana Gem support in the generic non-combat strategy and Use Mana Gem support in the generic combat strategy. This might be the biggest benefit of the overhaul - the gem has a 90 second cooldown, not shared with mana potions. It really prevents the mage from gassing out in longer fights. And the mana gem has 3 charges!
9. Added Mana Shield ability, which triggers on low health.
10. Changed Mirror Image from a boost ability to an anti-threat tool. Not many people know this, but it's best use in PvE is it's anti-threat modifier: "Mod Total Threat - Temporary Value: -90000000". It also doesn't do good damage, and is essentially used best as a pre-pull spell. But until the mages know how to react to a pull-timer, it's going to be used to reduce threat.

Let me know what y'all think!
2025-07-26 01:49:49 -07:00
Yunfan Li
feda619066
Engine optimization for better performance and mem usage (#1462)
* Optimize loot

* World channel talk

* General improvement

* Engine rebuild for performance and memory usage

* Fix crash with AutoDoQuest = 0
2025-07-25 12:11:03 +02:00
Yunfan Li
4a00c954ed
RPG update travel flight status (#1445) 2025-07-23 23:37:41 +08:00
Alex Dcnh
8fd188ff3b
Update PlayerbotAI.cpp 2025-07-04 19:19:29 +02:00
Alex Dcnh
326783ed4f
PlayerbotAI – Fix GetEquipGearScore to mirror Blizzard’s average-ilvl rules 2025-07-04 10:23:37 +02:00
Alex Dcnh
edc9241fa3
Update PlayerbotAI.cpp 2025-07-03 22:21:54 +02:00
ThePenguinMan96
00cc2468f1
Warlock overhaul (#1397)
This is a complete overhaul of the warlock class, making 3 new strategies (affliction, demonology, and destruction), as well as finishing the warlock tank strategy (shadow ward and searing pain). It also includes a soulstone fix, where the bots can change who they soulstone based on the non-combat strategies you set for them. It also includes a self-resurrect action and trigger that allows the bots to resurrect using a soulstone or reincarnation. Many other skills were added to finish out the warlock skillset.
2025-06-27 20:00:38 +02:00
NoxMax
bb004825aa
AutoScaleActivity refactoring (#1375)
* AutoScaleActivity refactoring

* Abandon AutoScaleActivity 5% stepping
2025-06-12 23:21:35 +02:00
Brian
3c05e47cb2
CMaNGOS Playerbots "lfg" command implemented (#1291)
* CMaNGOS Playerbots "lfg" command implemented

* Remove logging, fix warning, add suggestion

- Remove LOG_INFO's console clutter, since 'lfg' command is working correctly now.
- Warning C26813 fixed for: placeholders["%role"] = (role == BOT_ROLE_TANK ? "tank" : (role == BOT_ROLE_HEALER ? "healer" : "dps"));
- Added suggestion to let bots do autogear & maintenance, so players can instantly start their dungeon or raid activities without manually having to configure the playerbots gear. It could save a lot of time. This is up to discussion for playerbots maintainers.
2025-06-01 15:31:29 +08:00
Yunfan Li
b726f3dfcb
Active loot roll (#1338) 2025-05-25 21:24:25 +08:00
Type1Error
95c572bf48
feat(playerbots): staggered taxi take-off for bots (#1281)
* feat(playerbots): staggered taxi take-off for bots

Adds four new configurable settings to playerbots.conf:

- AiPlayerbot.BotTaxiDelayMinMs:   Min random delay before the 1st follower bot clicks the flight-master
- AiPlayerbot.BotTaxiDelayMaxMs:   Upper bound for the overall taxi delay window – larger spreads big raids
- AiPlayerbot.BotTaxiGapMs:        Fixed gap added per group-slot so bots never take off together
- AiPlayerbot.BotTaxiGapJitterMs:  Extra small randomness added to each gap so launches don’t look robotic

These options allow server owners to fine-tune how bots queue up and take off from flight masters, making their behavior appear more natural.

Closes #1017 : Bots use Flight master nearly the same time.

* fixed build errors

Was missing a header and variable declarations.
2025-05-10 13:45:15 +02:00
Type1Error
e48c3351d3
fix (#1179): resolve bot stuttering in BGs after player death (#1269)
Fixes #1179

This update fixes several issues related to bot behavior in battlegrounds when the player dies and releases spirit:

- Removed conflicting strategies (+stay / +follow): Bots were being told to follow and stay simultaneously each tick, causing oscillating movement ("stuttering"). The +stay strategy is now skipped in BGs to allow bots to continue objectives normally.

- Disabled follow while in BG: When the player died, bots attempted to return to the player repeatedly, abandoning objective-based movement. PlayerbotAI now sets -follow while in BGs to keep bots engaged with the objectives.

- Prevented dead bots from following ghosts: Previously, dead bots would follow ghost players away from the graveyard and potentially miss Rez. Bots now wait at the spirit healer when dead in BGs.

- Removed redundant strategy changes and messages in ReleaseSpiritAction as they no longer apply in battleground contexts.
2025-05-06 21:09:32 +02:00
NoxMax
2649cc0ad5
Comment fix (#1263)
Reflecting changes made a while back about changing the default active bots from 10% to 100% 9fb2b51f169ddb9ab7c7a463f85cafe1da33c56c
2025-05-04 15:37:01 +02:00
Cryo81
04b8b76362
ilvl calculation fixed warfury use case (#1222)
* War fury detection fixed in GetEquipGearScore.

* fixing indentation

---------

Co-authored-by: Julien MAS <julien.mas81@gmail.com>
2025-04-22 12:32:54 +02:00
Cryo81
07e4dec70d
Warning fix + ilvl function fix (#1210)
* 1 variable order warning fixed
70 unused variable warning fixed

* Fixed GetEquipGearScore function

---------

Co-authored-by: Julien MAS <julien.mas81@gmail.com>
2025-04-20 14:26:42 +08:00
Jered
9be4b26424
Feat/onyxia raid strategy init (#1182)
* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* feat: init onyxia raid strategy

* Feat/onyxia raid strategy init fix (#1)

* feat: init onyxia raid strategy

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix

* feat: ony raid strategy init fix
2025-04-20 14:23:14 +08:00
bash
2f549295d5
Added more defense programming (#1195) 2025-04-17 11:51:42 +08:00
Yunfan Li
7676fd6427
Fix multithread issue on LFG and group leave (#1143) 2025-03-31 22:46:27 +08:00
kadeshar
feb7bb8a8b
Added Vault of Archavon strategy with Emalon tactics (#1117) 2025-03-25 13:28:53 +01:00
kadeshar
3d6d454337
Stay strategy improvement (#1072)
* - Stay Strategy work in combat and with RTSC

* - Fixed summon with stay strategy

* - Added new stay strategy support for chat commands
2025-03-20 10:53:16 +01:00
avirar
c4a4d3a9e6
Rogue bots can unlock items in their bags and in the trade window (#1055) 2025-03-17 15:10:33 +01:00
Yunfan Li
38912d4a8a
Auto do quest feature (new rpg strategy) (#1034)
* New rpg startup speed up and refactor

* New rpg do quest

* Fix invalid height in quest poi

* Add quest accept and reward limitation

* New rpg quest improvement

* Organize quest log, reward quests and fix grind target

* Quest dropped statistic and remove redundant code

* Decrease grind relevance lower than loot

* Fix new rpg drop quest

* Go to reward quest instead of innkeeper when quest completed

* Fix incorrect logic in do quest reward

* Fix reset quests in factory

* Fix crash on grind target value

Co-authored-by: SaW <swerkhoven@outlook.com>

* Fix a minor error in DoCompletedQuest

* Let bots get rid of impossible quests faster

* Increase loot fluency (especially for caster)

* Remove seasonal quests from auto accept

* Enhance quest accept condition check

* Add questgiver check (limit acceptation of quest 7946)

* Questgiver check and localization

* Near npc fix

* Fix quest item report

* Add lowPriorityQuest set for quests can not be done

* Improve gameobjects loot

* Do complete quest

* FIx move far to teleport check

* Accept or reward quest from game objects

* Fix possible crash in rpg game objects

* Fix ChooseNpcOrGameObjectToInteract crash

---------

Co-authored-by: SaW <swerkhoven@outlook.com>
2025-03-14 21:31:33 +08:00
Yunfan Li
d8cb75d376
Fix m_CastItem in CastSpell (#1047)
Fixed issues where some items and spells bypass item level requirement or use incorrect item level.
2025-03-02 20:20:51 +01:00
SaW
9fbf60d812
Resolve most warnings - PlayerbotAI (#1025)
Resolve most warnings - PlayerbotAI

---------

Co-authored-by: blinkysc <37940565+blinkysc@users.noreply.github.com>
2025-03-01 14:19:07 +01:00
Yunfan Li
95c2ba9105
Permission check and readability improvements (#997)
* AiFactory check by spell instead of level

* Ignore group security for guild invitation
2025-02-23 20:09:59 +01:00
Yunfan Li
62e0235e73
Scripts and sessions update to align with acore (#987) 2025-02-22 12:08:53 +08:00
avirar
a0278f1efb
Hunter ammo equip bug and other issues with BuyAction.cpp (#986)
Resolves #947

Equip logic was failing as projectiles were never returning ITEM_USAGE_EQUIP in ItemUsageValue.cpp, added two cases where equip is returned:

If no ammo is currently set
If new ammo has higher DPS than old/currently equipped ammo
While testing this using "b [itemlink]" and "b vendor" to purchase arrows I noticed some issues with BuyAction.cpp and have resolved them:

Bots will now perform the "equip upgrades" action for any bought item that has an equip usage
When using "b vendor" to buy all useful items from vendors within interaction distance, it now sorts the list of available items by calculated item score and buys the highest scoring item (if it is higher than the currently equipped item) for each slot. It should not buy multiple items for the same slot anymore, saving gold/emblems/etc.
"b vendor" will now only attempt to buy 1 of each item. Consumable and projectile item types can be bought up to 10 times per execution as long as it is still useful to buy the item in each iteration of the for loop. All items were following this behaviour previously and since the equip command was only given after the for loop it would buy 10 of an item before triggering it wasn't useful to buy more.
And finally, resolved issues where a bot runs out of ammo mid-fight:

Re-enabled combat and non-combat "no ammo" strategies to perform "equip upgrades" action.
Modified GenericTriggers.cpp; AmmoCountTrigger::IsActive to return true when the bot has ammo but it is not equipped yet.
2025-02-21 18:32:10 +01:00