mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +00:00
fix(Core/Spells): Improved Drain Soul triggering from every target … (#8144)
...that dies and not just the one affected by Drain Soul and move the Drain Soul code to spell scripts - TC Ports:d9743c984f (diff-ea612aafadff90005e88b243eb000369be9e5cb6f8dc85a008d31e42b156e0ec)and2b1b36f561 (diff-ea612aafadff90005e88b243eb000369be9e5cb6f8dc85a008d31e42b156e0ec)
This commit is contained in:
@@ -8409,28 +8409,8 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
break;
|
||||
case SPELLFAMILY_WARLOCK:
|
||||
{
|
||||
// Drain Soul
|
||||
if (auraSpellInfo->SpellFamilyFlags[0] & 0x4000)
|
||||
{
|
||||
// Improved Drain Soul
|
||||
Unit::AuraEffectList const& mAddFlatModifier = GetAuraEffectsByType(SPELL_AURA_DUMMY);
|
||||
for (Unit::AuraEffectList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetMiscValue() == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellInfo()->SpellIconID == 113)
|
||||
{
|
||||
int32 value2 = CalculateSpellDamage(this, (*i)->GetSpellInfo(), 2);
|
||||
basepoints0 = int32(CalculatePct(GetMaxPower(POWER_MANA), value2));
|
||||
// Drain Soul
|
||||
CastCustomSpell(this, 18371, &basepoints0, nullptr, nullptr, true, castItem, triggeredByAura);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Not remove charge (aura removed on death in any cases)
|
||||
// Need for correct work Drain Soul SPELL_AURA_CHANNEL_DEATH_ITEM aura
|
||||
return false;
|
||||
}
|
||||
// Nether Protection
|
||||
else if (auraSpellInfo->SpellIconID == 1985)
|
||||
if (auraSpellInfo->SpellIconID == 1985)
|
||||
{
|
||||
if (!procSpell)
|
||||
return false;
|
||||
|
||||
@@ -5431,7 +5431,6 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mod
|
||||
return;
|
||||
|
||||
Player* plCaster = caster->ToPlayer();
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
// Item amount
|
||||
if (GetAmount() <= 0)
|
||||
@@ -5440,24 +5439,6 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mod
|
||||
if (GetSpellInfo()->Effects[m_effIndex].ItemType == 0)
|
||||
return;
|
||||
|
||||
// Soul Shard
|
||||
if (GetSpellInfo()->Effects[m_effIndex].ItemType == 6265)
|
||||
{
|
||||
// Soul Shard only from units that grant XP or honor
|
||||
if (!plCaster->isHonorOrXPTarget(target) ||
|
||||
(target->GetTypeId() == TYPEID_UNIT && !target->ToCreature()->isTappedBy(plCaster)))
|
||||
return;
|
||||
|
||||
// If this is Drain Soul, check for Glyph of Drain Soul
|
||||
if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000))
|
||||
{
|
||||
// Glyph of Drain Soul - chance to create an additional Soul Shard
|
||||
if (AuraEffect* aur = caster->GetAuraEffect(58070, 0))
|
||||
if (roll_chance_i(aur->GetMiscValue()))
|
||||
caster->CastSpell(caster, 58068, true, 0, aur); // We _could_ simply do ++count here, but Blizz does it this way :)
|
||||
}
|
||||
}
|
||||
|
||||
//Adding items
|
||||
uint32 noSpaceForCount = 0;
|
||||
uint32 count = m_amount;
|
||||
@@ -6308,21 +6289,6 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
|
||||
damage += (damage + 1) / 2; // +1 prevent 0.5 damage possible lost at 1..4 ticks
|
||||
// 5..8 ticks have normal tick damage
|
||||
}
|
||||
// There is a Chance to make a Soul Shard when Drain soul does damage
|
||||
if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000))
|
||||
{
|
||||
if (caster && caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->isHonorOrXPTarget(target))
|
||||
{
|
||||
if (roll_chance_i(20))
|
||||
{
|
||||
caster->CastSpell(caster, 43836, true, 0, this);
|
||||
// Glyph of Drain Soul - chance to create an additional Soul Shard
|
||||
if (AuraEffect* aur = caster->GetAuraEffect(58070, 0))
|
||||
if (roll_chance_i(aur->GetMiscValue()))
|
||||
caster->CastSpell(caster, 58068, true, 0, aur);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else // xinef: ceil obtained value, it may happen that 10 ticks for 10% damage may not kill owner
|
||||
damage = uint32(ceil(CalculatePct<float, float>(target->GetMaxHealth(), damage)));
|
||||
|
||||
Reference in New Issue
Block a user