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

fix(Core/Unit): fix Dual Wield for more creatures, CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK, creature disarm damage #20015

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

sogladev
Copy link
Contributor

Changes Proposed:

This PR proposes changes to:

  • Core (units, players, creatures, game systems).
  • Scripts (bosses, spell scripts, creature scripts).
  • Database (SAI, creatures, etc).

dual wield:
current dual wield logic relies on Unit::haveOffhandWeapon() which requires m_canDualWield to be set. New dual wield logic for creatures is based on cmangos' implementation. player DW remains unchanged. I did not remove Unit::haveOffhandWeapon() as it is still used on some scripts

creatures can now dual wield if: has non-disarmed weapon in offhand OR m_canDualWield is set. m_canDualWield is set by SetCanDualWield through script or SPELL_EFFECT_DUAL_WIELD, CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK

changes:

  1. dual wielding mobs can hit with their off-hand without relying on m_canDualWield being set
  2. implement CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK which allows special cases to attack with non-weapon offhand. ex. allows 20929 Wrath Lord to dual wield main hand sword and offhand fist
  3. disarmed mobs no longer do near zero damage, instead damage is reduced by ~50%
  4. implement helper function Unit::GetVirtualItemId for SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID... to use helper function based on tc, omitted refactoring
  5. shapeshift check for can useweapon, small part of using data from SpellShapeshiftForm.dbc present in cmangos

Issues Addressed:

SOURCE:

The changes have been validated through:

  • Live research (checked on live servers, e.g Classic WotLK, Retail, etc.)
  • Sniffs (remember to share them with the open source community!)
  • Video evidence, knowledge databases or other public sources (e.g forums, Wowhead, etc.)
  • The changes promoted by this pull request come partially or entirely from another project (cherry-pick). Cherry-picks must be committed using the proper --author tag in order to be accepted, thus crediting the original authors, unless otherwise unable to be found
  1. disarm damage https://wowwiki-archive.fandom.com/wiki/Disarm_effect, original commit in cmangos
  2. creatures with CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK from cmangos-db ExtraFlags & 0x00800000, trinitytc lists 2 creatures Ymirjar Battle-Maiden flags_extra & 0x00000800

Tests Performed:

This PR has been:

  • Tested in-game by the author.
  • Tested in-game by other community members/someone else other than the author/has been live on production servers.
  • This pull request requires further testing and may have edge cases to be tested.

How to Test the Changes:

  • This pull request can be tested by following the reproduction steps provided in the linked issue
  • This pull request requires further testing. Provide steps to test your changes. If it requires any specific setup e.g multiple players please specify it as well.

special case dual wield 20929 Wrath Lord with CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK
should attack with main hand and off hand fist

.npc add temp 20929

generic case dual wield 22143 Gordunni Back-Breaker

.npc add temp 22143

disarm MH

.cast 8379

disarm MH and OH with dismantle

.cast 51722 
  1. dual-wield animation, damage and disarmed damage
  2. special case animation

Known Issues and TODO List:

  • refactor, use helper Unit::GetVirtualItemId
  • remove Unit::haveOffhandWeapon()

How to Test AzerothCore PRs

When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].

You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:

http://www.azerothcore.org/wiki/How-to-test-a-PR

REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).

For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.

sogladev and others added 7 commits September 22, 2024 12:57
no longer requires m_CanDualwield set to use Offhand attack
requires non-disarmed weapon in Offhand OR creature_flag_extra enabled

Co-authored-by: Ovah <[email protected]>
Co-authored-by: Warlockbugs <[email protected]>
set disarm to reduce minmax damage by 50% instead of setting to 0

Co-authored-by: Warlockbugs <[email protected]>
@github-actions github-actions bot added DB related to the SQL database CORE Related to the core file-cpp Used to trigger the matrix build labels Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CORE Related to the core DB related to the SQL database file-cpp Used to trigger the matrix build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MOBS - GENERIC] Dual-Wielding doesn't work.
1 participant