Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TL;DR
- The accessories "Team Glasses" and "Expedite Ring" both work on Futaba, the rest do not.
- Preamble:
- So I was asked to check if certain accessories apply to Futaba, and I knew some relevant game functions to check, and I mistakenly labeled a certain function as only being relevant to "active combat" party members, which lead to half right, half wrong results, so instead of trying to decipher code that has been messed by with Denuvo and/or aggressive inlining due to compiler settings, I decided to take a much more surefire approach; Simply patching the game function that is used to check if a unit possesses a specific skill, and then patch the function to log who is being checked, and what skill is being checked by them.
- As an example, what I was trying to decipher looked a little bit like this:
- https://i.imgur.com/upedbEe.png
- ==========================================================================
- Technical mumbo jumbo:
- For those familiar with decompiling game executables and patching code, I will provide some relevant details into what I am doing to make sure we are all on the same page.
- If you decompile the latest P5R Steam game executable (version 1.0.4b as of this post), you can find the relevant function at the address 0x14c52f6a0, or by following this signature scan:
- 48 89 5C 24 ?? 48 89 6C 24 ?? 56 57 41 56 48 83 EC 70 44 0F B7 59 ??
- The function is defined as follows
- bool btl::datUnit::doesUnitHaveSkillOrAccessoryGear(datUnit* unit, int skillID)
- You can find the data for the datUnit structure in the public repository for my "Custom Bonus Tweaks" mod at the following link:
- https://github.com/DeathChaos25/p5r.enhance.cbt.reloaded/blob/master/GameFunctions_Structs.cs#L186
- with that in mind, here is what my patch to this function (using Reloaded-II) looked like:
- public bool DoesUnitHaveSkillOrAccessoryGear(datUnit* unit, ushort skillID)
- {
- bool result = _hookDoesUnitHaveSkillOrAccessoryGear.OriginalFunction(unit, skillID);
- Log($"Checking if {(unit->unitType == 2 ? "enemy" : "player")} ID {unit->unitID:D3} has skill {skillID:D4} -> {result}");
- return result;
- }
- This will log which Player (or enemy) is being checked, the player/enemy ID being checked, what skill is being checked on them, and if the check was successful or not
- You can also find a dump of skill IDs generated from the game files in the following wiki:
- https://amicitia.miraheze.org/wiki/Persona_5_Royal/Skills
- ==========================================================
- The logs:
- So with the above in mind, I went and did some combat with the following party setup
- Joker (ID 01)
- Panther (ID 04)
- Queen (ID 06)
- Violet (ID 10)
- Why this specific set up? No particular reason other than the character IDs not being consecutive, meaning the jump in IDs and only containing these 4 will let us know for sure if something is checking all players, or only the ones active in the current combat.
- Another relevant caveat is that P5R added the feature of skill accessories, that is, accessories that give players the ability to use select skills.
- This feature was also implemented retroactively, and now some old accessories switched from being an explicitly programmed effect, to the effect now being found in a passive skill, and the accessory now simply granting that passive skill to the player.
- A relevant example of this is the "Midnight Bandana" accessory, in P5 the All Out Attack damage calculation code explicitly checked for possession of this item ID, but in P5R, skill accessories were retroactively programmed, so now this accessory grants the passive skill ID 884, which is the "All-Out Attack Boost" passive skill, and we can confirm this with our function patch, as the following showed up in the logs whenever we perform an All Out Attack with our aforementioned party setup:
- Checking if player ID 001 has skill 0884 -> False
- Checking if player ID 004 has skill 0884 -> False
- Checking if player ID 006 has skill 0884 -> False
- Checking if player ID 010 has skill 0884 -> False
- In this particular case, it is clear only the 4 party members in combat were checked for this skill (or accessory containing the skill) and no other party members, thus non participating members (like Futaba) would not give any extra damage boost to All Out Attacks by holding this accessory/skill.
- An interesting note to make here is that Futaba's All out Attack is all smoke and mirrors, what you see is not the "real" Futaba performing an All Out Attack, rather, what you see is simply Joker's All out Attack assets being replaced, and the new particle files happen to contain a copy of the "Oracle" model, wholly separate from the "real" one.
- So with that in mind, I tested a few encounters in a palace by ending them with both the Instakill effect, or by ending the encounter with a normal victory in combat, and at the end of every encounter, these skills were logged (for easier reading, the logs will contain skill id and the skill name taken from wiki):
- Checking if player ID 001 has skill 0889 (Money Boost) -> False
- Checking if player ID 004 has skill 0889 (Money Boost) -> False
- Checking if player ID 006 has skill 0889 (Money Boost) -> False
- Checking if player ID 010 has skill 0889 (Money Boost) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0859 (Plus 50% EXP) -> False
- Checking if player ID 002 has skill 0879 (Plus 15% EXP) -> True
- Checking if player ID 002 has skill 0859 (Plus 50% EXP) -> False
- Checking if player ID 003 has skill 0879 (Plus 15% EXP) -> True
- Checking if player ID 003 has skill 0859 (Plus 50% EXP) -> False
- Checking if player ID 004 has skill 0879 (Plus 15% EXP) -> True
- Checking if player ID 004 has skill 0859 (Plus 50% EXP) -> False
- Checking if player ID 005 has skill 0879 (Plus 15% EXP) -> True
- Checking if player ID 005 has skill 0859 (Plus 50% EXP) -> False
- Checking if player ID 006 has skill 0879 (Plus 15% EXP) -> True
- Checking if player ID 006 has skill 0859 (Plus 50% EXP) -> False
- Checking if player ID 007 has skill 0879 (Plus 15% EXP) -> True
- Checking if player ID 007 has skill 0859 (Plus 50% EXP) -> False
- Checking if player ID 008 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 008 has skill 0859 (Plus 50% EXP) -> False
- Checking if player ID 009 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 009 has skill 0859 (Plus 50% EXP) -> False
- Checking if player ID 010 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 010 has skill 0859 (Plus 50% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0859 (Plus 50% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0879 (Plus 15% EXP) -> False
- Checking if player ID 001 has skill 0861 (Victory Cry) -> True
- Checking if player ID 004 has skill 0861 (Victory Cry) -> False
- Checking if player ID 004 has skill 0860 (Life Aid) -> False
- Checking if player ID 004 has skill 0997 (Victory Cry) -> False
- Checking if player ID 004 has skill 0299 (Guiding Tendril) -> False
- Checking if player ID 006 has skill 0861 (Victory Cry) -> False
- Checking if player ID 006 has skill 0860 (Life Aid) -> False
- Checking if player ID 006 has skill 0997 (Victory Cry) -> False
- Checking if player ID 006 has skill 0299 (Guiding Tendril) -> False
- Checking if player ID 010 has skill 0861 (Victory Cry) -> False
- Checking if player ID 010 has skill 0860 (Life Aid) -> False
- Checking if player ID 010 has skill 0997 (Victory Cry) -> False
- Checking if player ID 010 has skill 0299 (Guiding Tendril) -> False
- Checking if player ID 008 has skill 0440 (Subrecover HP) -> False
- Checking if player ID 008 has skill 0648 (Subrecover HP EX) -> True
- Checking if player ID 008 has skill 0441 (Subrecover SP) -> False
- Checking if player ID 008 has skill 0649 (Subrecover SP EX) -> True
- Some notes on this:
- - Victory Cry appears twice, my educated guess is the P5R programmers forgot that Victory Cry already existed and programmed a second one
- - Exp is checked on Joker multiple times because this is checking both Joker himself and then also all of his personas, although for some odd reason the 50% exp boost is only checked for Joker and the current ACTIVE Persona, not any of the personas in the stock reserve
- - Futaba's recovery skills are only checked after every individual party member is checked for their own recovery skills
- - Guiding Tendril is essentially a New Game+ exclusive skill accessory, it is both an active skill and also gives the Life Aid passive effect
- - The skill 889 (Money Boost) is only checked on the active combat units of your party, this passive skill is also granted by the "S.E.E.S Armband" Accessory (which means this accessory has no effect when equipped to Futaba)
- - The skill 879 (Plus 15% EXP) is checked on all available party members (even if not participating in the current battle), this passive skill is also granted by the "Team Glasses" accessory, meaning Futaba can benefit from this too
- - The skill 859 (Plus 50% EXP) is checked on all available party members (even if not participating in the current battle), this passive skill is also granted by the "Expedite Ring" accessory, meaning Futaba can benefit from this too
Advertisement
Add Comment
Please, Sign In to add comment