Skip to content

Commit

Permalink
wip1
Browse files Browse the repository at this point in the history
  • Loading branch information
Redbu11 authored and Redbu11 committed Sep 16, 2024
1 parent 8afc730 commit 7ab3d2b
Show file tree
Hide file tree
Showing 4 changed files with 897 additions and 466 deletions.
6 changes: 3 additions & 3 deletions playerbot/TravelMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2908,9 +2908,9 @@ std::vector<QuestTravelDestination*> TravelMgr::GetAllAvailableQuestTravelDestin
uint32 maxDistance
)
{
std::ostringstream out;
out << "---------bot: " << bot->GetName() << " Attempting to GetAllQuestTravelDestinations";
sLog.outBasic(out.str().c_str());
//std::ostringstream out;
//out << "---------bot: " << bot->GetName() << " Attempting to GetAllQuestTravelDestinations";
//sLog.outBasic(out.str().c_str());


auto ai = bot->GetPlayerbotAI();
Expand Down
15 changes: 11 additions & 4 deletions playerbot/strategy/actions/AttackAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,29 @@ bool AttackAction::Attack(Player* requester, Unit* target)
}
}

if (IsMovingAllowed() && !sServerFacade.IsInFront(bot, target, sPlayerbotAIConfig.sightDistance, CAST_ANGLE_IN_FRONT))
/*if (IsMovingAllowed() && !sServerFacade.IsInFront(bot, target, sPlayerbotAIConfig.sightDistance, CAST_ANGLE_IN_FRONT))
{
sServerFacade.SetFacingTo(bot, target);
}*/

if (target && target->IsAlive() && bot->IsInWorld() && !bot->IsBeingTeleported() && IsMovingAllowed())
{
sServerFacade.SetFacingTo(bot, target);
}

bool result = true;
bool result = false;

// Don't attack target if it is waiting for attack or in stealth
if (!ai->HasStrategy("stealthed", BotState::BOT_STATE_COMBAT) && !isWaitingForAttack)
{
ai->PlayAttackEmote(1);
result = bot->Attack(target, !ai->IsRanged(bot) || (sServerFacade.GetDistance2d(bot, target) < 5.0f));
bool isMeleeAttack = !ai->IsRanged(bot) || (sServerFacade.GetDistance2d(bot, target) < 5.0f);

result = bot->Attack(target, isMeleeAttack);
}

if (result)
{
ai->PlayAttackEmote(1);
// Force change combat state to have a faster reaction time
ai->OnCombatStarted();
}
Expand Down
Loading

0 comments on commit 7ab3d2b

Please sign in to comment.