From 1bbed177c8ba061f23847720a5837ec8c6115bbf Mon Sep 17 00:00:00 2001 From: dillyns <49765217+dillyns@users.noreply.github.com> Date: Sat, 30 May 2026 10:14:38 -0400 Subject: [PATCH] Add Nefarian Fear Ward action and trigger, along with Wild Magic trigger (#2412) ## Pull Request Description For Nefarian in BWL, this does the following: Mages - Ice block if the mage class call "Wild Magic" happens Priests - Buff the current target of Nefarian with Fear Ward ## Feature Evaluation - Describe the **minimum logic** required to achieve the intended behavior. - Describe the **processing cost** when this logic executes across many bots. ## How to Test the Changes Go to Nefarian (id 11583) or his phase 1 form (id 10162) in BWL with a mage and a priest bot. During phase 2, the priest bot should cast fear ward on whoever nefarian is targeting. Wait for a mage class call. Once it happens the mage bot should cast ice block (if its available) to remove the Wild Magic debuff. ## 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? - - [x] No - - [ ] Yes (**explain why**) - Does this change add new decision branches or increase maintenance complexity? - - [x] No - - [ ] Yes (**explain below**) ## AI Assistance Was AI assistance used while working on this change? - - [ ] No - - [x] Yes (**explain below**) AI assistance was used to explore how dungeon/raid strats are implemented and to explore examples. All code has been reviewed ## Final Checklist - - [x] Stability is not compromised. - - [x] Performance impact is understood, tested, and acceptable. - - [x] Added logic complexity is justified and explained. - - [x] Any new bot dialogue lines are translated. - - [x] Documentation updated if needed (Conf comments, WiKi commands). ## Notes for Reviewers --- .../BlackwingLair/Action/RaidBwlActions.cpp | 13 ++++++++++++ .../BlackwingLair/Action/RaidBwlActions.h | 7 +++++++ .../Raid/BlackwingLair/RaidBwlActionContext.h | 2 ++ .../BlackwingLair/RaidBwlTriggerContext.h | 4 ++++ .../Strategy/RaidBwlStrategy.cpp | 6 ++++++ .../BlackwingLair/Trigger/RaidBwlTriggers.cpp | 21 +++++++++++++++++++ .../BlackwingLair/Trigger/RaidBwlTriggers.h | 16 ++++++++++++++ .../Raid/BlackwingLair/Util/RaidBwlHelpers.h | 5 ++++- 8 files changed, 73 insertions(+), 1 deletion(-) diff --git a/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp b/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp index 2d018fc91..7a12c3b87 100644 --- a/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp +++ b/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp @@ -38,3 +38,16 @@ bool BwlUseHourglassSandAction::Execute(Event /*event*/) { return botAI->CastSpell(SPELL_HOURGLASS_SAND, bot); } + +bool BwlNefarianFearWardAction::Execute(Event /*event*/) +{ + Unit* nefarian = AI_VALUE2(Unit*, "find target", "nefarian"); + if (!nefarian) + return false; + + Unit* victim = nefarian->GetVictim(); + if (!victim) + return false; + + return botAI->CastSpell("fear ward", victim); +} diff --git a/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.h b/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.h index 27037414a..28b2f667c 100644 --- a/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.h +++ b/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.h @@ -29,4 +29,11 @@ public: bool Execute(Event event) override; }; +class BwlNefarianFearWardAction : public Action +{ +public: + BwlNefarianFearWardAction(PlayerbotAI* botAI) : Action(botAI, "bwl nefarian fear ward") {} + bool Execute(Event event) override; +}; + #endif diff --git a/src/Ai/Raid/BlackwingLair/RaidBwlActionContext.h b/src/Ai/Raid/BlackwingLair/RaidBwlActionContext.h index 7b73f410f..4e46b1ca5 100644 --- a/src/Ai/Raid/BlackwingLair/RaidBwlActionContext.h +++ b/src/Ai/Raid/BlackwingLair/RaidBwlActionContext.h @@ -13,12 +13,14 @@ public: creators["bwl check onyxia scale cloak"] = &RaidBwlActionContext::bwl_check_onyxia_scale_cloak; creators["bwl turn off suppression device"] = &RaidBwlActionContext::bwl_turn_off_suppression_device; creators["bwl use hourglass sand"] = &RaidBwlActionContext::bwl_use_hourglass_sand; + creators["bwl nefarian fear ward"] = &RaidBwlActionContext::bwl_nefarian_fear_ward; } private: static Action* bwl_check_onyxia_scale_cloak(PlayerbotAI* botAI) { return new BwlOnyxiaScaleCloakAuraCheckAction(botAI); } static Action* bwl_turn_off_suppression_device(PlayerbotAI* botAI) { return new BwlTurnOffSuppressionDeviceAction(botAI); } static Action* bwl_use_hourglass_sand(PlayerbotAI* botAI) { return new BwlUseHourglassSandAction(botAI); } + static Action* bwl_nefarian_fear_ward(PlayerbotAI* botAI) { return new BwlNefarianFearWardAction(botAI); } }; #endif diff --git a/src/Ai/Raid/BlackwingLair/RaidBwlTriggerContext.h b/src/Ai/Raid/BlackwingLair/RaidBwlTriggerContext.h index de2ce0058..a2de3fd5a 100644 --- a/src/Ai/Raid/BlackwingLair/RaidBwlTriggerContext.h +++ b/src/Ai/Raid/BlackwingLair/RaidBwlTriggerContext.h @@ -11,11 +11,15 @@ public: { creators["bwl suppression device"] = &RaidBwlTriggerContext::bwl_suppression_device; creators["bwl affliction bronze"] = &RaidBwlTriggerContext::bwl_affliction_bronze; + creators["bwl wild magic"] = &RaidBwlTriggerContext::bwl_wild_magic; + creators["bwl nefarian fear ward"] = &RaidBwlTriggerContext::bwl_nefarian_fear_ward; } private: static Trigger* bwl_suppression_device(PlayerbotAI* ai) { return new BwlSuppressionDeviceTrigger(ai); } static Trigger* bwl_affliction_bronze(PlayerbotAI* ai) { return new BwlAfflictionBronzeTrigger(ai); } + static Trigger* bwl_wild_magic(PlayerbotAI* ai) { return new BwlWildMagicTrigger(ai); } + static Trigger* bwl_nefarian_fear_ward(PlayerbotAI* ai) { return new BwlNefarianFearWardTrigger(ai); } }; #endif diff --git a/src/Ai/Raid/BlackwingLair/Strategy/RaidBwlStrategy.cpp b/src/Ai/Raid/BlackwingLair/Strategy/RaidBwlStrategy.cpp index ec36b2cde..76d0da5ef 100644 --- a/src/Ai/Raid/BlackwingLair/Strategy/RaidBwlStrategy.cpp +++ b/src/Ai/Raid/BlackwingLair/Strategy/RaidBwlStrategy.cpp @@ -10,4 +10,10 @@ void RaidBwlStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode("bwl affliction bronze", { NextAction("bwl use hourglass sand", ACTION_RAID) })); + + triggers.push_back(new TriggerNode("bwl wild magic", { + NextAction("ice block", ACTION_RAID) })); + + triggers.push_back(new TriggerNode("bwl nefarian fear ward", { + NextAction("bwl nefarian fear ward", ACTION_RAID) })); } diff --git a/src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.cpp b/src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.cpp index 4b4bee1ad..500c81a92 100644 --- a/src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.cpp +++ b/src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.cpp @@ -27,3 +27,24 @@ bool BwlAfflictionBronzeTrigger::IsActive() { return bot->HasAura(SPELL_BROOD_AFFLICTION_BRONZE); } + +bool BwlWildMagicTrigger::IsActive() +{ + return bot->getClass() == CLASS_MAGE && bot->HasAura(SPELL_WILD_MAGIC); +} + +bool BwlNefarianFearWardTrigger::IsActive() +{ + if (bot->getClass() != CLASS_PRIEST) + return false; + + Unit* nefarian = AI_VALUE2(Unit*, "find target", "nefarian"); + if (!nefarian || !nefarian->IsInCombat()) + return false; + + Unit* victim = nefarian->GetVictim(); + if (!victim) + return false; + + return !botAI->HasAura("fear ward", victim); +} diff --git a/src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.h b/src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.h index 0aa290007..8222cf592 100644 --- a/src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.h +++ b/src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.h @@ -21,4 +21,20 @@ public: bool IsActive() override; }; +// Nefarian + +class BwlWildMagicTrigger : public Trigger +{ +public: + BwlWildMagicTrigger(PlayerbotAI* botAI) : Trigger(botAI, "bwl wild magic") {} + bool IsActive() override; +}; + +class BwlNefarianFearWardTrigger : public Trigger +{ +public: + BwlNefarianFearWardTrigger(PlayerbotAI* botAI) : Trigger(botAI, "bwl nefarian fear ward") {} + bool IsActive() override; +}; + #endif diff --git a/src/Ai/Raid/BlackwingLair/Util/RaidBwlHelpers.h b/src/Ai/Raid/BlackwingLair/Util/RaidBwlHelpers.h index 3333d826d..c76f0e892 100644 --- a/src/Ai/Raid/BlackwingLair/Util/RaidBwlHelpers.h +++ b/src/Ai/Raid/BlackwingLair/Util/RaidBwlHelpers.h @@ -12,7 +12,10 @@ namespace BlackwingLairHelpers // Chromaggus SPELL_BROOD_AFFLICTION_BRONZE = 23170, - SPELL_HOURGLASS_SAND = 23645 + SPELL_HOURGLASS_SAND = 23645, + + // Nefarian + SPELL_WILD_MAGIC = 23410 }; enum BlackwingLairGameObjects