<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -328,7 +328,7 @@ enum AuraType
     SPELL_AURA_MOD_HEALING_RECEIVED = 283,                  // Possibly only for some spell family class spells
     SPELL_AURA_284,
     SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285,
-    SPELL_AURA_286,
+    SPELL_AURA_ABILITY_PERIODIC_CRIT = 286,
     SPELL_AURA_DEFLECT_SPELLS,
     SPELL_AURA_288,
     SPELL_AURA_289,</diff>
      <filename>src/game/SpellAuraDefines.h</filename>
    </modified>
    <modified>
      <diff>@@ -336,7 +336,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
     &amp;Aura::HandleNoImmediateEffect,                         //283 SPELL_AURA_MOD_HEALING_RECEIVED       implemented in Unit::SpellHealingBonus
     &amp;Aura::HandleUnused,                                    //284 not used by any spells (3.08a)
     &amp;Aura::HandleAuraModAttackPowerOfArmor,                 //285 SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR  implemented in Player::UpdateAttackPowerAndDamage
-    &amp;Aura::HandleUnused,                                    //286 not used by any spells (3.08a)
+    &amp;Aura::HandleNoImmediateEffect,                         //286 SPELL_AURA_ABILITY_PERIODIC_CRIT      implemented in Aura::IsCritFromAbilityAura called from AuraEffect::PeriodicTick
     &amp;Aura::HandleNoImmediateEffect,                         //287 SPELL_AURA_DEFLECT_SPELLS             implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult
     &amp;Aura::HandleUnused,                                    //288 not used by any spells (3.09) except 1 test spell.
     &amp;Aura::HandleUnused,                                    //289 unused
@@ -5896,6 +5896,9 @@ void Aura::PeriodicTick()
             else
                 pdamage = uint32(m_target-&gt;GetMaxHealth()*amount/100);
 
+            // This method can modify pdamage
+            bool isCrit = IsCritFromAbilityAura(pCaster, pdamage);
+
             // As of 2.2 resilience reduces damage from DoT ticks as much as the chance to not be critically hit
             // Reduce dot damage from resilience for players
             if (m_target-&gt;GetTypeId() == TYPEID_PLAYER)
@@ -5908,7 +5911,7 @@ void Aura::PeriodicTick()
 
             pCaster-&gt;DealDamageMods(m_target, pdamage, &amp;absorb);
 
-            SpellPeriodicAuraLogInfo pInfo(this, pdamage, 0, absorb, resist, 0.0f);
+            SpellPeriodicAuraLogInfo pInfo(this, pdamage, 0, absorb, resist, 0.0f, isCrit);
             m_target-&gt;SendPeriodicAuraLog(&amp;pInfo);
 
             Unit* target = m_target;                        // aura can be deleted in DealDamage
@@ -6030,10 +6033,13 @@ void Aura::PeriodicTick()
 
             pdamage = pCaster-&gt;SpellHealingBonus(m_target, GetSpellProto(), pdamage, DOT, GetStackAmount());
 
+            // This method can modify pdamage
+            bool isCrit = IsCritFromAbilityAura(pCaster, pdamage);
+
             sLog.outDetail(&quot;PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u&quot;,
                 GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target-&gt;GetGUIDLow(), m_target-&gt;GetTypeId(), pdamage, GetId());
 
-            SpellPeriodicAuraLogInfo pInfo(this, pdamage, 0, 0, 0, 0.0f);
+            SpellPeriodicAuraLogInfo pInfo(this, pdamage, 0, 0, 0, 0.0f, isCrit);
             m_target-&gt;SendPeriodicAuraLog(&amp;pInfo);
 
             int32 gain = m_target-&gt;ModifyHealth(pdamage);
@@ -6921,3 +6927,19 @@ void Aura::HandleAuraSafeFall( bool Apply, bool Real )
     if(Apply &amp;&amp; Real &amp;&amp; GetId() == 32474 &amp;&amp; m_target-&gt;GetTypeId() == TYPEID_PLAYER)
         ((Player*)m_target)-&gt;ActivateTaxiPathTo(506, GetId());
 }
