diff --git a/Source/Framework/Constants/CliDBConst.cs b/Source/Framework/Constants/CliDBConst.cs index 73e8ee0db..5d20e294b 100644 --- a/Source/Framework/Constants/CliDBConst.cs +++ b/Source/Framework/Constants/CliDBConst.cs @@ -1725,7 +1725,7 @@ namespace Framework.Constants Unk2 = 0x00000002, // 616 Spells In 3.0.3, Something Friendly Unk3 = 0x00000004, // 22 Spells In 3.0.3, No Idea... Unk4 = 0x00000008, // 49 Spells In 3.0.3, Some Mounts - PersonalSpawn = 0x00000010, // Personal Spawn (Creature Visible Only By Summoner) + PersonalSpawn = 0x00000010, // Only Visible to Summoner Unk6 = 0x00000020, // 0 Spells In 3.3.5, Unused Unk7 = 0x00000040, // 12 Spells In 3.0.3, No Idea Unk8 = 0x00000080, // 4 Spells In 3.0.3, No Idea @@ -1737,7 +1737,7 @@ namespace Framework.Constants Unk14 = 0x00002000, // Guides, Player Follows Unk15 = 0x00004000, // Force Of Nature, Shadowfiend, Feral Spirit, Summon Water Elemental Unk16 = 0x00008000, // Light/Dark Bullet, Soul/Fiery Consumption, Twisted Visage, Twilight Whelp. Phase Related? - Unk17 = 0x00010000, + PersonalGroupSpawn = 0x00010000, // Only Visible to Summoner's Group Unk18 = 0x00020000, Unk19 = 0x00040000, Unk20 = 0x00080000, diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index 306f64365..bfd3a7b77 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -1113,6 +1113,11 @@ namespace Game.Entities if (_privateObjectOwner == seer.GetPrivateObjectOwner()) return true; + Player playerSeer = seer.ToPlayer(); + if (playerSeer != null) + if (playerSeer.IsInGroup(_privateObjectOwner)) + return true; + return false; } diff --git a/Source/Game/Entities/Player/Player.Groups.cs b/Source/Game/Entities/Player/Player.Groups.cs index e297eae37..7082d8947 100644 --- a/Source/Game/Entities/Player/Player.Groups.cs +++ b/Source/Game/Entities/Player/Player.Groups.cs @@ -149,6 +149,21 @@ namespace Game.Entities } } + public bool IsInGroup(ObjectGuid groupGuid) + { + Group group = GetGroup(); + if (group != null) + if (group.GetGUID() == groupGuid) + return true; + + Group originalGroup = GetOriginalGroup(); + if (originalGroup != null) + if (originalGroup.GetGUID() == groupGuid) + return true; + + return false; + } + public void SetGroup(Group group, byte subgroup = 0) { if (!group) diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index d19222b74..7a00667d4 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -1595,9 +1595,16 @@ namespace Game.Spells if (m_originalCaster == null) return; - ObjectGuid privateObjectOwner = ObjectGuid.Empty; - if (properties.Flags.HasAnyFlag(SummonPropFlags.PersonalSpawn)) - privateObjectOwner = m_originalCaster.IsPrivateObject() ? m_originalCaster.GetPrivateObjectOwner() : m_originalCaster.GetGUID(); + ObjectGuid privateObjectOwner = m_originalCaster.GetGUID(); + if (!properties.Flags.HasAnyFlag(SummonPropFlags.PersonalSpawn | SummonPropFlags.PersonalGroupSpawn)) + privateObjectOwner = ObjectGuid.Empty; + + if (m_originalCaster.IsPrivateObject()) + privateObjectOwner = m_originalCaster.GetPrivateObjectOwner(); + + if (properties.Flags.HasAnyFlag(SummonPropFlags.PersonalGroupSpawn)) + if (m_originalCaster.IsPlayer() && m_originalCaster.ToPlayer().GetGroup()) + privateObjectOwner = m_originalCaster.ToPlayer().GetGroup().GetGUID(); int duration = m_spellInfo.CalcDuration(m_originalCaster);