diff options
author | dr.skull <dr.skull@centrum.sk> | 2011-12-12 12:04:58 +0100 |
---|---|---|
committer | dr.skull <dr.skull@centrum.sk> | 2011-12-13 19:20:51 +0100 |
commit | d6ebfa993bd774135b255f1a6560a8aa22237b89 (patch) | |
tree | 8d76e5ef5a72da36df36459c0ab83c92da3bf03d /src | |
parent | b85a5e9fa5bf0bd0cd9c625c39f27e8a82222eca (diff) |
Core/Spells: issue/3744
Windfury and Flametongue should proc from abilities
Signed-off-by: dr.skull <dr.skull@centrum.sk>
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 659ebef92af..286e9ae1f23 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7070,7 +7070,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 28850; break; } - // Windfury Weapon (Passive) 1-5 Ranks + // Windfury Weapon (Passive) 1-8 Ranks case 33757: { Player* player = ToPlayer(); @@ -7085,8 +7085,10 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return false; WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot())); - if ((attType != BASE_ATTACK && attType != OFF_ATTACK) || !isAttackReady(attType)) - return false; + if ((attType != BASE_ATTACK && attType != OFF_ATTACK) + || attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK + || attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK) + return false; // Now compute real proc chance... uint32 chance = 20; @@ -7132,8 +7134,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere int32 extra_attack_power = CalculateSpellDamage(victim, windfurySpellInfo, 1); // Value gained from additional AP - basepoints0 = int32(extra_attack_power / 14.0f * GetAttackTime(BASE_ATTACK) / 1000); - triggered_spell_id = 25504; + basepoints0 = int32(extra_attack_power / 14.0f * GetAttackTime(attType) / 1000); + + if (procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK) + triggered_spell_id = 25504; + + if (procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK) + triggered_spell_id = 33750; // apply cooldown before cast to prevent processing itself if (cooldown) @@ -7371,6 +7378,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (GetTypeId() != TYPEID_PLAYER || !victim || !victim->isAlive() || !castItem || !castItem->IsEquipped()) return false; + Player* player = ToPlayer(); + WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot())); + if ((attType != BASE_ATTACK && attType != OFF_ATTACK) + || attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK + || attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK) + return false; + float fire_onhit = float(CalculatePctF(dummySpell->Effects[EFFECT_0]. CalcValue(), 1.0f)); float add_spellpower = (float)(SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) @@ -7380,7 +7394,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere ApplyPctF(add_spellpower, 3.84f); // Enchant on Off-Hand and ready? - if (castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND && isAttackReady(OFF_ATTACK)) + if (castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK) { float BaseWeaponSpeed = GetAttackTime(OFF_ATTACK) / 1000.0f; @@ -7390,7 +7404,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } // Enchant on Main-Hand and ready? - else if (castItem->GetSlot() == EQUIPMENT_SLOT_MAINHAND && isAttackReady(BASE_ATTACK)) + else if (castItem->GetSlot() == EQUIPMENT_SLOT_MAINHAND && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK) { float BaseWeaponSpeed = GetAttackTime(BASE_ATTACK) / 1000.0f; |