+
+bool Aura::IsCritFromAbilityAura(Unit* caster, uint32&amp; damage)
+{
+    Unit::AuraList const&amp; auras = caster-&gt;GetAurasByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
+    for(Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
+    {
+        if (!(*itr)-&gt;isAffectedOnSpell(m_spellProto))
+            continue;
+
+        if (caster-&gt;isSpellCrit(m_target, m_spellProto, GetSpellSchoolMask(m_spellProto)))
+            damage = caster-&gt;SpellCriticalDamageBonus(m_spellProto, damage, m_target);
+
+        return true;
+    }
+    return false;
+}</diff>
      <filename>src/game/SpellAuras.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -325,6 +325,8 @@ class MANGOS_DLL_SPEC Aura
     protected:
         Aura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
 
+        bool IsCritFromAbilityAura(Unit* caster, uint32&amp; damage);
+
         Modifier m_modifier;
         SpellModifier *m_spellmod;
 </diff>
      <filename>src/game/SpellAuras.h</filename>
    </modified>
    <modified>
      <diff>@@ -4278,13 +4278,13 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
             data &lt;&lt; uint32(GetSpellSchoolMask(aura-&gt;GetSpellProto()));
             data &lt;&lt; uint32(pInfo-&gt;absorb);                  // absorb
             data &lt;&lt; uint32(pInfo-&gt;resist);                  // resist
-            data &lt;&lt; uint8(0);                               // new 3.1.2
+            data &lt;&lt; uint8(pInfo-&gt;critical ? 1 : 0);         // new 3.1.2 critical flag
             break;
         case SPELL_AURA_PERIODIC_HEAL:
         case SPELL_AURA_OBS_MOD_HEALTH:
             data &lt;&lt; uint32(pInfo-&gt;damage);                  // damage
             data &lt;&lt; uint32(pInfo-&gt;overDamage);              // overheal?
-            data &lt;&lt; uint8(0);                               // new 3.1.2
+            data &lt;&lt; uint8(pInfo-&gt;critical ? 1 : 0);         // new 3.1.2 critical flag
             break;
         case SPELL_AURA_OBS_MOD_MANA:
         case SPELL_AURA_PERIODIC_ENERGIZE:</diff>
      <filename>src/game/Unit.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -686,7 +686,7 @@ struct SpellNonMeleeDamage{
 
 struct SpellPeriodicAuraLogInfo
 {
-    SpellPeriodicAuraLogInfo(Aura *_aura, uint32 _damage, uint32 _overDamage, uint32 _absorb, uint32 _resist, float _multiplier)
+    SpellPeriodicAuraLogInfo(Aura *_aura, uint32 _damage, uint32 _overDamage, uint32 _absorb, uint32 _resist, float _multiplier, bool _critical = false)
         : aura(_aura), damage(_damage), overDamage(_overDamage), absorb(_absorb), resist(_resist), multiplier(_multiplier) {}
 
     Aura   *aura;
@@ -695,6 +695,7 @@ struct SpellPeriodicAuraLogInfo
     uint32 resist;
     uint32 overDamage;                                      // overkill/overheal
     float  multiplier;
+    bool   critical;
 };
 
 uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition);</diff>
      <filename>src/game/Unit.h</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
 #ifndef __REVISION_NR_H__
 #define __REVISION_NR_H__
- #define REVISION_NR &quot;8138&quot;
+ #define REVISION_NR &quot;8139&quot;
 #endif // __REVISION_NR_H__</diff>
      <filename>src/shared/revision_nr.h</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>716cfd9e28d383f6d5f3f93de870bbe750a44503</id>
    </parent>
  </parents>
  <author>
    <name>ApoC</name>
    <email>apoc@nymfe.net</email>
  </author>
  <url>http://github.com/mangos/mangos/commit/db13c2fe18ff3953851eaaf86922ee57510e556a</url>
  <id>db13c2fe18ff3953851eaaf86922ee57510e556a</id>
  <committed-date>2009-07-06T13:48:34-07:00</committed-date>
  <authored-date>2009-07-06T10:50:06-07:00</authored-date>
  <message>[8139] Implemented aura SPELL_AURA_ABILITY_PERIODIC_CRIT(286).

This commit affects spells 49868, 58435, 63068, 63091, 63503,
64915, 64925.

Signed-off-by: ApoC &lt;apoc@nymfe.net&gt;</message>
  <tree>79506804891c719b27d821fcc9ef4ef582c1f074</tree>
  <committer>
    <name>ApoC</name>
    <email>apoc@nymfe.net</email>
  </committer>
</commit>
