Ejemplo n.º 1
0
        public MoveNodes <int> mPathNodes = new MoveNodes <int>(); //镖车行走路线

        public static NPCInstance CreateNPCInstance(CSCommon.MapInfo_Npc nd, MapInstance map)
        {
            NPCInstance ret = new NPCInstance();

            ret.mId = ServerFrame.Util.GenerateObjID(ServerFrame.GameObjectType.NPC);

            var init = new NpcInit();

            init.GameType     = eActorGameType.Npc;
            init.Data         = nd;
            init.OwnerMapData = map.MapInfo;
            if (!ret.Initialize(init))
            {
                return(null);
            }

            ret.Reborn();
            ret.OnEnterMap(map);

            return(ret);
        }