From cb281c7ebdf9e094ea42ba3243408c8b55b53dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E8=80=80?= Date: Wed, 6 Nov 2024 20:02:05 +0800 Subject: [PATCH] 2024-11-6 correct problems of forge of souls bronjahm strategy 2024-11-6 --- .../forgeofsouls/ForgeOfSoulsActions.cpp | 35 +++++++++++++------ .../wotlk/forgeofsouls/ForgeOfSoulsActions.h | 4 +-- .../forgeofsouls/ForgeOfSoulsMultipliers.cpp | 10 ++---- .../forgeofsouls/ForgeOfSoulsStrategy.cpp | 2 +- .../forgeofsouls/ForgeOfSoulsTriggers.cpp | 2 +- 5 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.cpp b/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.cpp index 31b477ff..e0e8425f 100644 --- a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.cpp +++ b/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.cpp @@ -43,25 +43,40 @@ bool AttackCorruptedSoulFragmentAction::Execute(Event event) bool BronjahmGroupPositionAction::Execute(Event event) { + Unit* boss = AI_VALUE2(Unit*, "find target", "bronjahm"); + if (!boss) + return false; + if (botAI->IsTank(bot)) - if (bot->GetExactDist2d(BRONJAHM_TANK_POSITION) > 5.0f) - return MoveTo(bot->GetMapId(), BRONJAHM_TANK_POSITION.GetPositionX(), BRONJAHM_TANK_POSITION.GetPositionY(), - BRONJAHM_TANK_POSITION.GetPositionZ(), false, false, false, true, - MovementPriority::MOVEMENT_COMBAT); + { + bot->SetTarget(boss->GetGUID()); + if (AI_VALUE2(bool, "has aggro", "current target")) + if (bot->GetExactDist2d(BRONJAHM_TANK_POSITION) > 5.0f) + return MoveTo(bot->GetMapId(), BRONJAHM_TANK_POSITION.GetPositionX(), + BRONJAHM_TANK_POSITION.GetPositionY(), BRONJAHM_TANK_POSITION.GetPositionZ(), false, + false, false, true, MovementPriority::MOVEMENT_NORMAL); + else + return Attack(boss); else - return false; + { + return Attack(boss); + } + } else { - Unit* boss = AI_VALUE2(Unit*, "find target", "bronjahm"); - - if (boss) + float maxMovement = 10.0f; + if (bot->getClass() == CLASS_HUNTER) { - + return Move(bot->GetAngle(boss), fmin(bot->GetExactDist2d(boss) - 6.5f, maxMovement)); + } + else + { + return Move(bot->GetAngle(boss), fmin(bot->GetExactDist2d(boss) - 2.0f, maxMovement)); } } } -bool BronjahmGroupPositionAction::isUseful() { return bot->GetExactDist2d(BRONJAHM_TANK_POSITION) > 5.0f; } +bool BronjahmGroupPositionAction::isUseful() { return true; } bool BronjahmTankTargetAction::Execute(Event event) { diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.h b/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.h index 227a6fbe..f4a6521d 100644 --- a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.h +++ b/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.h @@ -23,10 +23,10 @@ public: bool Execute(Event event) override; }; -class BronjahmGroupPositionAction : public MovementAction +class BronjahmGroupPositionAction : public AttackAction { public: - BronjahmGroupPositionAction(PlayerbotAI* ai) : MovementAction(ai, "bronjahm group position") {} + BronjahmGroupPositionAction(PlayerbotAI* ai) : AttackAction(ai, "bronjahm group position") {} bool Execute(Event event) override; diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsMultipliers.cpp b/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsMultipliers.cpp index 4e41de27..6eed3c81 100644 --- a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsMultipliers.cpp +++ b/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsMultipliers.cpp @@ -16,7 +16,8 @@ float BronjahmMultiplier::GetValue(Action* action) { if (dynamic_cast(action)) return 0.0f; - if (boss && boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_CORRUPT_SOUL)) + if (boss && boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_CORRUPT_SOUL) && + bot->HasAura(SPELL_CORRUPT_SOUL)) { if (dynamic_cast(action) && !dynamic_cast(action)) { @@ -28,8 +29,6 @@ float BronjahmMultiplier::GetValue(Action* action) { float AttackFragmentMultiplier::GetValue(Action* action) { - if (botAI->IsHeal(bot) && dynamic_cast(action)) - return 0.0f; Unit* fragment = nullptr; @@ -45,10 +44,7 @@ float AttackFragmentMultiplier::GetValue(Action* action) } } - if (fragment && dynamic_cast(action)) - return 0.0f; - - if (fragment && dynamic_cast(action)) + if (fragment && botAI->IsDps(bot) && dynamic_cast(action)) return 0.0f; return 1.0f; diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsStrategy.cpp b/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsStrategy.cpp index 1cc522f8..68b89157 100644 --- a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsStrategy.cpp +++ b/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsStrategy.cpp @@ -8,7 +8,7 @@ void WotlkDungeonFoSStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode( "switch to soul fragment", NextAction::array(0, new NextAction("attack corrupted soul fragment", ACTION_RAID + 1), nullptr))); triggers.push_back(new TriggerNode("bronjahm position", - NextAction::array(0, new NextAction("bronjahm position", ACTION_RAID + 1), nullptr))); + NextAction::array(0, new NextAction("bronjahm group position", ACTION_RAID + 1), nullptr))); } void WotlkDungeonFoSStrategy::InitMultipliers(std::vector& multipliers) diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsTriggers.cpp b/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsTriggers.cpp index a5e4c169..b2bf096b 100644 --- a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsTriggers.cpp +++ b/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsTriggers.cpp @@ -1,5 +1,5 @@ -#include "ForgeOfSoulsTriggers.h" #include "Playerbots.h" +#include "ForgeOfSoulsTriggers.h" #include "AiObject.h" #include "AiObjectContext.h"