Weapon Asset (BO2)

From COD Engine Research
Jump to: navigation, search

The purpose of the weapon asset should be fairly obvious, but the structure not so much. The weapon asset on Black Ops 2 continues on the Modern Warfare 2 idea of the "WeaponVariantDef". On Xbox 360 the WeaponVariantDef is 0x2CC bytes, while the WeaponDef is 0x990.

enum AnimationType : int
{
  none = 0,
  default = 1,
  other = 2,
  sniper = 3,
  m203 = 4,
  hold = 5,
  briefcase = 6,
  reviver = 7,
  radio = 8,
  dualwield = 9,
  remotecontrol = 10,
  crossbow = 11,
  minigun = 12,
  beltfed = 13, 
  g11 = 14,
  rearclip = 15,
  handleclip = 16,
  rearclipsniper = 17,
  ballisticknife = 18,
  singleknife = 19,
  nopump = 20,
  hatchet = 21,
  grimreaper = 22,
  zipline = 23,
  riotshield = 24,
  tablet = 25,
  turned = 26,
  screecher = 27,
  PLAYER_ANIM_TYPE_MAX
};
 
enum meansOfDeath_t//WeaponDef->iDamageType
{
  MOD_UNKNOWN = 0x0,
  MOD_PISTOL_BULLET = 0x1,
  MOD_RIFLE_BULLET = 0x2,
  MOD_GRENADE = 0x3,
  MOD_GRENADE_SPLASH = 0x4,
  MOD_PROJECTILE = 0x5,
  MOD_PROJECTILE_SPLASH = 0x6,
  MOD_MELEE = 0x7,
  MOD_BAYONET = 0x8,
  MOD_HEAD_SHOT = 0x9,
  MOD_CRUSH = 0xA,
  MOD_TELEFRAG = 0xB,
  MOD_FALLING = 0xC,
  MOD_SUICIDE = 0xD,
  MOD_TRIGGER_HURT = 0xE,
  MOD_EXPLOSIVE = 0xF,
  MOD_IMPACT = 0x10,
  MOD_BURNED = 0x11,
  MOD_HIT_BY_OBJECT = 0x12,
  MOD_DROWN = 0x13,
  MOD_GAS = 0x14,
  MOD_NUM = 0x15
};
 
enum weapAnimFiles_t//WeaponDef->szXAnims
{
  WEAP_ANIM_ROOT = 0x0,
  WEAP_ANIM_IDLE = 0x1,
  WEAP_ANIM_EMPTY_IDLE = 0x2,
  WEAP_ANIM_FIRE_INTRO = 0x3,
  WEAP_ANIM_FIRE = 0x4,
  WEAP_ANIM_HOLD_FIRE = 0x5,
  WEAP_ANIM_LASTSHOT = 0x6,
  WEAP_ANIM_FINALSHOT = 0x7,
  WEAP_ANIM_RECHAMBER = 0x8,
  WEAP_ANIM_MELEE = 0x9,
  WEAP_ANIM_MELEE1 = 0xA,
  WEAP_ANIM_MELEE2 = 0xB,
  WEAP_ANIM_MELEE3 = 0xC,
  WEAP_ANIM_MELEE_EMPTY = 0xD,
  WEAP_ANIM_MELEE_CHARGE = 0xE,
  WEAP_ANIM_MELEE_CHARGE_EMPTY = 0xF,
  WEAP_ANIM_RELOAD = 0x10,
  WEAP_ANIM_RELOAD_RIGHT = 0x11,
  WEAP_ANIM_RELOAD_EMPTY = 0x12,
  WEAP_ANIM_RELOAD_START = 0x13,
  WEAP_ANIM_RELOAD_END = 0x14,
  WEAP_ANIM_RELOAD_QUICK = 0x15,
  WEAP_ANIM_RELOAD_QUICK_EMPTY = 0x16,
  WEAP_ANIM_RAISE = 0x17,
  WEAP_ANIM_FIRST_RAISE = 0x18,
  WEAP_ANIM_DROP = 0x19,
  WEAP_ANIM_ALT_RAISE = 0x1A,
  WEAP_ANIM_ALT_DROP = 0x1B,
  WEAP_ANIM_QUICK_RAISE = 0x1C,
  WEAP_ANIM_QUICK_DROP = 0x1D,
  WEAP_ANIM_EMPTY_RAISE = 0x1E,
  WEAP_ANIM_EMPTY_DROP = 0x1F,
  WEAP_ANIM_SPRINT_IN = 0x20,
  WEAP_ANIM_SPRINT_LOOP = 0x21,
  WEAP_ANIM_SPRINT_OUT = 0x22,
  WEAP_ANIM_SPRINT_EMPTY_IN = 0x23,
  WEAP_ANIM_SPRINT_EMPTY_LOOP = 0x24,
  WEAP_ANIM_SPRINT_EMPTY_OUT = 0x25,
  WEAP_ANIM_LOWREADY_IN = 0x26,
  WEAP_ANIM_LOWREADY_LOOP = 0x27,
  WEAP_ANIM_LOWREADY_OUT = 0x28,
  WEAP_ANIM_CONT_FIRE_IN = 0x29,
  WEAP_ANIM_CONT_FIRE_LOOP = 0x2A,
  WEAP_ANIM_CONT_FIRE_OUT = 0x2B,
  WEAP_ANIM_CRAWL_IN = 0x2C,
  WEAP_ANIM_CRAWL_FORWARD = 0x2D,
  WEAP_ANIM_CRAWL_BACK = 0x2E,
  WEAP_ANIM_CRAWL_RIGHT = 0x2F,
  WEAP_ANIM_CRAWL_LEFT = 0x30,
  WEAP_ANIM_CRAWL_OUT = 0x31,
  WEAP_ANIM_CRAWL_EMPTY_IN = 0x32,
  WEAP_ANIM_CRAWL_EMPTY_FORWARD = 0x33,
  WEAP_ANIM_CRAWL_EMPTY_BACK = 0x34,
  WEAP_ANIM_CRAWL_EMPTY_RIGHT = 0x35,
  WEAP_ANIM_CRAWL_EMPTY_LEFT = 0x36,
  WEAP_ANIM_CRAWL_EMPTY_OUT = 0x37,
  WEAP_ANIM_DEPLOY = 0x38,
  WEAP_ANIM_BREAKDOWN = 0x39,
  WEAP_ANIM_DETONATE = 0x3A,
  WEAP_ANIM_NIGHTVISION_WEAR = 0x3B,
  WEAP_ANIM_NIGHTVISION_REMOVE = 0x3C,
  WEAP_ANIM_ADS_FIRE = 0x3D,
  WEAP_ANIM_ADS_LASTSHOT = 0x3E,
  WEAP_ANIM_ADS_FIRE_INTRO = 0x3F,
  WEAP_ANIM_ADS_RECHAMBER = 0x40,
  WEAP_ANIM_DTP_IN = 0x41,
  WEAP_ANIM_DTP_LOOP = 0x42,
  WEAP_ANIM_DTP_OUT = 0x43,
  WEAP_ANIM_DTP_EMPTY_IN = 0x44,
  WEAP_ANIM_DTP_EMPTY_LOOP = 0x45,
  WEAP_ANIM_DTP_EMPTY_OUT = 0x46,
  WEAP_ANIM_SLIDE_IN = 0x47,
  WEAP_ANIM_MANTLE = 0x48,
  WEAP_ANIM_CAMERA_SPRINT_LOOP = 0x49,
  WEAP_ANIM_CAMERA_DTP_IN = 0x4A,
  WEAP_ANIM_CAMERA_DTP_LOOP = 0x4B,
  WEAP_ANIM_CAMERA_DTP_OUT = 0x4C,
  WEAP_ANIM_CAMERA_MANTLE = 0x4D,
  WEAP_ANIM_FIRE_LEFT = 0x4E,
  WEAP_ANIM_LASTSHOT_LEFT = 0x4F,
  WEAP_ANIM_FINALSHOT_LEFT = 0x50,
  WEAP_ANIM_IDLE_LEFT = 0x51,
  WEAP_ANIM_EMPTY_IDLE_LEFT = 0x52,
  WEAP_ANIM_RELOAD_EMPTY_LEFT = 0x53,
  WEAP_ANIM_RELOAD_LEFT = 0x54,
  WEAP_ANIM_ADS_UP = 0x55,
  WEAP_ANIM_ADS_DOWN = 0x56,
  WEAP_ANIM_ADS_UP_OTHER_SCOPE = 0x57,
  NUM_WEAP_ANIMS = 0x58
};
 
enum weapType_t : int
{
  WEAPTYPE_BULLET = 0,
  WEAPTYPE_GRENADE = 1,
  WEAPTYPE_PROJECTILE = 2,
  WEAPTYPE_BINOCULARS = 3,
  WEAPTYPE_GAS = 4,
  WEAPTYPE_BOMB = 5,
  WEAPTYPE_MINE = 6,
  WEAPTYPE_MELEE = 7,
  WEAPTYPE_RIOTSHIELD = 8,
  WEAPTYPE_MAX
};
 
enum weapClass_t : int
{
  WEAPCLASS_RIFLE = 0,
  WEAPCLASS_MG = 1,
  WEAPCLASS_SMG = 2,
  WEAPCLASS_SPREAD = 3,
  WEAPCLASS_PISTOL = 4,
  WEAPCLASS_GRENADE = 5,
  WEAPCLASS_ROCKETLAUNCHER = 6,
  WEAPCLASS_TURRET = 7,
  WEAPCLASS_NON_PLAYER = 8,
  WEAPCLASS_GAS = 9,
  WEAPCLASS_ITEM  = 10,
  WEAPCLASS_MELEE = 11,
  WEAPCLASS_KILLSTREAK_ALT_STORED_WEAPON = 12,
  WEAPCLASS_PISTOL_SPREAD = 13,
  WEAPCLASS_MAX
};
 
enum weaponIconRatioType_t : int
{
  WEAPON_ICON_RATIO_1TO1 = 0,
  WEAPON_ICON_RATIO_2TO1 = 1,
  WEAPON_ICON_RATIO_4TO1 = 2,
  WEAPON_ICON_RATIO_MAX
};
 
enum PenetrateType : int
{
  PENETRATE_TYPE_NONE = 0,
  PENETRATE_TYPE_SMALL = 1,
  PENETRATE_TYPE_MEDIUM = 2,
  PENETRATE_TYPE_LARGE = 3,
  PENETRATE_TYPE_MAX 
};
 
enum weapStance_t : int
{
  WEAPSTANCE_STAND = 0x0,
  WEAPSTANCE_DUCK = 0x1,
  WEAPSTANCE_PRONE = 0x2,
  WEAPSTANCE_MAX
};
 
enum ammoCounterClipType_t : int
{
  AMMO_COUNTER_CLIP_NONE = 0,
  AMMO_COUNTER_CLIP_MAGAZINE = 1,
  AMMO_COUNTER_CLIP_SHORTMAGAZINE = 2,
  AMMO_COUNTER_CLIP_SHOTGUN = 3,
  AMMO_COUNTER_CLIP_ROCKET = 4,
  AMMO_COUNTER_CLIP_BELTFED = 5,
  AMMO_COUNTER_CLIP_ALTWEAPON = 6,
  AMMO_COUNTER_CLIP_MAX
};
 
enum weapOverlayReticle_t
{
  WEAPOVERLAYRETICLE_NONE = 0x0,
  WEAPOVERLAYRETICLE_CROSSHAIR = 0x1,
  WEAPOVERLAYRETICLE_MAX
};
 
enum weapOverlayInterface_t
{
  WEAPOVERLAYINTERFACE_NONE = 0x0,
  WEAPOVERLAYINTERFACE_JAVELIN = 0x1,
  WEAPOVERLAYINTERFACE_TURRETSCOPE = 0x2,
  WEAPOVERLAYINTERFACE_MAX
};
 
