Jump to content

[Mangos-0.12] Wrong calculating bonus after recent backportings !


Guest mns

Recommended Posts

in fact caused GetSpellDuration(spellProto) result .

it's -1

Unit.cpp

       if(damagetype == DOT)
       {
           int32 DotDuration = GetSpellDuration(spellProto);
           // 200% limit
           if(DotDuration > 0)
           {
               if(DotDuration > 30000) DotDuration = 30000;
               if(!IsChanneledSpell(spellProto)) DotFactor = DotDuration / 15000.0f;
               int x = 0;
               for(int j = 0; j < 3; j++)
               {
                   if( spellProto->Effect[j] == SPELL_EFFECT_APPLY_AURA && (
                       spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_DAMAGE ||
                       spellProto->EffectApplyAuraName[j] == SPELL_AURA_PERIODIC_LEECH) )
                   {
                       x = j;
                       break;
                   }
               }
               int32 DotTicks = 6;
               if(spellProto->EffectAmplitude[x] != 0)
                   DotTicks = DotDuration / spellProto->EffectAmplitude[x];
               if(DotTicks)
               {
                   DoneAdvertisedBenefit /= DotTicks*int32(stack);
                   TakenAdvertisedBenefit /= DotTicks*int32(stack);
               }
           }
       }

can you any fast solution or i must rollback own server ? :(

Link to comment
Share on other sites

emergency patch

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index b5abcb9..7b49835 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7830,7 +7830,8 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
                    DoneAdvertisedBenefit /= DotTicks*int32(stack);
                    TakenAdvertisedBenefit /= DotTicks*int32(stack);
                }
-            }
+            }else
+                return healamount;
        }
        // Distribute Damage over multiple effects, reduce by AoE
        CastingTime = GetCastingTimeForBonus( spellProto, damagetype, CastingTime );

Link to comment
Share on other sites

I guess the only way is to manage all the spells manually :S

For the example in this thread:

INSERT INTO `mangos`.`spell_bonus_data`(`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`comments`) VALUES 
( '10461','0','0','0','Shaman - Healing Stream Totem Rank 5'),
( '10460','0','0','0','Shaman - Healing Stream Totem Rank 4'),
( '6372','0','0','0','Shaman - Healing Stream Totem Rank 3'),
( '6371','0','0','0','Shaman - Healing Stream Totem Rank 2'),
( '5672','0','0','0','Shaman - Healing Stream Totem Rank 1');

At least I guess ! Milk13 will do this better than me.

Link to comment
Share on other sites

this can help to found missed spells :)

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index b5abcb9..7b49835 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7830,7 +7830,8 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
                    DoneAdvertisedBenefit /= DotTicks*int32(stack);
                    TakenAdvertisedBenefit /= DotTicks*int32(stack);
                }
-            }
+            }else
+                sLog.outError("Missed spell_bonus_data : %u",spellProto->Id);
        }
        // Distribute Damage over multiple effects, reduce by AoE
        CastingTime = GetCastingTimeForBonus( spellProto, damagetype, CastingTime );

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