Pelf

Pelf_drain_soul_siphon_1 patch

Mar 5th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.21 KB | None | 0 0
  1. diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
  2. index defacf3..98058a7 100644
  3. --- a/src/server/game/Entities/Unit/Unit.cpp
  4. +++ b/src/server/game/Entities/Unit/Unit.cpp
  5. @@ -4248,6 +4248,20 @@ uint32 Unit::GetAuraCount(uint32 spellId) const
  6.      return count;
  7.  }
  8.  
  9. +void Unit::GetAllAuras(AuraList &auralist)
  10. +{
  11. +   auralist.clear();
  12. +   if (m_appliedAuras.empty())
  13. +       return;
  14. +
  15. +   for (AuraApplicationMap::iterator itr = m_appliedAuras.begin(); itr != m_appliedAuras.end(); ++itr)
  16. +   {
  17. +       if (AuraApplication* aurApp = itr->second)
  18. +           if (Aura* aura = aurApp->GetBase())
  19. +               auralist.push_back(aura);
  20. +   }        
  21. +};
  22. +
  23.  bool Unit::HasAura(uint32 spellId, uint64 casterGUID, uint64 itemCasterGUID, uint8 reqEffMask) const
  24.  {
  25.      if (GetAuraApplication(spellId, casterGUID, itemCasterGUID, reqEffMask))
  26. diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
  27. index d25ad71..c19e835 100644
  28. --- a/src/server/game/Entities/Unit/Unit.h
  29. +++ b/src/server/game/Entities/Unit/Unit.h
  30. @@ -1665,7 +1665,8 @@ class Unit : public WorldObject
  31.  
  32.          bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster = 0) const;
  33.          uint32 GetAuraCount(uint32 spellId) const;
  34. -        bool HasAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
  35. +       void GetAllAuras(AuraList &auralist);
  36. +       bool HasAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
  37.          bool HasAuraType(AuraType auraType) const;
  38.          bool HasAuraTypeWithCaster(AuraType auratype, uint64 caster) const;
  39.          bool HasAuraTypeWithMiscvalue(AuraType auratype, int32 miscvalue) const;
  40. diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
  41. index c3e3ac9..95d5f38 100644
  42. --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
  43. +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
  44.  
  45. @@ -1476,9 +1477,55 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
  46.                 if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags[0] & 0x00004000))
  47.                  {
  48.                      if (caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->isHonorOrXPTarget(target))
  49. +               if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK)
  50. +               {
  51. +                   switch(GetId())
  52. +                   {
  53. +                   case 1120: // Drain Soul
  54. +                       if (target->GetHealthPct() < 25)
  55. +                           damage *= 2;
  56. +                   case 689: // Drain Life
  57. +                   case 89420: //Drain Life
  58. +                       if (caster->HasAura(17804) || // soul siphon rank 1
  59. +                           caster->HasAura(17805))   // soul siphon rank 2
  60. +                       {
  61. +                           Unit::AuraList _auras;
  62. +                           uint8 count = 0;
  63. +                           target->GetAllAuras(_auras);
  64. +                           if (!_auras.empty())
  65. +                           {
  66. +                               // для каждого спелла от ауры из списка находим
  67. +                               // его в sSkillLineAbilityStore
  68. +                               // если найден
  69. +                               // и если спелл принадлежит кастеру,
  70. +                               // и если спелл не сам drain soul
  71. +                               // и если скиллид равен 355 (колдовство)
  72. +                               // счетчик++
  73. +                               for (Unit::AuraList::iterator itr = _auras.begin(); itr != _auras.end(); ++itr)
  74. +                                   for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
  75. +                                   {
  76. +                                       if (SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j))
  77. +                                           if ((*itr)->GetSpellProto()->Id == skillLine->spellId &&
  78. +                                               (*itr)->GetCaster()->GetGUID() == caster->GetGUID() &&
  79. +                                               (*itr)->GetSpellProto()->Id != GetSpellProto()->Id &&
  80. +                                               skillLine->skillId == 355)
  81. +                                               count++;
  82. +                                       break;
  83. +                                   }
  84. +
  85. +                           }
  86. +                           if (count > 3)
  87. +                               count = 3;
  88. +
  89. +                           if (caster->HasAura(17804))
  90. +                               damage += (damage*0.03)*count;
  91. +                           else if (caster->HasAura(17805))
  92. +                               damage += (damage*0.06)*count;
  93. +                       }
  94. +                       break;
  95. +                   }
  96. +               }
  97.                  if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_GENERIC)
  98.                  {
  99.                      switch (GetId())
Advertisement
Add Comment
Please, Sign In to add comment