All pastes #824470 Raw Edit

thenecromacer

public text v1 · immutable
·published 2007-12-20 00:05 UTC
rendered paste body
Index: src/game/ObjectMgr.cpp
===================================================================
--- src/game/ObjectMgr.cpp	(revision 4872)
+++ src/game/ObjectMgr.cpp	(working copy)
@@ -4902,6 +4902,23 @@
     if (spellInfo_1->SpellFamilyName != spellInfo_2->SpellFamilyName)
         return false;
 
+    // Rend + Deep Wounds
+    if ( spellInfo_1->SpellFamilyName == SPELLFAMILY_WARRIOR )
+    {
+        bool periodic=false;
+
+        for (int i = 0; i < 3; i++)
+        {
+            if (spellInfo_1->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_DAMAGE )
+                periodic = true;
+        }
+        for (int i = 0; i < 3; i++)
+        {
+            if (spellInfo_2->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_DAMAGE && periodic)
+            return false;
+        }
+    }
+
     for (int i = 0; i < 3; ++i)
         if (spellInfo_1->Effect[i] != spellInfo_2->Effect[i] ||
         spellInfo_1->EffectItemType[i] != spellInfo_2->EffectItemType[i] ||
Index: src/game/Unit.cpp
===================================================================
--- src/game/Unit.cpp	(revision 4872)
+++ src/game/Unit.cpp	(working copy)
@@ -1350,7 +1350,7 @@
                 pdamage = mod->m_amount;
 
                 //Calculate armor mitigation if it is a physical spell
-                if (spellProto->School == SPELL_SCHOOL_NORMAL)
+                if (spellProto->School == SPELL_SCHOOL_NORMAL && spellProto->Mechanic != MECHANIC_BLEED)
                 {
                     uint32 pdamageReductedArmor = CalcArmorReducedDamage(pVictim, pdamage);
                     cleanDamage.damage += pdamage - pdamageReductedArmor;
@@ -6485,10 +6485,41 @@
 
     uint8 comboPoints = unitPlayer ? unitPlayer->GetComboPoints() : 0;
     bool needClearCombo = false;
+    float tickCoefficient = 1.0;
+    int32 value = 0;
 
+    if(duration)
+    {
+        int32 minduration = GetDuration(spellProto);
+        int32 maxduration = GetMaxDuration(spellProto);
+
+        if( minduration != -1 && minduration != maxduration )
+        {
+            value = minduration + int32((maxduration - minduration) * comboPoints / 5);
+            needClearCombo = true;
+        }
+        else
+            value = minduration;
+
+        if ( spellProto->EffectAmplitude[effect_index] != 0 && value != 0 )
+            tickCoefficient = (float)spellProto->EffectAmplitude[effect_index]/(float)value;
+
+        *duration = value;
+
+        if (*duration > 0)
+        {
+            int32 durationMod = 0;
+            AuraList const& mMechanicMod = GetAurasByType(SPELL_AURA_MECHANIC_DURATION_MOD);
+            for(AuraList::const_iterator i = mMechanicMod.begin();i != mMechanicMod.end(); ++i)
+                if((*i)->GetModifier()->m_miscvalue == int32(spellProto->Mechanic))
+                    durationMod+= (*i)->GetModifier()->m_amount;
+            *duration = *duration * (100+durationMod) /100;
+            if (*duration < 0) *duration = 0;
+        }
+    }
+
     if(damage)
     {
-        int32 value = 0;
         uint32 level = 0;
 
         level = getLevel() - spellProto->spellLevel;
@@ -6510,12 +6541,27 @@
         {
             value += (int32)(comboDamage * comboPoints);
 
-            // Eviscerate
-            if( spellProto->SpellIconID == 514 && spellProto->SpellFamilyName == SPELLFAMILY_ROGUE)
-                value += (int32)(GetTotalAttackPowerValue(BASE_ATTACK) * comboPoints * 0.03);
+            // Eviscerate & Rupture
+            if( (spellProto->SpellIconID == 514 || spellProto->SpellIconID == 500 ) && spellProto->SpellFamilyName == SPELLFAMILY_ROGUE)
+                value += (int32)(GetTotalAttackPowerValue(BASE_ATTACK) * comboPoints * 0.03 * tickCoefficient);
 
             needClearCombo = true;
         }
+        // Garrote also check to not add bonus to CP gain or silence..
+        else if ( spellProto->SpellIconID == 498 && spellProto->SpellFamilyName == SPELLFAMILY_ROGUE &&
+             spellProto->Effect[effect_index] == SPELL_EFFECT_APPLY_AURA  &&
+             spellProto->EffectApplyAuraName[effect_index] == SPELL_AURA_PERIODIC_DAMAGE )
+        {
+            value += (int32)(GetTotalAttackPowerValue(BASE_ATTACK) * 0.03 * tickCoefficient);
+        }
+        // rend
+        else if ( spellProto->SpellIconID == 64 && spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR)
+        {
+            float avgDmg = (GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE) + GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE))/2;
+            float weaponSpeed = GetAttackTime(BASE_ATTACK)/1000;
+            
+            value += (int32)(tickCoefficient*0.00743*3*(avgDmg+(GetTotalAttackPowerValue(BASE_ATTACK)/14)*weaponSpeed));
+        }
 
         if(Player* modOwner = GetSpellModOwner())
         {
@@ -6548,31 +6594,6 @@
         *damage = value;
     }
 
-    if(duration)
-    {
-        int32 minduration = GetDuration(spellProto);
-        int32 maxduration = GetMaxDuration(spellProto);
-
-        if( minduration != -1 && minduration != maxduration )
-        {
-            *duration = minduration + int32((maxduration - minduration) * comboPoints / 5);
-            needClearCombo = true;
-        }
-        else
-            *duration = minduration;
-
-        if (*duration > 0)
-        {
-            int32 durationMod = 0;
-            AuraList const& mMechanicMod = GetAurasByType(SPELL_AURA_MECHANIC_DURATION_MOD);
-            for(AuraList::const_iterator i = mMechanicMod.begin();i != mMechanicMod.end(); ++i)
-                if((*i)->GetModifier()->m_miscvalue == int32(spellProto->Mechanic))
-                    durationMod+= (*i)->GetModifier()->m_amount;
-            *duration = *duration * (100+durationMod) /100;
-            if (*duration < 0) *duration = 0;
-        }
-    }
-
     if(unitPlayer && needClearCombo)
         unitPlayer->ClearComboPoints();
 }