Unlocking items Part 2: Making Sure It Survives Game Restart
When the game restart, there's 2 phase on applying the saved data to your maiden. Namely
SaveManager.LoadValue
and
LeagueData.ApplyLook
. Both checks for premium items and if you have bought it. If not, it will reset the data on memory to default values, and if you enter the Customization screen, write it to the savegame. So to ensure your customization using premium items survives, those two methods need to be edited.
The goal is simple, remove all references to variables inside Steaminit. It's easier said than done.
First,
LeagueData.ApplyLook
, cos it's the easier of the two. Here's the resulting full code after edit. Mind you, all the caps variable names will be different in yours, so read and edit carefully.
Code: Select all
public void ApplyLook(int JHBEGOOKAEL)
{
GlobalVar.CurrentLeagueCharacterData[0].BodyType = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].BodyType;
GlobalVar.CurrentLeagueCharacterData[0].Part1Colour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Part1Colour;
GlobalVar.CurrentLeagueCharacterData[0].Part2Colour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Part2Colour;
GlobalVar.CurrentLeagueCharacterData[0].Part3Colour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Part3Colour;
GlobalVar.CurrentLeagueCharacterData[0].Part4Colour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Part4Colour;
GlobalVar.CurrentLeagueCharacterData[0].OutfitPlug = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].OutfitPlug;
GlobalVar.CurrentLeagueCharacterData[0].F_Setting.BodyRoughness = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].BodyRoughness;
GlobalVar.CurrentLeagueCharacterData[0].WeaponSkinID = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].WeaponSkinID;
GlobalVar.CurrentLeagueCharacterData[0].ShowWeapon = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].ShowWeapon;
GlobalVar.CurrentLeagueCharacterData[0].WeaponPos = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].WeaponPos;
GlobalVar.CurrentLeagueCharacterData[0].WeaponRot = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].WeaponRot;
GlobalVar.CurrentLeagueCharacterData[0].WeaponScale = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].WeaponScale;
GlobalVar.CurrentLeagueCharacterData[0].WeaponColour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].WeaponColour;
GlobalVar.CurrentLeagueCharacterData[0].ShieldType = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].ShieldType;
GlobalVar.CurrentLeagueCharacterData[0].ShowShield = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].ShowShield;
GlobalVar.CurrentLeagueCharacterData[0].ShieldColour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].ShieldColour;
GlobalVar.CurrentLeagueCharacterData[0].WingType = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].WingType;
GlobalVar.CurrentLeagueCharacterData[0].ShowWing = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].ShowWing;
GlobalVar.CurrentLeagueCharacterData[0].WingColour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].WingColour;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn3 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn3;
GlobalVar.CurrentLeagueCharacterData[0].Acc_ChokerColor1 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_ChokerColor1;
GlobalVar.CurrentLeagueCharacterData[0].Acc_ChokerColor2 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_ChokerColor2;
GlobalVar.CurrentLeagueCharacterData[0].Acc_ChokerColor3 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_ChokerColor3;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn3Pos = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn3Pos;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn3Rot = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn3Rot;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn3Scale = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn3Scale;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Glass = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Glass;
GlobalVar.CurrentLeagueCharacterData[0].Acc_GlassColour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_GlassColour;
GlobalVar.CurrentLeagueCharacterData[0].Acc_GlassPos = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_GlassPos;
GlobalVar.CurrentLeagueCharacterData[0].Acc_GlassRot = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_GlassRot;
GlobalVar.CurrentLeagueCharacterData[0].Acc_GlassScale = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_GlassScale;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Mask1 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Mask1;
GlobalVar.CurrentLeagueCharacterData[0].Acc_MaskColour1 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_MaskColour1;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Mask1Pos = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Mask1Pos;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Mask1Rot = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Mask1Rot;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Mask1Scale = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Mask1Scale;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Mask2 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Mask2;
GlobalVar.CurrentLeagueCharacterData[0].Acc_HeadGearColor1 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_HeadGearColor1;
GlobalVar.CurrentLeagueCharacterData[0].Acc_HeadGearColor2 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_HeadGearColor2;
GlobalVar.CurrentLeagueCharacterData[0].Acc_HeadGearColor3 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_HeadGearColor3;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Mask2Pos = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Mask2Pos;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Mask2Rot = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Mask2Rot;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Mask2Scale = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Mask2Scale;
GlobalVar.CurrentLeagueCharacterData[0].CapeID = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].CapeID;
GlobalVar.CurrentLeagueCharacterData[0].CapeColour1 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].CapeColour1;
GlobalVar.CurrentLeagueCharacterData[0].CapeColour2 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].CapeColour2;
GlobalVar.CurrentLeagueCharacterData[0].CapeColour3 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].CapeColour3;
GlobalVar.CurrentLeagueCharacterData[0].CapePos = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].CapePos;
GlobalVar.CurrentLeagueCharacterData[0].CapeRot = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].CapeRot;
GlobalVar.CurrentLeagueCharacterData[0].CapeScale = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].CapeScale;
GlobalVar.CurrentLeagueCharacterData[0].PoseID = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].PoseID;
GlobalVar.CurrentLeagueCharacterData[0].GauntletID = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].GauntletID;
GlobalVar.CurrentLeagueCharacterData[0].ShowGauntlet = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].ShowGauntlet;
GlobalVar.CurrentLeagueCharacterData[0].GauntletColor1 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].GauntletColor1;
GlobalVar.CurrentLeagueCharacterData[0].GauntletColor2 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].GauntletColor2;
GlobalVar.CurrentLeagueCharacterData[0].GauntletColor3 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].GauntletColor3;
GlobalVar.CurrentLeagueCharacterData[0].GauntletColor4 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].GauntletColor4;
GlobalVar.CurrentLeagueCharacterData[0].HairType = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].HairType;
GlobalVar.CurrentLeagueCharacterData[0].HairColour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].HairColour;
GlobalVar.CurrentLeagueCharacterData[0].TattooType = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].TattooType;
GlobalVar.CurrentLeagueCharacterData[0].Tattoo1Colour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Tattoo1Colour;
GlobalVar.CurrentLeagueCharacterData[0].Tattoo2Colour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Tattoo2Colour;
GlobalVar.CurrentLeagueCharacterData[0].Tattoo3Colour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Tattoo3Colour;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn1 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn1;
GlobalVar.CurrentLeagueCharacterData[0].Acc_HornColour1 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_HornColour1;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn1Pos = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn1Pos;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn1Rot = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn1Rot;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn1Scale = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn1Scale;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn2 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn2;
GlobalVar.CurrentLeagueCharacterData[0].Acc_HornColour2 = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_HornColour2;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn2Pos = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn2Pos;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn2Rot = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn2Rot;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Horn2Scale = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Horn2Scale;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Ear = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Ear;
GlobalVar.CurrentLeagueCharacterData[0].Acc_EarColour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_EarColour;
GlobalVar.CurrentLeagueCharacterData[0].Acc_EarPos = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_EarPos;
GlobalVar.CurrentLeagueCharacterData[0].Acc_EarRot = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_EarRot;
GlobalVar.CurrentLeagueCharacterData[0].Acc_EarScale = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_EarScale;
GlobalVar.CurrentLeagueCharacterData[0].Acc_Tails = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_Tails;
GlobalVar.CurrentLeagueCharacterData[0].Acc_TailColour = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_TailColour;
GlobalVar.CurrentLeagueCharacterData[0].Acc_TailsPos = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_TailsPos;
GlobalVar.CurrentLeagueCharacterData[0].Acc_TailsRot = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_TailsRot;
GlobalVar.CurrentLeagueCharacterData[0].Acc_TailsScale = GlobalVar.CurrentLeagueCharacterData[0].PlayeLookData[JHBEGOOKAEL].Acc_TailsScale;
if (GlobalVar.Player != null && !GlobalVar.Player.GetComponent<NewPlayerControl>().BoneScript.ccMode)
{
GlobalVar.Player.GetComponent<NewPlayerControl>().BoneScript.ApplyLook();
}
}
There's a bunch of lines removed from the original, mainly the
if
lines. Just make sure to make your code similar to that using the "Edit C# Method".
The hard part is editing
SaveManager.LoadValue
, cos it requires editing the IL code. And no, it won't just involves setting some fields to
ldc.i4.1
, cos you need to turn codes such as this:
Code: Select all
if (SteamInit.NPBOPBKMFNH[num3] || (FMLLCCPHAEE != SaveManager.MLKJGNFODND.Normal_Form1 && FMLLCCPHAEE != SaveManager.MLKJGNFODND.Normal_Form2 && FMLLCCPHAEE != SaveManager.MLKJGNFODND.GeneralPreset) || flag)
to this
Code: Select all
if (true || (FMLLCCPHAEE != SaveManager.MLKJGNFODND.Normal_Form1 && FMLLCCPHAEE != SaveManager.MLKJGNFODND.Normal_Form2 && FMLLCCPHAEE != SaveManager.MLKJGNFODND.GeneralPreset) || flag)
That will be a long "
short" tutorial in IL for that kind of edit, and, mind you, the edit is repeated for each item categories. My dll is already filled with junk from unsuccessful edits to post it cos I can't guarantee what havoc it can do on your system.
Suffice to say, anyone who are adventurous can do this workflow:
Return to the edits made on
NewUI_CC_IconItem.Update
on my previous
post. Remember this kind of edits
Code: Select all
case NewUI_CC_IconItem.JJPCBOAFJFJ.Outfit:
SteamInit.NPBOPBKMFNH[this.MyID] = true;
this.unlocked = true;
Right click on
NPBOPBKMFNH
, then "Analyze"->"get"->"Used By"->"SaveManager.LoadValue"->"Show Reference in Method (New Tab)". Then you get the corresponding line highlighted, then "Edit IL Instruction". The corresponding lines is then highlighted in IL Editor. The hard part is deciding what to edit.
For outfit, you get these lines highlighted in IL Editor:
Code: Select all
3326 2914 call bool[] Steamworks.SteamInit::get_OutfitUnlocked()
3327 2919 ldloc.s V_7 (7)
3328 291B ldelem.u1
3329 291C brtrue.s 3343 (2931) ldc.i4.1
3330 291E ldarg.2
3331 291F brfalse.s 3341 (292E) ldc.i4.0
3332 2921 ldarg.2
3333 2922 ldc.i4.1
3334 2923 beq.s 3341 (292E) ldc.i4.0
3335 2925 ldarg.2
3336 2926 ldc.i4.2
3337 2927 ceq
3338 2929 ldc.i4.0
3339 292A ceq
3340 292C br.s 3344 (2932) ldloc.0
3341 292E ldc.i4.0
3342 292F br.s 3344 (2932) ldloc.0
3343 2931 ldc.i4.1
3344 2932 ldloc.0
3345 2933 or
3346 2934 brfalse.s 3351 (2940) ldloc.1
Now remove the highlight, and only highlight the 1st 2 lines:
Code: Select all
3326 2914 call bool[] Steamworks.SteamInit::get_OutfitUnlocked()
3327 2919 ldloc.s V_7 (7)
Now right click, and select "NOP Instruction".
After that, click the
ldelem.u1
part of the 3rd line:
Select
ldc.i4.1
. The code now reads as follow:
Code: Select all
3326 2914 nop
3327 2919 nop
3328 291B ldc.i4.1
3329 291C brtrue.s 3343 (2931) ldc.i4.1
3330 291E ldarg.2
3331 291F brfalse.s 3341 (292E) ldc.i4.0
3332 2921 ldarg.2
3333 2922 ldc.i4.1
3334 2923 beq.s 3341 (292E) ldc.i4.0
3335 2925 ldarg.2
3336 2926 ldc.i4.2
3337 2927 ceq
3338 2929 ldc.i4.0
3339 292A ceq
3340 292C br.s 3344 (2932) ldloc.0
3341 292E ldc.i4.0
3342 292F br.s 3344 (2932) ldloc.0
3343 2931 ldc.i4.1
3344 2932 ldloc.0
3345 2933 or
3346 2934 brfalse.s 3351 (2940) ldloc.1
After closing the window by clicking OK, you'll get this:
Code: Select all
if (true || (FMLLCCPHAEE != SaveManager.MLKJGNFODND.Normal_Form1 && FMLLCCPHAEE != SaveManager.MLKJGNFODND.Normal_Form2 && FMLLCCPHAEE != SaveManager.MLKJGNFODND.GeneralPreset) || flag)
Now repeat the process for all item categories.
There are variations of the edit above. Let's look at Tattoos:
Code: Select all
if (SteamInit.PBJIILLFFBE[Mathf.Max(0, num3 - 1)] || (FMLLCCPHAEE != SaveManager.MLKJGNFODND.Normal_Form1 && FMLLCCPHAEE != SaveManager.MLKJGNFODND.Normal_Form2 && FMLLCCPHAEE != SaveManager.MLKJGNFODND.GeneralPreset) || flag)
Getting there by the same process like before, you'll get these il codes:
Code: Select all
3371 2967 call bool[] Steamworks.SteamInit::get_TattooUnlocked()
3372 296C ldc.i4.0
3373 296D ldloc.s V_7 (7)
3374 296F ldc.i4.1
3375 2970 sub
3376 2971 call int32 [UnityEngine.CoreModule]UnityEngine.Mathf::Max(int32, int32)
3377 2976 ldelem.u1
3378 2977 brtrue.s 3392 (298C) ldc.i4.1
3379 2979 ldarg.2
3380 297A brfalse.s 3390 (2989) ldc.i4.0
3381 297C ldarg.2
3382 297D ldc.i4.1
3383 297E beq.s 3390 (2989) ldc.i4.0
3384 2980 ldarg.2
3385 2981 ldc.i4.2
3386 2982 ceq
3387 2984 ldc.i4.0
3388 2985 ceq
3389 2987 br.s 3393 (298D) ldloc.0
3390 2989 ldc.i4.0
3391 298A br.s 3393 (298D) ldloc.0
3392 298C ldc.i4.1
3393 298D ldloc.0
3394 298E or
3395 298F brfalse.s 3400 (299B) ldloc.1
So, highlight the 6 first line, right click, then "NOP Instruction". At the 7th line, change
ldelem.u1
to
ldc.i4.1
. The code now reads:
Code: Select all
3371 2967 nop
3372 296C nop
3373 296D nop
3374 296F nop
3375 2970 nop
3376 2971 nop
3377 2976 ldc.i4.1
3378 2977 brtrue.s 3392 (298C) ldc.i4.1
3379 2979 ldarg.2
3380 297A brfalse.s 3390 (2989) ldc.i4.0
3381 297C ldarg.2
3382 297D ldc.i4.1
3383 297E beq.s 3390 (2989) ldc.i4.0
3384 2980 ldarg.2
3385 2981 ldc.i4.2
3386 2982 ceq
3387 2984 ldc.i4.0
3388 2985 ceq
3389 2987 br.s 3393 (298D) ldloc.0
3390 2989 ldc.i4.0
3391 298A br.s 3393 (298D) ldloc.0
3392 298C ldc.i4.1
3393 298D ldloc.0
3394 298E or
3395 298F brfalse.s 3400 (299B) ldloc.1
After clicking OK, you'll get:
Code: Select all
if (true || (FMLLCCPHAEE != SaveManager.MLKJGNFODND.Normal_Form1 && FMLLCCPHAEE != SaveManager.MLKJGNFODND.Normal_Form2 && FMLLCCPHAEE != SaveManager.MLKJGNFODND.GeneralPreset) || flag)
Do you see a pattern here?
For codes like these:
The IL code will always start with:
Code: Select all
call bool[] Steamworks.SteamInit::get_ ...
What you want to do is look for the combo of this 2 lines immediately after:
Then, select the lines from the
call bool[] Steamworks::
to one line directly above
ldelem.u1
, and NOP them. Afterward, change the
ldelem.u1
to
ldc.i4.1
Let's try something harder:
Code: Select all
if (characterData.Acc_Glass > 0 && !flag && !SteamInit.JACFFEPMKKI[characterData.Acc_Glass - 1] && (FMLLCCPHAEE == SaveManager.MLKJGNFODND.Normal_Form1 || FMLLCCPHAEE == SaveManager.MLKJGNFODND.Normal_Form2))
The corresponding IL code:
Code: Select all
2438 1D6A ldloc.1
2439 1D6B ldfld int32 CharacterData::Acc_Glass
2440 1D70 ldc.i4.0
2441 1D71 ble.s 2463 (1D9D) ldloc.s V_4 (4)
2442 1D73 ldloc.0
2443 1D74 brtrue.s 2463 (1D9D) ldloc.s V_4 (4)
2444 1D76 call bool[] Steamworks.SteamInit::get_GlassUnlock()
2445 1D7B ldloc.1
2446 1D7C ldfld int32 CharacterData::Acc_Glass
2447 1D81 ldc.i4.1
2448 1D82 sub
2449 1D83 ldelem.u1
2450 1D84 brtrue.s 2463 (1D9D) ldloc.s V_4 (4)
2451 1D86 ldarg.2
2452 1D87 brfalse.s 2456 (1D8D) ldloc.1
2453 1D89 ldarg.2
2454 1D8A ldc.i4.1
2455 1D8B bne.un.s 2463 (1D9D) ldloc.s V_4 (4)
Remember the guideline above? Select the lines from
call bool[] Steamworks.SteamInit::
to one line above the next
ldelem.u1
, that is line 2444 to 2448, then NOP them. Afterward, change
ldelem.u1
to
ldc.i4.1
.
The code now looks like this:
Code: Select all
2438 1D6A ldloc.1
2439 1D6B ldfld int32 CharacterData::Acc_Glass
2440 1D70 ldc.i4.0
2441 1D71 ble.s 2463 (1D95) ldloc.s V_4 (4)
2442 1D73 ldloc.0
2443 1D74 brtrue.s 2463 (1D95) ldloc.s V_4 (4)
2444 1D76 nop
2445 1D77 nop
2446 1D78 nop
2447 1D79 nop
2448 1D7A nop
2449 1D7B ldc.i4.1
2450 1D7C brtrue.s 2463 (1D95) ldloc.s V_4 (4)
2451 1D7E ldarg.2
2452 1D7F brfalse.s 2456 (1D85) ldloc.1
2453 1D81 ldarg.2
2454 1D82 ldc.i4.1
2455 1D83 bne.un.s 2463 (1D95) ldloc.s V_4 (4)
And the corresponding C# code:
Code: Select all
if (characterData.Acc_Glass > 0 && !flag && !true && (FMLLCCPHAEE == SaveManager.MLKJGNFODND.Normal_Form1 || FMLLCCPHAEE == SaveManager.MLKJGNFODND.Normal_Form2))
Hope this is enough to get you going.