server icon indicating copy to clipboard operation
server copied to clipboard

[core] Allow interruption of certain player events when being attacked

Open TracentEden2 opened this issue 1 year ago • 0 comments

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 PR adds interruptibility to certain events when the player is the target of an aggressive action (like an attack or mob ability). On retail such events are primarily menu-based events like when confirming the use of a teleporter in sky or sea. The retail behavior (and event interruption) can be seen for example in this retail video.

Specifically the PR moves release function from lua base entity to char entity so it can be easily called in battle entity code (such as onAttack). The battle entity code itself checks in several places for aggressive actions (at the same locations where detectable status effects (like invis) are removed from targets of aggressive actions), and if the player is not locked in a CS then it releases the player from the event.

The current PR is a draft to get comments as I am not an expert on events.

Steps to test these changes

Attempt to use different teleporters and NPCs while being attacked by mobs.

TracentEden2 avatar Mar 21 '24 16:03 TracentEden2