Help with IL_Spy code

Posts 16 of 6 · Page 1 of 1
Help with IL_Spy code
Guys I cant quite figure out the directions below to increase the amount of skillpoints I get per level. Can anyone get it to work and clear these instructions up for me. Thanks in advance.

55. Set Amount of SkillPoints Per Level Up
56. EntityPlayer.AddExp(Int32) : Void
57. Line 51, insert after selection:
58. ldc.i4.1 //ldc.i4.1 adds +1 to default skillpoints. you can use ldc.i4.1 thru .8 or ldc.i4 with value of Int32 and a number of your choice
59. add //mul also available for multiply the number above by the default amount given per level
60.
Lets see if I can clear this up for you.

First off, I'll rewrite the instructions to attempt to make them a bit more clear, then I'll explain step-by-step how to use them.

Set amount of skillpoints received upon ranking up:
Location: -/EntityPlayer/AddExp(Int32): Void
Select the instruction 051 and create the following instructions after it:
ldc.i4 // Set operand type to Int32. Set the operand (dec) to how many additional points you want to receive each level up.
add

So to start off, I'll navigate to the "AddExp(Int32): Void" method inside the "EntityPlayer" class. I'll do this by expanding Assembly-CSharp.dll by clicking on the "+" button next to it. After doing this, I'll expand the "-" namespace/"directory" the same way. Next, I'll look for the "EntityPlayer" class/"directory" inside the now-extensive list of classes/"directories" that's now being displayed. Inside "EntityPlayer" class/"directory," find and select the "AddExp(Int32): Void" method. Inside the Reflexel window, scroll down the list of instructions until you reach instruction 051 (line 051) and select it. Right click it and click on "Create New...." Now in the OpCode textbox inside the new window that popped up, type in (or find it in the dropdown menu) "ldc.i4." (Without the period obviously.) For the "Operand type," select "Int32" and for the "Operand," type in the number of additional skillpoints you want to receive when you rank up (also make sure the dropdown list next to the Operand is set to "Dec"). After that, click the "Insert after selection" button. Now select the instruction 052 (the one you just created), right click it, and click "Create New..." again. Now inside the "OpCode" box, type in "add." (Again without the period.) Leave both the "Operand type" and "Operand" to the default, and click on the "Insert after selection" button.

You're done! Just save the modified assembly and you're good to go!

Just to cover all my bases for your question, I'll go into slightly more detail about the original instructions Bartender wrote.

Looking at where he said "ldc.i4.1 adds +1 to default skillpoints. you can use ldc.i4.1 thru .8 or ldc.i4 with value of Int32 and a number of your choice."
What he means by this is that instead of using only "ldc.i4" like I did in my example above, you can alternatively use the instructions "ldc.i4.1," "ldc.i4.2," "ldc.i4.3," and so on until you reach "ldc.i4.8." That's the highest those particular OpCodes go. So for example, I wanted to add five additional skillpoints per level, I can alternatively use "ldc.i4.5" instead of using "ldc.i4" with the Operand of 5.

Now where he said "mul also available for multiply the number above by the default amount given per level."
What he's saying here is that instead of using "add" and adding to the number of skillpoints you receive per level, you can use "mul" instead and multiply to the number of skillpoints you receive. For example, lets say I get six points every time I level up. I can using "mul" and "ldc.i4.2" to multiply that six points by two to get twelve each level instead of having to add six points to get the same result. It's just a different operation you can use to increase the number of skillpoints you get. Using "mul" is particularly useful if you want to get absurd amounts skillpoints each level if you don't feel like adding 1000 or so instead.

Best,
Sqeegie
Thanks Squeegie, that more than clears it up, thanks to you and Bartender I learned how to how to use IL Spy or even be able to do any of this.
Sqeegie any way to inject the Assembly CSharp into 7D2D Mod Launcher? I added it to the TempMods Folder and the original 7D2D Folder but it doesn't seem to use it. Looks like its grabbing it from somewhere else because the changes aren't implemented.
Sorry, but I wouldn't know. I've never used mods, or the mod launcher before. Hope you figure it out!
Got it working, thanks anyways.
Posts 16 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?