Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LUA] Fix Quick Draw improperly calculating resistance #5610

Conversation

ampitere
Copy link
Contributor

@ampitere ampitere commented May 4, 2024

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • 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?

Currently Quick Draw elemental shots (and other magical abilities) do not properly calculate a mob's resistance. For example, if you use Fire Shot on a Fire Elemental it will deal full damage, the same damage as any other elemental shot, and the resist value will be 1. To resolve this we will reuse the xi.combat.magicHitRate.calculateResistRate which does properly account for mob's resistances.

There's a decent amount of code duplication that exists between scripts/globals/combat/magic_hit_rate.lua and scripts/globals/magic.lua, but I have left that for now as this minor change resolves resistances flat out not working.

Steps to test these changes

  1. !changejob 17 99
  2. !additem 2974 99
  3. !additem 21278
  4. !additem 18235 99
  5. Equip the gun and bullets
  6. Find a mob with elemental resistances (Elementals in Sky for example !pos 397 -24 -2 130)
  7. !immortal the mob
  8. Use Quick Draw with a shot the mob is resistance to (Fire Elemental is resistant to Fire and Ice)
  9. Shots that the mob are resistant to should now deal significantly less damage
  10. !reset if necessary

image

@claywar claywar merged commit 0e5a435 into LandSandBoat:base May 4, 2024
12 checks passed
@ampitere ampitere deleted the fix_quick_draw_improperly_calculating_resistance branch May 4, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants