Core/Spells: reverted proc behaivior for pets and fixed applying spell mods for hunter pets and minions

This commit is contained in:
Ovahlord committed 2019-12-09 16:10:54 +01:00
1 parent cbaa290b0b
commit abb62cc76f
4 files changed
+8 -23

No files matched your search

+2 -1
View File
@@ -10932,12 +10932,13 @@ Player* Unit::GetSpellModOwner() const
if (Player* player = const_cast<Unit*>(this)->ToPlayer())
return player;
if (HasUnitTypeMask(UNIT_MASK_PET | UNIT_MASK_TOTEM | UNIT_MASK_GUARDIAN))
if (HasUnitTypeMask(UNIT_MASK_PET | UNIT_MASK_TOTEM | UNIT_MASK_GUARDIAN | UNIT_MASK_HUNTER_PET | UNIT_MASK_MINION))
{
if (Unit* owner = GetOwner())
if (Player* player = owner->ToPlayer())
return player;
}
return nullptr;
}
@@ -1827,10 +1827,6 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event
// so talents modifying chances and judgements will have properly calculated proc chance
if (Unit* caster = GetCaster())
{
// Pets, Minions etc. inherit their proc chance values from their owner
if (caster->IsCreature() && caster->GetOwner())
caster = GetCaster()->GetOwner();
// calculate ppm chance if present and we're using weapon
if (eventInfo.GetDamageInfo() && procEntry.ProcsPerMinute != 0)
{
-18
View File
@@ -2522,13 +2522,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
// Do triggers for unit
if (canEffectTrigger)
{
// Controlled units should trigger procs for their owner as well
if (Unit* owner = caster->GetOwner())
owner->ProcSkillsAndAuras(unitTarget, procAttacker, procVictim, PROC_SPELL_TYPE_HEAL, PROC_SPELL_PHASE_HIT, hitMask, this, nullptr, &healInfo);
caster->ProcSkillsAndAuras(unitTarget, procAttacker, procVictim, PROC_SPELL_TYPE_HEAL, PROC_SPELL_PHASE_HIT, hitMask, this, nullptr, &healInfo);
}
}
// Do damage and triggers
else if (m_damage > 0)
@@ -2578,10 +2572,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
DamageInfo spellDamageInfo(damageInfo, SPELL_DIRECT_DAMAGE, m_attackType, hitMask);
caster->ProcSkillsAndAuras(unitTarget, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_HIT, hitMask, this, &spellDamageInfo, nullptr);
// Controlled units should trigger procs for their owner as well
if (Unit* owner = caster->GetOwner())
owner->ProcSkillsAndAuras(unitTarget, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_HIT, hitMask, this, &spellDamageInfo, nullptr);
if (caster->GetTypeId() == TYPEID_PLAYER && !m_spellInfo->HasAttribute(SPELL_ATTR0_STOP_ATTACK_TARGET) && !m_spellInfo->HasAttribute(SPELL_ATTR4_CANT_TRIGGER_ITEM_SPELLS) &&
(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED))
caster->ToPlayer()->CastItemCombatSpell(spellDamageInfo);
@@ -2599,10 +2589,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
DamageInfo spellNoDamageInfo(damageInfo, NODAMAGE, m_attackType, hitMask);
caster->ProcSkillsAndAuras(unitTarget, procAttacker, procVictim, PROC_SPELL_TYPE_NO_DMG_HEAL, PROC_SPELL_PHASE_HIT, hitMask, this, &spellNoDamageInfo, nullptr);
// Controlled units should trigger procs for their owner as well
if (Unit* owner = caster->GetOwner())
owner->ProcSkillsAndAuras(unitTarget, procAttacker, procVictim, PROC_SPELL_TYPE_NO_DMG_HEAL, PROC_SPELL_PHASE_HIT, hitMask, this, &spellNoDamageInfo, nullptr);
if (caster->GetTypeId() == TYPEID_PLAYER && !m_spellInfo->HasAttribute(SPELL_ATTR0_STOP_ATTACK_TARGET) && !m_spellInfo->HasAttribute(SPELL_ATTR4_CANT_TRIGGER_ITEM_SPELLS) &&
(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED))
caster->ToPlayer()->CastItemCombatSpell(spellNoDamageInfo);
@@ -3564,10 +3550,6 @@ void Spell::_cast(bool skipCheck)
m_originalCaster->ProcSkillsAndAuras(nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_CAST, hitMask, this, nullptr, nullptr);
// Controlled units should trigger procs for their owner as well
if (Unit* owner = m_originalCaster->GetOwner())
owner->ProcSkillsAndAuras(nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_CAST, hitMask, this, nullptr, nullptr);
// Call CreatureAI hook OnSuccessfulSpellCast
if (Creature* caster = m_originalCaster->ToCreature())
if (caster->IsAIEnabled)
+6
View File
@@ -5617,6 +5617,12 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY;
});
// Tamed Pet Passive 07 (DND)
ApplySpellFix({ 20784 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE;
});
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
{
SpellInfo* spellInfo = mSpellInfoMap[i];