Removing Cooldown Between Casting Magicks
Download and Install
- Download the patched file 171e8b0d2241eb79[drive.google.com]
- Put it into this directory and cofirm file replace:<Steam installation directory>\steamapps\common\Magicka 2\data
most likely on your PC it is:
C:\Program Files (x86)\Steam\steamapps\common\Magicka 2\data - Enjoy!
Demo
How It's Done
Disclaimer:
This part might be interesting to developers. It is a little story how I managed to remove the cooldown. You absolutely do not have to read this.
File names look not that friendly :/
Magicka 2 is based on the Bitsquid game engine (same engine of Magicka Wizard Wars) which uses such unfriendly namings. Fortunately, I have found a toolkit[github.com] that allows to unpack Bitsquid data files. Then, somewhere on the internet I found that the file named 171e8b0d2241eb79 contains the scripting files (Bitsquid uses Lua for scripting). So I tried to unpack that file first, and after some unlucky attempts the tool suddenly bloated with promisingly looking lines.
Hurray!
The resulting directory contained a lot of .lua files.
Unfortunately, these were not the original lua textual source files
After spending plenty of time in Google and hex editor, I found out that this are LuaJIT compiled lua files prefixed by some bytes containing the size of the file.
Also it looks like each file contained its own path (virtual path?) in the file system of the game. Very handy to have some hints about what the file is about. Since I wanted to remove the cooldown between casting magicks, I picked some files related to magicks, deleted first 8 bytes (that prefix with the file length) of their content and then started trying to decompile them. I tried one decompiler after another until one of them[gitlab.com] processed the input file without any errors... And even produced some output file...
Holding breath in anticipation, I opened that file and...
After decompiling some more files and doing some research, I found this:
So, the target was found. Almost there.
I could have tried to change that number here in the decompiled file, recompile it and then repack all the files back but I was afraid that that might not work because of the file size change and possible byte-code incompatibilities. So instead I wanted to somehow edit the original byte-code directly and surgically: this number 3 should be somewhere there and I only needed to change it to 0. Adjust just one single byte. The only tiny diifficulty to solve was to find that same 3 among thousands of other 3s all over the binary file...
In order to do some more research, I downloaded the LuaJIT compiler and compiled two version of this file: the original one (with the cooldown equals to 3) and one with 3 replaced with another number (I used 80). Then I compared them in a hex editor. As expected, the files differed by only one byte.
I sketched a C# program to check the original byte-code for presence of this pattern. And it found it - and, furthermore, exatly once. So I modified the unpacker taken from the toolkit (I mentioned it in the beginning) to find this pattern, replace this single 3 with 0 and then pack the data back into a package using zlib.ZOutputStream.
I copied the result file into the "Magicka 2/data" folder, started the game (which happened luckily without any errors) and tried to cast some magick. The cooldown was gone. I was just utterly happy that it worked and now I am happy to share my results with you :)
Thank you very much for your attention if you read this article all the way down here and have not fallen asleep :)
This guide was created by its original author on the Steam Community. Are you the author and want it removed? Request removal.