🐛 Pit ambush can leave mob in inconsistent state
I affirm:
- [x] I understand that if I do not agree to the following points by completing the checkboxes my issue will be ignored.
- [x] I have read and understood the Contributing Guide and the Code of Conduct.
- [x] I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.
OS / platform the server is running (if known)
Branch affected by issue
base
Steps to reproduce
Pit ambush can be out ranged, which leaves the mob in an inconsistent state due to the unhide and setAnimation calls being in the onMobWeaponSkill function
I do not know what the behavior on retail is, but there's a few ways to solve this on a technical level. I am 100% offering to fix it, but I didn't know a better venue than just submitting an issue to get discussion going about the way we'd want to solve it
I think a clean solution is a timer to engage after pit ambush completes in the mixin (i.e. the mixin that triggers the ambush mobskill would set a timer to engage only if getAnimation returns the expected value). That way if pit ambush fails then the mob just stays underground
I do not know what the behavior on retail is
Retail behavior is on detecting you their AI "engages" and the 1st thing they do is ambush+climb out. If the lose the player, they hide again to ambush the next poor sap to come along. This only happens with certain antlions. usually the ones with the dark color carapace or NM and not the rest.
Some relevant prior edits that tried to make these animate like retail:
- https://github.com/LandSandBoat/server/commit/57cf297d652686874f450f9c51debe9cb37e34bf
- https://github.com/LandSandBoat/server/commit/69b5a7d65f34ae33450444e2756681eff7c592c1
I think a clean solution is a timer to engage after pit ambush completes in the mixin (i.e. the mixin that triggers the ambush mobskill would set a timer to engage only if getAnimation returns the expected value).
They are already engaged by the time they unhide and fire the skill.
If the issue is they are melee swinging during the animations for either climbing out of the ground or the skill itself the likely solution involves their spawn and idle functions disabling melee and their scripts-enabling it after the ambush+climb out via setAutoAttackEnabled() but timer() is not likely to get a pass from me (it would help to see the issue in game first, but I'm betting its the same one previously tackled 3x in DSP). It could be enabled on pit ambush's completion for example so that a swing could not come before.
edit: part of "climb out" is make them able to be targeted and name visible
ah good point
the engage listener is what fires off the ambush ability.
Let me clarify the issue:
you can outrun the ambush ability, so the flow is as such:
- run near the underground antlion
- it engages and immediately readies the pit ambush
- player runs out of range of the ability, so it doesn't go off
- this mean the logic to unhide name, become targettable, and set animation sub to be visible are not triggered
- mob is still engaged and attacking the player
video of it in action:
https://imgur.com/1qNQtAs
note i got stuck on the invisble tuchulcha, but the armored hunter i was able to get by and i was able to out range pit ambush
video of it in action:
https://imgur.com/1qNQtAs
note i got stuck on the invisble tuchulcha, but the armored hunter i was able to get by and i was able to out range pit ambush
OH! THE ENM! yeah that's got altogether its own bugs on top of regular pit ambush's in Attohwa Chasm xD those particular antliosn have never worked right even at times the others did and to my knowledge nobody looked into why the same code didn't function right for them. That isn't to say the regular ones are ok right now either - I'd be surprised if they were honestly.
you can outrun the ambush ability, so the flow is as such:
run near the underground antlion it engages and immediately readies the pit ambush player runs out of range of the ability, so it doesn't go off this mean the logic to unhide name, become targettable, and set animation sub to be visible are not triggered mob is still engaged and attacking the player
so if you do not outrun it, things are ok, just screwed up if you do?
We really should have another listener that handles show name unhide etc. instead of doing it in the mobskill. Perhaps an onMobSkillFinish listener with a modification to still fire when interrupted (and a bool to tell you that) or possibly a 2nd listener for onMobSkillInterupted? But moving it into the mobskill script caused that, since if no skill goes off that code never fires. Possible that previously the code fired too soon and that's why it moved there.
correct, it only breaks if you outrun the ability, because yea the logic to unhide, etc is in the code that only executes when the dmg is done.
This is why i suggested a timer that checks if that other logic fired. Perhaps disengage if the move doesn't go off
fully resolved by https://github.com/LandSandBoat/server/pull/5794