Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.61 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include "c_base_attributable_item.h"
  4.  
  5. enum weapon_type
  6. {
  7. weapontype_knife = 1,
  8. weapontype_pistol,
  9. weapontype_submachinegun,
  10. weapontype_rifle,
  11. weapontype_shotgun,
  12. weapontype_sniper_rifle,
  13. weapontype_machinegun,
  14. weapontype_c4,
  15. weapontype_grenade,
  16. weapontype_unknown
  17. };
  18.  
  19. class c_base_combat_weapon : public c_base_attributable_item
  20. {
  21. public:
  22. class strike_weapon_definition
  23. {
  24. public:
  25. char pad_0x0000[0x8]; //0x0000
  26. int m_nWeaponID; //0x0008
  27. };
  28.  
  29. class weapon_data
  30. {
  31. public:
  32.  
  33.  
  34. int get_weapon_id() const
  35. {
  36. if (!m_pWeaponDef)
  37. return -1;
  38.  
  39. return m_pWeaponDef->m_nWeaponID;
  40. }
  41.  
  42. float get_standing_accuracy(c_base_combat_weapon* weapon) const
  43. {
  44. const auto max_speed = weapon->get_zoom_level() > 0 ? flMaxPlayerSpeedAlt : flMaxPlayerSpeed;
  45. return max_speed / 3.f;
  46. }
  47.  
  48. virtual ~weapon_data() = default;
  49.  
  50. char* consoleName; // 0x0004
  51. char pad_0008[8]; // 0x0008
  52. strike_weapon_definition* m_pWeaponDef; //0x0010
  53. int iMaxClip1; // 0x0014
  54. int iMaxClip2; // 0x0018
  55. int iDefaultClip1; // 0x001C
  56. int iDefaultClip2; // 0x0020
  57. char pad_0024[8]; // 0x0024
  58. char* szWorldModel; // 0x002C
  59. char* szViewModel; // 0x0030
  60. char* szDroppedModel; // 0x0034
  61. char pad_0038[4]; // 0x0038
  62. char* N0000023E; // 0x003C
  63. char pad_0040[56]; // 0x0040
  64. char* szEmptySound; // 0x0078
  65. char pad_007C[4]; // 0x007C
  66. char* szBulletType; // 0x0080
  67. char pad_0084[4]; // 0x0084
  68. char* szHudName; // 0x0088
  69. char* szWeaponName; // 0x008C
  70. char pad_0090[60]; // 0x0090
  71. int WeaponType; // 0x00C8
  72. int iWeaponPrice; // 0x00CC
  73. int iKillAward; // 0x00D0
  74. char* szAnimationPrefix; // 0x00D4
  75. float flCycleTime; // 0x00D8
  76. float flCycleTimeAlt; // 0x00DC
  77. float flTimeToIdle; // 0x00E0
  78. float flIdleInterval; // 0x00E4
  79. bool bFullAuto; // 0x00E8
  80. char pad_0x00E5[3]; // 0x00E9
  81. int iDamage; // 0x00EC
  82. float flArmorRatio; // 0x00F0
  83. int iBullets; // 0x00F4
  84. float flPenetration; // 0x00F8
  85. float flFlinchVelocityModifierLarge; // 0x00FC
  86. float flFlinchVelocityModifierSmall; // 0x0100
  87. float flRange; // 0x0104
  88. float flRangeModifier; // 0x0108
  89. float flThrowVelocity; // 0x010C
  90. char pad_0x010C[16]; // 0x0110
  91. bool bHasSilencer; // 0x011C
  92. char pad_0x0119[3]; // 0x011D
  93. char* pSilencerModel; // 0x0120
  94. int iCrosshairMinDistance; // 0x0124
  95. float flMaxPlayerSpeed; // 0x0128
  96. float flMaxPlayerSpeedAlt; // 0x012C
  97. char pad_0x0130[4]; // 0x0130
  98. float flSpread; // 0x0134
  99. float flSpreadAlt; // 0x0138
  100. float flInaccuracyCrouch; // 0x013C
  101. float flInaccuracyCrouchAlt; // 0x0140
  102. float flInaccuracyStand; // 0x0144
  103. float flInaccuracyStandAlt; // 0x0148
  104. float flInaccuracyJumpInitial; // 0x014C
  105. float flInaccuracyJump; // 0x0150
  106. float flInaccuracyJumpAlt; // 0x0154
  107. float flInaccuracyLand; // 0x0158
  108. float flInaccuracyLandAlt; // 0x015C
  109. float flInaccuracyLadder; // 0x0160
  110. float flInaccuracyLadderAlt; // 0x0164
  111. float flInaccuracyFire; // 0x0168
  112. float flInaccuracyFireAlt; // 0x016C
  113. float flInaccuracyMove; // 0x0170
  114. float flInaccuracyMoveAlt; // 0x0174
  115. float flInaccuracyReload; // 0x0178
  116. int iRecoilSeed; // 0x017C
  117. float flRecoilAngle; // 0x0180
  118. float flRecoilAngleAlt; // 0x0184
  119. float flRecoilAngleVariance; // 0x0188
  120. float flRecoilAngleVarianceAlt; // 0x018C
  121. float flRecoilMagnitude; // 0x0190
  122. float flRecoilMagnitudeAlt; // 0x0194
  123. float flRecoilMagnitudeVariance; // 0x0198
  124. float flRecoilMagnitudeVarianceAlt; // 0x019C
  125. float flRecoveryTimeCrouch; // 0x01A0
  126. float flRecoveryTimeStand; // 0x01A4
  127. float flRecoveryTimeCrouchFinal; // 0x01A8
  128. float flRecoveryTimeStandFinal; // 0x01AC
  129. int iRecoveryTransitionStartBullet; // 0x01B0
  130. int iRecoveryTransitionEndBullet; // 0x01B4
  131. bool bUnzoomAfterShot; // 0x01B8
  132. bool bHideViewModelZoomed; // 0x01B9
  133. char pad_0x01B5[2]; // 0x01BA
  134. char iZoomLevels[3]; // 0x01BC
  135. int iZoomFOV[2]; // 0x01C0
  136. float fZoomTime[3]; // 0x01C4
  137. char* szWeaponClass; // 0x01D4
  138. float flAddonScale; // 0x01D8
  139. char pad_0x01DC[4]; // 0x01DC
  140. char* szEjectBrassEffect; // 0x01E0
  141. char* szTracerEffect; // 0x01E4
  142. int iTracerFrequency; // 0x01E8
  143. int iTracerFrequencyAlt; // 0x01EC
  144. char* szMuzzleFlashEffect_1stPerson; // 0x01F0
  145. char pad_0x01F4[4]; // 0x01F4
  146. char* szMuzzleFlashEffect_3rdPerson; // 0x01F8
  147. char pad_0x01FC[4]; // 0x01FC
  148. char* szMuzzleSmokeEffect; // 0x0200
  149. float flHeatPerShot; // 0x0204
  150. char* szZoomInSound; // 0x0208
  151. char* szZoomOutSound; // 0x020C
  152. float flInaccuracyPitchShift; // 0x0210
  153. float flInaccuracySoundThreshold; // 0x0214
  154. float flBotAudibleRange; // 0x0218
  155. char pad_0x0218[8]; // 0x0220
  156. char* pWrongTeamMsg; // 0x0224
  157. bool bHasBurstMode; // 0x0228
  158. char pad_0x0225[3]; // 0x0229
  159. bool bIsRevolver; // 0x022C
  160. bool bCannotShootUnderwater; // 0x0230
  161. };
  162.  
  163. bool is_grenade() { return get_item_definition() >= weapon_flashbang && get_item_definition() <= weapon_incgrenade; }
  164. bool is_knife() { return (get_item_definition() >= weapon_knife_flip && get_item_definition() <= weapon_knife_widowmaker) || get_item_definition() == weapon_knife || get_item_definition() == weapon_knifegg || get_item_definition() == weapon_knife_ghost; }
  165. bool is_bomb() { return get_item_definition() == weapon_c4; }
  166.  
  167. char * GetGunIcon();
  168.  
  169. char* get_weapon_name();
  170.  
  171. vfunc(479, get_inaccuracy(), float(__thiscall*)(void*))()
  172. vfunc(480, update_accuracy(), void(__thiscall*)(void*))()
  173.  
  174. netvar(get_current_clip(), int32_t, "CBaseCombatWeapon", "m_iClip1")
  175. netvar(get_next_primary_attack(), float, "CBaseCombatWeapon", "m_flNextPrimaryAttack")
  176. netvar(get_next_secondary_attack(), int32_t, "CBaseCombatWeapon", "m_flNextSecondaryAttack")
  177. netvar(get_postpone_fire_ready_time(), int32_t, "CWeaponCSBase", "m_flPostponeFireReadyTime")
  178. netvar(get_zoom_level(), int32_t, "CWeaponCSBaseGun", "m_zoomLevel")
  179. netvar(get_accuracy_penalty(), float, "CWeaponCSBase", "m_fAccuracyPenalty")
  180. netvar(get_recoil_index(), float, "CWeaponCSBase", "m_flRecoilIndex")
  181. netvar(get_last_shot_time(), float, "CWeaponCSBase", "m_fLastShotTime")
  182. netvar(get_pin_pulled(), bool, "CBaseCSGrenade", "m_bPinPulled")
  183. netvar(get_throw_time(), float, "CBaseCSGrenade", "m_fThrowTime")
  184. offset(get_in_reload(), bool, 0x3285)
  185. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement