Advertisement
hitplusone

Deep Wounds

Jun 24th, 2011
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.25 KB | None | 0 0
  1. src\server\game\Spells\SpellEffects.cpp
  2.  
  3. case 12162: // Deep wounds
  4.                 case 12850: // (now good common check for this spells)
  5.                 case 12868:
  6.                 {
  7.                     if (!unitTarget)
  8.                         return;
  9.  
  10.                     float damage;
  11.                     // DW should benefit of attack power, damage percent mods etc.
  12.                     // TODO: check if using offhand damage is correct and if it should be divided by 2
  13.                     if (m_caster->haveOffhandWeapon() && m_caster->getAttackTimer(BASE_ATTACK) > m_caster->getAttackTimer(OFF_ATTACK))
  14.                         damage = (m_caster->GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE))/2;
  15.                     else
  16.                         damage = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE))/2;
  17.  
  18.                     switch (m_spellInfo->Id)
  19.                     {
  20.                         case 12162: damage *= 0.16f; break; // Rank 1
  21.                         case 12850: damage *= 0.32f; break; // Rank 2
  22.                         case 12868: damage *= 0.48f; break; // Rank 3
  23.                         default:
  24.                             sLog->outError("Spell::EffectDummy: Spell %u not handled in DW", m_spellInfo->Id);
  25.                             return;
  26.                     };
  27.  
  28.                     // get remaining damage of old Deep Wound aura
  29.                     AuraEffect* deepWound = unitTarget->GetAuraEffect(12721, 0, m_caster->GetGUID());
  30.                     if (deepWound)
  31.                     {
  32.      ++NORMAL                   int32 remainingTicks =deepWound->GetBase()->GetDuration() / deepWound->GetAmplitude();
  33.      --MAXI DPS LIKE REVOL      //int32 remainingTicks = ceil(float(deepWound->GetBase()->GetDuration()) / float(deepWound->GetAmplitude()));
  34.                         damage += remainingTicks * deepWound->GetAmount();
  35.                     }
  36.  
  37.                     // 1 tick/sec * 6 sec = 6 ticks
  38.                     int32 deepWoundsDotBasePoints0 = int32(damage / 6);
  39.                     m_caster->CastCustomSpell(unitTarget, 12721, &deepWoundsDotBasePoints0, NULL, NULL, true, NULL);
  40.                     return;
  41.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement