Guest User

Untitled

a guest
Nov 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. signed int __cdecl Script_UnitIsTapped(int pLuaState)
  2. {
  3. signed int result; // eax@2
  4. char *v2; // eax@3
  5. CGUnit_C *v3; // eax@3
  6. int v4; // [sp+8h] [bp-4h]@0
  7.  
  8. if ( lua_isstring(pLuaState, 1) )
  9. {
  10. v2 = lua_tolstring(pLuaState, 1, 0);
  11. v3 = (CGUnit_C *)GetUnitFromName(v2);
  12. if ( v3 && v3->UnitData->UNIT_DYNAMIC_FLAGS & 4 )
  13. {
  14. lua_pushnumber(pLuaState, 1.0);
  15. result = 1;
  16. }
  17. else
  18. {
  19. lua_pushnil(pLuaState);
  20. result = 1;
  21. }
  22. }
  23. else
  24. {
  25. luaL_error(pLuaState, "Usage: UnitIsTapped(\"unit\")", v4);
  26. result = 0;
  27. }
  28. return result;
  29. }
  30.  
  31. signed int __cdecl Script_UnitIsTappedByPlayer(int a1)
  32. {
  33. signed int result; // eax@2
  34. char *v2; // eax@3
  35. CGUnit_C *v3; // eax@3
  36. int v4; // [sp+8h] [bp-4h]@0
  37.  
  38. if ( lua_isstring(a1, 1) )
  39. {
  40. v2 = lua_tolstring(a1, 1, 0);
  41. v3 = (CGUnit_C *)GetUnitFromName(v2);
  42. if ( v3 && v3->UnitData->UNIT_DYNAMIC_FLAGS & 8 )
  43. {
  44. lua_pushnumber(a1, 1.0);
  45. result = 1;
  46. }
  47. else
  48. {
  49. lua_pushnil(a1);
  50. result = 1;
  51. }
  52. }
  53. else
  54. {
  55. luaL_error(a1, "Usage: UnitIsTappedByPlayer(\"unit\")", v4);
  56. result = 0;
  57. }
  58. return result;
  59. }
  60.  
  61. signed int __cdecl Script_UnitIsTappedByAllThreatList(int a1)
  62. {
  63. signed int result; // eax@2
  64. char *v2; // eax@3
  65. CGUnit_C *v3; // eax@3
  66. int v4; // [sp+8h] [bp-4h]@0
  67.  
  68. if ( lua_isstring(a1, 1) )
  69. {
  70. v2 = lua_tolstring(a1, 1, 0);
  71. v3 = (CGUnit_C *)GetUnitFromName(v2);
  72. if ( v3 && v3->UnitData->UNIT_DYNAMIC_FLAGS & 0x80 )
  73. {
  74. lua_pushnumber(a1, 1.0);
  75. result = 1;
  76. }
  77. else
  78. {
  79. lua_pushnil(a1);
  80. result = 1;
  81. }
  82. }
  83. else
  84. {
  85. luaL_error(a1, "Usage: UnitIsTappedByAllThreatList(\"unit\")", v4);
  86. result = 0;
  87. }
  88. return result;
  89. }
Add Comment
Please, Sign In to add comment