Jump to content

Recommended Posts

By modifying Assembly-CSharp.dll one can achieve with ease many frequently requested things that are otherwise not possible or very difficult. I have decided to make this tutorial instead of mods since mods for Assembly-CSharp.dll have some drawbacks (see below).

Difficulties with Assembly-CSharp.dll modding
- A modified Assembly-CSharp.dll won't be properly recognized by patches. So one has to use the BACKUP and patch the game or reinstall it. After that one has to redo all modifications to the new Assembly-CSharp.dll. It helps if one keeps track of the changes in a text file.
- Assembly-CSharp mods are incompatible with any other mod that modifies Assembly-CSharp.dll

Getting started
- Assembly-CSharp.dll is located in "...\PillarsOfEternityII_Data\Managed".
- MAKE A BACKUP of Assembly-CSharp.dll !!!!!
- To modify the dll you need a de/compiler like dnspy.
- Launch up dnspy and open Assembly-CSharp.dll. The rest should be self explanatory for everyone with little programming skills (else leave your hands out of it!!! and learn programming).

What can be done?
 
1. Helms for godlike

 

under "Equipment" "HasEquipmentSlot" (search it in the window at the bottom). In the main window right click and select "edit class"
1.1 now decomment or delete
************************************************************************************
if (slot == Equippable.EquipmentSlot.Head)
{
return !component || component.CharacterRace != CharacterStats.Race.Godlike;
}
************************************************************************************

1.2 remove line 389
************************************************************************************
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
************************************************************************************
and line 395
************************************************************************************
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
************************************************************************************

1.3 change line 575
************************************************************************************
AppearancePiece
************************************************************************************
to
************************************************************************************
Game.GameData.AppearancePiece
************************************************************************************
1.4 compile!

 

 

2. Does "waiting" from the rest menu take to long?

 

under "UIWaitManager" "WaitDurationRealSeconds" (search it) right click in the main window and select "edit method"
2.1 change from
*************************************************************************************************
return this.m_totalWaitTime / (this.m_waitSpeed * 3600f);
*************************************************************************************************
to
*************************************************************************************************
return this.m_totalWaitTime / (this.m_waitSpeed * 36000f);
*************************************************************************************************
2.2 compile!

 

 

3. XP Gain.
You dislike PoE2 xp system? The lines you need to edit are under "Partymanager" "AddPartySizeBonusXP" and "AssignXPToInactiveParty"

I prefer no party size and no inactive penalty (changes for that below). This lines can also be modified to have a difficult scaling.

 

3.1 search "AddPartySizeBonusXP" and right click in the main window and select "edit method"
change
*************************************************************************************************
float num = (float)ExperienceTable.GameData.PartySizeBonusExperiencePercent / 100f;
int numActivePrimaryPartyMembers = this.GetNumActivePrimaryPartyMembers();
float num2 = 0f;
if (numActivePrimaryPartyMembers < 5)
{
num2 = num * (float)(5 - numActivePrimaryPartyMembers);
}
return Mathf.RoundToInt((float)(xp + Mathf.RoundToInt((float)xp * num2)));
*************************************************************************************************
to
*************************************************************************************************
float num3 = (float)ExperienceTable.GameData.PartySizeBonusExperiencePercent / 100f;
this.GetNumActivePrimaryPartyMembers();
float num2 = num3 * 5f;
return Mathf.RoundToInt((float)(xp + Mathf.RoundToInt((float)xp * num2)));
*************************************************************************************************
3.2 compile!

