Jump to content

[bug][7200]Hammer of the Righteous

Guest plopy

Recommended Posts

  • 11 months later...

Hammer of the Righteous

6% of base mana Melee Range

Instant cast 6 sec cooldown

Requires One-Handed Melee Weapon

Hammer the current target and up to 2 additional nearby targets, causing 4 times your main hand damage per second as Holy damage.

else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0004000000000000))
                   // Add main hand dps * effect[2] amount
                   float average = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2;
                   int32 count = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget);
                   damage += count * int32(average * IN_MILISECONDS) / m_caster->GetAttackTime(BASE_ATTACK);

Can anyone please explain to me in detail what is "count" variable, and what is it used for in this formula?

Because I can not reproduce the damage I do on retail server using 100% exact parameters such as gear, enchants, buffs and talent spec. I'm trying to determine if spellpower is included in damage calculations, because it absolutely shouldn't be, according to tests on retail.

Link to comment
Share on other sites

Count is some number between 7 and 10 or through some strange calculation its a number around 17.


    int32 level = int32(getLevel());
   if (level > (int32)spellProto->maxLevel && spellProto->maxLevel > 0)
       level = (int32)spellProto->maxLevel;
   else if (level < (int32)spellProto->baseLevel)
       level = (int32)spellProto->baseLevel;
   level-= (int32)spellProto->spellLevel;

   float basePointsPerLevel = spellProto->EffectRealPointsPerLevel[effect_index];
   float randomPointsPerLevel = spellProto->EffectDicePerLevel[effect_index];
   int32 basePoints = int32(effBasePoints + level * basePointsPerLevel);
   int32 randomPoints = int32(spellProto->EffectDieSides[effect_index] + level * randomPointsPerLevel);
   float comboDamage = spellProto->EffectPointsPerComboPoint[effect_index];

   // range can have possitive and negative values, so order its for irand
   int32 randvalue = int32(spellProto->EffectBaseDice[effect_index]) >= randomPoints
       ? irand(randomPoints, int32(spellProto->EffectBaseDice[effect_index]))
       : irand(int32(spellProto->EffectBaseDice[effect_index]), randomPoints);

   int32 value = basePoints + randvalue;

This is the formula used to generate the 7 to 10.


    if(spellProto->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION && spellProto->spellLevel &&
           spellProto->Effect[effect_index] != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE &&
           spellProto->Effect[effect_index] != SPELL_EFFECT_KNOCK_BACK &&
           (spellProto->Effect[effect_index] != SPELL_EFFECT_APPLY_AURA || spellProto->EffectApplyAuraName[effect_index] != SPELL_AURA_MOD_DECREASE_SPEED))
       value = int32(value*0.25f*exp(getLevel()*(70-spellProto->spellLevel)/1000.0f));

The above would generate the 17.

Link to comment
Share on other sites

int32 count = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget);

All I am asking is what is this line supposed to do.

Since spell is pretty clear: 4x main hand average dps (the rest of formula is good).

Why is random number between 7 and 10 being generated (or 17 in this case as u said)?

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