Jump to content

[fix][7990] Dual Wielding and Chance on Hit Procs


Guest nos4r2zod

Recommended Posts

What bug does the patch fix? What features does the patch add?

Chance on hit procs that do not use auras should be dependent on the hand being used.

For example, a rogue poison applied to the off-hand weapon should NOT be triggered when the main hand attacks. If it is an effect that should proc off of an attack made by any hand, then an aura effect would be used instead, and the term "Equip: Chance on hit ..." is used rather than just "Chance on hit." Compare Misplaced Servo Arm with Perdition's Blade for example, and check out the links on the spell effects as well.

If you want to confirm this bug, you can try the following:

1) Make an offhand weapon in the db with an attack delay of 65.53 seconds, add a poison to it, and dual wield it with an unenchanted main hand. You'll see that the main hand triggers the off-hand's poison anyways.

2) Dual wield daggers with 1.4 attack speed (normallized). Apply wound poison (50% proc chance) to both. The amount of melee hits made will be 1:1 with the number of wound poison procs (each hit has two 50% chances of proccing poison).

For which repository revision was the patch created?

7970

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

Didn't find any in search

Who has been writing this patch? Please include either forum user names or email addresses.

Myself

Patch:

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 4b693b4..d1e7509 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1501,8 +1501,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
    {
        if(GetTypeId() == TYPEID_PLAYER && pVictim->isAlive())
        {
-            for(int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)
-                ((Player*)this)->CastItemCombatSpell(((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0,i), pVictim, damageInfo->attackType);
+            ((Player*)this)->CastItemCombatSpell(((Player*)this)->GetWeaponForAttack(damageInfo->attackType, true), pVictim, damageInfo->attackType);
        }

        // victim's damage shield

In fact, the iteration through all equipped items for "Chance on hit" procs isn't needed, because trinkets/jewelry/armor that add proc effects would always be handled through auras.

Link to comment
Share on other sites

In fact, the iteration through all equipped items for "Chance on hit" procs isn't needed, because trinkets/jewelry/armor that add proc effects would always be handled through auras.
For check this and better at server laoding integrity checks in general i add this check in loading code.

Also i simplify call by move hit item selection code to cast combat function.

With this changes patch in [7990]. Thank you :)

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use