Jump to content

Additive Percent Modifier Calculation System


Auntie Mangos

Recommended Posts

Revision of MaNGOS:

9851

Link to bug reports:

http://getmangos.eu/community/showthread.php?13853-Shield-Slam

What does it fix?

Currently in MaNGOS we have multiplicative percent modifier system only. But as You can read in bug reports, warriors' Shield Block Value should be calculated in additive system, so currently the warrior class profits too much BV from their modifiers (talents, gems, skills).

I'm not sure how this problem should be fixed, but I came up with an idea of implementing the additive system next to the existing multiplicative one. It basically doesn't change anything in the existing one, it's used whenever needed (in my patch for SBV only: for every percent modification of shield block value).

Patch: http://pastebin.com/6JYngkiA

Seperate patch for Shield Block Value(1): http://pastebin.com/SbHaCBxb

Seperate patch for Shield Block Value(2): http://pastebin.com/6tkiQJE4

I divided the patch so it would be more readable.

First SBV patch is for all percentage modifiers (AFAIK all pct mods are additive in SBV case), so it is optimal.

Second one is for handling every modifier aura separately. If not every modifier is additive, then this should be implemented and later extended for more auras.

Unfortunatelly I don't have much wisdom about any other classes in WoW, so I can't say if they should use additive system in any cases as well. AFAIK paladins' SBV has the cap for additional damage from SBV - similiar to warriors' one - so probably their SBV should be calculated in the same way.

Patch was tested by me and gave positive results. Please test as well and share Your opinion. :)

Link to comment
Share on other sites

  • 40 years later...

On wowhead there are only PCT_MOD and FLAT_MOD modifiers. There's no information if this is additive or multiplicative, currently it's implemented as multiplicative, but as I've shown, there is at least one case where a statistic should be calculated in additive way.

I dunno much about other classes so I'm counting on users' help. If there are more modifiers that should be additive then this should be implemented ASAP.

This patch consists of 2 parts:

1) the general implementation of the additive calc. sys.

2) patch for Shield Block Value which uses this calculating.

Update: i divided the patch in the first post.

Now I will show You an example of using the additive calculating next to multiplicative depending on the aura ID:

void Aura::HandleShieldBlockValue(bool apply, bool /*Real*/)//ppp
{
   BaseModType modType = FLAT_MOD;

   if(m_modifier.m_auraname == SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT)
   {
       switch(GetId())
       {
           case 2565:                   //Shield Block
               modType = PCT_ADD_MOD;
               break;
           case 29598:
           case 29599:                  //Shield Mastery
               modType = PCT_ADD_MOD;
               break;
           default:
               modType = PCT_MOD;
               break;
       }
   }

   if(m_target->GetTypeId() == TYPEID_PLAYER)
       ((Player*)m_target)->HandleBaseModValue(SHIELD_BLOCK_VALUE, modType, float(m_modifier.m_amount), apply);
}

As You can see it gives you full control over applying modifiers depending on ID of the auras.

Link to comment
Share on other sites

I found something similiar in Unit.cpp:

switch(modifierType)
   {
       case BASE_VALUE:
       case TOTAL_VALUE:
           m_auraModifiersGroup[unitMod][modifierType] += apply ? amount : -amount;
           break;
       case BASE_PCT:
       case TOTAL_PCT:
           if(amount <= -100.0f)                           //small hack-fix for -100% modifiers
               amount = -200.0f;

           val = (100.0f + amount) / 100.0f;
           m_auraModifiersGroup[unitMod][modifierType] *= apply ? val : (1.0f/val);
           break;

       default:
           break;
   }

It looks like BASE_PCT is what i call an additive percent modifier, and TOTAL_PCT is the multiplicative one. So it seems to me that this system is actually declared in MaNGOS but not defined (it's the same as multiplicative) and it is only for basic statistics' (strength, stamina etc.) calculations and not for shield block value.

Link to comment
Share on other sites

  • 2 months later...
Guest
This topic is now closed to further replies.
×
×
  • 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