Core/Creatures: Implemented AttackableBySummoner summon properties flag
Port From (https://github.com/TrinityCore/TrinityCore/commit/64a1c7735e3888f7c6e413c2a70196f7f8d4a090)
This commit is contained in:
@@ -2198,6 +2198,25 @@ namespace Game.Entities
|
|||||||
if (this == target)
|
if (this == target)
|
||||||
return ReputationRank.Friendly;
|
return ReputationRank.Friendly;
|
||||||
|
|
||||||
|
bool isAttackableBySummoner(Unit me, ObjectGuid targetGuid)
|
||||||
|
{
|
||||||
|
if (!me)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
TempSummon tempSummon = me.ToTempSummon();
|
||||||
|
if (tempSummon == null || tempSummon.m_Properties == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (tempSummon.m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.AttackableBySummoner)
|
||||||
|
&& targetGuid == tempSummon.GetSummonerGUID())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isAttackableBySummoner(ToUnit(), target.GetGUID()) || isAttackableBySummoner(target.ToUnit(), GetGUID()))
|
||||||
|
return ReputationRank.Neutral;
|
||||||
|
|
||||||
// always friendly to charmer or owner
|
// always friendly to charmer or owner
|
||||||
if (GetCharmerOrOwnerOrSelf() == target.GetCharmerOrOwnerOrSelf())
|
if (GetCharmerOrOwnerOrSelf() == target.GetCharmerOrOwnerOrSelf())
|
||||||
return ReputationRank.Friendly;
|
return ReputationRank.Friendly;
|
||||||
|
|||||||
Reference in New Issue
Block a user