diff --git a/zone/attack.cpp b/zone/attack.cpp index c869792a7..abe667b04 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -140,9 +140,25 @@ EQ::skills::SkillType Mob::AttackAnimation(int Hand, const EQ::ItemInstance* wea } // If we're attacking with the secondary hand, play the dual wield anim - if (Hand == EQ::invslot::slotSecondary) // DW anim + if (Hand == EQ::invslot::slotSecondary) {// DW anim type = animDualWield; + //allow animation chance to fire to be similar to your dw chance + if (GetDualWieldingSameDelayWeapons() == 2) { + SetDualWieldingSameDelayWeapons(3); + } + } + + //If both weapons have same delay this allows a chance for DW animation + if (GetDualWieldingSameDelayWeapons() && Hand == EQ::invslot::slotPrimary) { + + if (GetDualWieldingSameDelayWeapons() == 3 && zone->random.Roll(50)) { + type = animDualWield; + SetDualWieldingSameDelayWeapons(2);//Don't roll again till you do another dw attack. + } + SetDualWieldingSameDelayWeapons(2);//Ensures first attack is always primary. + } + DoAnim(type, 0, false); return skillinuse; @@ -5541,6 +5557,8 @@ void Mob::SetAttackTimer() void Client::SetAttackTimer() { float haste_mod = GetHaste() * 0.01f; + int primary_speed = 0; + int secondary_speed = 0; //default value for attack timer in case they have //an invalid weapon equipped: @@ -5618,6 +5636,21 @@ void Client::SetAttackTimer() speed = static_cast(speed + ((hhe / 100.0f) * delay)); } TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true, true); + + if (i == EQ::invslot::slotPrimary) { + primary_speed = speed; + } + else if (i == EQ::invslot::slotSecondary) { + secondary_speed = speed; + } + } + + //To allow for duel wield animation to display correctly if both weapons have same delay + if (primary_speed == secondary_speed) { + SetDualWieldingSameDelayWeapons(1); + } + else { + SetDualWieldingSameDelayWeapons(0); } } diff --git a/zone/mob.cpp b/zone/mob.cpp index 74fb9d1f0..2276275ee 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -487,6 +487,7 @@ Mob::Mob( npc_assist_cap = 0; use_double_melee_round_dmg_bonus = false; + dw_same_delay = 0; #ifdef BOTS m_manual_follow = false; diff --git a/zone/mob.h b/zone/mob.h index ec7a84700..a3a664f1f 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -852,6 +852,8 @@ public: int GetHealRate() const { return itembonuses.HealRate + spellbonuses.HealRate + aabonuses.HealRate; } int GetMemoryBlurChance(int base_chance); inline bool HasBaseEffectFocus() const { return (spellbonuses.FocusEffects[focusFcBaseEffects] || aabonuses.FocusEffects[focusFcBaseEffects] || itembonuses.FocusEffects[focusFcBaseEffects]); } + int32 GetDualWieldingSameDelayWeapons() const { return dw_same_delay; } + inline void SetDualWieldingSameDelayWeapons(int32 val) { dw_same_delay = val; } bool TryDoubleMeleeRoundEffect(); bool GetUseDoubleMeleeRoundDmgBonus() const { return use_double_melee_round_dmg_bonus; } @@ -1467,6 +1469,7 @@ protected: int16 slow_mitigation; // Allows for a slow mitigation (100 = 100%, 50% = 50%) Timer tic_timer; Timer mana_timer; + int32 dw_same_delay; Timer focusproclimit_timer[MAX_FOCUS_PROC_LIMIT_TIMERS]; //SPA 511 int32 focusproclimit_spellid[MAX_FOCUS_PROC_LIMIT_TIMERS]; //SPA 511