From 4c9b0adb727e6e03288a340ed924cd3dd7d0e9ba Mon Sep 17 00:00:00 2001 From: kadeshar Date: Sat, 4 Apr 2026 13:00:51 +0200 Subject: [PATCH] Fire mage cc (#2281) ## Pull Request Description Added support for fire mage cc spells like: Dragon's Breath (disorient) and Blast Wave (knockback) ## How to Test the Changes 1. Invite fire mage to party 2. Add strategy `nc +duel` 3. Start duel and go near bot 4. Bot should use frost nova/dragon's breath/blast wave depends of cooldowns ## Impact Assessment - Does this change increase per-bot/per-tick processing or risk scaling poorly with thousands of bots? - - [x] No, not at all - - [ ] Minimal impact (**explain below**) - - [ ] Moderate impact (**explain below**) - Does this change modify default bot behavior? - - [ ] No - - [x] Yes (**explain why**) Mages cc by default - Does this change add new decision branches or increase maintenance complexity? - - [x] No - - [ ] Yes (**explain below**) ## Messages to Translate - Does this change add bot messages to translate? - - [x] No - - [ ] Yes (**list messages in the table**) | Message key | Default message | | --------------- | ------------------ | | | | | | | ## AI Assistance - Was AI assistance used while working on this change? - - [ ] No - - [x] Yes (**explain below**) OpenCode, for research differences between CcStrategy implementation between cmangos and ac playerbots ## Final Checklist - - [x] Stability is not compromised. - - [x] Performance impact is understood, tested, and acceptable. - - [x] Added logic complexity is justified and explained. - - [x] Documentation updated if needed (Conf comments, WiKi commands). ## Notes for Reviewers --- src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp | 8 ++++++++ src/Bot/Factory/AiFactory.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp b/src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp index 75a63efa4..0e26c692d 100644 --- a/src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp +++ b/src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp @@ -237,6 +237,14 @@ void MageBoostStrategy::InitTriggers(std::vector& triggers) void MageCcStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("polymorph", { NextAction("polymorph", 30.0f) })); + + Player* bot = botAI->GetBot(); + int tab = AiFactory::GetPlayerSpecTab(bot); + if (tab == MAGE_TAB_FIRE) + { + triggers.push_back(new TriggerNode("enemy too close for spell", {NextAction("dragon's breath", ACTION_INTERRUPT + 1)})); + triggers.push_back(new TriggerNode("enemy is close", {NextAction("blast wave", ACTION_INTERRUPT)})); + } } void MageAoeStrategy::InitTriggers(std::vector& triggers) diff --git a/src/Bot/Factory/AiFactory.cpp b/src/Bot/Factory/AiFactory.cpp index 6121789a9..a821886f9 100644 --- a/src/Bot/Factory/AiFactory.cpp +++ b/src/Bot/Factory/AiFactory.cpp @@ -311,7 +311,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa else engine->addStrategiesNoInit("frost", nullptr); - engine->addStrategiesNoInit("dps", "dps assist", "cure", "aoe", nullptr); + engine->addStrategiesNoInit("dps", "dps assist", "cure", "cc", "aoe", nullptr); break; case CLASS_WARRIOR: if (tab == WARRIOR_TAB_PROTECTION)