Solved "Help with hook, please."

Status
Not open for further replies.

jaimecd

Platinian
Original poster
Jul 24, 2019
23
7
3
40
Brasil
bool AtkToggle;

long(*old_get_AttackPower)(void*instance);
long get_AttackPower(void *instance) {
if(instance != NULL && AtkToggle) {
return 9999999l;
}
return old_get_AttackPower(instance);
}

HOOK_LIB("libil2cpp.so", "0x25520C0", get_AttackPower, old_get_AttackPower);

OBFUSCATE("1_Toggle_ATK"),

case1:
AtkToggle = boolean;
break;


"I wrote the code, and it worked perfectly for dealing damage to monsters, but I also take the same damage that I deal. How do I make it so that only the monsters take the damage from my modifier?"


"I found these IDs."
 

Attachments

awdasd

Platinian
Feb 14, 2021
8
1
3
17
United Kingdom
Just use an if statement. For example, get a field or gameobject, etc from that instance. And if it meets the requirements of being your player. Then return something different, otherwise just return the old function.
 
  • Like
Reactions: jaimecd

DaRealPanDa

Co-Administrator
Staff member
Supporting-Team
Global Moderator
Social Media
Mar 12, 2018
6,891
15,721
2,120
27
Skyrim
Thread will be set to "solved" and closed.
When you're not happy with that just send me a message and i will re-open the thread for you.

Thanks.
 
Status
Not open for further replies.