Esempio n. 1
0
        public override void StartDungeon()
        {
            StartTimer(eDungeonTimerType.WaitEnd, DateTime.Now.AddMinutes(mFubenRecord.TimeLimitMinutes), TimeOverEnd);
            base.StartDungeon();
            var npcList = new List <ObjNPC>();

            //移出阻挡npc
            foreach (var objBase in mObjDict)
            {
                if (objBase.Value.GetObjType() == ObjType.NPC)
                {
                    var objNpc = objBase.Value as ObjNPC;
                    var npcId  = objNpc.TableNpc.Id;
                    if (npcId == 999)
                    {
                        npcList.Add(objNpc);
                    }
                    BattleObjIdList.Add(objNpc.ObjId);
                }
            }
            foreach (var npc in npcList)
            {
                LeaveScene(npc);
            }

            if (mFightWarnTrigger == null)
            {
                mFightWarnTrigger = SceneServerControl.Timer.CreateTrigger(DateTime.Now.AddSeconds(3.0f),
                                                                           OnTriggerFightWarn);
            }

            if (mNpc5003Trigger == null)
            {
                mNpc5003Trigger = SceneServerControl.Timer.CreateTrigger(DateTime.Now.AddSeconds(60.0f),
                                                                         OnTriggerNpc5003Born);
            }

            if (mPlayerBuffTrigger == null)
            {
                mPlayerBuffTrigger = SceneServerControl.Timer.CreateTrigger(DateTime.Now.AddSeconds(15.0f),
                                                                            OnTriggerPlayerBuff, 15 * 1000);
            }
            if (mBossBuffTrigger == null)
            {
                mBossBuffTrigger = SceneServerControl.Timer.CreateTrigger(DateTime.Now.AddSeconds(6.0f),
                                                                          OnTriggerBossBuff, 6 * 1000);
            }
            mNpcLeader50000.AddBuff(3002, 1, mNpcLeader50000);
            mNpcLeader50015.AddBuff(3002, 1, mNpcLeader50015);
            SetInvincible(mNpcLeader50000);
            SetInvincible(mNpc50001);
            SetInvincible(mNpcLeader50015);
            SetInvincible(mNpc50016);

            mStartFightTrigger = null;
        }