mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-26 15:06:22 +00:00
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:
@@ -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) &&
|
||||
|
||||
Reference in New Issue
Block a user