2024-11-6 correct problems

This commit is contained in:
姜耀
2024-11-06 23:05:32 +08:00
parent cb281c7ebd
commit 7af720f127
5 changed files with 23 additions and 75 deletions

View File

@@ -65,6 +65,9 @@ bool BronjahmGroupPositionAction::Execute(Event event)
else
{
float maxMovement = 10.0f;
if (bot->GetExactDist2d(boss) > maxMovement)
{
if (bot->getClass() == CLASS_HUNTER)
{
return Move(bot->GetAngle(boss), fmin(bot->GetExactDist2d(boss) - 6.5f, maxMovement));
@@ -74,44 +77,11 @@ bool BronjahmGroupPositionAction::Execute(Event event)
return Move(bot->GetAngle(boss), fmin(bot->GetExactDist2d(boss) - 2.0f, maxMovement));
}
}
else
return false;
}
}
bool BronjahmGroupPositionAction::isUseful() { return true; }
bool BronjahmTankTargetAction::Execute(Event event)
{
if (botAI->IsTank(bot))
{
Unit* boss = AI_VALUE2(Unit*, "find target", "bronjahm");
if (boss && AI_VALUE(Unit*, "current target") != boss)
return Attack(boss);
else
return false;
}
else
return false;
}
bool BronjahmDpsPositionAction::Execute(Event event)
{
Unit* boss = AI_VALUE2(Unit*, "find target", "bronjahm");
if (!boss)
return false;
if (bot->getClass() == CLASS_HUNTER)
{
return Move(bot->GetAngle(boss), 8.0f);
}
else
{
return Move(bot->GetAngle(boss), 5.0f);
}
}
bool BronjahmDpsPositionAction::isUseful()
{
if (bot->GetExactDist2d(BRONJAHM_TANK_POSITION) <= 10.0f)
return false;
return botAI->IsDps(bot) || botAI->IsHeal(bot);
}

View File

@@ -7,7 +7,7 @@
#include "Playerbots.h"
#include "ForgeOfSoulsTriggers.h"
const Position BRONJAHM_TANK_POSITION = Position(5297.9204f, 2506.698f, 686.06793f);
const Position BRONJAHM_TANK_POSITION = Position(5297.920f, 2506.698f, 686.068f);
class MoveFromBronjahmAction : public MovementAction
{
@@ -33,21 +33,5 @@ public:
bool isUseful() override;
};
class BronjahmDpsPositionAction : public MovementAction
{
public:
BronjahmDpsPositionAction(PlayerbotAI* ai) : MovementAction(ai, "bronjahm dps position") {}
bool Execute(Event event) override;
bool isUseful() override;
};
class BronjahmTankTargetAction : public AttackAction
{
public:
BronjahmTankTargetAction(PlayerbotAI* ai) : AttackAction(ai, "bronjahm tank target") {}
bool Execute(Event event) override;
};
#endif

View File

@@ -8,15 +8,14 @@
float BronjahmMultiplier::GetValue(Action* action) {
Unit* boss = nullptr;
boss = AI_VALUE2(Unit *, "find target", "bronjahm");
Unit* boss = AI_VALUE2(Unit *, "find target", "bronjahm");
if (!boss)
return 1.0f;
if (botAI->IsTank(bot))
if (dynamic_cast<TankAssistAction*>(action))
return 0.0f;
if (boss && boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_CORRUPT_SOUL) &&
if (boss->FindCurrentSpellBySpellId(SPELL_CORRUPT_SOUL) &&
bot->HasAura(SPELL_CORRUPT_SOUL))
{
if (dynamic_cast<MovementAction*>(action) && !dynamic_cast<MoveFromBronjahmAction*>(action))

View File

@@ -6,11 +6,10 @@
bool MoveFromBronjahmTrigger::IsActive()
{
Unit* boss = AI_VALUE2(Unit*, "find target", "bronjahm");
if (boss && boss->HasUnitState(UNIT_STATE_CASTING))
{
if (boss->FindCurrentSpellBySpellId(SPELL_CORRUPT_SOUL) && bot->HasAura(SPELL_CORRUPT_SOUL))
return true;
}
return false;
}
@@ -36,9 +35,5 @@ bool SwitchToSoulFragment::IsActive()
bool BronjahmPositionTrigger::IsActive()
{
Unit* boss = AI_VALUE2(Unit*, "find target", "bronjahm");
if (boss)
return true;
return false;
return bool(AI_VALUE2(Unit*, "find target", "bronjahm"));
}

View File

@@ -6,7 +6,7 @@
#include "GenericTriggers.h"
#include "DungeonStrategyUtils.h"
enum FosIDs
enum ForgeOfSoulsBronjahmIDs
{
// Boss1
NPC_CORRUPTED_SOUL_FRAGMENT = 36535,