Guest User

Untitled

a guest
Jan 16th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. struct e_primary_skull
  2. {
  3. enum : __int32
  4. {
  5. _iron = 0,
  6. _black_eye,
  7. _tough_luck,
  8. _catch,
  9. _fog,
  10. _famine,
  11. _thunderstorm,
  12. _tilt,
  13. _mythic,
  14.  
  15. k_number_of_primary_skulls
  16. } value;
  17.  
  18. bool enabled = false;
  19.  
  20. const char *GetName()
  21. {
  22. const char *names[] {
  23. "iron",
  24. "black eye",
  25. "tough luck",
  26. "catch",
  27. "fog",
  28. "famine",
  29. "thunderstorm",
  30. "tilt",
  31. "mythic"
  32. };
  33. return names[value];
  34. }
  35. };
  36. std::vector<e_primary_skull> primary_skulls = {
  37. { e_primary_skull::_iron, false },
  38. { e_primary_skull::_black_eye, false },
  39. { e_primary_skull::_tough_luck, false },
  40. { e_primary_skull::_catch, false },
  41. { e_primary_skull::_fog, false },
  42. { e_primary_skull::_famine, false },
  43. { e_primary_skull::_thunderstorm, false },
  44. { e_primary_skull::_tilt, false },
  45. { e_primary_skull::_mythic, false }
  46. };
  47. void primary_skull_toggle_hook(__int16 skull, char enable)
  48. {
  49. if (skull < e_primary_skull::k_number_of_primary_skulls)
  50. primary_skulls[skull].enabled = enable ? true : false;
  51. }
  52. bool __cdecl primary_skull_is_active_hook(__int16 skull)
  53. {
  54. if (skull < e_primary_skull::k_number_of_primary_skulls)
  55. return primary_skulls[skull].enabled;
  56. return false;
  57. }
  58.  
  59. struct e_secondary_skull
  60. {
  61. enum : __int32
  62. {
  63. _assassin = 0,
  64. _blind,
  65. _superman,
  66. _birthday_party,
  67. _daddy,
  68. _third_person,
  69. _directors_cut,
  70.  
  71. k_number_of_secondary_skulls,
  72. } value;
  73.  
  74. bool enabled = false;
  75.  
  76. const char *GetName()
  77. {
  78. const char *names[] {
  79. "assassin",
  80. "blind",
  81. "superman",
  82. "birthday party",
  83. "daddy",
  84. "third person",
  85. "directors cut"
  86. };
  87. return names[value];
  88. }
  89. };
  90. std::vector<e_secondary_skull> secondary_skulls = {
  91. { e_secondary_skull::_assassin, false },
  92. { e_secondary_skull::_blind, false },
  93. { e_secondary_skull::_superman, false },
  94. { e_secondary_skull::_birthday_party, false },
  95. { e_secondary_skull::_daddy, false },
  96. { e_secondary_skull::_third_person, false },
  97. { e_secondary_skull::_directors_cut, false }
  98. };
  99. void secondary_skull_toggle_hook(__int16 skull, char enable)
  100. {
  101. if (skull < e_secondary_skull::k_number_of_secondary_skulls)
  102. secondary_skulls[skull].enabled = enable ? true : false;
  103. }
  104. bool __cdecl secondary_skull_is_active_hook(__int16 skull)
  105. {
  106. if (skull < e_secondary_skull::k_number_of_secondary_skulls)
  107. return secondary_skulls[skull].enabled;
  108. return false;
  109. }
  110.  
  111. inline void AddMiscHooks()
  112. {
  113. AddHook({ 0x132B50 }, &primary_skull_toggle_hook, "primary_skull_toggle");
  114. AddHook({ 0x132EE0 }, &secondary_skull_toggle_hook, "secondary_skull_toggle");
  115.  
  116. AddHook({ 0x20AE20 }, &primary_skull_is_active_hook, "primary_skull_is_active");
  117. AddHook({ 0x20AE50 }, &secondary_skull_is_active_hook, "secondary_skull_is_active");
  118. }
Add Comment
Please, Sign In to add comment