enum weapInventoryType_t : int
{
  WEAPINVENTORY_PRIMARY = 0,
  WEAPINVENTORY_OFFHAND = 1,
  WEAPINVENTORY_ITEM = 2,
  WEAPINVENTORY_ALTMODE = 3,
  WEAPINVENTORY_MELEE = 4,
  WEAPINVENTORY_DW_LEFT_HAND = 5,
  WEAPINVENTORY_MAX
};
 
enum ImpactType : int
{
  IMPACT_TYPE_NONE = 0,
  IMPACT_TYPE_BULLET_SMALL = 1,
  IMPACT_TYPE_BULLET_LARGE = 2,
  IMPACT_TYPE_BULLET_AP = 3,
  IMPACT_TYPE_BULLET_XTREME = 4,
  IMPACT_TYPE_SHOTGUN = 5,
  IMPACT_TYPE_GRENADE_BOUNCE = 6,
  IMPACT_TYPE_GRENADE_EXPLODE = 7,
  IMPACT_TYPE_RIFLE_GRENADE = 8,
  IMPACT_TYPE_ROCKET_EXPLODE = 9,
  IMPACT_TYPE_ROCKET_EXPLODE_XTREME = 10,
  IMPACT_TYPE_PROJECTILE_DUD = 11,
  IMPACT_TYPE_MORTAR_SHELL = 12,
  IMPACT_TYPE_TANK_SHELL = 13,
  IMPACT_TYPE_BOLT = 14,
  IMPACT_TYPE_BLADE = 15,
  IMPACT_TYPE_MAX
};
 
enum weapFireType_t : int
{
  WEAPON_FIRETYPE_FULLAUTO = 0,
  WEAPON_FIRETYPE_SINGLESHOT = 1,
  WEAPON_FIRETYPE_2ROUNDBURST = 2,
  WEAPON_FIRETYPE_3ROUNDBURST = 3,
  WEAPON_FIRETYPE_4ROUNDBURST = 4,
  WEAPON_FIRETYPE_5ROUNDBURST = 5,
  WEAPON_FIRETYPE_STACKEDFIRE = 6,
  WEAPON_FIRETYPE_MINIGUN = 7,
  WEAPON_FIRETYPE_CHARGESHOT = 8,
  WEAPON_FIRETYPE_JETGUN = 9,
  WEAPON_FIRETYPE_MAX
};
 
enum weapClipType_t : int
{
  WEAPON_CLIPTYPE_BOTTOM = 0x0,
  WEAPON_CLIPTYPE_TOP = 0x1,
  WEAPON_CLIPTYPE_LEFT = 0x2,
  WEAPON_CLIPTYPE_DP28 = 0x3,
  WEAPON_CLIPTYPE_PTRS = 0x4,
  WEAPON_CLIPTYPE_LMG = 0x5,
  WEAPON_CLIPTYPECOUNT = 0x6,
};
 
enum barrelType_t : int
{
  BARREL_TYPE_SINGLE = 0x0,
  BARREL_TYPE_DUAL = 0x1,
  BARREL_TYPE_DUAL_ALTERNATE = 0x2,
  BARREL_TYPE_QUAD = 0x3,
  BARREL_TYPE_QUAD_ALTERNATE = 0x4,
  BARREL_TYPE_QUAD_DOUBLE_ALTERNATE = 0x5,
  BARREL_TYPE_COUNT = 0x6
};
 
enum surfaceNames_t
{
  bark,
  brick,
  carpet,
  cloth,
  concrete,
  dirt,
  flesh,
  foliage,
  glass,
  grass,
  gravel,
  ice,
  metal,
  mud,
  paper,
  plaster,
  rock,
  sand,
  snow,
  water,
  wood,
  asphalt,
  ceramic,
  plastic,
  rubber,
  cushion,
  fruit,
  paintedmetal,
  player,
  tallgrass,
  riotshield,
  opaqueglass
};
 
enum WeapStickinessType
{
  WEAPSTICKINESS_NONE = 0x0,
  WEAPSTICKINESS_ALL = 0x1,
  WEAPSTICKINESS_ALL_NO_SENTIENTS = 0x2,
  WEAPSTICKINESS_GROUND = 0x3,
  WEAPSTICKINESS_GROUND_WITH_YAW = 0x4,
  WEAPSTICKINESS_FLESH = 0x5,
  WEAPSTICKINESS_COUNT = 0x6
};
 
enum WeapRotateType
{
  WEAPROTATE_GRENADE_ROTATE = 0x0,
  WEAPROTATE_BLADE_ROTATE = 0x1,
  WEAPROTATE_CYLINDER_ROTATE = 0x2,
  WEAPROTATE_COUNT = 0x3
};
 
enum guidedMissileType_t
{
  MISSILE_GUIDANCE_NONE = 0x0,
  MISSILE_GUIDANCE_SIDEWINDER = 0x1,
  MISSILE_GUIDANCE_HELLFIRE = 0x2,
  MISSILE_GUIDANCE_JAVELIN = 0x3,
  MISSILE_GUIDANCE_BALLISTIC = 0x4,
  MISSILE_GUIDANCE_WIRE = 0x5,
  MISSILE_GUIDANCE_TV = 0x6,
  MISSILE_GUIDANCE_DRONE = 0x7,
  MISSILE_GUIDANCE_HEAT = 0x8,
  MISSILE_GUIDANCE_MAX
};
 
