Ejemplo n.º 1
0
        public bool IsHostileTo(ref FactionTemplate entry)
        {
            if (Id == entry.Id)
                return false;

            if (entry.Faction != 0)
            {
                for (int i = 0; i < 4; ++i)
                    if (EnemyFaction[i] == entry.Faction)
                        return true;

                for (int i = 0; i < 4; ++i)
                    if (FriendFaction[i] == entry.Faction)
                        return false;
            }
            return (HostileMask & entry.FactionGroup) != 0;
        }
Ejemplo n.º 2
0
        public uint Id; // 0        m_ID

        #endregion Fields

        #region Methods

        public bool IsFriendlyTo(ref FactionTemplate entry)
        {
            if (Id == entry.Id)
                return true;

            if (entry.Faction != 0)
            {
                for (int i = 0; i < 4; ++i)
                    if (EnemyFaction[i] == entry.Faction)
                        return false;

                for (int i = 0; i < 4; ++i)
                    if (FriendFaction[i] == entry.Faction)
                        return true;
            }
            return ((FriendlyMask & entry.FactionGroup) == 0) || ((FactionGroup & entry.FriendlyMask) == 0);
        }