diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index 0bdfbd9a..d951929d 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -981,7 +981,7 @@ bool MovementAction::ChaseTo(WorldObject* obj, float distance, float angle) UpdateMovementState(); - if (bot->IsSitState()) + if (!bot->IsStandState()) bot->SetStandState(UNIT_STAND_STATE_STAND); if (bot->IsNonMeleeSpellCast(true)) @@ -1288,11 +1288,13 @@ bool SetBehindTargetAction::Execute(Event event) float angle = GetFollowAngle() / 3 + target->GetOrientation() + M_PI; + //return ChaseTo(target, 0.f, angle); + float distance = sPlayerbotAIConfig->contactDistance; float x = target->GetPositionX() + cos(angle) * distance; float y = target->GetPositionY() + sin(angle) * distance; float z = target->GetPositionZ(); - //bot->UpdateGroundPositionZ(x, y, z); + bot->UpdateGroundPositionZ(x, y, z); return MoveTo(bot->GetMapId(), x, y, z); } diff --git a/src/strategy/actions/MovementActions.h b/src/strategy/actions/MovementActions.h index b4aecc51..41e77769 100644 --- a/src/strategy/actions/MovementActions.h +++ b/src/strategy/actions/MovementActions.h @@ -84,10 +84,10 @@ class MoveOutOfEnemyContactAction : public MovementAction bool isUseful() override; }; -class SetFacingTargetAction : public MovementAction +class SetFacingTargetAction : public Action { public: - SetFacingTargetAction(PlayerbotAI* botAI) : MovementAction(botAI, "set facing") { } + SetFacingTargetAction(PlayerbotAI* botAI) : Action(botAI, "set facing") { } bool Execute(Event event) override; bool isUseful() override; diff --git a/src/strategy/generic/CombatStrategy.cpp b/src/strategy/generic/CombatStrategy.cpp index 7f2796a9..b0bb4aa3 100644 --- a/src/strategy/generic/CombatStrategy.cpp +++ b/src/strategy/generic/CombatStrategy.cpp @@ -7,8 +7,8 @@ void CombatStrategy::InitTriggers(std::vector &triggers) { - triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_NORMAL + 9), nullptr))); - triggers.push_back(new TriggerNode("invalid target", NextAction::array(0, new NextAction("drop target", 55), nullptr))); + triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_MOVE + 11), nullptr))); + triggers.push_back(new TriggerNode("invalid target", NextAction::array(0, new NextAction("drop target", 100), nullptr))); triggers.push_back(new TriggerNode("mounted", NextAction::array(0, new NextAction("check mount state", 54), nullptr))); triggers.push_back(new TriggerNode("out of react range", NextAction::array(0, new NextAction("flee to master", 55), nullptr))); triggers.push_back(new TriggerNode("combat stuck", NextAction::array(0, new NextAction("reset", 1.0f), nullptr))); diff --git a/src/strategy/generic/MeleeCombatStrategy.cpp b/src/strategy/generic/MeleeCombatStrategy.cpp index e9e3a15d..d59b2990 100644 --- a/src/strategy/generic/MeleeCombatStrategy.cpp +++ b/src/strategy/generic/MeleeCombatStrategy.cpp @@ -18,5 +18,5 @@ void SetBehindCombatStrategy::InitTriggers(std::vector &triggers) { CombatStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("not behind target", NextAction::array(0, new NextAction("set behind", ACTION_NORMAL + 9), nullptr))); + triggers.push_back(new TriggerNode("not behind target", NextAction::array(0, new NextAction("set behind", ACTION_MOVE + 7), nullptr))); } diff --git a/src/strategy/generic/RangedCombatStrategy.cpp b/src/strategy/generic/RangedCombatStrategy.cpp index e2243495..271dbc3c 100644 --- a/src/strategy/generic/RangedCombatStrategy.cpp +++ b/src/strategy/generic/RangedCombatStrategy.cpp @@ -9,5 +9,6 @@ void RangedCombatStrategy::InitTriggers(std::vector &triggers) { CombatStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", ACTION_HIGH), nullptr))); + triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", ACTION_HIGH), nullptr))); + triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", ACTION_MOVE + 7), nullptr))); }