Jump to content

DamageBonusDone vs DamageBonusTaken


bdebaere

Recommended Posts

Hello everyone,

Me again. I haven't slept right these last couple of weeks so I'll use that as an excuse as to why I'm not getting this. I currently have the release 20 running but am downloading develop 21. I checked and the little bit of code hasn't changed.

I have been messing around with Spell.dbc to create an aura that reduces all damage taken by x% (aura: 87) and increases all damage done by y% (aura: 79). Aura 87 works, aura 79 however does not. My character still does the same amount of damage. Right here is the code that deals with aura 79 in function SpellDamageBonusDone():

AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
   for (AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
   {
       if (((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto)) &&
           (*i)->GetSpellProto()->EquippedItemClass == -1 &&
           // -1 == any item class (not wand then)
           (*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0)
           // 0 == any inventory type (not wand then)
       {
           DoneTotalMod *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
       }
   }

Now if you compare the code above to the code below. This is the one line that deals with aura 87 in function SpellDamageBonusTaken(). Just one.

TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, schoolMask);

When I remove the requirements on the aura 79 function, I get the desired result (almost, Retribution Aura for example, still deals normal damage). So it can't be faulty dbc editing, I assume.

Can someone explain to me why these are very different? And more importantly, why it's not working (for me). There's probably some reason but I can't seem to figure it out.

bdebaere

Link to comment
Share on other sites

Compare the two method calls:

GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE)  // your 1st example patch
GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, schoolMask) // your 2nd example patch

For any damage increase/vulnerability, the damage type should be specified: melee, spell (spellschool). See enum SpellSchoolMask in SharedDefines.h. The 2nd method filters the type getting desired one by the parameter. The 1st gives the full list of such auras, which are filtered further by 1) damage school and 2) some additional conditions for the cases like "increase specific item class damage done".

You've probably failed in defining the new spell. If you did not define EffectMiscValue for your spelleffect with aura SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, as well as fields for item types as -1, the filter mentioned will prevent the effect.

Note also that the correct way of adding spell is the table spell_dbc, not implemented yet in Mangos (but see TC). Changes for existing spells may be introduced within SpellMgr::ModDBCSpellAttributes(). Such changes should be also kept in the DB table, which is NYI it the TC also.

Link to comment
Share on other sites

Archived

This topic is now archived and is 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