aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShocker <shocker@freakz.ro>2012-01-04 13:25:43 -0800
committerShocker <shocker@freakz.ro>2012-01-04 13:25:43 -0800
commit0a17ab2e4ce86940c6066230de1fe9939656ad3d (patch)
treeaeb54017aab96a2c1ab52e6cad08d36f3e183a8d
parentb1129499a2b111aae7a3d9e75a06211c5f4f84e3 (diff)
parent2cd57b53e63614185d8b57719d369d7c92c6f896 (diff)
Merge pull request #4314 from drskull/master
Core/Spells: Windfury and Flametongue should proc from abilities
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp28
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp2
2 files changed, 22 insertions, 8 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 4e9e273e628..65e4bb76566 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -7069,7 +7069,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();
@@ -7084,8 +7084,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;
@@ -7131,8 +7133,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)
@@ -7370,6 +7377,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)
@@ -7379,7 +7393,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;
@@ -7389,7 +7403,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;
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index 9e8b8a9eda4..be33cbcc413 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -125,7 +125,7 @@ class spell_sha_fire_nova : public SpellScriptLoader
{
Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]);
if (totem && totem->isTotem())
- totem->CastSpell(totem, spellId, true);
+ caster->CastSpell(totem, spellId, true);
}
}