Core/Spells: Implemented SUMMON_PROP_FLAG_PERSONAL_GROUP_SPAWN
Port From (https://github.com/TrinityCore/TrinityCore/commit/2398c1e23c57cf5b6ac778b09a09d28e2704fd75)
This commit is contained in:
@@ -1725,7 +1725,7 @@ namespace Framework.Constants
|
|||||||
Unk2 = 0x00000002, // 616 Spells In 3.0.3, Something Friendly
|
Unk2 = 0x00000002, // 616 Spells In 3.0.3, Something Friendly
|
||||||
Unk3 = 0x00000004, // 22 Spells In 3.0.3, No Idea...
|
Unk3 = 0x00000004, // 22 Spells In 3.0.3, No Idea...
|
||||||
Unk4 = 0x00000008, // 49 Spells In 3.0.3, Some Mounts
|
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
|
Unk6 = 0x00000020, // 0 Spells In 3.3.5, Unused
|
||||||
Unk7 = 0x00000040, // 12 Spells In 3.0.3, No Idea
|
Unk7 = 0x00000040, // 12 Spells In 3.0.3, No Idea
|
||||||
Unk8 = 0x00000080, // 4 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
|
Unk14 = 0x00002000, // Guides, Player Follows
|
||||||
Unk15 = 0x00004000, // Force Of Nature, Shadowfiend, Feral Spirit, Summon Water Elemental
|
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?
|
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,
|
Unk18 = 0x00020000,
|
||||||
Unk19 = 0x00040000,
|
Unk19 = 0x00040000,
|
||||||
Unk20 = 0x00080000,
|
Unk20 = 0x00080000,
|
||||||
|
|||||||
@@ -1113,6 +1113,11 @@ namespace Game.Entities
|
|||||||
if (_privateObjectOwner == seer.GetPrivateObjectOwner())
|
if (_privateObjectOwner == seer.GetPrivateObjectOwner())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
Player playerSeer = seer.ToPlayer();
|
||||||
|
if (playerSeer != null)
|
||||||
|
if (playerSeer.IsInGroup(_privateObjectOwner))
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
public void SetGroup(Group group, byte subgroup = 0)
|
||||||
{
|
{
|
||||||
if (!group)
|
if (!group)
|
||||||
|
|||||||
@@ -1595,9 +1595,16 @@ namespace Game.Spells
|
|||||||
if (m_originalCaster == null)
|
if (m_originalCaster == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ObjectGuid privateObjectOwner = ObjectGuid.Empty;
|
ObjectGuid privateObjectOwner = m_originalCaster.GetGUID();
|
||||||
if (properties.Flags.HasAnyFlag(SummonPropFlags.PersonalSpawn))
|
if (!properties.Flags.HasAnyFlag(SummonPropFlags.PersonalSpawn | SummonPropFlags.PersonalGroupSpawn))
|
||||||
privateObjectOwner = m_originalCaster.IsPrivateObject() ? m_originalCaster.GetPrivateObjectOwner() : m_originalCaster.GetGUID();
|
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);
|
int duration = m_spellInfo.CalcDuration(m_originalCaster);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user