diff --git a/src/strategy/raids/ulduar/RaidUlduarActionContext.h b/src/strategy/raids/ulduar/RaidUlduarActionContext.h index 3bf822b4..f52711ba 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActionContext.h +++ b/src/strategy/raids/ulduar/RaidUlduarActionContext.h @@ -31,6 +31,7 @@ public: creators["kologarn mark dps target action"] = &RaidUlduarActionContext::kologarn_mark_dps_target_action; creators["kologarn fall from floor action"] = &RaidUlduarActionContext::kologarn_fall_from_floor_action; creators["kologarn nature resistance action"] = &RaidUlduarActionContext::kologarn_nature_resistance_action; + creators["kologarn rubble slowdown action"] = &RaidUlduarActionContext::kologarn_rubble_slowdown_action; creators["hodir move snowpacked icicle"] = &RaidUlduarActionContext::hodir_move_snowpacked_icicle; creators["hodir biting cold jump"] = &RaidUlduarActionContext::hodir_biting_cold_jump; creators["hodir frost resistance action"] = &RaidUlduarActionContext::hodir_frost_resistance_action; @@ -55,6 +56,7 @@ private: static Action* kologarn_mark_dps_target_action(PlayerbotAI* ai) { return new KologarnMarkDpsTargetAction(ai); } static Action* kologarn_fall_from_floor_action(PlayerbotAI* ai) { return new KologarnFallFromFloorAction(ai); } static Action* kologarn_nature_resistance_action(PlayerbotAI* ai) { return new KologarnNatureResistanceAction(ai); } + static Action* kologarn_rubble_slowdown_action(PlayerbotAI* ai) { return new KologarnRubbleSlowdownAction(ai); } static Action* hodir_move_snowpacked_icicle(PlayerbotAI* ai) { return new HodirMoveSnowpackedIcicleAction(ai); } static Action* hodir_biting_cold_jump(PlayerbotAI* ai) { return new HodirBitingColdJumpAction(ai); } static Action* hodir_frost_resistance_action(PlayerbotAI* ai) { return new HodirFrostResistanceAction(ai); } diff --git a/src/strategy/raids/ulduar/RaidUlduarActions.cpp b/src/strategy/raids/ulduar/RaidUlduarActions.cpp index c0f61d11..cdd7dd4f 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActions.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarActions.cpp @@ -1390,6 +1390,21 @@ bool KologarnNatureResistanceAction::isUseful() return kologarnNatureResistanceTrigger.IsActive(); } +bool KologarnRubbleSlowdownAction::Execute(Event event) +{ + Group* group = bot->GetGroup(); + if (!group) + return false; + + int8 skullIndex = 7; + ObjectGuid currentSkullTarget = group->GetTargetIcon(skullIndex); + Unit* currentSkullUnit = botAI->GetUnit(currentSkullTarget); + if (!currentSkullUnit || !currentSkullUnit->IsAlive() || currentSkullUnit->GetEntry() != NPC_RUBBLE) + return false; + + return botAI->CastSpell("frost trap", currentSkullUnit); +} + bool HodirMoveSnowpackedIcicleAction::isUseful() { // Check boss and it is alive diff --git a/src/strategy/raids/ulduar/RaidUlduarActions.h b/src/strategy/raids/ulduar/RaidUlduarActions.h index 0c12585c..f7da8435 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActions.h +++ b/src/strategy/raids/ulduar/RaidUlduarActions.h @@ -181,6 +181,13 @@ public: bool isUseful() override; }; +class KologarnRubbleSlowdownAction : public Action +{ +public: + KologarnRubbleSlowdownAction(PlayerbotAI* botAI) : Action(botAI, "kologarn rubble slowdown action") {} + bool Execute(Event event) override; +}; + class HodirBitingColdJumpAction : public MovementAction { public: diff --git a/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp b/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp index 277e94b5..c0ff5616 100644 --- a/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp @@ -83,6 +83,10 @@ void RaidUlduarStrategy::InitTriggers(std::vector& triggers) "kologarn nature resistance trigger", NextAction::array(0, new NextAction("kologarn nature resistance action", ACTION_RAID), nullptr))); + triggers.push_back(new TriggerNode( + "kologarn rubble slowdown trigger", + NextAction::array(0, new NextAction("kologarn rubble slowdown action", ACTION_RAID), nullptr))); + // // Hodir // diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h b/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h index bd7d1b29..f6160a87 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h +++ b/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h @@ -31,6 +31,7 @@ public: creators["kologarn mark dps target trigger"] = &RaidUlduarTriggerContext::kologarn_mark_dps_target_trigger; creators["kologarn fall from floor trigger"] = &RaidUlduarTriggerContext::kologarn_fall_from_floor_trigger; creators["kologarn nature resistance trigger"] = &RaidUlduarTriggerContext::kologarn_nature_resistance_trigger; + creators["kologarn rubble slowdown trigger"] = &RaidUlduarTriggerContext::kologarn_rubble_slowdown_trigger; creators["hodir biting cold"] = &RaidUlduarTriggerContext::hodir_biting_cold; creators["hodir near snowpacked icicle"] = &RaidUlduarTriggerContext::hodir_near_snowpacked_icicle; creators["hodir frost resistance trigger"] = &RaidUlduarTriggerContext::hodir_frost_resistance_trigger; @@ -55,6 +56,7 @@ private: static Trigger* kologarn_mark_dps_target_trigger(PlayerbotAI* ai) { return new KologarnMarkDpsTargetTrigger(ai); } static Trigger* kologarn_fall_from_floor_trigger(PlayerbotAI* ai) { return new KologarnFallFromFloorTrigger(ai); } static Trigger* kologarn_nature_resistance_trigger(PlayerbotAI* ai) { return new KologarnNatureResistanceTrigger(ai); } + static Trigger* kologarn_rubble_slowdown_trigger(PlayerbotAI* ai) { return new KologarnRubbleSlowdownTrigger(ai); } static Trigger* hodir_biting_cold(PlayerbotAI* ai) { return new HodirBitingColdTrigger(ai); } static Trigger* hodir_near_snowpacked_icicle(PlayerbotAI* ai) { return new HodirNearSnowpackedIcicleTrigger(ai); } static Trigger* hodir_frost_resistance_trigger(PlayerbotAI* ai) { return new HodirFrostResistanceTrigger(ai); } diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp b/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp index 4ddaca56..afe65640 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp @@ -502,6 +502,35 @@ bool KologarnNatureResistanceTrigger::IsActive() return false; } +bool KologarnRubbleSlowdownTrigger::IsActive() +{ + Unit* boss = AI_VALUE2(Unit*, "find target", "kologarn"); + + // Check boss and it is alive + if (!boss || !boss->IsAlive()) + return false; + + // Check if bot is hunter + if (bot->getClass() != CLASS_HUNTER) + return false; + + Group* group = bot->GetGroup(); + if (!group) + return false; + + // Check that the current skull mark is set on rubble + int8 skullIndex = 7; + ObjectGuid currentSkullTarget = group->GetTargetIcon(skullIndex); + Unit* currentSkullUnit = botAI->GetUnit(currentSkullTarget); + if (!currentSkullUnit || !currentSkullUnit->IsAlive() || currentSkullUnit->GetEntry() != NPC_RUBBLE) + return false; + + if (bot->HasSpellCooldown(SPELL_FROST_TRAP)) + return false; + + return true; +} + bool HodirBitingColdTrigger::IsActive() { Unit* boss = AI_VALUE2(Unit*, "find target", "hodir"); diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggers.h b/src/strategy/raids/ulduar/RaidUlduarTriggers.h index 3b953c12..807946f7 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggers.h +++ b/src/strategy/raids/ulduar/RaidUlduarTriggers.h @@ -26,7 +26,7 @@ enum UlduarIDs SPELL_FOCUSED_EYEBEAM_10 = 63347, SPELL_FOCUSED_EYEBEAM_25_2 = 63976, SPELL_FOCUSED_EYEBEAM_25 = 63977, - + // Hodir NPC_SNOWPACKED_ICICLE = 33174, NPC_TOASTY_FIRE = 33342, @@ -38,6 +38,7 @@ enum UlduarIDs GOBJECT_NATURE_BOMB = 194902, // Buffs + SPELL_FROST_TRAP = 13809, SPELL_FROST_RESISTANCE_AURA = 48945, SPELL_FIRE_RESISTANCE_AURA = 48947, SPELL_ASPECT_OF_THE_WILD = 49071, @@ -172,6 +173,13 @@ public: bool IsActive() override; }; +class KologarnRubbleSlowdownTrigger : public Trigger +{ +public: + KologarnRubbleSlowdownTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn rubble slowdown trigger") {} + bool IsActive() override; +}; + // // Hodir //