Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Want to track Latent Power Counter / Time remaining #61

Open
ScottSilLew opened this issue Mar 13, 2020 · 2 comments
Open

Want to track Latent Power Counter / Time remaining #61

ScottSilLew opened this issue Mar 13, 2020 · 2 comments

Comments

@ScottSilLew
Copy link

I want to be able to track the Latent Power activation behavior. I don't know if it's a status effect that get applied, and I don't know where to look for memory addresses. Can someone point me in that direction?

@sheryl-rihacek
Copy link

same, but for coalesce!

@gabrielefilipp
Copy link
Owner

gabrielefilipp commented Mar 14, 2020

Hey,

I'll be very happy if you want to contribute to SmartHunter. For statuses you can understand how it works inside the file PlayerDataConfig.cs:

// For example
new StatusEffectConfig("Horn", "LOC_STATUS_EFFECT_SELF_IMPROVEMENT", (uint)(uint)StatusEffectConfig.MemorySource.Base, indexToHexStrNoOffset(14))
 
/*
*There you can see it calls the function private static string indexToHexStrNoOffset(int index)
*Which basically call private static string indexToHexStr(int index, ulong baseOffset) which calculate
*the offset and convert it to a string
*
*
*private static string indexToHexStr(int index, ulong baseOffset)
*{
*   ulong multiplier = 0x4;
*   string prefix = "";
*   if (index < 0)
*   {
*      index = (-1) * index;
*      prefix = "-";
*   }
*   ulong hex = baseOffset + multiplier * (ulong)index; // Here it is the IMPORTANT THING as every status will be 4 bytes (multiplier) away from each other
*   return $"{prefix}{hex.ToString("X")}";
*}
*
*Regarding duration and maxduration that should be done insde MhwHelper.cs under UpdatePlayerWidget function but for getting new statuses you need only what I said before
*/

So in the end if you want to discover new statuses i recommend you to debug the code in my git repo and place a breakpoint at line 183 of MhwMemoryUpdater.cs
Then, based on what status you are looking for (equipment, weapon, base) take the appropriate one:

ulong equipmentAddress = MemoryHelper.Read<ulong>(Process, lastBuffAddress + 0x14F8);
ulong weaponAddress = MemoryHelper.Read<ulong>(Process, lastBuffAddress + 0x76B0);
ulong buffAddress = MemoryHelper.Read<ulong>(Process, lastBuffAddress + 0x7D20);

Then:

1)Open CheatEngine;
2)Attach it to MonsterHunter;
3)Open MemoryView and navigate to the address you chose;
4)Scroll to the specific offset: from PlayerDataConfig.cs you can see that Hunting Horn's statuses start around offset indexToHexStrNoOffset(14) = 14 * 4 + 0 = 56 (38 in HEX), player afflicted statuses around indexToHexStrNoOffset(375) = 375 * 4 + 0 = 1500 (4DC in HEX), consumables around indexToHexStrNoOffset(421) = 421 * 4 + 0 = 1684 (694 in HEX) and finally weapons which i got only katan buffs so they might start also sooner around indexToHexStrNoOffset(2402) = 2402 * 4 + 0 = 9608 (2588 in HEX);
4)Enlarge the view;
5)Enter training room in MonsterHunter;
6)Trigger the buff;
7)Look at MemoryView what changed and if there's a value that is decrementing (that previously wasn't there);
8)Take note of the offset (it is in HEX so convert it to decimal) then divide it by 4;
9)Add it to PlayerDataConfig.cs;
10)Repeat.

Teorically you can add a lot of new statuses definitions with incremental numbers, like

new StatusEffectConfig("ID", "LOC", (uint)StatusEffectConfig.MemorySource.X, indexToHexStrNoOffset(x++));

And see if you get something useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants