Core/Spells: SpellAttr8 fixups - use creator instead of owner for SPELL_ATTR8_ONLY_TARGET_IF_SAME_CREATOR and removed cast time requirement for channelled spell predicted healing
Port From (https://github.com/TrinityCore/TrinityCore/commit/930a08fe03a033a6bb30fb8c94a8490c4b77fe91)
This commit is contained in:
@@ -4403,7 +4403,7 @@ namespace Game.Spells
|
||||
spellChannelStart.InterruptImmunities = interruptImmunities;
|
||||
}
|
||||
|
||||
if (m_spellInfo.HasAttribute(SpellAttr8.HealPrediction) && m_casttime != 0 && m_caster.IsUnit())
|
||||
if (m_spellInfo.HasAttribute(SpellAttr8.HealPrediction) && m_caster.IsUnit())
|
||||
{
|
||||
SpellTargetedHealPrediction healPrediction = new();
|
||||
if (unitCaster.m_unitData.ChannelObjects.Size() == 1 && unitCaster.m_unitData.ChannelObjects[0].IsUnit())
|
||||
|
||||
@@ -1006,8 +1006,19 @@ namespace Game.Spells
|
||||
Unit unitTarget = target.ToUnit();
|
||||
|
||||
if (HasAttribute(SpellAttr8.OnlyTargetIfSameCreator))
|
||||
if (caster != target && caster.GetGUID() != target.GetOwnerGUID())
|
||||
{
|
||||
ObjectGuid getCreatorOrSelf(WorldObject obj)
|
||||
{
|
||||
ObjectGuid creator = obj.GetCreatorGUID();
|
||||
if (creator.IsEmpty())
|
||||
creator = obj.GetGUID();
|
||||
|
||||
return creator;
|
||||
};
|
||||
|
||||
if (getCreatorOrSelf(caster) != getCreatorOrSelf(target))
|
||||
return SpellCastResult.BadTargets;
|
||||
}
|
||||
|
||||
// creature/player specific target checks
|
||||
if (unitTarget != null)
|
||||
@@ -4109,7 +4120,7 @@ namespace Game.Spells
|
||||
{
|
||||
public int MaxTargets; // The amount of targets after the damage decreases by the Square Root AOE formula
|
||||
public int NumNonDiminishedTargets; // The amount of targets that still take the full amount before the damage decreases by the Square Root AOE formula
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SpellEffectInfo
|
||||
|
||||
Reference in New Issue
Block a user