LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
301 stars 612 forks source link

[Lua+Core] Add interruption of player spells by physical mobskills #6396

Closed TracentEden2 closed 3 weeks ago

TracentEden2 commented 3 weeks ago

I affirm:

What does this pull request do?

This PR adds the potential for interruption of players casting spells when hit for positive damage by a physical mobskill. Retail capture of such an interruption can be seen in Siknoz capture of Kirin here. The PR assumes that each hit of the mobskill gives an interruption chance (as per discussion in PR comments). The PR adds a CLuaBaseEntity::tryHitInterrupt to accomplish this interruption logic.

The PR also refactors the handleBlock function and splits it into two functions isBlocked and getDamageReductionForBlock so that it is more consistent with other functions (like isParried) and removes the need for two return parameters. Also the refactor fixes a small bug that was in handleBlock related to applying the damage reduction to the hit damage.

Finally the PR renames the finaldmg variable to hitdamage in the getSingleHitDamage function in weaponskills.lua to improve readability and avoid confusion (as a variable named finaldmg is used differently in handleSinglePhysicalHit mobskill.lua).

Steps to test these changes

Fight a mob and turn off the mobs auto-attacks and start casting a long spell while spamming the mob with !tp 3000 until the mob uses many physical mobskills which hopefully interrupt the spell.

WinterSolstice8 commented 3 weeks ago

don't think there's any reason not to have it try to interrupt each hit, it's well known you can skill up guard/parry more than once on a multihit TP move

if weaponskills are only doing it once that could be wrong too

TracentEden2 commented 3 weeks ago

don't think there's any reason not to have it try to interrupt each hit, it's well known you can skill up guard/parry more than once on a multihit TP move

if weaponskills are only doing it once that could be wrong too

Yeah, I think you are right and I have updated the PR to reflect this. I think I will wait for now until WS logic is in Lua space to try to fix that. Thanks for the feedback!