Core/Spells: issue/3744

Windfury and Flametongue should proc from abilities

Signed-off-by: dr.skull <[email protected]>
This commit is contained in:
dr.skull
2011-12-13 19:20:51 +01:00
parent b85a5e9fa5
commit d6ebfa993b
+21 -7
View File
@@ -7070,7 +7070,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
triggered_spell_id = 28850; triggered_spell_id = 28850;
break; break;
} }
// Windfury Weapon (Passive) 1-5 Ranks // Windfury Weapon (Passive) 1-8 Ranks
case 33757: case 33757:
{ {
Player* player = ToPlayer(); Player* player = ToPlayer();
@@ -7085,8 +7085,10 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
return false; return false;
WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot())); WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot()));
if ((attType != BASE_ATTACK && attType != OFF_ATTACK) || !isAttackReady(attType)) if ((attType != BASE_ATTACK && attType != OFF_ATTACK)
return false; || 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... // Now compute real proc chance...
uint32 chance = 20; uint32 chance = 20;
@@ -7132,8 +7134,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
int32 extra_attack_power = CalculateSpellDamage(victim, windfurySpellInfo, 1); int32 extra_attack_power = CalculateSpellDamage(victim, windfurySpellInfo, 1);
// Value gained from additional AP // Value gained from additional AP
basepoints0 = int32(extra_attack_power / 14.0f * GetAttackTime(BASE_ATTACK) / 1000); basepoints0 = int32(extra_attack_power / 14.0f * GetAttackTime(attType) / 1000);
triggered_spell_id = 25504;
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 // apply cooldown before cast to prevent processing itself
if (cooldown) 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()) if (GetTypeId() != TYPEID_PLAYER || !victim || !victim->isAlive() || !castItem || !castItem->IsEquipped())
return false; 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 fire_onhit = float(CalculatePctF(dummySpell->Effects[EFFECT_0]. CalcValue(), 1.0f));
float add_spellpower = (float)(SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) 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); ApplyPctF(add_spellpower, 3.84f);
// Enchant on Off-Hand and ready? // 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; 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? // 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; float BaseWeaponSpeed = GetAttackTime(BASE_ATTACK) / 1000.0f;