Jump to content

Recommended Posts

Posted

Hi,

I'm planning to do my first fix, so i would like to know your opinion. I want to start with this code:

// Devastate bonus and sunder armor refresh
           else if(m_spellInfo->SpellVisual[0] == 12295 && m_spellInfo->SpellIconID == 1508)
           {
               uint32 stack = 0;
               // Need refresh all Sunder Armor auras from this caster
               Unit::AuraMap& suAuras = unitTarget->GetAuras();
               SpellEntry const *spellInfo;
               for(Unit::AuraMap::iterator itr = suAuras.begin(); itr != suAuras.end(); ++itr)
               {
                   spellInfo = (*itr).second->GetSpellProto();
                   if( spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR &&
                       (spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000)) &&
                       (*itr).second->GetCasterGUID() == m_caster->GetGUID())
                   {
                       (*itr).second->RefreshAura();
                       stack = (*itr).second->GetStackAmount();
                       break;
                   }
               }
               if (stack)
                   spell_bonus += stack * CalculateDamage(2, unitTarget);
               if (!stack || stack < spellInfo->StackAmount)
                   // Devastate causing Sunder Armor Effect
                   // and no need to cast over max stack amount
                   m_caster->CastSpell(unitTarget, 58567, true);
+                 float threat = 354;
+                 unitTarget->addThreat(threat);
           }
           break;

i know, it's hacked, because it's hardcoded and also i know, that real threat is 345+5% of ap for first stack of sunder armor and 5% of ap for other stacks. But this is first try, and i don't know, where to apply addThreat() function for correct usage. Thanks for comments.

×
×
  • 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