aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorMeji <alvaromegias_46@hotmail.com>2021-11-16 11:51:05 +0100
committerGitHub <noreply@github.com>2021-11-16 11:51:05 +0100
commita832435b9787c1997da87a124ff99bf06251aa07 (patch)
treece0f6a516b0e3d9f36ab5b567d8e7575e83256d6 /src/server/game/Spells/SpellEffects.cpp
parent9451f8058384fc98725018ba50732c62710078c0 (diff)
Core/Spells: Implemented SummonPropertiesFlags: UseSummonerFaction & IgnoreSummonerPhase (#27273)
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 1cee345fbff..ecb748be23e 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -1922,13 +1922,13 @@ void Spell::EffectSummonType()
ObjectGuid privateObjectOwner = [&]()
{
- if (!(properties->Flags & (SUMMON_PROP_FLAG_PERSONAL_SPAWN | SUMMON_PROP_FLAG_PERSONAL_GROUP_SPAWN)))
+ if (!(properties->GetFlags().HasFlag(SummonPropertiesFlags::OnlyVisibleToSummoner | SummonPropertiesFlags::OnlyVisibleToSummonerGroup)))
return ObjectGuid::Empty;
if (caster->IsPrivateObject())
return caster->GetPrivateObjectOwner();
- if (properties->Flags & SUMMON_PROP_FLAG_PERSONAL_GROUP_SPAWN)
+ if (properties->GetFlags().HasFlag(SummonPropertiesFlags::OnlyVisibleToSummonerGroup))
if (caster->IsPlayer() && m_originalCaster->ToPlayer()->GetGroup())
return caster->ToPlayer()->GetGroup()->GetGUID();
@@ -1976,7 +1976,7 @@ void Spell::EffectSummonType()
case SUMMON_CATEGORY_ALLY:
case SUMMON_CATEGORY_UNK:
{
- if (properties->Flags & 512)
+ if (properties->GetFlags().HasFlag(SummonPropertiesFlags::JoinSummonerSpawnGroup))
{
SummonGuardian(effectInfo, entry, properties, numSummons, privateObjectOwner);
break;
@@ -2054,10 +2054,15 @@ void Spell::EffectSummonType()
continue;
if (properties->Control == SUMMON_CATEGORY_ALLY)
- {
summon->SetOwnerGUID(caster->GetGUID());
- summon->SetFaction(caster->GetFaction());
- }
+
+ uint32 faction = properties->Faction;
+ if (properties->GetFlags().HasFlag(SummonPropertiesFlags::UseSummonerFaction)) // TODO: Determine priority between faction and flag
+ if (Unit* summoner = summon->GetSummoner())
+ faction = summoner->GetFaction();
+
+ if (faction)
+ summon->SetFaction(faction);
ExecuteLogEffectSummonObject(SpellEffectName(effectInfo->Effect), summon);
}
@@ -2106,12 +2111,6 @@ void Spell::EffectSummonType()
args.AddSpellMod(SPELLVALUE_BASE_POINT0, basePoints);
unitCaster->CastSpell(summon, spellId, args);
-
- uint32 faction = properties->Faction;
- if (!faction)
- faction = unitCaster->GetFaction();
-
- summon->SetFaction(faction);
break;
}
}
@@ -5134,9 +5133,6 @@ void Spell::SummonGuardian(SpellEffectInfo const* effect, uint32 entry, SummonPr
if (summon->HasUnitTypeMask(UNIT_MASK_GUARDIAN))
((Guardian*)summon)->InitStatsForLevel(level);
- if (properties && properties->Control == SUMMON_CATEGORY_ALLY)
- summon->SetFaction(unitCaster->GetFaction());
-
if (summon->HasUnitTypeMask(UNIT_MASK_MINION) && m_targets.HasDst())
((Minion*)summon)->SetFollowAngle(unitCaster->GetAbsoluteAngle(summon));