Fix stuck on knockback, enhance movement & flee and trap weave strats (#980)

* Hunter trap weave strats

* Do not allow actions to stack

* Remove trap weave by default

* Refactor on Engine

Co-authored-by: SaW <swerkhoven@outlook.com>

* Remove unused funcs in Queue

* Remove ExpireActionTime config

---------

Co-authored-by: SaW <swerkhoven@outlook.com>
This commit is contained in:
Yunfan Li
2025-02-18 22:55:44 +08:00
committed by GitHub
parent 6353c86b53
commit bb729e35b9
23 changed files with 173 additions and 81 deletions

View File

@@ -9,6 +9,7 @@
#include "PlayerbotAIConfig.h"
#include "Playerbots.h"
#include "ServerFacade.h"
#include "SharedDefines.h"
static float GetSpeedInMotion(Unit* target)
{
@@ -56,8 +57,19 @@ bool EnemyTooCloseForSpellTrigger::IsActive()
bool EnemyTooCloseForAutoShotTrigger::IsActive()
{
Unit* target = AI_VALUE(Unit*, "current target");
if (!target)
return false;
return target && (target->GetVictim() != bot || target->isFrozen() || !target->CanFreeMove()) &&
// hunter move away after casting immolation/explosive trap
bool trapToCast = bot->getClass() == CLASS_HUNTER;
uint32 spellId = AI_VALUE2(uint32, "spell id", "immolation trap");
if (!spellId)
trapToCast = false;
if (spellId && bot->HasSpellCooldown(spellId))
trapToCast = false;
return !trapToCast && (target->GetVictim() != bot || target->isFrozen() || !target->CanFreeMove()) &&
bot->IsWithinMeleeRange(target);
// if (target->GetTarget() == bot->GetGUID() && !bot->GetGroup() && !target->HasUnitState(UNIT_STATE_ROOT) &&