コード例 #1
0
ファイル: MogoWorld.cs プロジェクト: lbddk/ahzs-client
    static public void CreateDummy(uint eid, int x, int y, int cfgId, int difficulty, int spawnPointCfgId)
    {
        //LoggerHelper.Error("CreateDummy difficulty:" + difficulty);
        if (!MonsterData.dataMap.ContainsKey(cfgId))
        {
            return;
        }
        MonsterData m = MonsterData.GetData(cfgId, MogoWorld.thePlayer.ApplyMissionID == Mogo.Game.RandomFB.RAIDID ? MogoWorld.thePlayer.level : difficulty);
        EntityDummy entity = new EntityDummy();
        CellAttachedInfo info = new CellAttachedInfo();
        info.x = (short)x;
        info.y = (short)y;
        info.id = eid;
        entity.spawnPointCfgId = spawnPointCfgId;
        entity.MonsterData = m;
        entity.ID = eid;
        entity.clientTrapId = m.clientTrapId;
        entity.SetEntityCellInfo(info);
        if (m.clientBoss == 1)
        {//为体验关特制
            entity.stateFlag = 1 << 13;
        }
        entity.SetCfg(m);
        //entity.curHp = (uint)currHp;因为现在不用重新登录刷怪,所以直接前端设一次就够了,现在curHp换成difficulty了,如果大于0则要根据difficulty匹配怪物的能力in MonsterValue
        entity.OnEnterWorld();

        entity.enterX = (short)x;
        entity.enterZ = (short)y;
        OnEnterWorld(entity);

        if (isLoadingScene)//在副本下线重新登录后isLoadingScene没有置回去false 导致dummy刷不出
        {
            //entity.ReadyCreateModel();
        }
        else
        {
            TimerHeap.AddTimer(1000, 0, DelayCreateDummy, entity);
        }
    }