Jump to content

[spell] Immolate, Rupture, Flame Shock critical dmg


Guest przemratajczak

Recommended Posts

MaNGOS 9739

UDB 389

SD2 1675

Bug:

According to patch notes some spells with SPELL_AURA_PERIODIC_DAMAGE effect can now crit

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 97591d5..1d38fae 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -8729,14 +8729,42 @@ void Aura::HandleAuraSafeFall( bool Apply, bool Real )

bool Aura::IsCritFromAbilityAura(Unit* caster, uint32& damage)
{
+    bool bCanCrit = false;
+
+    switch(m_spellProto->SpellFamilyName)
+    {
+        case SPELLFAMILY_WARLOCK:
+            // Immolate
+            if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004))
+                bCanCrit = true;
+            break;
+
+        case SPELLFAMILY_ROGUE:
+            // Rupture
+            if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000100000))
+                bCanCrit = true;
+            break;
+
+        case SPELLFAMILY_SHAMAN:
+            // Flame Shock
+            if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000010000000))
+                bCanCrit = true;
+            break;
+
+            default:  break;
+    }
+
    Unit::AuraList const& auras = caster->GetAurasByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
    for(Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
    {
        if (!(*itr)->isAffectedOnSpell(m_spellProto))
            continue;
-        if (!caster->isSpellCrit(m_target, m_spellProto, GetSpellSchoolMask(m_spellProto)))
-            break;

+        bCanCrit = true;
+    }
+
+    if (bCanCrit && caster->isSpellCrit(m_target, m_spellProto, GetSpellSchoolMask(m_spellProto)))
+    {
        damage = caster->SpellCriticalDamageBonus(m_spellProto, damage, m_target);
        return true;
    }

Pastebin

Link to comment
Share on other sites

insert ignore into playercreateinfo_spell values
(1,9,75445,'Demonic Immolate'),
(2,9,75445,'Demonic Immolate'),
(5,9,75445,'Demonic Immolate'),
(7,9,75445,'Demonic Immolate'),
(10,9,75445,'Demonic Immolate');
insert ignore into playercreateinfo_spell values
(2,7,75461,'Flame Shock Passive'),
(6,7,75461,'Flame Shock Passive'),
(8,7,75461,'Flame Shock Passive'),
(11,7,75461,'Flame Shock Passive');

Link to comment
Share on other sites

insert ignore into playercreateinfo_spell values
(1,9,75445,'Demonic Immolate'),
(2,9,75445,'Demonic Immolate'),
(5,9,75445,'Demonic Immolate'),
(7,9,75445,'Demonic Immolate'),
(10,9,75445,'Demonic Immolate');
insert ignore into playercreateinfo_spell values
(2,7,75461,'Flame Shock Passive'),
(6,7,75461,'Flame Shock Passive'),
(8,7,75461,'Flame Shock Passive'),
(11,7,75461,'Flame Shock Passive');

Is this only for new characters? i mean playercreateinfo_spell "This table holds information on what spells newly created characters should start out with"

I´m sorry i´m a noob on Db -.-

Link to comment
Share on other sites

  • 1 month later...

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 97591d5..1d38fae 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -8729,14 +8729,42 @@ void Aura::HandleAuraSafeFall( bool Apply, bool Real )

bool Aura::IsCritFromAbilityAura(Unit* caster, uint32& damage)
{
+    bool bCanCrit = false;
+
+    switch(m_spellProto->SpellFamilyName)
+    {
+        case SPELLFAMILY_WARLOCK:
+            // Immolate
+            if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004))
+                bCanCrit = true;
+            break;
+
+        case SPELLFAMILY_ROGUE:
+            // Rupture
+            if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000100000))
+                bCanCrit = true;
+            break;
+
+        case SPELLFAMILY_SHAMAN:
+            // Flame Shock
+            if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000010000000))
+                bCanCrit = true;
+            break;
+
+            default:  break;
+    }
+
    Unit::AuraList const& auras = caster->GetAurasByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
    for(Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
    {
        if (!(*itr)->isAffectedOnSpell(m_spellProto))
            continue;
-        if (!caster->isSpellCrit(m_target, m_spellProto, GetSpellSchoolMask(m_spellProto)))
-            break;

+        bCanCrit = true;
+    }
+
+    if (bCanCrit && caster->[u]IsSpellCrit[/u](m_target, m_spellProto, GetSpellSchoolMask(m_spellProto)))
+    {
        damage = caster->SpellCriticalDamageBonus(m_spellProto, damage, m_target);
        return true;
    }

This patch is working with a small change in revision 10091

I got a compile error, because the function "IsSpellCrit" now defined with a "I". After change works fine.

Sry for my bad english

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use