Core/Spells: Implemented SUMMON_PROP_FLAG_PERSONAL_GROUP_SPAWN

This commit is contained in:
Shauren authored and Ovahlord committed 2021-03-29 20:56:00 +02:00
1 parent ddb50c2e3d
commit 0f02c6a699
5 files changed
+34 -5

No files matched your search

+2 -2
View File
@@ -605,7 +605,7 @@ enum SummonPropFlags
SUMMON_PROP_FLAG_UNK2 = 0x00000002, // 616 spells in 3.0.3, something friendly
SUMMON_PROP_FLAG_UNK3 = 0x00000004, // 22 spells in 3.0.3, no idea...
SUMMON_PROP_FLAG_UNK4 = 0x00000008, // 49 spells in 3.0.3, some mounts
SUMMON_PROP_FLAG_PERSONAL_SPAWN = 0x00000010, // Personal Spawn (creature visible only by summoner)
SUMMON_PROP_FLAG_PERSONAL_SPAWN = 0x00000010, // Only Visible to Summoner
SUMMON_PROP_FLAG_UNK6 = 0x00000020, // 0 spells in 3.3.5, unused
SUMMON_PROP_FLAG_UNK7 = 0x00000040, // 12 spells in 3.0.3, no idea
SUMMON_PROP_FLAG_UNK8 = 0x00000080, // 4 spells in 3.0.3, no idea
@@ -617,7 +617,7 @@ enum SummonPropFlags
SUMMON_PROP_FLAG_UNK14 = 0x00002000, // Guides, player follows
SUMMON_PROP_FLAG_UNK15 = 0x00004000, // Force of Nature, Shadowfiend, Feral Spirit, Summon Water Elemental
SUMMON_PROP_FLAG_UNK16 = 0x00008000, // Light/Dark Bullet, Soul/Fiery Consumption, Twisted Visage, Twilight Whelp. Phase related?
SUMMON_PROP_FLAG_UNK17 = 0x00010000,
SUMMON_PROP_FLAG_PERSONAL_GROUP_SPAWN = 0x00010000, // Only Visible to Summoner's Group
SUMMON_PROP_FLAG_UNK18 = 0x00020000,
SUMMON_PROP_FLAG_UNK19 = 0x00040000,
SUMMON_PROP_FLAG_UNK20 = 0x00080000,
@@ -1739,6 +1739,10 @@ bool WorldObject::CheckPrivateObjectOwnerVisibility(WorldObject const* seer) con
if (_privateObjectOwner == seer->GetPrivateObjectOwner())
return true;
if (Player const* playerSeer = seer->ToPlayer())
if (playerSeer->IsInGroup(_privateObjectOwner))
return true;
return false;
}
@@ -23302,6 +23302,19 @@ void Player::ClearComboPoints()
m_comboTarget.Clear();
}
bool Player::IsInGroup(ObjectGuid groupGuid) const
{
if (Group const* group = GetGroup())
if (group->GetGUID() == groupGuid)
return true;
if (Group const* group = GetOriginalGroup())
if (group->GetGUID() == groupGuid)
return true;
return false;
}
void Player::SetGroup(Group* group, int8 subgroup)
{
if (group == nullptr)
+1
View File
@@ -2268,6 +2268,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
/*** GROUP SYSTEM ***/
/*********************************************************/
bool IsInGroup(ObjectGuid groupGuid) const;
Group* GetGroupInvite() const { return m_groupInvite; }
void SetGroupInvite(Group* group) { m_groupInvite = group; }
Group* GetGroup() { return m_group.getTarget(); }
+14 -3
View File
@@ -1837,9 +1837,20 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
if (!m_originalCaster)
return;
ObjectGuid privateObjectOwner;
if (properties->Flags & SUMMON_PROP_FLAG_PERSONAL_SPAWN)
privateObjectOwner = m_originalCaster->IsPrivateObject() ? m_originalCaster->GetPrivateObjectOwner() : m_originalCaster->GetGUID();
ObjectGuid privateObjectOwner = [&]()
{
if (!(properties->Flags & (SUMMON_PROP_FLAG_PERSONAL_SPAWN | SUMMON_PROP_FLAG_PERSONAL_GROUP_SPAWN)))
return ObjectGuid::Empty;
if (m_originalCaster->IsPrivateObject())
return m_originalCaster->GetPrivateObjectOwner();
if (properties->Flags & SUMMON_PROP_FLAG_PERSONAL_GROUP_SPAWN)
if (m_originalCaster->IsPlayer() && m_originalCaster->ToPlayer()->GetGroup())
return m_originalCaster->ToPlayer()->GetGroup()->GetGUID();
return m_originalCaster->GetGUID();
}();
int32 duration = m_spellInfo->GetDuration();
if (Player* modOwner = m_originalCaster->GetSpellModOwner())