Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
- index defacf3..98058a7 100644
- --- a/src/server/game/Entities/Unit/Unit.cpp
- +++ b/src/server/game/Entities/Unit/Unit.cpp
- @@ -4248,6 +4248,20 @@ uint32 Unit::GetAuraCount(uint32 spellId) const
- return count;
- }
- +void Unit::GetAllAuras(AuraList &auralist)
- +{
- + auralist.clear();
- + if (m_appliedAuras.empty())
- + return;
- +
- + for (AuraApplicationMap::iterator itr = m_appliedAuras.begin(); itr != m_appliedAuras.end(); ++itr)
- + {
- + if (AuraApplication* aurApp = itr->second)
- + if (Aura* aura = aurApp->GetBase())
- + auralist.push_back(aura);
- + }
- +};
- +
- bool Unit::HasAura(uint32 spellId, uint64 casterGUID, uint64 itemCasterGUID, uint8 reqEffMask) const
- {
- if (GetAuraApplication(spellId, casterGUID, itemCasterGUID, reqEffMask))
- diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
- index d25ad71..c19e835 100644
- --- a/src/server/game/Entities/Unit/Unit.h
- +++ b/src/server/game/Entities/Unit/Unit.h
- @@ -1665,7 +1665,8 @@ class Unit : public WorldObject
- bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster = 0) const;
- uint32 GetAuraCount(uint32 spellId) const;
- - bool HasAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
- + void GetAllAuras(AuraList &auralist);
- + bool HasAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
- bool HasAuraType(AuraType auraType) const;
- bool HasAuraTypeWithCaster(AuraType auratype, uint64 caster) const;
- bool HasAuraTypeWithMiscvalue(AuraType auratype, int32 miscvalue) const;
- diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- index c3e3ac9..95d5f38 100644
- --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- @@ -1476,9 +1477,55 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
- if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags[0] & 0x00004000))
- {
- if (caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->isHonorOrXPTarget(target))
- + if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK)
- + {
- + switch(GetId())
- + {
- + case 1120: // Drain Soul
- + if (target->GetHealthPct() < 25)
- + damage *= 2;
- + case 689: // Drain Life
- + case 89420: //Drain Life
- + if (caster->HasAura(17804) || // soul siphon rank 1
- + caster->HasAura(17805)) // soul siphon rank 2
- + {
- + Unit::AuraList _auras;
- + uint8 count = 0;
- + target->GetAllAuras(_auras);
- + if (!_auras.empty())
- + {
- + // для каждого спелла от ауры из списка находим
- + // его в sSkillLineAbilityStore
- + // если найден
- + // и если спелл принадлежит кастеру,
- + // и если спелл не сам drain soul
- + // и если скиллид равен 355 (колдовство)
- + // счетчик++
- + for (Unit::AuraList::iterator itr = _auras.begin(); itr != _auras.end(); ++itr)
- + for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
- + {
- + if (SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j))
- + if ((*itr)->GetSpellProto()->Id == skillLine->spellId &&
- + (*itr)->GetCaster()->GetGUID() == caster->GetGUID() &&
- + (*itr)->GetSpellProto()->Id != GetSpellProto()->Id &&
- + skillLine->skillId == 355)
- + count++;
- + break;
- + }
- +
- + }
- + if (count > 3)
- + count = 3;
- +
- + if (caster->HasAura(17804))
- + damage += (damage*0.03)*count;
- + else if (caster->HasAura(17805))
- + damage += (damage*0.06)*count;
- + }
- + break;
- + }
- + }
- if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_GENERIC)
- {
- switch (GetId())
Advertisement
Add Comment
Please, Sign In to add comment