Trinitycore: [3.3.5a] Core/Spells: Frenzied Regeneration should crit

Created on 7 Nov 2017  路  7Comments  路  Source: TrinityCore/TrinityCore


Current behaviour: Frenzied Regeneration doesn't crit at all.

Expected behaviour: This spell must have a crit chance (see comment). It's unstated whether it should inherit spell or agility crit, but according to the worldoflogs, I'd assume that it's spell crit.

Branch(es): 3.3.5a

TC rev. hash/commit: TrinityCore rev. 6612ec47f4cd+

TDB version: TDB335

Operating system: Ubuntu 16.04

Branch-3.3.5a Comp-Core Sub-Spells

All 7 comments

I could try to fix this myself, but I'm not sure how to do so correctly. I'd be glad to see any information on that. Thanks!

I don't have SpellWork for 3.3.5 but look on spell attributes if spell have SPELL_ATTR2_CANT_CRIT or similar

Spell doesn't have such.

Not sure if this is fix or not. Have a look and see:

diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 526157708a..d4f2a5b225 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -503,9 +503,12 @@ class spell_dru_frenzied_regeneration : public AuraScript
         // Nothing to do
         if (!rage)
             return;
-
+        
         int32 const mod = std::min(static_cast<int32>(rage), 100);
-        int32 const regen = CalculatePct(GetTarget()->GetMaxHealth(), GetTarget()->CalculateSpellDamage(nullptr, GetSpellInfo(), EFFECT_1) * mod / 100.f);
+        int32 const damage = GetTarget()->CalculateSpellDamage(nullptr, GetSpellInfo(), EFFECT_1);
+        int32 const bonus = GetTarget()->SpellCriticalHealingBonus(GetTarget(), GetSpellInfo(), (damage * mod), GetTarget());
+        int32 const regen = CalculatePct(GetTarget()->GetMaxHealth(), ((damage * mod)+bonus) / 100.0f);
+        
         CastSpellExtraArgs args(aurEff);
         args.AddSpellBP0(regen);
         GetTarget()->CastSpell(nullptr, SPELL_DRUID_FRENZIED_REGENERATION_HEAL, args);

Without the redundant whitespace, it looks like this:

diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 98f15ff70d..1f6c9eb0d4 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -529,11 +529,14 @@ class spell_dru_frenzied_regeneration : public AuraScript
         // Nothing to do
         if (!rage)
             return;

         int32 const mod = std::min(static_cast<int32>(rage), 100);
-        int32 const regen = CalculatePct(GetTarget()->GetMaxHealth(), GetTarget()->CalculateSpellDamage(GetSpellInfo(), EFFECT_1) * mod / 100.f);
+        int32 const damage = GetTarget()->CalculateSpellDamage(nullptr, GetSpellInfo(), EFFECT_1);
+        int32 const bonus = GetTarget()->SpellCriticalHealingBonus(GetTarget(), GetSpellInfo(), (damage * mod), GetTarget());
+        int32 const regen = CalculatePct(GetTarget()->GetMaxHealth(), ((damage * mod)+bonus) / 100.0f);
+
         CastSpellExtraArgs args(aurEff);
         args.AddSpellBP0(regen);
         GetTarget()->CastSpell(nullptr, SPELL_DRUID_FRENZIED_REGENERATION_HEAL, args);
         GetTarget()->SetPower(POWER_RAGE, rage - mod);
     }

(based on TrinityCore rev. 718742005c3b 2018-06-17 17:03:10 +0200 (3.3.5 branch) )

ID - 22845 Frenzied Regeneration
DamageClass = 0 (SPELL_DAMAGE_CLASS_NONE)

SPELL_ATTR0_CU_CAN_CRIT isn't enought for this case
need a better check here?
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Unit/Unit.cpp#L6923-L6967

or SPELL_ATTR0_CU_CAN_CRIT + change damage_class in spellmgr.cpp can be valid?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZenoX92 picture ZenoX92  路  3Comments

Rushor picture Rushor  路  3Comments

Blasphemous picture Blasphemous  路  3Comments

Tatara902 picture Tatara902  路  3Comments

Rushor picture Rushor  路  3Comments