enum hitLocation_t
{
  HITLOC_NONE = 0x0,
  HITLOC_HELMET = 0x1,
  HITLOC_HEAD = 0x2,
  HITLOC_NECK = 0x3,
  HITLOC_TORSO_UPR = 0x4,
  HITLOC_TORSO_MID = 0x5,
  HITLOC_TORSO_LWR = 0x6,
  HITLOC_R_ARM_UPR = 0x7,
  HITLOC_L_ARM_UPR = 0x8,
  HITLOC_R_ARM_LWR = 0x9,
  HITLOC_L_ARM_LWR = 0xA,
  HITLOC_R_HAND = 0xB,
  HITLOC_L_HAND = 0xC,
  HITLOC_R_LEG_UPR = 0xD,
  HITLOC_L_LEG_UPR = 0xE,
  HITLOC_R_LEG_LWR = 0xF,
  HITLOC_L_LEG_LWR = 0x10,
  HITLOC_R_FOOT = 0x11,
  HITLOC_L_FOOT = 0x12,
  HITLOC_GUN = 0x13,
  HITLOC_RIOT = 0x14,
  HITLOC_NUM = 0x15,
};
 
struct ProjectileExplosionEffect
{
  FxEffectDef * projExplosionEffect;
  bool projExplosionEffectForceNormalUp;
};
 
struct FlameTable
{
  float streamChunkGravityStart;
  float streamChunkGravityEnd;
  float streamChunkMaxSize;
  float streamChunkStartSize;
  float streamChunkEndSize;
  float streamChunkStartSizeRand;
  float streamChunkEndSizeRand;
  float streamChunkDistScalar;
  float streamChunkDistSwayScale;
  float streamChunkDistSwayVelMax;
  float streamChunkSpeed;
  float streamChunkDecel;
  float streamChunkVelocityAddScale;
  float streamChunkDuration;
  float streamChunkDurationScaleMaxVel;
  float streamChunkDurationVelScalar;
  float streamChunkSizeSpeedScale;
  float streamChunkSizeAgeScale;
  float streamChunkSpawnFireIntervalSt;
  float streamChunkSpawnFireIntervalEn;
  float streamChunkSpawnFireMinLifeFra;
  float streamChunkSpawnFireMaxLifeFra;
  float streamChunkFireMinLifeFrac;
  float streamChunkFireMinLifeFracStar;
  float streamChunkFireMinLifeFracEnd;
  float streamChunkDripsMinLifeFrac;
  float streamChunkDripsMinLifeFracSta;
  float streamChunkDripsMinLifeFracEnd;
  float streamChunkRotationRange;
  float streamSizeRandSinWave;
  float streamSizeRandCosWave;
  float streamDripsChunkInterval;
  float streamDripsChunkMinFrac;
  float streamDripsChunkRandFrac;
  float streamSmokeChunkInterval;
  float streamSmokeChunkMinFrac;
  float streamSmokeChunkRandFrac;
  float streamChunkCullDistSizeFrac;
  float streamChunkCullMinLife;
  float streamChunkCullMaxLife;
  float streamFuelSizeStart;
  float streamFuelSizeEnd;
  float streamFuelLength;
  float streamFuelNumSegments;
  float streamFuelAnimLoopTime;
  float streamFlameSizeStart;
  float streamFlameSizeEnd;
  float streamFlameLength;
  float streamFlameNumSegments;
  float streamFlameAnimLoopTime;
  float streamPrimaryLightRadius;
  float streamPrimaryLightRadiusFlutte;
  float streamPrimaryLightR;
  float streamPrimaryLightG;
  float streamPrimaryLightB;
  float streamPrimaryLightFlutterR;
  float streamPrimaryLightFlutterG;
  float streamPrimaryLightFlutterB;
  float fireLife;
  float fireLifeRand;
  float fireSpeedScale;
  float fireSpeedScaleRand;
  float fireVelocityAddZ;
  float fireVelocityAddZRand;
  float fireVelocityAddSideways;
  float fireGravity;
  float fireGravityEnd;
  float fireMaxRotVel;
  float fireFriction;
  float fireEndSizeAdd;
  float fireStartSizeScale;
  float fireEndSizeScale;
  float fireBrightness;
  float dripsLife;
  float dripsLifeRand;
  float dripsSpeedScale;
  float dripsSpeedScaleRand;
  float dripsVelocityAddZ;
  float dripsVelocityAddZRand;
  float dripsVelocityAddSideways;
  float dripsGravity;
  float dripsGravityEnd;
  float dripsMaxRotVel;
  float dripsFriction;
  float dripsEndSizeAdd;
  float dripsStartSizeScale;
  float dripsEndSizeScale;
  float dripsBrightness;
  float smokeLife;
  float smokeLifeRand;
  float smokeSpeedScale;
  float smokeVelocityAddZ;
  float smokeGravity;
  float smokeGravityEnd;
  float smokeMaxRotation;
  float smokeMaxRotVel;
  float smokeFriction;
  float smokeEndSizeAdd;
  float smokeStartSizeAdd;
  float smokeOriginSizeOfsZScale;
  float smokeOriginOfsZ;
  float smokeFadein;
  float smokeFadeout;
  float smokeMaxAlpha;
  float smokeBrightness;
  float smokeOriginOffset;
  float collisionSpeedScale;
  float collisionVolumeScale;
  const char * name;
  Material * fire;
  Material * smoke;
  Material * heat;
  Material * drips;
  Material * streamFuel;
  Material * streamFuel2;
  Material * streamFlame;
  Material * streamFlame2;
  const char * flameOffLoopSound;
  const char * flameIgniteSound;
  const char * flameOnLoopSound;
  const char * flameCooldownSound;
};
 
enum OffhandClass
{
  OFFHAND_CLASS_NONE = 0x0,
  OFFHAND_CLASS_FRAG_GRENADE = 0x1,
  OFFHAND_CLASS_SMOKE_GRENADE = 0x2,
  OFFHAND_CLASS_FLASH_GRENADE = 0x3,
  OFFHAND_CLASS_GEAR = 0x4,
  OFFHAND_CLASS_SUPPLYDROP_MARKER = 0x5,
  OFFHAND_CLASS_COUNT = 0x6,
};
 
enum OffhandSlot
{
  OFFHAND_SLOT_NONE = 0x0,
  OFFHAND_SLOT_LETHAL_GRENADE = 0x1,
  OFFHAND_SLOT_TACTICAL_GRENADE = 0x2,
  OFFHAND_SLOT_EQUIPMENT = 0x3,
  OFFHAND_SLOT_SPECIFIC_USE = 0x4,
  OFFHAND_SLOT_COUNT = 0x5,
};
 
struct WeaponDef
{
  const char *szOverlayName;
  XModel **gunXModel;
  XModel *handXModel;
  const char *szModeName;
  ScriptString (*noteTrackSoundMapKeys)[0x14];
  ScriptString (*notetrackSoundMapValues)[0x14];
  AnimationType playerAnimType;
  weapType_t weaponType;
  weapClass_t weaponClass;
  PenetrateType penetrateType;
  ImpactType impactType;
  weapInventoryType_t inventoryType;
  weapFireType_t fireType;							
  weapClipType_t clipType;
  barrelType_t barrelType;
  int itemIndex;
  const char * parentWeaponName;
  int iJamFireTime;
  int overheatWeapon;
  float overheatRate;
  float cooldownRate;
  float overheatEndVal;
  bool coolWhileFiring;
  bool fuelTankWeapon;
  int iTankLifeTime;
  OffhandClass offhandClass;
  OffhandSlot offhandSlot;
  weapStance_t stance;
  FxEffectDef * viewFlashEffect;
  FxEffectDef * worldFlashEffect;
  FxEffectDef * barrelCooldownEffect;
  int barrelCooldownMinCount;
  vec3_t vViewFlashOffset;
  vec3_t vWorldFlashOffset;
  char * pickupSound;
  char * pickupSoundPlayer;
  char * ammoPickupSound;
  char * ammoPickupSoundPlayer;
  char * projectileSound;
  char * pullbackSound;
  char * pullbackSoundPlayer;
  char * fireSound;
  char * fireSoundPlayer;
  char * loopFireSound;
  char * loopFireSoundPlayer;
  char * loopFireEndSound;
  char * loopFireEndSoundPlayer;
  char * startFireSound;
  char * stopFireSound;
  char * killcamStartFireSound;
  char * startFireSoundPlayer;
  char * stopFireSoundPlayer;
  char * killcamStartFireSoundPlayer;
  char * lastShotSound;
  char * lastShotSoundPlayer;
  char * emptyFireSound;
  char * emptyFireSoundPlayer;
  char * crackSound;
  char * whizbySound;
  char * meleeSwipeSound;
  char * meleeSwipeSoundPlayer;
  char * meleeHitSound;
  char * meleeMissSound;
  char * rechamberSound;
  char * rechamberSoundPlayer;
  char * reloadSound;
  char * reloadSoundPlayer;
  char * reloadEmptySound;
  char * reloadEmptySoundPlayer;
  char * reloadStartSound;
  char * reloadStartSoundPlayer;
  char * reloadEndSound;
  char * reloadEndSoundPlayer;
  char * rotateLoopSound;
  char * rotateLoopSoundPlayer;
  char * rotateStopSound;
  char * rotateStopSoundPlayer;
  char * deploySound;
  char * deploySoundPlayer;
  char * finishDeploySound;
  char * finishDeploySoundPlayer;
  char * breakdownSound;
  char * breakdownSoundPlayer;
  char * finishBreakdownSound;
  char * finishBreakdownSoundPlayer;
  char * detonateSound;
  char * detonateSoundPlayer;
  char * nightVisionWearSound;
  char * nightVisionWearSoundPlayer;
  char * nightVisionRemoveSound;
  char * nightVisionRemoveSoundPlayer;
  char * altSwitchSound;
  char * altSwitchSoundPlayer;
  char * raiseSound;
  char * raiseSoundPlayer;
  char * firstRaiseSound;
  char * firstRaiseSoundPlayer;
  char * adsRaiseSoundPlayer;
  char * adsLowerSoundPlayer;
  char * putawaySound;
  char * putawaySoundPlayer;
  char * overheatSound;
  char * overheatSoundPlayer;
  char * adsZoomSound;
  char * shellCasing;
  char * shellCasingPlayer;
  char * * bounceSounds;    //Refer to surfaceNames_t
  const char * standMountedWeapdef;
  const char * crouchMountedWeapdef;
  const char * proneMountedWeapdef;
  unsigned int standMountedWeapIndex;
  unsigned int crouchMountedWeapIndex;
  unsigned int proneMountedWeapIndex;
  FxEffectDef * viewShellEjectEffect;
  FxEffectDef * worldShellEjectEffect;
  FxEffectDef * viewLastShotEjectEffect;
  FxEffectDef * worldLastShotEjectEffect;
  vec3_t vViewShellEjectOffset;
  vec3_t vWorldShellEjectOffset;
  vec3_t vViewShellEjectRotation;
  vec3_t vWorldShellEjectRotation;
  Material *reticleCenter;
  Material *reticleSide;
  int iReticleCenterSize;
  int iReticleSideSize;
  int iReticleMinOfs;
  activeReticleType_t activeReticleType;
  vec3_t vStandMove;
  vec3_t vStandRot;
  vec3_t vDuckedOfs;
  vec3_t vDuckedMove;
  vec3_t vDuckedSprintOfs;
  vec3_t vDuckedSprintRot;
  vec2_t vDuckedSprintBob;
  float fDuckedSprintCycleScale;
  vec3_t vSprintOfs;
  vec3_t vSprintRot;
  vec2_t vSprintBob;
  float fSprintCycleScale;
  vec3_t vLowReadyOfs;
  vec3_t vLowReadyRot;
  vec3_t vRideOfs;
  vec3_t vRideRot;
  vec3_t vDtpOfs;
  vec3_t vDtpRot;
  vec2_t vDtpBob;
  float fDtpCycleScale;
  vec3_t vMantleOfs;
  vec3_t vMantleRot;
  vec3_t vSlideOfs;
  vec3_t vSlideRot;
  vec3_t vDuckedRot;
  vec3_t vProneOfs;
  vec3_t vProneMove;
  vec3_t vProneRot;
  vec3_t vStrafeMove;
  vec3_t vStrafeRot;
  float fPosMoveRate;
  float fPosProneMoveRate;
  float fStandMoveMinSpeed;
  float fDuckedMoveMinSpeed;
  float fProneMoveMinSpeed;
  float fPosRotRate;
  float fPosProneRotRate;
  float fStandRotMinSpeed;
  float fDuckedRotMinSpeed;
  float fProneRotMinSpeed;
  XModel * *worldModel;
  XModel *worldClipModel;
  XModel *rocketModel;
  XModel *mountedModel;
  XModel *additionalMeleeModel;
  Material * fireTypeIcon;
  Material * hudIcon;
  weaponIconRatioType_t hudIconRatio;
  Material * indicatorIcon;
  weaponIconRatioType_t indicatorIconRatio;
  Material * ammoCounterIcon;
  weaponIconRatioType_t ammoCounterIconRatio;
  ammoCounterClipType_t ammoCounterClip;
  int iStartAmmo;
  int iMaxAmmo;
  int shotCount;
  const char *szSharedAmmoCapName;
  int iSharedAmmoCapIndex;
  int iSharedAmmoCap;
  bool unlimitedAmmo;
  bool ammoCountClipRelative;
  int damage[6];
  float damageRange[6];
  int minPlayerDamage;
  float damageDuration;
  float damageInterval;
  int playerDamage;
  int iMeleeDamage;
  int iDamageType;
  ScriptString explosionTag;
  int iFireDelay;
  int iMeleeDelay;
  int meleeChargeDelay;
  int iDetonateDelay;
  int iSpinUpTime;
  int iSpinDownTime;
  float spinRate;
  const char *spinLoopSound;
  const char *spinLoopSoundPlayer;
  const char *startSpinSound;
  const char *startSpinSoundPlayer;
  const char *stopSpinSound;
  const char *stopSpinSoundPlayer;
  bool applySpinPitch;
  int iFireTime;
  int iLastFireTime;
  int iRechamberTime;
  int iRechamberBoltTime;
  int iHoldFireTime;
  int iDetonateTime;
  int iMeleeTime;
  int iBurstDelayTime;
  int meleeChargeTime;
  int iReloadTimeRight;
  int iReloadTimeLeft;
  int reloadShowRocketTime;
  int iReloadEmptyTimeLeft;
  int iReloadAddTime;
  int iReloadEmptyAddTime;
  int iReloadQuickAddTime;
  int iReloadQuickEmptyAddTime;
  int iReloadStartTime;
  int iReloadStartAddTime;
  int iReloadEndTime;
  int iDropTime;
  int iRaiseTime;
  int iAltDropTime;
  int quickDropTime;
  int quickRaiseTime;
  int iFirstRaiseTime;
  int iEmptyRaiseTime;
  int iEmptyDropTime;
  int sprintInTime;
  int sprintLoopTime;
  int sprintOutTime;
  int lowReadyInTime;
  int lowReadyLoopTime;
  int lowReadyOutTime;
  int contFireInTime;
  int contFireLoopTime;
  int contFireOutTime;
  int dtpInTime;
  int dtpLoopTime;
  int dtpOutTime;
  int crawlInTime;
  int crawlForwardTime;
  int crawlBackTime;
  int crawlRightTime;
  int crawlLeftTime;
  int crawlOutFireTime;
  int crawlOutTime;
  int slideInTime;
  int deployTime;
  int breakdownTime;
  int iFlourishTime;
  int nightVisionWearTime;
  int nightVisionWearTimeFadeOutEnd;
  int nightVisionWearTimePowerUp;
  int nightVisionRemoveTime;
  int nightVisionRemoveTimePowerDown;
  int nightVisionRemoveTimeFadeInStart;
  int fuseTime;
  int aiFuseTime;
  int lockOnRadius;
  int lockOnSpeed;
  bool requireLockonToFire;
  bool noAdsWhenMagEmpty;
  bool avoidDropCleanup;
  unsigned int stackFire;
  float stackFireSpread;
  float stackFireAccuracyDecay;
  const char *stackSound;
  float autoAimRange;
  float aimAssistRange;
  bool mountableWeapon;
  float aimPadding;
  float enemyCrosshairRange;
  bool crosshairColorChange;
  float moveSpeedScale;
  float adsMoveSpeedScale;
  float sprintDurationScale;
  weapOverlayReticle_t adsOverlayReticle;
  weapOverlayInterface_t adsOverlayInterface;
  float overlayWidth;
  float overlayHeight;
  float fAdsBobFactor;
  float fAdsViewBobMult;
  bool bHoldBreathToSteady;
  float fHipSpreadStandMin;
  float fHipSpreadDuckedMin;
  float fHipSpreadProneMin;
  float hipSpreadStandMax;
  float hipSpreadDuckedMax;
  float hipSpreadProneMax;
  float fHipSpreadDecayRate;
  float fHipSpreadFireAdd;
  float fHipSpreadTurnAdd;
  float fHipSpreadMoveAdd;
  float fHipSpreadDuckedDecay;
  float fHipSpreadProneDecay;
  float fHipReticleSidePos;
  float fAdsIdleAmount;
  float fHipIdleAmount;
  float adsIdleSpeed;
  float hipIdleSpeed;
  float fIdleCrouchFactor;
  float fIdleProneFactor;
  float fGunMaxPitch;
  float fGunMaxYaw;
  float swayMaxAngle;
  float swayLerpSpeed;
  float swayPitchScale;
  float swayYawScale;
  float swayHorizScale;
  float swayVertScale;
  float swayShellShockScale;
  float adsSwayMaxAngle;
  float adsSwayLerpSpeed;
  float adsSwayPitchScale;
  float adsSwayYawScale;
  bool sharedAmmo;
  bool bRifleBullet;
  bool armorPiercing;
  bool bAirburstWeapon;
  bool bBoltAction;
  bool bUseAltTagFlash;
  bool bUseAntiLagRewind;
  bool bIsCarriedKillstreakWeapon;
  bool aimDownSight;
  bool bRechamberWhileAds;
  bool bReloadWhileAds;
  float adsViewErrorMin;
  float adsViewErrorMax;
  bool bCookOffHold;
  bool bClipOnly;
  bool bCanUseInVehicle;
  bool bNoDropsOrRaises;
  bool adsFireOnly;
  bool cancelAutoHolsterWhenEmpty;
  bool suppressAmmoReserveDisplay;
  bool laserSight;
  bool laserSightDuringNightvision;
  bool bHideThirdPerson;
  bool bHasBayonet;
  bool bDualWield;
  bool bExplodeOnGround;
  bool bThrowBack;
  bool bRetrievable;
  bool bDieOnRespawn;
  bool bNoThirdPersonDropsOrRaises;
  bool bContinuousFire;
  bool bNoPing;
  bool bForceBounce;
  bool bUseDroppedModelAsStowed;
  bool bNoQuickDropWhenEmpty;
  bool bKeepCrosshairWhenADS;
  bool bUseOnlyAltWeaoponHideTagsInAltMode;
  bool bAltWeaponAdsOnly;
  bool bAltWeaponDisableSwitching;
  Material *killIcon;
  weaponIconRatioType_t killIconRatio;
  bool flipKillIcon;
  bool bNoPartialReload;
  bool bSegmentedReload;
  bool bNoADSAutoReload;
  int iReloadAmmoAdd;
  int iReloadStartAdd;
  const char *szSpawnedGrenadeWeaponName;
  const char *szDualWieldWeaponName;
  unsigned int dualWieldWeaponIndex;
  int iDropAmmoMin;
  int iDropAmmoMax;
  int iDropClipAmmoMin;
  int iDropClipAmmoMax;
  int iShotsBeforeRechamber;
  bool blocksProne;
  bool bShowIndicator;
  int isRollingGrenade;
  int useBallisticPrediction;
  int isValuable;
  int isTacticalInsertion;
  bool isReviveWeapon;
  bool bUseRigidBodyOnVehicle;
  int iExplosionRadius;
  int iExplosionRadiusMin;
  int iIndicatorRadius;
  int iExplosionInnerDamage;
  int iExplosionOuterDamage;
  float damageConeAngle;
  int iProjectileSpeed;
  int iProjectileSpeedUp;
  int iProjectileSpeedRelativeUp;
  int iProjectileSpeedForward;
  float fProjectileTakeParentVelocity;
  int iProjectileActivateDist;
  float projLifetime;
  float timeToAccelerate;
  float projectileCurvature;
  XModel *projectileModel;
  weapProjExposion_t projExplosion;
  ProjectileExplosionEffect projExplosionEffect[5];
  FxEffectDef * projDudEffect;
  const char *projExplosionSound;
  const char *projDudSound;
  const char *mortarShellSound;
  const char *tankShellSound;
  bool bProjImpactExplode;
  bool bProjSentientImpactExplode;
  bool bProjExplodeWhenStationary;
  bool bBulletImpactExplode;
  WeapStickinessType stickiness;
  WeapRotateType rotateType;
  bool plantable;
  bool hasDetonator;
  bool timedDetonation;
  bool noCrumpleMissile;
  bool rotate;
  bool keepRolling; 
  bool holdButtonToThrow;
  bool offhandHoldIsCancelable;
  bool freezeMovementWhenFiring;
  float lowAmmoWarningThreshold;
  bool bDisallowAtMatchStart;
  float meleeChargeRange;
  bool bUseAsMelee;
  bool isCameraSensor;
  bool isAcousticSensor;
  bool isLaserSensor;
  bool isHoldUseGrenade;
  float *parallelBounce;
  float *perpendicularBounce;
  FxEffectDef * projTrailEffect;
  vec3_t vProjectileColor;
  guidedMissileType_t guidedMissileType;
  float maxSteeringAccel;
  int projIgnitionDelay;
  FxEffectDef *projIgnitionEffect;
  const char *projIgnitionSound;
  float fAdsAimPitch;
  float fAdsCrosshairInFrac;
  float fAdsCrosshairOutFrac;
  int adsGunKickReducedKickBullets;
  float adsGunKickReducedKickPercent;
  float fAdsGunKickPitchMin;
  float fAdsGunKickPitchMax;
  float fAdsGunKickYawMin;
  float fAdsGunKickYawMax;
  float fAdsGunKickAccel;
  float fAdsGunKickSpeedMax;
  float fAdsGunKickSpeedDecay;
  float fAdsGunKickStaticDecay;
  float fAdsViewKickPitchMin;
  float fAdsViewKickPitchMax;
  float fAdsViewKickMinMagnitude;
  float fAdsViewKickYawMin;
  float fAdsViewKickYawMax;
  float fAdsRecoilReductionRate;
  float fAdsRecoilReductionLimit;
  float fAdsRecoilReturnRate;
  float fAdsViewScatterMin;
  float fAdsViewScatterMax;
  float fAdsSpread;
  int hipGunKickReducedKickBullets;
  float hipGunKickReducedKickPercent;
  float fHipGunKickPitchMin;
  float fHipGunKickPitchMax;
  float fHipGunKickYawMin;
  float fHipGunKickYawMax;
  float fHipGunKickAccel;
  float fHipGunKickSpeedMax;
  float fHipGunKickSpeedDecay;
  float fHipGunKickStaticDecay;
  float fHipViewKickPitchMin;
  float fHipViewKickPitchMax;
  float fHipViewKickMinMagnitude;
  float fHipViewKickYawMin;
  float fHipViewKickYawMax;
  float fHipViewScatterMin;
  float fHipViewScatterMax;
  float fAdsViewKickCenterDuckedScale;
  float fAdsViewKickCenterProneScale;
  float fAntiQuickScopeTime;
  float fAntiQuickScopeScale;
  float fAntiQuickScopeSpreadMultiplier;
  float fAntiQuickScopeSpreadMax;
  float fAntiQuickScopeSwayFactor;
  float fightDist;
  float maxDist;
  const char * aiVsAiAccuracyGraphName;
  const char * aiVsPlayerAccuracyGraphName;
  vec2_t * aiVsAiAccuracyGraphKnots;
  vec2_t * aiVsPlayerAccuracyGraphKnots;
  vec2_t * aiVsAiOriginalAccuracyGraphKnots;
  vec2_t * aiVsPlayerOriginalAccuracyGraphKnots;
  int aiVsAiAccuracyGraphKnotCount;
  int aiVsPlayerAccuracyGraphKnotCount;
  int aiVsAiOriginalAccuracyGraphKnotCount;
  int aiVsPlayerOriginalAccuracyGraphKnotCount;
  int iPositionReloadTransTime;
  float leftArc;
  float rightArc;
  float topArc;
  float bottomArc;
  float accuracy;
  float aiSpread;
  float playerSpread;
  float minTurnSpeed[2];
  float maxTurnSpeed[2];
  float pitchConvergenceTime;
  float yawConvergenceTime;
  float suppressTime;
  float maxRange;
  float fAnimHorRotateInc;
  float fPlayerPositionDist;
  const char *szUseHintString;
  const char *dropHintString;
  int iUseHintStringIndex;
  int dropHintStringIndex;
  float horizViewJitter;
  float vertViewJitter;
  float cameraShakeScale;
  int cameraShakeDuration;
  int cameraShakeRadius;
  float explosionCameraShakeScale;
  int explosionCameraShakeDuration;
  int explosionCameraSHakeRadius;
  const char *szScript;
  float destabilizationRateTime;
  float destabilizationCurvatureMax;
  int destabilizeDistance;
  float * locationDamageMultipliers;      //Refer to hitLocation_t
  const char *fireRumble;
  const char *meleeImpactRumble;
  const char *reloadRumble;
  const char *explosionRumble;
  TracerDef *tracerType;
  TracerDef *enemyTracerType;
  float adsDofStart;
  float adsDofEnd;
  float hipDofStart;
  float hipDofEnd;
  float scanSpeed;
  float scanAccel;
  int scanPauseTime;
  const char * flameTableFirstPerson;
  const char * flameTableThirdPerson;
  flameTable * firstPersonFlameTable;
  flameTable * thirdPersonFlameTable;
  FxEffectDef * tagFx_preparationEffect;
  FxEffectDef * tagFlash_preparationEffect;
  bool doGibbing;
  float maxGibDistance;
  float altScopeADSTransInTime;
  float altScopeADSTransOutTime;
  int iIntroFireTime;
  int iIntroFireLength;
  FxEffectDef * meleeSwipeEffect;						//FxEffectDef
  FxEffectDef * meleeImpactEffect;						//FxEffectDef
  FxEffectDef * meleeImpactNoBloodEffect;
  const char *throwBackType;
  WeaponCamo * camo;
  float customFloat[3];
  __declspec(align(4)) bool customBool0;
  __declspec(align(4)) bool customBool1;
  __declspec(align(4)) bool customBool2;
};
 
