Fix combat movement (#18026)

* Improve combat movement

 - Removed a bunch of logic related to another attempt at fixing combat movement.
- Removed SMART_ACTION_SET_CASTER_COMBAT_DIST and updated smarts scripts accordingly.
- Cherry-picked 7fb7432620
- Cherry-picked 63a6e1e048

Co-Authored-By: Ludovic Barbier <ludovic.barbier03@gmail.com>
Co-Authored-By: Giacomo Pozzoni <giacomopoz@gmail.com>

* Some more cleanup + fix sql

* More fixes to caster chase/combat movement + some cherry picks because why not

- Fix casters always trying to chase to melee range
- Fix casters another case of casters sometimes walking back instead of stopping
- Cleaned up some code
- Cherry picked ca25e8d019
- Cherry picked 96b289cadb

Co-Authored-By: Giacomo Pozzoni <giacomopoz@gmail.com>

* Added parentheses

* Fixed caster combat movement when target is rooted

- Made a few adjustments to chase range and stuff, but nothing set in stone.

* convert uint to int

---------

Co-authored-by: Ludovic Barbier <ludovic.barbier03@gmail.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
This commit is contained in:
AG
2024-01-03 09:56:24 +01:00
committed by GitHub
parent 623ee56509
commit 8f127f9e21
8 changed files with 224 additions and 142 deletions

View File

@@ -64,10 +64,11 @@ public:
bool IsEscorted() override { return (mEscortState & SMART_ESCORT_ESCORTING); }
void RemoveEscortState(uint32 uiEscortState) { mEscortState &= ~uiEscortState; }
void SetAutoAttack(bool on) { mCanAutoAttack = on; }
void SetCombatMove(bool on);
void SetCombatMove(bool on, float chaseRange = 0.0f);
bool CanCombatMove() { return mCanCombatMove; }
void SetFollow(Unit* target, float dist = 0.0f, float angle = 0.0f, uint32 credit = 0, uint32 end = 0, uint32 creditType = 0, bool aliveState = true);
void StopFollow(bool complete);
void MoveAway(float distance);
void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker);
SmartScript* GetScript() { return &mScript; }
@@ -205,7 +206,6 @@ public:
// Xinef
void SetWPPauseTimer(uint32 time) { mWPPauseTimer = time; }
void SetForcedCombatMove(float dist);
private:
bool mIsCharmed;