diff --git a/src/strategy/raids/ulduar/RaidUlduarActionContext.h b/src/strategy/raids/ulduar/RaidUlduarActionContext.h index c7d1a3c7..adc457ea 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActionContext.h +++ b/src/strategy/raids/ulduar/RaidUlduarActionContext.h @@ -24,6 +24,7 @@ public: creators["razorscale grounded"] = &RaidUlduarActionContext::razorscale_grounded; creators["razorscale harpoon action"] = &RaidUlduarActionContext::razorscale_harpoon_action; creators["razorscale fuse armor action"] = &RaidUlduarActionContext::razorscale_fuse_armor_action; + creators["hodir move snowpacked icicle"] = &RaidUlduarActionContext::hodir_move_snowpacked_icicle; } private: @@ -36,6 +37,7 @@ private: static Action* razorscale_grounded(PlayerbotAI* ai) { return new RazorscaleGroundedAction(ai); } static Action* razorscale_harpoon_action(PlayerbotAI* ai) { return new RazorscaleHarpoonAction(ai); } static Action* razorscale_fuse_armor_action(PlayerbotAI* ai) { return new RazorscaleFuseArmorAction(ai); } + static Action* hodir_move_snowpacked_icicle(PlayerbotAI* ai) { return new HodirMoveSnowpackedIcicleAction(ai); } }; #endif diff --git a/src/strategy/raids/ulduar/RaidUlduarActions.cpp b/src/strategy/raids/ulduar/RaidUlduarActions.cpp index 6e378bd4..8ccbb121 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActions.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarActions.cpp @@ -1154,3 +1154,34 @@ bool RazorscaleFuseArmorAction::Execute(Event event) bossHelper.AssignRolesBasedOnHealth(); return true; } + +bool HodirMoveSnowpackedIcicleAction::isUseful() +{ + // Check boss and it is alive + Unit* boss = AI_VALUE2(Unit*, "find target", "hodir"); + if (!boss || !boss->IsAlive()) + { + return false; + } + + // Find the nearest Snowpacked Icicle Target + Creature* target = bot->FindNearestCreature(33174, 100.0f); + if (!target) + return false; + + // Check that boss is stacked on Snowpacked Icicle + if (bot->GetDistance2d(target->GetPositionX(), target->GetPositionY()) <= 3.0f) + { + return false; + } +} + +bool HodirMoveSnowpackedIcicleAction::Execute(Event event) +{ + Creature* target = bot->FindNearestCreature(33174, 100.0f); + if (!target) + return false; + + return MoveTo(target->GetMapId(), target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), false, + false, false, true, MovementPriority::MOVEMENT_NORMAL); +} diff --git a/src/strategy/raids/ulduar/RaidUlduarActions.h b/src/strategy/raids/ulduar/RaidUlduarActions.h index 34b0484e..2c1499a0 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActions.h +++ b/src/strategy/raids/ulduar/RaidUlduarActions.h @@ -106,4 +106,12 @@ public: bool isUseful() override; }; +class HodirMoveSnowpackedIcicleAction : public MovementAction +{ +public: + HodirMoveSnowpackedIcicleAction(PlayerbotAI* botAI) : MovementAction(botAI, "hodir move snowpacked icicle") {} + bool Execute(Event event) override; + bool isUseful() override; +}; + #endif diff --git a/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp b/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp index c9f9916b..6582fc4b 100644 --- a/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp @@ -46,6 +46,15 @@ void RaidUlduarStrategy::InitTriggers(std::vector& triggers) "razorscale fuse armor trigger", NextAction::array(0, new NextAction("razorscale fuse armor action", ACTION_RAID + 2), nullptr))); + // + // Hodir + // + triggers.push_back(new TriggerNode( + "hodir near snowpacked icicle", + NextAction::array(0, new NextAction("hodir move snowpacked icicle", ACTION_RAID + 5), nullptr))); + triggers.push_back(new TriggerNode( + "hodir biting cold", NextAction::array(0, new NextAction("intense cold jump", ACTION_RAID + 4), nullptr))); + } void RaidUlduarStrategy::InitMultipliers(std::vector& multipliers) diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h b/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h index 4b42c401..a7a1090b 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h +++ b/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h @@ -24,6 +24,8 @@ public: creators["razorscale grounded"] = &RaidUlduarTriggerContext::razorscale_grounded; creators["razorscale harpoon trigger"] = &RaidUlduarTriggerContext::razorscale_harpoon_trigger; creators["razorscale fuse armor trigger"] = &RaidUlduarTriggerContext::razorscale_fuse_armor_trigger; + creators["hodir biting cold"] = &RaidUlduarTriggerContext::hodir_biting_cold; + creators["hodir near snowpacked icicle"] = &RaidUlduarTriggerContext::hodir_near_snowpacked_icicle; } private: @@ -36,6 +38,8 @@ private: static Trigger* razorscale_grounded(PlayerbotAI* ai) { return new RazorscaleGroundedTrigger(ai); } static Trigger* razorscale_harpoon_trigger(PlayerbotAI* ai) { return new RazorscaleHarpoonAvailableTrigger(ai); } static Trigger* razorscale_fuse_armor_trigger(PlayerbotAI* ai) { return new RazorscaleFuseArmorTrigger(ai); } + static Trigger* hodir_biting_cold(PlayerbotAI* ai) { return new HodirBitingColdTrigger(ai); } + static Trigger* hodir_near_snowpacked_icicle(PlayerbotAI* ai) { return new HodirNearSnowpackedIcicleTrigger(ai); } }; #endif diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp b/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp index d2da0940..49e24fc4 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp @@ -241,3 +241,25 @@ bool RazorscaleFuseArmorTrigger::IsActive() return false; } + +bool HodirBitingColdTrigger::IsActive() +{ + Unit* boss = AI_VALUE2(Unit*, "find target", "hodir"); + return boss && botAI->GetAura("biting cold", bot, false, false); +} + +//Snowpacked Icicle Target +bool HodirNearSnowpackedIcicleTrigger::IsActive() +{ + // Check boss and it is alive + Unit* boss = AI_VALUE2(Unit*, "find target", "hodir"); + if (!boss || !boss->IsAlive()) + { + return false; + } + + // Find the nearest Snowpacked Icicle Target + Creature* target = bot->FindNearestCreature(33174, 100.0f); + if (!target) + return false; +} diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggers.h b/src/strategy/raids/ulduar/RaidUlduarTriggers.h index 2dc1e7a6..a03dfbb4 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggers.h +++ b/src/strategy/raids/ulduar/RaidUlduarTriggers.h @@ -76,4 +76,18 @@ public: bool IsActive() override; }; +class HodirBitingColdTrigger : public Trigger +{ +public: + HodirBitingColdTrigger(PlayerbotAI* ai) : Trigger(ai, "hodir biting cold") {} + bool IsActive() override; +}; + +class HodirNearSnowpackedIcicleTrigger : public Trigger +{ +public: + HodirNearSnowpackedIcicleTrigger(PlayerbotAI* ai) : Trigger(ai, "hodir near snowpacked icicle") {} + bool IsActive() override; +}; + #endif