Guest User

Untitled

a guest
Nov 19th, 2018
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <API/ARK/Ark.h>
  3.  
  4. #pragma comment(lib, "ArkApi.lib")
  5.  
  6. DECLARE_HOOK(APrimalStructure_TakeDamage, float, APrimalStructure*, float, FDamageEvent*, AController*, AActor*);
  7.  
  8. float Hook_APrimalStructure_TakeDamage(APrimalStructure* _this, float Damage, FDamageEvent* DamageEvent,
  9. AController* EventInstigator, AActor* DamageCauser)
  10. {
  11. if (_this->TargetingTeamField() != 0)
  12. {
  13. if (EventInstigator)
  14. {
  15. ACharacter* character = EventInstigator->CharacterField();
  16.  
  17. if (character != nullptr && character->IsA(APrimalDinoCharacter::GetPrivateStaticClass()))
  18. {
  19. APrimalDinoCharacter* dino = static_cast<APrimalDinoCharacter*>(character);
  20.  
  21. FString descr;
  22. dino->GetDinoDescriptiveName(&descr);
  23.  
  24.  
  25.  
  26.  
  27. if (descr.Contains("Corrupted"))
  28. {
  29. return 0;
  30. }
  31.  
  32. }
  33. }
  34. }
  35.  
  36. return APrimalStructure_TakeDamage_original(_this, Damage, DamageEvent, EventInstigator, DamageCauser);
  37. }
  38.  
  39. void Load()
  40. {
  41. Log::Get().Init("ByeByeCorrupted");
  42.  
  43. ArkApi::GetHooks().SetHook("APrimalStructure.TakeDamage", &Hook_APrimalStructure_TakeDamage,
  44. &APrimalStructure_TakeDamage_original);
  45. }
  46.  
  47. void Unload()
  48. {
  49. ArkApi::GetHooks().DisableHook("APrimalStructure.TakeDamage", &Hook_APrimalStructure_TakeDamage);
  50. }
  51.  
  52. BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
  53. {
  54. switch (ul_reason_for_call)
  55. {
  56. case DLL_PROCESS_ATTACH:
  57. Load();
  58. break;
  59. case DLL_PROCESS_DETACH:
  60. Unload();
  61. break;
  62. }
  63. return TRUE;
  64. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×