struct WeaponVariantDef
{
  char * name;
  int iVariantCount;
  WeaponDef *weapDef;
  const char *szDisplayName;
  const char *szAltWeaponName;
  const char *szAttachmentUnique;
  WeaponAttachment **attachments;				//Count = 0x3F
  WeaponAttachmentUnique **attachmentUniques;			//Count = 0x5F
  const char **szXAnims;					//Count = 0x58
  ScriptString (*hideTags)[0x20];
  XModel **attachViewModel;					//Count = 8
  XModel **attachWorldModel;					//Count = 8
  const char **attachViewModelTag;				//Count = 8
  const char **attachWorldModelTag;				//Count = 8
  vec3_t attachViewModelOffset[8];
  vec3_t attachWorldModelOffset[8];
  vec3_t attachViewModelRotation[8];
  vec3_t attachWorldModelRotation[8];
  vec3_t stowedModelOffsets;
  vec3_t stowedModelRotations;
  unsigned int altWeaponIndex;
  int iAttachments;
  bool bIgnoreAttachments;
  int iClipSize;
  int iReloadTime;
  int iReloadEmptyTime;
  int iReloadQuickTime;
  int iReloadQuickEmptyTime;
  int iAdsTransInTime;
  int iAdsTransOutTime;
  int iAltRaiseTime;
  const char *szAmmoDisplayName;
  const char *szAmmoName;
  int iAmmoIndex;
  const char *szClipName;
  int iClipIndex;
  float fAimAssistRangeAds;
  float fAdsSwayHorizScale;
  float fAdsSwayVertScale;
  float fAdsViewKickCenterSpeed;
  float fHipViewKickCenterSpeed;
  float fAdsZoomFov[3];
  float fAdsZoomInFrac;
  float fAdsZoomOutFrac;
  float fOverlayAlphaScale;
  float fOOPosAnimLength[2];
  bool bSilenced;
  bool bDualMag;
  bool bInfraRed;
  bool bTVGuided;
  unsigned int perks[2];
  bool bAntiQuickScope;
  Material *overlayMaterial;
  Material *overlayMaterialLowRes;
  Material *dpadIcon;
  weaponIconRatioType_t dpadIconRatio;
  bool noAmmoOnDpadIcon;
  bool mmsWeapon;
  bool mmsInScope;
  float mmsFOV;
  float mmsAspect;
  float mmsMaxDist;
  vec3_t ikLeftHandIdlePos;
  vec3_t ikLeftHandOffset;
  vec3_t ikLeftHandRotation;
  bool bUsingLeftHandProneIK;
  vec3_t ikLeftHandProneOffset;
  vec3_t ikLeftHandProneRotation;
  vec3_t ikLeftHandUiViewerOffset;
  vec3_t ikLeftHandUiViewerRotation;
};

Source Format

The weapon source files are raw text files with no extension, located at "raw/weapons/sp/" for SP weapons and "raw/weapons/mp/" for MP weapons (Speculation is that zombie weapons go in "raw/weapons/zm/"). They use the same format as many other assets, with each setting name and value separated by a back-slash. The first setting identifies the file, and for weapons the identifier string is "WEAPONFILE".