Solved "Help with hook, please."

Status
Not open for further replies.

jaimecd

Platinian
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

  • Sem título.png
    Sem título.png
    8.2 KB · Views: 89
  • Sem título1.png
    Sem título1.png
    10 KB · Views: 90
  • Sem títuloUID.png
    Sem títuloUID.png
    10.1 KB · Views: 90
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.
 
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.
Back
Top Bottom