All pastes #908855 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-02-18 19:47 UTC
rendered paste body
Index: game/Spell.cpp
===================================================================
--- game/Spell.cpp	(revision 5253)
+++ game/Spell.cpp	(working copy)
@@ -3798,7 +3799,7 @@
             case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL:
             {
                 if(m_caster->GetTypeId() != TYPEID_PLAYER) return SPELL_FAILED_TARGET_NOT_PLAYER;
-                if(m_spellInfo->rangeIndex == 1 || m_spellInfo->rangeIndex == 2 || m_spellInfo->rangeIndex == 7)
+				if(m_spellInfo->rangeIndex == 1 || m_spellInfo->rangeIndex == 2 || m_spellInfo->rangeIndex == 6 || m_spellInfo->rangeIndex == 7)
                     break;
                 Item *pItem = ((Player*)m_caster)->GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED );
                 if(!pItem || pItem->IsBroken() || pItem->GetProto()->Class != ITEM_CLASS_WEAPON )
Index: game/SpellEffects.cpp
===================================================================
--- game/SpellEffects.cpp	(revision 5253)
+++ game/SpellEffects.cpp	(working copy)
@@ -3219,7 +3262,7 @@
     // FIXME: we also need select OFF_ATTACK if trigering some spell at offhand attack
     else if(m_spellInfo->SpellVisual==3136 || m_spellInfo->SpellIconID==2293)
         attType = BASE_ATTACK;
-    else if(m_spellInfo->rangeIndex != 1 && m_spellInfo->rangeIndex != 2 && m_spellInfo->rangeIndex != 7)
+    else if(m_spellInfo->rangeIndex != 1 && m_spellInfo->rangeIndex != 2 && m_spellInfo->rangeIndex != 6 && m_spellInfo->rangeIndex != 7)
     {
         attType = RANGED_ATTACK;
 
Index: game/Unit.cpp
===================================================================
--- game/Unit.cpp	(revision 5253)
+++ game/Unit.cpp	(working copy)
@@ -4307,17 +4305,40 @@
                     return;
                 }
             }
-            if( ((Player*)this)->HasSpellCooldown(32910)) 
+            if( ((Player*)this)->HasSpellCooldown(windfurySpellId)) 
                 return;
 
             SpellEntry const* windfurySpellEntry = sSpellStore.LookupEntry(windfurySpellId);
 
-            int32 addvalue = windfurySpellEntry->EffectBasePoints[0];
-            
-            CastCustomSpell(this, 32910, &addvalue, NULL, NULL, true, castItem, triggeredByAura);
-            
-            ((Player*)this)->AddSpellCooldown(32910,0,time(NULL) + 3);
+			// Add cooldown - note better to check it this way, or it can chain proc because cooldown is not yet added
+            ((Player*)this)->AddSpellCooldown(windfurySpellId,0,time(NULL) + 3);   
 
+            // Windfury Deals damage Equal to 2 attacks
+            SpellModifier *mod = new SpellModifier;
+            mod->op = SPELLMOD_DAMAGE;
+            mod->value = 100;
+            mod->type = SPELLMOD_PCT;
+            mod->spellId = 0;
+            mod->effectId = 0;
+            mod->lastAffected = 0;
+            mod->mask = 0x800000LL;
+            mod->charges = 0;
+
+            ((Player*)this)->AddSpellMod(mod, true);
+
+            // Main-Hand
+			int32 MainAPBonus = (int32)(windfurySpellEntry->EffectBasePoints[0]/14 * GetAttackTime(BASE_ATTACK)/1000);
+            CastCustomSpell(pVictim,25504,&MainAPBonus,NULL,NULL,true,NULL,triggeredByAura);  
+
+
+			// Off-Hand
+			if(haveOffhandWeapon())
+			{
+				int32 OffAPBonus = (int32)(windfurySpellEntry->EffectBasePoints[0]/14 * GetAttackTime(OFF_ATTACK)/1000);
+				CastCustomSpell(pVictim,33750,&OffAPBonus,NULL,NULL,true,NULL,triggeredByAura); 
+			}
+
+            ((Player*)this)->AddSpellMod(mod, false);
             return;
         }