fix(Core/Unit): fix Dual Wield for more creatures, CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK, creature disarm damage #20015
+160
−30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes Proposed:
This PR proposes changes to:
dual wield:
current dual wield logic relies on
Unit::haveOffhandWeapon()
which requiresm_canDualWield
to be set. New dual wield logic for creatures is based on cmangos' implementation. player DW remains unchanged. I did not removeUnit::haveOffhandWeapon()
as it is still used on some scriptscreatures can now dual wield if: has non-disarmed weapon in offhand OR
m_canDualWield
is set.m_canDualWield
is set bySetCanDualWield
through script orSPELL_EFFECT_DUAL_WIELD
,CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK
azerothcore-wotlk/src/server/game/Entities/Unit/Unit.cpp
Line 527 in bb0d292
changes:
m_canDualWield
being setCREATURE_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 fistUnit::GetVirtualItemId
forSetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID...
to use helper function based on tc, omitted refactoringSpellShapeshiftForm.dbc
present in cmangosIssues Addressed:
SOURCE:
The changes have been validated through:
CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK
from cmangos-dbExtraFlags & 0x00800000
, trinitytc lists 2 creatures Ymirjar Battle-Maidenflags_extra & 0x00000800
Tests Performed:
This PR has been:
How to Test the Changes:
special case dual wield 20929 Wrath Lord with
CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK
should attack with main hand and off hand fist
generic case dual wield 22143 Gordunni Back-Breaker
disarm MH
disarm MH and OH with dismantle
Known Issues and TODO List:
Unit::GetVirtualItemId
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.