3.3 search "AssignXPToInactiveParty" and right click in the main window and select "edit method"
change
*************************************************************************************************
if (partyMembersOfInactiveStatus != null && partyMembersOfInactiveStatus.Count > 0)
{
foreach (PartyMemberData partyMemberData in partyMembersOfInactiveStatus)
{
if (partyMemberData != null && partyMemberData.MemberType == PartyMemberType.Primary)
{
if (partyMemberData.Level <= GameState.PlayerCharacter.Stats.Level)
{
xp = xp * ExperienceTable.GameData.StoredExperiencePercent / 100;
}
else
{
xp = xp * ExperienceTable.GameData.StoredExperienceHigherLevelPercent / 100;
}
partyMemberData.Experience += xp;
*************************************************************************************************
to
*************************************************************************************************
if (partyMembersOfInactiveStatus != null && partyMembersOfInactiveStatus.Count > 0)
{
foreach (PartyMemberData partyMemberData in partyMembersOfInactiveStatus)
{
if (partyMemberData != null && partyMemberData.MemberType == PartyMemberType.Primary)
{
xp = xp;
partyMemberData.Experience += xp;
**************************************************************************************************
3.4 compile!

 

 

4. Difficulty scaling

 

under "DifficultyScaling" "public class ScaleData" right click on the token and chose "edit class"

 

this things can be changed...

                CreatureAttributeBonus

                CreatureLevelMult = 1f;
                DetectableDifficultyMult = 1f;
                DisarmDifficultyMult = 1f;
                TrapEffectMult = 1f;
                TrapDamageMult = 1f;
                SkillCheckMult = 1f;

Edited by Fhav6X
  • Like 7
Link to comment
Share on other sites

  • 3 months later...
  • 5 months later...

@OMGJesuis

Things may have shifted around a little since the original post, but it is still possible.

Follow the original post to open the .dll in dnSpy, then Game --> Equipment, then "Edit Class".

Comment out lines 747-750 with // so it looks like:

//if (slot == EquipmentSlot.Head)
//{
//	return !component || component.CharacterRace != Race.Godlike;
//}

Then at line 569, change the first AppearancePiece to Game.GameData.AppearancePiece and compile.  Save the module, and wear fancy hats.

PTmX89l.jpg

Link to comment
Share on other sites

  • 1 month later...

Can anyone update this? I will admit not knowing much in the way of programing but I just want to put the Pearlescent Rhomboid Helstone on my godlike character. It even makes sense it not like its even touch the head.

@Ethics Gradient's post was a step in the right direction, but I guess an update changed things.

Code CS0052.PNG

Link to comment
Share on other sites

  • 8 months later...

Im not sure if I posted it already or not (since it doesnt show), but I will ask again:

in the CURRENT patch, I saw some things changed (including the lines position), but I did what EthicsGradient suggested. It DID work. I used the Pearlescent Rhomboid Helsone. It works great! I wonder why this one wasn't default usable by Godlike, as it has NO effect on his head-sike and stuff. Bad decision, Devs. Look:

1160813389_2020-08-1017_50_17-PillarsofEternityII.png.c97c8c9dd8070d31513628b93c2878cc.png

I also tried downloaded his .dll file and replaced the one in the data, but in that case the game then did not open the main menu (only the OBSIDIAN and VersusEvil logos, then black screen). 

 

So for future reference: try manually changing the file, do not download his .dll because it's old code.

 

Also, I saw these lines of code below the helmet one and I wonder if it relates to other characters using pet slots... 

Anyone got code changes to make it happen? Or at least the Eder one (that I know it's coded in-game due to Berath's favors).

 

Edited by BRUNO NEVES OLIVEIRA
Link to comment
Share on other sites

On 8/10/2020 at 9:21 PM, BRUNO NEVES OLIVEIRA said:

Also, I saw these lines of code below the helmet one and I wonder if it relates to other characters using pet slots... 

Anyone got code changes to make it happen? Or at least the Eder one (that I know it's coded in-game due to Berath's favors).

 

I don't know the way to achieve it using .ddl modding, but there does exist a .gamedatabundle mod that unlocks pets slot if that's all your looking to do.

Link to comment
Share on other sites

  • 2 weeks later...

The description for the mod says "Does not prevent achievements". Though I don't have gog achievements enabled, from a very quick test making 5 potions the in game achievements that give points towards Berath's Blessing can be unlocked this mod enabled. As far as I'm aware the only thing that will actually disables unlocking achievements is the "iroll20s" console command.

Link to comment
Share on other sites

On 12/12/2018 at 4:43 PM, Fhav6X said:
On 12/12/2018 at 4:43 PM, Fhav6X said:

1. Helms for godlike

 

  Hide contents

under "Equipment" "HasEquipmentSlot" (search it in the window at the bottom). In the main window right click and select "edit class"
1.1 now decomment or delete
************************************************************************************
if (slot == Equippable.EquipmentSlot.Head)
{
return !component || component.CharacterRace != CharacterStats.Race.Godlike;
}
************************************************************************************

1.2 remove line 389
************************************************************************************
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
************************************************************************************
and line 395
************************************************************************************
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
************************************************************************************

1.3 change line 575
************************************************************************************
AppearancePiece
************************************************************************************
to
************************************************************************************
Game.GameData.AppearancePiece
************************************************************************************
1.4 compile!

 

 

This no longer works, and the code actually looks very different:

image.png

Any idea of what needs to be done to make this work? I'm amazed that there are no regular mods for this available anywhere.

Edit: Also, the whole thing refuses to compile even if I change nothing. What a trainwreck.

Edited by Luckmann
  • Like 1

t50aJUd.jpg

Link to comment
Share on other sites

  • 3 weeks later...
On 8/26/2020 at 10:49 AM, Kvellen said:

The description for the mod says "Does not prevent achievements". Though I don't have gog achievements enabled, from a very quick test making 5 potions the in game achievements that give points towards Berath's Blessing can be unlocked this mod enabled. As far as I'm aware the only thing that will actually disables unlocking achievements is the "iroll20s" console command.

I don' quite understand what would be the "Override directory" as says in the readme:

INSTALLATION:
Add UnlockPets folder to your Override directory.

 

Nvm, I saw this thread here I understood: 

 

Edited by BRUNO NEVES OLIVEIRA
Link to comment
Share on other sites

  • 8 months later...

Thanks for the tutorial Ethics Gradient - I had no issues using dnSpy to make the edits and compile the dll, tested with both the original and the six man party mod (with unlock pets enabled). Now my druid godlike can run around with a stupid clipping hat 😒

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...