fix(Core/AI): Improve creature leashing behavior. (#19751)

* Init.

https: //github.com/vmangos/core/commit/7d2f1e2923734ea1b983eeaa0208cfd158d4af02
Co-Authored-By: ratkosrb <35845488+ratkosrb@users.noreply.github.com>

* Hackfix for pets.

* Whoops.

* Correct evade uses.

* Conflict.

* Actually fix grace timer.

* Add visibility distance check.

Creatures should always fail combat checks in the open world if they're outside of visibility distance, might not be the case for worldbosses.

---------

Co-authored-by: ratkosrb <35845488+ratkosrb@users.noreply.github.com>
This commit is contained in:
Benjamin Jackson
2024-09-03 15:08:56 -04:00
committed by GitHub
parent 1edac37ac3
commit bf18b9bdfb
8 changed files with 61 additions and 42 deletions

View File

@@ -58,7 +58,7 @@ struct npc_pet_hunter_snake_trap : public ScriptedAI
me->LoadCreaturesAddon(true);
me->SetLootRecipient(nullptr);
me->ResetPlayerDamageReq();
me->SetLastDamagedTime(0);
me->ClearLastLeashExtensionTimePtr();
me->AddUnitState(UNIT_STATE_EVADE);
me->GetMotionMaster()->MoveTargetedHome();