From e104c5f8be76992f7a831cf1d5c06a1a14fa24ec Mon Sep 17 00:00:00 2001 From: kadeshar Date: Wed, 7 May 2025 21:55:56 +0200 Subject: [PATCH] - Added Kologarn Focused Eyebeam cheat (#1274) - Added Kologarn Crunch Armor cheat - Added Kologarn proper targeting and setting rti target --- .../raids/ulduar/RaidUlduarActionContext.h | 6 + .../raids/ulduar/RaidUlduarActions.cpp | 109 +++++++++++++++++- src/strategy/raids/ulduar/RaidUlduarActions.h | 24 ++++ .../raids/ulduar/RaidUlduarStrategy.cpp | 16 +++ .../raids/ulduar/RaidUlduarTriggerContext.h | 8 ++ .../raids/ulduar/RaidUlduarTriggers.cpp | 100 ++++++++++++++-- .../raids/ulduar/RaidUlduarTriggers.h | 33 ++++++ 7 files changed, 283 insertions(+), 13 deletions(-) diff --git a/src/strategy/raids/ulduar/RaidUlduarActionContext.h b/src/strategy/raids/ulduar/RaidUlduarActionContext.h index 11a6f0c1..cdfd6af5 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActionContext.h +++ b/src/strategy/raids/ulduar/RaidUlduarActionContext.h @@ -33,6 +33,9 @@ public: 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["kologarn eyebeam action"] = &RaidUlduarActionContext::kologarn_eyebeam_action; + creators["kologarn rti target action"] = &RaidUlduarActionContext::kologarn_rti_target_action; + creators["kologarn crunch armor action"] = &RaidUlduarActionContext::kologarn_crunch_armor_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; @@ -63,6 +66,9 @@ private: static Action* kologarn_fall_from_floor_action(PlayerbotAI* ai) { return new KologarnFallFromFloorAction(ai); } static Action* kologarn_nature_resistance_action(PlayerbotAI* ai) { return new BossNatureResistanceAction(ai, "kologarn"); } static Action* kologarn_rubble_slowdown_action(PlayerbotAI* ai) { return new KologarnRubbleSlowdownAction(ai); } + static Action* kologarn_eyebeam_action(PlayerbotAI* ai) { return new KologarnEyebeamAction(ai); } + static Action* kologarn_rti_target_action(PlayerbotAI* ai) { return new KologarnRtiTargetAction(ai); } + static Action* kologarn_crunch_armor_action(PlayerbotAI* ai) { return new KologarnCrunchArmorAction(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 BossFrostResistanceAction(ai, "hodir"); } diff --git a/src/strategy/raids/ulduar/RaidUlduarActions.cpp b/src/strategy/raids/ulduar/RaidUlduarActions.cpp index 4221238e..42cb0e43 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActions.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarActions.cpp @@ -32,8 +32,9 @@ const std::vector availableVehicles = {NPC_VEHICLE_CHOPPER, NPC_SALVAGED const std::vector corners = { {183.53f, 66.53f, 409.80f}, {383.03f, 75.10f, 411.71f}, {379.74f, -133.05f, 410.88f}, {158.67f, -137.54f, 409.80f}}; -const Position ULDUAR_KOLOGARN_CRUNCH_ARMOR_RESET_SPOT = Position(1752.4803f, -43.44299f, 448.805f); -const Position ULDUAR_KOLOGARN_RESTORE_POSITION = Position(1764.3749f, -24.02903f, 448.0f, 0.00087690353); +const Position ULDUAR_KOLOGARN_RESTORE_POSITION = Position(1764.3749f, -24.02903f, 448.0f, 0.00087690353f); +const Position ULDUAR_KOLOGARN_EYEBEAM_LEFT_POSITION = Position(1781.2051f, 9.34402f, 449.0f, 0.00087690353f); +const Position ULDUAR_KOLOGARN_EYEBEAM_RIGHT_POSITION = Position(1763.2561f, -24.44305f, 449.0f, 0.00087690353f); bool FlameLeviathanVehicleAction::Execute(Event event) { @@ -1223,10 +1224,16 @@ bool KologarnMarkDpsTargetAction::isUseful() bool KologarnMarkDpsTargetAction::Execute(Event event) { Unit* targetToMark = nullptr; + Unit* additionalTargetToMark = nullptr; Unit* targetToCcMark = nullptr; int8 skullIndex = 7; // Skull + int8 crossIndex = 6; // Cross int8 moonIndex = 4; // Moon + Unit* boss = AI_VALUE2(Unit*, "find target", "kologarn"); + if (!boss || !boss->IsAlive()) + return false; + // Check that there is rubble to mark GuidVector targets = AI_VALUE(GuidVector, "possible targets"); Unit* target = nullptr; @@ -1240,6 +1247,7 @@ bool KologarnMarkDpsTargetAction::Execute(Event event) if (target->GetEntry() == NPC_RUBBLE && target->IsAlive()) { targetToMark = target; + additionalTargetToMark = boss; } } @@ -1249,6 +1257,7 @@ bool KologarnMarkDpsTargetAction::Execute(Event event) if (rightArm && rightArm->IsAlive()) { targetToMark = rightArm; + additionalTargetToMark = boss; } } @@ -1291,7 +1300,11 @@ bool KologarnMarkDpsTargetAction::Execute(Event event) { group->SetTargetIcon(moonIndex, bot->GetGUID(), targetToCcMark->GetGUID()); } - + if (additionalTargetToMark) + { + group->SetTargetIcon(crossIndex, bot->GetGUID(), additionalTargetToMark->GetGUID()); + } + return true; } break; // Stop after finding the first valid bot tank @@ -1308,6 +1321,10 @@ bool KologarnMarkDpsTargetAction::Execute(Event event) { group->SetTargetIcon(moonIndex, bot->GetGUID(), targetToCcMark->GetGUID()); } + if (additionalTargetToMark) + { + group->SetTargetIcon(crossIndex, bot->GetGUID(), additionalTargetToMark->GetGUID()); + } return true; } } @@ -1325,6 +1342,10 @@ bool KologarnMarkDpsTargetAction::Execute(Event event) { group->SetTargetIcon(moonIndex, bot->GetGUID(), targetToCcMark->GetGUID()); } + if (additionalTargetToMark) + { + group->SetTargetIcon(crossIndex, bot->GetGUID(), additionalTargetToMark->GetGUID()); + } return true; } break; // Stop after finding the first valid bot tank @@ -1364,6 +1385,84 @@ bool KologarnRubbleSlowdownAction::Execute(Event event) return botAI->CastSpell("frost trap", currentSkullUnit); } +bool KologarnEyebeamAction::Execute(Event event) +{ + float distanceToLeftPoint = bot->GetExactDist(ULDUAR_KOLOGARN_EYEBEAM_LEFT_POSITION); + float distanceToRightPoint = bot->GetExactDist(ULDUAR_KOLOGARN_EYEBEAM_RIGHT_POSITION); + + bool runToLeftSide; + if (!distanceToLeftPoint) + { + runToLeftSide = true; + } + else if (!distanceToRightPoint) + { + runToLeftSide = false; + } + else + { + runToLeftSide = distanceToRightPoint > distanceToLeftPoint; + } + + bool teleportedToPoint; + KologarnEyebeamTrigger kologarnEyebeamTrigger(botAI); + if (runToLeftSide) + { + teleportedToPoint = bot->TeleportTo(bot->GetMapId(), ULDUAR_KOLOGARN_EYEBEAM_LEFT_POSITION.GetPositionX(), + ULDUAR_KOLOGARN_EYEBEAM_LEFT_POSITION.GetPositionY(), + ULDUAR_KOLOGARN_EYEBEAM_LEFT_POSITION.GetPositionZ(), + ULDUAR_KOLOGARN_EYEBEAM_LEFT_POSITION.GetOrientation()); + } + else + { + teleportedToPoint = bot->TeleportTo(bot->GetMapId(), ULDUAR_KOLOGARN_EYEBEAM_RIGHT_POSITION.GetPositionX(), + ULDUAR_KOLOGARN_EYEBEAM_RIGHT_POSITION.GetPositionY(), + ULDUAR_KOLOGARN_EYEBEAM_RIGHT_POSITION.GetPositionZ(), + ULDUAR_KOLOGARN_EYEBEAM_RIGHT_POSITION.GetOrientation()); + } + + if (teleportedToPoint) + SetNextMovementDelay(5000); + + return teleportedToPoint; +} + +bool KologarnEyebeamAction::isUseful() +{ + KologarnEyebeamTrigger kologarnEyebeamTrigger(botAI); + return kologarnEyebeamTrigger.IsActive(); +} + +bool KologarnRtiTargetAction::isUseful() +{ + KologarnRtiTargetTrigger kologarnRtiTargetTrigger(botAI); + return kologarnRtiTargetTrigger.IsActive(); +} + +bool KologarnRtiTargetAction::Execute(Event event) +{ + if (botAI->IsMainTank(bot) || botAI->IsAssistTankOfIndex(bot, 0)) + { + context->GetValue("rti")->Set("cross"); + return true; + } + + context->GetValue("rti")->Set("skull"); + return true; +} + +bool KologarnCrunchArmorAction::isUseful() +{ + KologarnCrunchArmorTrigger kologarnCrunchArmorTrigger(botAI); + return kologarnCrunchArmorTrigger.IsActive(); +} + +bool KologarnCrunchArmorAction::Execute(Event event) +{ + bot->RemoveAura(SPELL_CRUNCH_ARMOR); + return true; +} + bool HodirMoveSnowpackedIcicleAction::isUseful() { // Check boss and it is alive @@ -1587,7 +1686,7 @@ bool FreyaMarkDpsTargetAction::Execute(Event event) if (group) { ObjectGuid currentSkullTarget = group->GetTargetIcon(skullIndex); - + if (!currentSkullTarget || (targetToMark->GetGUID() != currentSkullTarget)) { group->SetTargetIcon(skullIndex, bot->GetGUID(), targetToMark->GetGUID()); @@ -1605,7 +1704,7 @@ bool FreyaMarkDpsTargetAction::Execute(Event event) if (group) { ObjectGuid currentSkullTarget = group->GetTargetIcon(skullIndex); - + if (!currentSkullTarget || (targetToMark->GetGUID() != currentSkullTarget)) { group->SetTargetIcon(skullIndex, bot->GetGUID(), targetToMark->GetGUID()); diff --git a/src/strategy/raids/ulduar/RaidUlduarActions.h b/src/strategy/raids/ulduar/RaidUlduarActions.h index 5889b07f..16c4e213 100644 --- a/src/strategy/raids/ulduar/RaidUlduarActions.h +++ b/src/strategy/raids/ulduar/RaidUlduarActions.h @@ -153,6 +153,30 @@ public: bool Execute(Event event) override; }; +class KologarnEyebeamAction : public MovementAction +{ +public: + KologarnEyebeamAction(PlayerbotAI* botAI) : MovementAction(botAI, "kologarn eyebeam action") {} + bool Execute(Event event) override; + bool isUseful() override; +}; + +class KologarnRtiTargetAction : public Action +{ +public: + KologarnRtiTargetAction(PlayerbotAI* botAI) : Action(botAI, "kologarn rti target action") {} + bool Execute(Event event) override; + bool isUseful() override; +}; + +class KologarnCrunchArmorAction : public Action +{ +public: + KologarnCrunchArmorAction(PlayerbotAI* botAI) : Action(botAI, "kologarn crunch armor action") {} + bool Execute(Event event) override; + bool isUseful() override; +}; + class HodirBitingColdJumpAction : public MovementAction { public: diff --git a/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp b/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp index 4701b49f..e14d0687 100644 --- a/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp @@ -75,6 +75,18 @@ void RaidUlduarStrategy::InitTriggers(std::vector& triggers) "kologarn fall from floor trigger", NextAction::array(0, new NextAction("kologarn fall from floor action", ACTION_RAID + 1), nullptr))); + triggers.push_back(new TriggerNode( + "kologarn rti target trigger", + NextAction::array(0, new NextAction("kologarn rti target action", ACTION_RAID + 1), nullptr))); + + triggers.push_back(new TriggerNode( + "kologarn eyebeam trigger", + NextAction::array(0, new NextAction("kologarn eyebeam action", ACTION_RAID + 1), nullptr))); + + triggers.push_back(new TriggerNode( + "kologarn attack dps target trigger", + NextAction::array(0, new NextAction("attack rti target", ACTION_RAID), nullptr))); + triggers.push_back(new TriggerNode( "kologarn mark dps target trigger", NextAction::array(0, new NextAction("kologarn mark dps target action", ACTION_RAID), nullptr))); @@ -87,6 +99,10 @@ void RaidUlduarStrategy::InitTriggers(std::vector& triggers) "kologarn rubble slowdown trigger", NextAction::array(0, new NextAction("kologarn rubble slowdown action", ACTION_RAID), nullptr))); + triggers.push_back(new TriggerNode( + "kologarn crunch armor trigger", + NextAction::array(0, new NextAction("kologarn crunch armor action", ACTION_RAID), nullptr))); + // // Hodir // diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h b/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h index 8889b09d..a676ac0e 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h +++ b/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h @@ -33,6 +33,10 @@ public: 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["kologarn eyebeam trigger"] = &RaidUlduarTriggerContext::kologarn_eyebeam_trigger; + creators["kologarn rti target trigger"] = &RaidUlduarTriggerContext::kologarn_rti_target_trigger; + creators["kologarn crunch armor trigger"] = &RaidUlduarTriggerContext::kologarn_crunch_armor_trigger; + creators["kologarn attack dps target trigger"] = &RaidUlduarTriggerContext::kologarn_attack_dps_target_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; @@ -63,6 +67,10 @@ private: static Trigger* kologarn_fall_from_floor_trigger(PlayerbotAI* ai) { return new KologarnFallFromFloorTrigger(ai); } static Trigger* kologarn_nature_resistance_trigger(PlayerbotAI* ai) { return new BossNatureResistanceTrigger(ai, "kologarn"); } static Trigger* kologarn_rubble_slowdown_trigger(PlayerbotAI* ai) { return new KologarnRubbleSlowdownTrigger(ai); } + static Trigger* kologarn_eyebeam_trigger(PlayerbotAI* ai) { return new KologarnEyebeamTrigger(ai); } + static Trigger* kologarn_rti_target_trigger(PlayerbotAI* ai) { return new KologarnRtiTargetTrigger(ai); } + static Trigger* kologarn_crunch_armor_trigger(PlayerbotAI* ai) { return new KologarnCrunchArmorTrigger(ai); } + static Trigger* kologarn_attack_dps_target_trigger(PlayerbotAI* ai) { return new KologarnAttackDpsTargetTrigger(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 BossFrostResistanceTrigger(ai, "hodir"); } diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp b/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp index 97d2fb06..7f3cd0fb 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp +++ b/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp @@ -384,6 +384,94 @@ bool KologarnRubbleSlowdownTrigger::IsActive() return true; } +bool KologarnEyebeamTrigger::IsActive() +{ + Unit* boss = AI_VALUE2(Unit*, "find target", "kologarn"); + + // Check boss and it is alive + if (!boss || !boss->IsAlive()) + return false; + + GuidVector triggers = AI_VALUE(GuidVector, "possible triggers"); + + if (!triggers.empty()) + { + for (ObjectGuid const guid : triggers) + { + if (Unit* unit = botAI->GetUnit(guid)) + { + std::string triggerName = unit->GetNameForLocaleIdx(sWorld->GetDefaultDbcLocale()); + + if (triggerName.rfind("Focused Eyebeam", 0) == 0 && + bot->GetDistance2d(unit) < ULDUAR_KOLOGARN_EYEBEAM_RADIUS + 1.0f) + { + return true; + } + } + } + } + + return false; +} + +bool KologarnAttackDpsTargetTrigger::IsActive() +{ + Unit* boss = AI_VALUE2(Unit*, "find target", "kologarn"); + + // Check boss and it is alive + if (!boss || !boss->IsAlive()) + return false; + + // Get bot's current target + Unit* currentTarget = botAI->GetUnit(bot->GetTarget()); + if (!currentTarget || !currentTarget->IsAlive()) + return false; + + // Get the current raid marker from the group + Group* group = bot->GetGroup(); + if (!group) + return false; + + ObjectGuid skullTarget = group->GetTargetIcon(skullIndex); + ObjectGuid crossTarget = group->GetTargetIcon(crossIndex); + + if (crossTarget && (botAI->IsMainTank(bot) || botAI->IsAssistTankOfIndex(bot, 0))) + { + return currentTarget->GetGUID() != crossTarget; + } + else + { + return currentTarget->GetGUID() != skullTarget; + } +} + +bool KologarnRtiTargetTrigger::IsActive() +{ + Unit* boss = AI_VALUE2(Unit*, "find target", "kologarn"); + + // Check boss and it is alive + if (!boss || !boss->IsAlive()) + return false; + + std::string rtiMark = AI_VALUE(std::string, "rti"); + + if (botAI->IsMainTank(bot) || botAI->IsAssistTankOfIndex(bot, 0)) + return rtiMark != "cross"; + + return rtiMark != "skull"; +} + +bool KologarnCrunchArmorTrigger::IsActive() +{ + Unit* boss = AI_VALUE2(Unit*, "find target", "kologarn"); + + // Check boss and it is alive + if (!boss || !boss->IsAlive()) + return false; + + return bot->HasAura(SPELL_CRUNCH_ARMOR); +} + bool HodirBitingColdTrigger::IsActive() { Unit* boss = AI_VALUE2(Unit*, "find target", "hodir"); @@ -514,15 +602,13 @@ bool FreyaMarkDpsTargetTrigger::IsActive() } // Check that eonars gift is need to be mark - if (eonarsGift && - (!currentSkullUnit || currentSkullUnit->GetEntry() != eonarsGift->GetEntry())) + if (eonarsGift && (!currentSkullUnit || currentSkullUnit->GetEntry() != eonarsGift->GetEntry())) { return true; } // Check that ancient conservator is need to be mark - if (ancientConservator && - (!currentSkullUnit || currentSkullUnit->GetEntry() != ancientConservator->GetEntry())) + if (ancientConservator && (!currentSkullUnit || currentSkullUnit->GetEntry() != ancientConservator->GetEntry())) { return true; } @@ -549,8 +635,7 @@ bool FreyaMarkDpsTargetTrigger::IsActive() } // If the highest health unit is not already marked, mark it - if (highestHealthUnit && - (!currentSkullUnit || currentSkullUnit->GetEntry() != highestHealthUnit->GetEntry())) + if (highestHealthUnit && (!currentSkullUnit || currentSkullUnit->GetEntry() != highestHealthUnit->GetEntry())) { return true; } @@ -564,7 +649,7 @@ bool FreyaMarkDpsTargetTrigger::IsActive() if (!map || !map->IsRaid()) return false; - uint32 healthThreshold = map->Is25ManRaid() ? 7200 : 4900; // Detonate maximum damage + uint32 healthThreshold = map->Is25ManRaid() ? 7200 : 4900; // Detonate maximum damage // Check that detonate lasher dont kill raid members for (GroupReference* gref = group->GetFirstMember(); gref; gref = gref->next()) @@ -597,7 +682,6 @@ bool FreyaMoveToHealingSporeTrigger::IsActive() if (!conservatory || !conservatory->IsAlive()) return false; - GuidVector targets = AI_VALUE(GuidVector, "nearest npcs"); float nearestDistance = std::numeric_limits::max(); bool foundSpore = false; diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggers.h b/src/strategy/raids/ulduar/RaidUlduarTriggers.h index edb41145..a426ed59 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggers.h +++ b/src/strategy/raids/ulduar/RaidUlduarTriggers.h @@ -47,7 +47,12 @@ enum UlduarIDs SPELL_FROST_TRAP = 13809 }; +const int8 skullIndex = 7; // Skull +const int8 crossIndex = 6; // Cross +const int8 moonIndex = 4; // Moon + const float ULDUAR_KOLOGARN_AXIS_Z_PATHING_ISSUE_DETECT = 420.0f; +const float ULDUAR_KOLOGARN_EYEBEAM_RADIUS = 3.0f; // // Flame Levi @@ -159,6 +164,34 @@ public: bool IsActive() override; }; +class KologarnEyebeamTrigger : public Trigger +{ +public: + KologarnEyebeamTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn eyebeam trigger") {} + bool IsActive() override; +}; + +class KologarnAttackDpsTargetTrigger : public Trigger +{ +public: + KologarnAttackDpsTargetTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn attack dps target trigger") {} + bool IsActive() override; +}; + +class KologarnRtiTargetTrigger : public Trigger +{ +public: + KologarnRtiTargetTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn rti target trigger") {} + bool IsActive() override; +}; + +class KologarnCrunchArmorTrigger : public Trigger +{ +public: + KologarnCrunchArmorTrigger(PlayerbotAI* ai) : Trigger(ai, "kologarn crunch armor trigger") {} + bool IsActive() override; +}; + // // Hodir //