Пример #1
0
        public void KillBoss()
        {
            List <ObjNPC> l = new List <ObjNPC>();

            PushActionToAllObj(obj =>
            {
                if (obj.GetObjType() != ObjType.NPC)
                {
                    return;
                }

                ObjNPC npc = obj as ObjNPC;
                if (npc != null && npc.GetCamp() == 2)
                {
                    l.Add(npc);
                }
            });

            foreach (var npc in l)
            {
                npc.mDropOnDie = false;
                npc.Die(0, 0);
            }

            mTrigger = null;
        }
Пример #2
0
        private ObjCharacter GetCanAttack(ObjNPC npc)
        {
            if (mLastEnemy == null || mLastEnemy.IsDead() || !mLastEnemy.Active)
            {
                ObjCharacter temp   = null;
                var          maxDis = 9999999.0f;
                foreach (var pair in npc.Scene.mObjDict)
                {
                    var t = pair.Value as ObjCharacter;
                    if (t == null || npc.Equals(t) || npc.GetCamp() == t.GetCamp())
                    {
                        continue;
                    }
                    if (t.IsDead() || !t.Active)
                    {
                        continue;
                    }

                    /**if (!mAddList.Contains(t.TypeId))
                     * {
                     *  continue;
                     * }**/
                    var dis = (npc.GetPosition() - t.GetPosition()).LengthSquared();
                    if (dis < maxDis)
                    {
                        temp   = t;
                        maxDis = dis;
                    }
                }
                return(temp);
            }
            return(mLastEnemy);
        }
Пример #3
0
 public override void OnNpcRespawn(ObjNPC npc)
 {
     if (null != npc && npc.GetCamp() == 2)
     {
         mMonsterCount++;
         BroadCastMonsterCount();
     }
 }
Пример #4
0
        public override void OnNpcEnter(ObjNPC npc)
        {
            if (null != npc && npc.GetCamp() == 2)
            {
                mMonsterCount++;
                BroadCastMonsterCount();

                npc.OnBehaviourChangeCallback += OnNpcBehaviourChanged;
            }
        }
Пример #5
0
 public override void OnNpcDie(ObjNPC npc, ulong characterId = 0)
 {
     base.OnNpcDie(npc, characterId);
     if (npc == null || npc.GetCamp() != 2)
     {
         return;
     }
     if (--mMonsterCount == 0)
     {
         OnWin();
     }
     else
     {
         foreach (var objPlayer in EnumAllPlayer())
         {
             objPlayer.Proxy.BroadcastSceneMonsterCount(mMonsterCount);
         }
     }
     BroadCastMonsterCount();
 }