Guest User

Untitled

a guest
May 27th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.48 KB | None | 0 0
  1.             case SPELLFAMILY_ROGUE:
  2.             {
  3.          
  4.                  // Dėl šitos sąlygos palužta:
  5.                   if(m_CastItem->GetTypeId() == TYPEID_ITEM)
  6.      
  7.                 // Envenom
  8.                 if (m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x800000000)))
  9.                 {
  10.                    
  11.                    
  12.                     // consume from stack dozes not more that have combo-points
  13.                     if(uint32 combo = ((Player*)m_caster)->GetComboPoints())
  14.                     {
  15.                        
  16.                         Aura *poison = 0;
  17.                         // Lookup for Deadly poison (only attacker applied)
  18.                         Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
  19.                         for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
  20.                         {
  21.                             // Deadly poison (only attacker applied)
  22.                             if ((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE && ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x10000)) &&
  23.                                 (*itr)->GetSpellProto()->SpellVisual==5100 && (*itr)->GetCasterGuid() == m_caster->GetObjectGuid())
  24.                             {
  25.                                
  26.                                 poison = *itr;
  27.                                 break;
  28.                             }
  29.                         }
  30.                         // count consumed deadly poison doses at target
  31.                         if (poison)
  32.                         {
  33.                             uint32 spellId = poison->GetId();
  34.                             uint32 doses = poison->GetStackAmount();
  35.                             if (doses > combo)
  36.                                 doses = combo;
  37.  
  38.                             unitTarget->RemoveAuraHolderFromStack(spellId, doses, m_caster->GetObjectGuid());
  39.  
  40.                             damage *= doses;
  41.                             damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.03f * doses);
  42.                         }
  43.                         // Eviscerate and Envenom Bonus Damage (item set effect)
  44.                         if (m_caster->GetDummyAura(37169))
  45.                             damage += ((Player*)m_caster)->GetComboPoints()*40;
  46.                     }
  47.                 }
  48.                 // Eviscerate
  49.                 else if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x00020000)) && m_caster->GetTypeId()==TYPEID_PLAYER)
  50.                 {
  51.                     if(uint32 combo = ((Player*)m_caster)->GetComboPoints())
  52.                     {
  53.                         damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * combo * 0.03f);
  54.  
  55.                         // Eviscerate and Envenom Bonus Damage (item set effect)
  56.                         if(m_caster->GetDummyAura(37169))
  57.                             damage += combo*40;
  58.                     }
  59.                 }
  60.                 break;
  61.             }
  62.             case SPELLFAMILY_HUNTER:
  63.             {
  64.                 // Steady Shot
  65.                 if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x100000000))
  66.                 {
  67.                     int32 base = irand((int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MINDAMAGE),(int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MAXDAMAGE));
  68.                     damage += int32(float(base)/m_caster->GetAttackTime(RANGED_ATTACK)*2800 + m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.2f);
  69.                 }
  70.                 break;
  71.             }
Add Comment
Please, Sign In to add comment