Guest User

Untitled

a guest
Apr 13th, 2012
771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. bool __thiscall CalcIsShotCriticalHelper(int this)
  2. {
  3. int v1; // esi@1
  4. int v2; // eax@1
  5. int v3; // ebx@1
  6. double v5; // st7@4
  7. int v6; // ecx@6
  8. int v7; // eax@6
  9. __int128 v8; // xmm0@7
  10. float v9; // ST24_4@11
  11. int v10; // edi@9
  12. int v11; // eax@9
  13. int v12; // ST14_4@10
  14. float v13; // ST24_4@16
  15. int v14; // edi@14
  16. int v15; // eax@14
  17. int v16; // ST14_4@15
  18. int v17; // [sp+18h] [bp-20h]@0
  19. int v18; // [sp+1Ch] [bp-1Ch]@0
  20. int v19; // [sp+20h] [bp-18h]@0
  21. float v20; // [sp+24h] [bp-14h]@4
  22.  
  23. v1 = this;
  24. v2 = sub_1001D460(this);
  25. v3 = __RTDynamicCast(
  26. v2,
  27. 0,
  28. (struct _s_RTTICompleteObjectLocator *)&C_BaseCombatCharacter__RTTI_Type_Descriptor_,
  29. (struct TypeDescriptor *)&C_BasePlayer__RTTI_Type_Descriptor_,
  30. 0);
  31. if ( !v3
  32. || !(unsigned __int8)(*(int (__thiscall **)(int))(*(_DWORD *)v3 + 496))(v3)
  33. || (v5 = sub_102DCCD0(v3 + 5588),
  34. v20 = v5,
  35. !(unsigned __int8)(*(int (__thiscall **)(int, _DWORD))(*(_DWORD *)v1 + 1552))(v1, 0)) )
  36. return 0;
  37. if ( (unsigned __int8)sub_102DCB30(v3 + 5588) )
  38. return 1;
  39. v6 = *(_DWORD *)(v1 + 2516);
  40. v7 = *(_DWORD *)(v1 + 2504) << 6;
  41. *(_BYTE *)(v1 + 2523) = 1;
  42. if ( *(_BYTE *)(v7 + v6 + 1844) )
  43. {
  44. v8 = *(_DWORD *)(LODWORD(off_1084FF2C) + 12);
  45. if ( *(float *)(v1 + 2536) <= *(float *)&v8 )
  46. {
  47. if ( (float)(*(float *)(v1 + 2540) + 1.0) <= *(float *)&v8 )
  48. {
  49. sub_10154FA0(LODWORD(off_1084FF2C) + 12);
  50. sub_1001CD60(
  51. 1.0 / (float)((float)(2.0 / fminf(fmaxf(v20 * 0.02, 0.0099999998), 0.99000001)) - 2.0),
  52. (int)"mult_crit_chance",
  53. v1,
  54. 0,
  55. COERCE_FLOAT(1),
  56. v17,
  57. v18,
  58. v19);
  59. v10 = (*(int (__thiscall **)(int))(*(_DWORD *)(v1 + 8) + 36))(v1 + 8) << 8;
  60. v11 = v10 | (*(int (__thiscall **)(int))(*(_DWORD *)(v3 + 8) + 36))(v3 + 8);
  61. if ( (v11 ^ dword_1084C184) != *(_DWORD *)(v1 + 2548) )
  62. {
  63. v12 = v11 ^ dword_1084C184;
  64. *(_DWORD *)(v1 + 2548) = v11 ^ dword_1084C184;
  65. RandomSeed(v12);
  66. }
  67. v9 = v5;
  68. if ( (float)(v9 * 10000.0) >= (float)RandomInt(0, 9999) )
  69. {
  70. *(float *)(v1 + 2536) = *(float *)(LODWORD(off_1084FF2C) + 12) + 2.0;
  71. return 1;
  72. }
  73. }
  74. return 0;
  75. }
  76. return 1;
  77. }
  78. sub_1001CD60(v20 * 0.02, (int)"mult_crit_chance", v1, 0, COERCE_FLOAT(1), v17, v18, v19);
  79. v14 = (*(int (__thiscall **)(int))(*(_DWORD *)(v1 + 8) + 36))(v1 + 8) << 8;
  80. v15 = v14 | (*(int (__thiscall **)(int))(*(_DWORD *)(v3 + 8) + 36))(v3 + 8);
  81. if ( (v15 ^ dword_1084C184) != *(_DWORD *)(v1 + 2548) )
  82. {
  83. v16 = v15 ^ dword_1084C184;
  84. *(_DWORD *)(v1 + 2548) = v15 ^ dword_1084C184;
  85. RandomSeed(v16);
  86. }
  87. v13 = v5;
  88. return (float)(v13 * 10000.0) > (float)RandomInt(0, 9999);
  89. }
Advertisement
Add Comment
Please, Sign In to add comment