You need to learn C.
Once you are good with C look at the trem source code.
To learn C get a good book or two.
And it will take time to get good.
A pk3 file is just a zip file with .pk3 instead of .zip
Get the source to some other mod and take a look.