Core/Spells: Expose number of targets selected for each spell effect to scripts to allow implementing spells that do something depending on number of targets hit

Port From (https://github.com/TrinityCore/TrinityCore/commit/1a7779a6e6464d9bc5b367e02820213edd60f704)
This commit is contained in:
hondacrx
2021-05-13 20:35:45 -04:00
parent 031cde7cb2
commit 1509cdfded
3 changed files with 61 additions and 7 deletions
+2 -2
View File
@@ -153,11 +153,11 @@ namespace Game.Spells
// Meteor like spells (divided damage to targets)
if (m_spellInfo.HasAttribute(SpellCustomAttributes.ShareDamage))
{
int count = m_UniqueTargetInfo.Count(targetInfo => Convert.ToBoolean(targetInfo.effectMask & (1 << (int)effIndex)));
long count = GetUnitTargetCountForEffect(effIndex);
// divide to all targets
if (count != 0)
damage /= count;
damage /= (int)count;
}
switch (m_spellInfo.SpellFamilyName)