-
-
Save niv/380338f7dad0d0f06656ed766a746d8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace | |
{ | |
bool (*GetIsPCDying)(CNWSObject* self); | |
bool GetIsPCDying_Hook(CNWSObject* self) | |
{ | |
if (vptr->AsNWSCreature() && vptr->AsNWSCreature()->GetPlayerCharacter()) | |
return GetCurrentHitPoints() < 1 && GetCurrentHitPoints() > -10; | |
else | |
return false; | |
} | |
bool (*GetIsDead_)(CNWSObject* self); | |
bool GetIsDead_Hook(CNWSObject* self) | |
{ | |
if (vptr->AsNWSCreature() && vptr->AsNWSCreature()->GetPlayerCharacter()) | |
return GetCurrentHitPoints() <= -10; | |
return GetCurrentHitPoints() <= 0; | |
} | |
} | |
void HookMe() | |
{ | |
NX_HOOK(?, GetIsPCDying, GetIsPCDying_Hook); | |
NX_HOOK(?, GetIsDead, GetIsDead_Hook); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment