Monster Follow Pathing
I affirm:
- [x] I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
- [x] I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
- [x] I have read and understood the Contributing Guide and the Code of Conduct.
- [x] I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.
What does this pull request do?
This is old code I wrote for Eden about 5 years ago. It adds a simple method for monsters to follow some target.
mob:follow(target, xi.follow.ROAM)
This is useful for many monsters such as:
- Slave Globes for Mother Globe
- Hpemde monster family
- Lamia No.19 pets (almost any pet really)
- Apkallu (they runaway from the player)
Steps to test these changes
- Travel to Mother Globe with
!gotoid 17506396and observe pathing - You can kill the slaves out of order with
!hp 0and they will properly adjust which mob they are following - You can engage with Mother Globe and the slaves properly path the the character and after the character dies they resume their follow pathing
Additional steps taken from #3629
- Go to Al'taieu.
- Kill a baby Ul'xzomit and respawn it. Observe it automatically re-attaches.
- Kill a mother Ul'xzomit. Observe the baby Ul'xzomits start roaming by themselves.
- Kill a baby Ul'xzomit and respawn it. Observe it starts roaming by itself.
- Respawn the mother Ul'xzomit. Observe the babies start following it again.
- Fight a mother Ul'xzomit. Kill a baby Ul'xzomit and respawn it. Observe the baby only links when it gets close.
- Kill an Ul'xzomit and let it respawn normally. Observe its respawn time is now 5.5 minutes.
Turns out there is already some logic for following inside https://github.com/LandSandBoat/server/blob/base/scripts/globals/follow.lua
I think it might make the most sense to combine these two since there is some nice logic for handling multiple followers (like we need to with Mother Globe) but it is also missing some functionality such as the runaway. I'm not positive the existing logic works with mobs following players/npcs either but this new follow logic does.
I have made an additional commit to the initial two that reworks the original follow logic: https://github.com/LandSandBoat/server/pull/5967/commits/95886fbd6ddad0c8081d0d3690ba5847c1fda0b2