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