Exemplo n.º 1
0
        public bool Conform(INPC en)
        {
            if (en.IsCanAttackNPC())
            {
                return(false);
            }
            if (CommonCondition.IsPetAndSummon(en))
            {
                return(false);
            }
            if (!CommonCondition.IsNpcCanAttackByTable(en))
            {
                return(false);
            }
            IPlayer    player      = EntitySystem.m_ClientGlobal.MainPlayer;
            ISkillPart m_skillPart = player.GetPart(Client.EntityPart.Skill) as ISkillPart;

            if (m_skillPart != null)
            {
                int error = 0;
                if (m_skillPart.CheckCanAttackTarget(en, out error))
                {
                    return(false);
                }
                else
                {
                    float dis = EntityHelper.GetEntityDistance(player, en);
                    if (dis <= m_nRange && en.IsDead())
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 2
0
        public bool Conform(INPC en)
        {
            if (en.IsDead())
            {
                return(false);
            }
            if (!en.IsCanAttackNPC())
            {
                return(false);
            }
            if (!CommonCondition.IsNpcCanAttackByTable(en))
            {
                return(false);
            }
            if (CommonCondition.IsPetAndSummon(en))
            {
                return(false);
            }
            IPlayer           player = EntitySystem.m_ClientGlobal.MainPlayer;
            IControllerSystem cs     = EntitySystem.m_ClientGlobal.GetControllerSystem();

            if (cs == null)
            {
                return(false);
            }

            IControllerHelper ch = cs.GetControllerHelper();

            if (ch == null)
            {
                return(false);
            }
            if (ch.IsSameTeam(en))
            {
                float dis = EntityHelper.GetEntityDistance(player, en);
                if (dis <= m_nRange)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 3
0
        public bool Conform(ICreature en)
        {
            if (en.IsDead())
            {
                return(false);
            }
            if (CommonCondition.IsPetAndSummon(en))
            {
                return(false);
            }
            if (!CommonCondition.IsNpcCanAttackByTable(en))
            {
                return(false);
            }
            if (en.IsHide())
            {
                return(false);
            }
            INPC npc = en as INPC;

            if (npc != null)
            {
                if (!npc.IsCanAttackNPC())
                {
                    return(false);
                }
            }
            if (CommonCondition.IsPetAndSummon(en))
            {
                return(false);
            }
            IPlayer player = EntitySystem.m_ClientGlobal.MainPlayer;

            float dis = EntityHelper.GetEntityDistance(player, en);

            if (dis <= m_nRange)
            {
                return(true);
            }


            return(false);
        }
Exemplo n.º 4
0
        public bool Conform(INPC en)
        {
            int error = 0;

            if (!CommonCondition.IsNpcCanAttackByTable(en))
            {
                return(false);
            }
            if (en.IsPet() || en.IsSummon())
            {
                int           masterID = en.GetProp((int)NPCProp.Masterid);
                IEntitySystem es       = EntitySystem.m_ClientGlobal.GetEntitySystem();
                if (es != null)
                {
                    IPlayer p = es.FindEntity <IPlayer>((uint)masterID);
                    if (p != null)
                    {
                        if (EntitySystem.m_ClientGlobal.MainPlayer.GetUID() == p.GetUID())
                        {
                            return(false);
                        }
                    }
                }
            }
            if (m_skillPart != null && m_skillPart.CheckCanAttackTarget(en, out error) == false)
            {
                return(false);
            }

            float fDis = Vector3.Distance(m_centerpos, en.GetPos());

            if (fDis > m_rang)
            {
                return(false);
            }
            return(true);
        }