diff --git a/addons/source-python/data/source-python/weapons/constants/csgo/WeaponID.ini b/addons/source-python/data/source-python/weapons/constants/csgo/WeaponID.ini old mode 100644 new mode 100755 index f05c480f4..35692a964 --- a/addons/source-python/data/source-python/weapons/constants/csgo/WeaponID.ini +++ b/addons/source-python/data/source-python/weapons/constants/csgo/WeaponID.ini @@ -1,60 +1,64 @@ # ../data/source-python/weapons/constants/csgo/WeaponID.ini -P228 = 1 -GLOCK = 2 -SCOUT = 3 -HEGRENADE = 4 -XM1014 = 5 -C4 = 6 -MAC10 = 7 +DEAGLE = 1 +ELITE = 2 +FIVESEVEN = 3 +GLOCK = 4 +#P228 = 5 +#USP = 6 +AK47 = 7 AUG = 8 -SMOKEGRENADE = 9 -ELITE = 10 -FIVESEVEN = 11 -UMP45 = 12 -SG550 = 13 -GALIL = 14 -FAMAS = 15 -USP = 16 -AWP = 17 -MP5NAVY = 18 -M249 = 19 -M3 = 20 -M4A1 = 21 -TMP = 22 -G3SG1 = 23 -FLASHBANG = 24 -DEAGLE = 25 -SG552 = 26 -AK47 = 27 -KNIFE = 28 -P90 = 29 -SHIELD = 30 -KEVLAR = 31 -ASSAULTSUIT = 32 -NIGHTVISION = 33 -GALILAR = 34 -BIZON = 35 -MAG7 = 36 -NEGEV = 37 -SAWEDOFF = 38 -TEC9 = 39 -TASER = 40 -HKP2K = 41 -MP7 = 42 -MP9 = 43 -NOVA = 44 -P250 = 45 -SCAR17 = 46 -SCAR20 = 47 -SG556 = 48 -SSG08 = 49 -KNIFEGG = 50 -MOLOTOV = 51 -DECOY = 52 -INCENDIARY = 53 -DEFUSER = 54 -HEAVYASSAULTSUIT = 55 +AWP = 9 +FAMAS = 10 +G3SG1 = 11 +#GALIL = 12 +GALILAR = 13 +M249 = 14 +#M3 = 15 +M4A1 = 16 +MAC10 = 17 +#MP5NAVY = 18 +P90 = 19 +ZONE_REPULSOR = 20 +#SCOUT = 20 +#SG550 = 21 +#SG552 = 22 +MP5SD = 23 +#TMP = 23 +UMP45 = 24 +XM1014 = 25 +BIZON = 26 +MAG7 = 27 +NEGEV = 28 +SAWEDOFF = 29 +TEC9 = 30 +TASER = 31 +HKP2000 = 32 +MP7 = 33 +MP9 = 34 +NOVA = 35 +P250 = 36 +SHIELD = 37 +#SCAR17 = 37 +SCAR20 = 38 +SG556 = 39 +SSG08 = 40 +KNIFEGG = 41 +KNIFE = 42 +FLASHBANG = 43 +HEGRENADE = 44 +SMOKEGRENADE = 45 +MOLOTOV = 46 +DECOY = 47 +INCGRENADE = 48 +C4 = 49 +KEVLAR = 50 +ASSAULTSUIT = 51 +HEAVYASSAULTSUIT = 52 +NVGS = 54 +NVG = 54 +NIGHTVISION = 54 +DEFUSER = 55 CUTTERS = 56 HEALTHSHOT = 57 KNIFE_T = 59 @@ -62,7 +66,7 @@ M4A1_SILENCER = 60 USP_SILENCER = 61 CZ75A = 63 REVOLVER = 64 -TAGGRENADE = 68 +TAGRENADE = 68 FISTS = 69 BREACHCHARGE = 70 TABLET = 72 @@ -75,8 +79,10 @@ FIREBOMB = 81 DIVERSION = 82 FRAG_GRENADE = 83 SNOWBALL = 84 +BUMPMINE = 85 # Knives from cases. BAYONET = 500 +KNIFE_CSS = 503 KNIFE_FLIP = 505 KNIFE_GUT = 506 KNIFE_KARAMBIT = 507 @@ -86,7 +92,11 @@ KNIFE_FALCHION = 512 KNIFE_SURVIVAL_BOWIE = 514 KNIFE_BUTTERFLY = 515 KNIFE_PUSH = 516 +KNIFE_CORD = 517 +KNIFE_CANIS = 518 KNIFE_URSUS = 519 KNIFE_GYPSY_JACKKNIFE = 520 +KNIFE_OUTDOOR = 521 KNIFE_STILETTO = 522 KNIFE_WIDOWMAKER = 523 +KNIFE_SKELETON = 525 diff --git a/addons/source-python/data/source-python/weapons/constants/csgo/WeaponSlot.ini b/addons/source-python/data/source-python/weapons/constants/csgo/WeaponSlot.ini new file mode 100755 index 000000000..036136b27 --- /dev/null +++ b/addons/source-python/data/source-python/weapons/constants/csgo/WeaponSlot.ini @@ -0,0 +1,9 @@ +# ../data/source-python/weapons/constants/csgo/WeaponSlot.ini + +PRIMARY = 0 +SECONDARY = 1 +KNIFE = 2 +GRENADE = 3 +C4 = 4 +SHIELD = 11 +TABLET = 12 diff --git a/addons/source-python/data/source-python/weapons/constants/csgo/WeaponType.ini b/addons/source-python/data/source-python/weapons/constants/csgo/WeaponType.ini new file mode 100755 index 000000000..bab54a7c2 --- /dev/null +++ b/addons/source-python/data/source-python/weapons/constants/csgo/WeaponType.ini @@ -0,0 +1,26 @@ +# ../data/source-python/weapons/constants/csgo/WeaponType.ini + +KNIFE = 0 +PISTOL = 1 +SMG = 2 +SUBMACHINEGUN = 2 +RIFLE = 3 +SHOTGUN = 4 +SNIPERRIFLE = 5 +SNIPER = 5 +MACHINEGUN = 6 +MG = 6 +C4 = 7 +EXPLOSIVE = 7 +TASER = 8 +GRENADE = 9 +EQUIPMENT = 10 +STACKABLEITEM = 11 +FISTS = 12 +BREACHCHARGE = 13 +BUMPMINE = 14 +TABLET = 15 +MELEE = 16 +SHIELD = 17 +ZONEREPULSOR = 18 +UNKNOWN = 19 diff --git a/addons/source-python/data/source-python/weapons/constants/orangebox/cstrike/WeaponID.ini b/addons/source-python/data/source-python/weapons/constants/orangebox/cstrike/WeaponID.ini old mode 100644 new mode 100755 index 30c716861..9809fc157 --- a/addons/source-python/data/source-python/weapons/constants/orangebox/cstrike/WeaponID.ini +++ b/addons/source-python/data/source-python/weapons/constants/orangebox/cstrike/WeaponID.ini @@ -32,4 +32,6 @@ P90 = 29 SHIELD = 30 KEVLAR = 31 ASSAULTSUIT = 32 +NVGS = 33 +NVG = 33 NIGHTVISION = 33 diff --git a/addons/source-python/data/source-python/weapons/constants/orangebox/cstrike/WeaponType.ini b/addons/source-python/data/source-python/weapons/constants/orangebox/cstrike/WeaponType.ini old mode 100644 new mode 100755 index 51aecb5c7..6ea48b5c6 --- a/addons/source-python/data/source-python/weapons/constants/orangebox/cstrike/WeaponType.ini +++ b/addons/source-python/data/source-python/weapons/constants/orangebox/cstrike/WeaponType.ini @@ -3,9 +3,14 @@ KNIFE = 0 PISTOL = 1 SMG = 2 +SUBMACHINEGUN = 2 RIFLE = 3 SHOTGUN = 4 +SNIPERRIFLE = 5 SNIPER = 5 MACHINEGUN = 6 +MG = 6 +C4 = 7 EXPLOSIVE = 7 GRENADE = 8 +UNKNOWN = 9 diff --git a/addons/source-python/data/source-python/weapons/csgo.ini b/addons/source-python/data/source-python/weapons/csgo.ini old mode 100644 new mode 100755 index e964290ed..11ad8a86c --- a/addons/source-python/data/source-python/weapons/csgo.ini +++ b/addons/source-python/data/source-python/weapons/csgo.ini @@ -35,620 +35,708 @@ # ========================================================================= # Snipers [[awp]] - slot = 0 + id = "AWP" + type = "SNIPERRIFLE" + slot = "PRIMARY" maxammo = 30 ammoprop = 6 clip = 5 cost = 4750 - item_definition_index = 9 - tags = "all,primary,rifle,sniper" + tags = "all,primary,rifle,sniper,sniperrifle" [[g3sg1]] - slot = 0 + id = "G3SG1" + type = "SNIPERRIFLE" + slot = "PRIMARY" maxammo = 90 ammoprop = 2 clip = 20 cost = 5000 - item_definition_index = 11 - tags = "all,primary,rifle,sniper" + tags = "all,primary,rifle,sniper,sniperrifle" [[scar20]] - slot = 0 + id = "SCAR20" + type = "SNIPERRIFLE" + slot = "PRIMARY" maxammo = 90 ammoprop = 2 clip = 20 cost = 5000 - item_definition_index = 38 - tags = "all,primary,rifle,sniper" + tags = "all,primary,rifle,sniper,sniperrifle" [[ssg08]] - slot = 0 + id = "SSG08" + type = "SNIPERRIFLE" + slot = "PRIMARY" maxammo = 90 ammoprop = 2 clip = 10 cost = 1700 - item_definition_index = 40 - tags = "all,primary,rifle" + tags = "all,primary,rifle,sniper,sniperrifle" # Assault Rifles [[ak47]] - slot = 0 + id = "AK47" + type = "RIFLE" + slot = "PRIMARY" maxammo = 90 ammoprop = 2 clip = 30 cost = 2700 - item_definition_index = 7 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle" [[aug]] - slot = 0 + id = "AUG" + type = "RIFLE" + slot = "PRIMARY" maxammo = 90 ammoprop = 2 clip = 30 cost = 3150 - item_definition_index = 8 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle" [[famas]] - slot = 0 + id = "FAMAS" + type = "RIFLE" + slot = "PRIMARY" maxammo = 90 ammoprop = 3 clip = 25 cost = 2250 - item_definition_index = 10 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle" [[galilar]] - slot = 0 + id = "GALILAR" + type = "RIFLE" + slot = "PRIMARY" maxammo = 90 ammoprop = 3 clip = 35 cost = 2000 - item_definition_index = 13 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle" [[m4a1]] - slot = 0 + id = "M4A1" + type = "RIFLE" + slot = "PRIMARY" maxammo = 90 ammoprop = 3 clip = 30 cost = 3100 - item_definition_index = 16 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle,parent" [[m4a1_silencer]] - slot = 0 + id = "M4A1_SILENCER" + type = "RIFLE" + slot = "PRIMARY" maxammo = 80 ammoprop = 4 clip = 20 cost = 2900 - item_definition_index = 60 parent_class = "weapon_m4a1" - tags = "all,secondary,rifle" + tags = "all,secondary,rifle,assaultrifle,cant_find" [[sg556]] - slot = 0 + id = "SG556" + type = "RIFLE" + slot = "PRIMARY" maxammo = 90 ammoprop = 3 clip = 30 cost = 2750 - item_definition_index = 39 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle" # SMGs [[bizon]] - slot = 0 + id = "BIZON" + type = "SMG" + slot = "PRIMARY" maxammo = 120 ammoprop = 7 clip = 64 cost = 1400 - item_definition_index = 26 - tags = "all,primary,smg" + tags = "all,primary,smg,submachinegun" [[mac10]] - slot = 0 + id = "MAC10" + type = "SMG" + slot = "PRIMARY" maxammo = 100 ammoprop = 9 clip = 30 cost = 1050 - item_definition_index = 17 - tags = "all,primary,smg" + tags = "all,primary,smg,submachinegun" + + [[mp5sd]] + id = "MP5SD" + type = "SMG" + slot = "PRIMARY" + maxammo = 120 + ammoprop = 7 + clip = 30 + cost = 1500 + parent_class = "weapon_mp7" + tags = "all,primary,smg,submachinegun,cant_find" [[mp7]] - slot = 0 + id = "MP7" + type = "SMG" + slot = "PRIMARY" maxammo = 120 ammoprop = 7 clip = 30 cost = 1700 - item_definition_index = 33 - tags = "all,primary,smg" + tags = "all,primary,smg,submachinegun,parent" [[mp9]] - slot = 0 + id = "MP9" + type = "SMG" + slot = "PRIMARY" maxammo = 120 ammoprop = 7 clip = 30 cost = 1250 - item_definition_index = 34 - tags = "all,primary,smg" + tags = "all,primary,smg,submachinegun" [[p90]] - slot = 0 + id = "P90" + type = "SMG" + slot = "PRIMARY" maxammo = 100 ammoprop = 13 clip = 50 cost = 2350 - item_definition_index = 19 - tags = "all,primary,smg" + tags = "all,primary,smg,submachinegun" [[ump45]] - slot = 0 + id = "UMP45" + type = "SMG" + slot = "PRIMARY" maxammo = 100 ammoprop = 9 clip = 25 cost = 1200 - item_definition_index = 24 - tags = "all,primary,smg" - - [[mp5sd]] - slot = 0 - maxammo = 120 - ammoprop = 7 - clip = 30 - cost = 1500 - item_definition_index = 23 - parent_class = "weapon_mp7" - tags = "all,primary,smg" + tags = "all,primary,smg,submachinegun" # Shotguns [[mag7]] - slot = 0 + id = "MAG7" + type = "SHOTGUN" + slot = "PRIMARY" maxammo = 32 ammoprop = 8 clip = 5 cost = 1800 - item_definition_index = 27 tags = "all,primary,shotgun" [[nova]] - slot = 0 + id = "NOVA" + type = "SHOTGUN" + slot = "PRIMARY" maxammo = 32 ammoprop = 8 clip = 8 cost = 1200 - item_definition_index = 35 tags = "all,primary,shotgun" [[sawedoff]] - slot = 0 + id = "SAWEDOFF" + type = "SHOTGUN" + slot = "PRIMARY" maxammo = 32 ammoprop = 8 clip = 7 cost = 1200 - item_definition_index = 29 tags = "all,primary,shotgun" [[xm1014]] - slot = 0 + id = "XM1014" + type = "SHOTGUN" + slot = "PRIMARY" maxammo = 32 ammoprop = 8 clip = 7 cost = 2000 - item_definition_index = 25 tags = "all,primary,shotgun" # Heavy Machine Gun [[m249]] - slot = 0 + id = "M249" + type = "MACHINEGUN" + slot = "PRIMARY" maxammo = 200 ammoprop = 5 clip = 100 cost = 5200 - item_definition_index = 14 - tags = "all,primary,machinegun" + tags = "all,primary,machinegun,mg" [[negev]] - slot = 0 + id = "NEGEV" + type = "MACHINEGUN" + slot = "PRIMARY" maxammo = 300 ammoprop = 5 clip = 150 cost = 1700 - item_definition_index = 28 - tags = "all,primary,machinegun" + tags = "all,primary,machinegun,mg" # ========================================================================= # SECONDARY WEAPONS # ========================================================================= [[cz75a]] - slot = 1 + id = "CZ75A" + type = "PISTOL" + slot = "SECONDARY" maxammo = 12 ammoprop = 12 clip = 12 cost = 500 - item_definition_index = 63 parent_class = "weapon_p250" - tags = "all,secondary,pistol" + tags = "all,secondary,pistol,cant_find" [[deagle]] - slot = 1 + id = "DEAGLE" + type = "PISTOL" + slot = "SECONDARY" maxammo = 35 ammoprop = 1 clip = 7 cost = 700 - item_definition_index = 1 - tags = "all,secondary,pistol" + tags = "all,secondary,pistol,parent" [[elite]] - slot = 1 + id = "ELITE" + type = "PISTOL" + slot = "SECONDARY" maxammo = 120 ammoprop = 7 clip = 30 cost = 500 - item_definition_index = 2 tags = "all,secondary,pistol" [[fiveseven]] - slot = 1 + id = "FIVESEVEN" + type = "PISTOL" + slot = "SECONDARY" maxammo = 100 ammoprop = 13 clip = 20 cost = 500 - item_definition_index = 3 tags = "all,secondary,pistol" [[glock]] - slot = 1 + id = "GLOCK" + type = "PISTOL" + slot = "SECONDARY" maxammo = 120 ammoprop = 7 clip = 20 cost = 200 - item_definition_index = 4 tags = "all,secondary,pistol" [[hkp2000]] - slot = 1 + id = "HKP2000" + type = "PISTOL" + slot = "SECONDARY" maxammo = 52 ammoprop = 10 clip = 13 cost = 200 - item_definition_index = 32 - tags = "all,secondary,pistol" + tags = "all,secondary,pistol,parent" [[p250]] - slot = 1 + id = "P250" + type = "PISTOL" + slot = "SECONDARY" maxammo = 26 ammoprop = 20 clip = 13 cost = 300 - item_definition_index = 36 - tags = "all,secondary,pistol" + tags = "all,secondary,pistol,parent" [[revolver]] - slot = 1 + id = "REVOLVER" + type = "PISTOL" + slot = "SECONDARY" maxammo = 8 ammoprop = 1 clip = 8 cost = 600 - item_definition_index = 64 parent_class = "weapon_deagle" - tags = "all,secondary,pistol" + tags = "all,secondary,pistol,cant_find" [[tec9]] - slot = 1 + id = "TEC9" + type = "PISTOL" + slot = "SECONDARY" maxammo = 90 ammoprop = 7 clip = 18 cost = 500 - item_definition_index = 30 tags = "all,secondary,pistol" [[usp_silencer]] - slot = 1 + id = "USP_SILENCER" + type = "PISTOL" + slot = "SECONDARY" maxammo = 24 ammoprop = 11 clip = 12 cost = 200 - item_definition_index = 61 parent_class = "weapon_hkp2000" - tags = "all,secondary,pistol" + tags = "all,secondary,pistol,cant_find" # ========================================================================= # MELEE WEAPONS # ========================================================================= [[axe]] - slot = 2 - item_definition_index = 75 + id = "AXE" + type = "MELEE" + slot = "KNIFE" parent_class = "weapon_melee" - tags = "all,melee" + tags = "all,melee,cant_find" + + [[bayonet]] + id = "BAYONET" + type = "KNIFE" + slot = "KNIFE" + parent_class = "weapon_knife" + tags = "all,knife,melee,earned,cant_create,cant_find" [[fists]] - slot = 2 - item_definition_index = 69 + id = "FISTS" + type = "FISTS" + slot = "KNIFE" tags = "all,melee" [[hammer]] - slot = 2 - item_definition_index = 76 + id = "HAMMER" + type = "MELEE" + slot = "KNIFE" parent_class = "weapon_melee" - tags = "all,melee" + tags = "all,melee,cant_find" [[knife]] - slot = 2 - item_definition_index = 42 - tags = "all,knife,melee" + id = "KNIFE" + type = "KNIFE" + slot = "KNIFE" + tags = "all,knife,melee,parent" - [[bayonet]] - slot = 2 - item_definition_index = 500 + [[knife_butterfly]] + id = "KNIFE_BUTTERFLY" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" - [[knife_butterfly]] - slot = 2 - item_definition_index = 515 + [[knife_canis]] + id = "KNIFE_CANIS" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" + + [[knife_cord]] + id = "KNIFE_CORD" + type = "KNIFE" + slot = "KNIFE" + parent_class = "weapon_knife" + tags = "all,knife,melee,earned,cant_create,cant_find" + + [[knife_css]] + id = "KNIFE_CSS" + type = "KNIFE" + slot = "KNIFE" + parent_class = "weapon_knife" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_falchion]] - slot = 2 - item_definition_index = 512 + id = "KNIFE_FALCHION" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_flip]] - slot = 2 - item_definition_index = 505 + id = "KNIFE_FLIP" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_ghost]] - slot = 2 - item_definition_index = 80 - tags = "all,knife,melee" + id = "KNIFE_GHOST" + type = "KNIFE" + slot = "KNIFE" + parent_class = "weapon_knife" + tags = "all,knife,melee,cant_find" [[knife_gut]] - slot = 2 - item_definition_index = 506 + id = "KNIFE_GUT" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_gypsy_jackknife]] - slot = 2 - item_definition_index = 520 + id = "KNIFE_GYPSY_JACKKNIFE" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_karambit]] - slot = 2 - item_definition_index = 507 + id = "KNIFE_KARAMBIT" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_m9_bayonet]] - slot = 2 - item_definition_index = 508 + id = "KNIFE_M9_BAYONET" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" + + [[knife_outdoor]] + id = "KNIFE_OUTDOOR" + type = "KNIFE" + slot = "KNIFE" + parent_class = "weapon_knife" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_push]] - slot = 2 - item_definition_index = 516 + id = "KNIFE_PUSH" + type = "KNIFE" + slot = "KNIFE" + parent_class = "weapon_knife" + tags = "all,knife,melee,earned,cant_create,cant_find" + + [[knife_skeleton]] + id = "KNIFE_SKELETON" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_stiletto]] - slot = 2 - item_definition_index = 522 + id = "KNIFE_STILETTO" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_survival_bowie]] - slot = 2 - item_definition_index = 514 + id = "KNIFE_SURVIVAL_BOWIE" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_t]] - slot = 2 - item_definition_index = 59 + id = "KNIFE_T" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee" + tags = "all,knife,melee,cant_find" [[knife_tactical]] - slot = 2 - item_definition_index = 509 + id = "KNIFE_TACTICAL" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_ursus]] - slot = 2 - item_definition_index = 519 + id = "KNIFE_URSUS" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knife_widowmaker]] - slot = 2 - item_definition_index = 523 + id = "KNIFE_WIDOWMAKER" + type = "KNIFE" + slot = "KNIFE" parent_class = "weapon_knife" - tags = "all,knife,melee,earned" + tags = "all,knife,melee,earned,cant_create,cant_find" [[knifegg]] - slot = 2 + id = "KNIFEGG" + type = "KNIFE" + slot = "KNIFE" tags = "all,knife,melee" - [[knife_css]] - slot = 2 - item_definition_index = 503 - parent_class = "weapon_knife" - tags = "all,knife,melee,earned" - - [[knife_cord]] - slot = 2 - item_definition_index = 517 - parent_class = "weapon_knife" - tags = "all,knife,melee,earned" - - [[knife_canis]] - slot = 2 - item_definition_index = 518 - parent_class = "weapon_knife" - tags = "all,knife,melee,earned" - - [[knife_outdoor]] - slot = 2 - item_definition_index = 521 - parent_class = "weapon_knife" - tags = "all,knife,melee,earned" - - [[knife_skeleton]] - slot = 2 - item_definition_index = 525 - parent_class = "weapon_knife" - tags = "all,knife,melee,earned" - [[melee]] - slot = 2 - tags = "all,melee" + id = "MELEE" + type = "MELEE" + slot = "KNIFE" + tags = "all,melee,parent" [[spanner]] - slot = 2 - item_definition_index = 78 + id = "SPANNER" + type = "MELEE" + slot = "KNIFE" parent_class = "weapon_melee" - tags = "all,melee" + tags = "all,melee,cant_find" [[taser]] - slot = 2 + id = "TASER" + type = "TASER" + slot = "KNIFE" maxammo = 1 ammoprop = 19 clip = 1 cost = 200 - item_definition_index = 31 tags = "all,melee" - # ========================================================================= # PROJECTILE WEAPONS # ========================================================================= [[decoy]] - slot = 3 + id = "DECOY" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_grenade_limit_default" ammoprop = 18 cost = 50 - item_definition_index = 47 - tags = "all,grenade" + tags = "all,grenade,parent" [[diversion]] - slot = 3 + id = "DIVERSION" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_grenade_limit_default" ammoprop = 18 - item_definition_index = 82 parent_class = "weapon_decoy" - tags = "all,grenade" + tags = "all,grenade,cant_find" [[firebomb]] - slot = 3 + id = "FIREBOMB" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_grenade_limit_default" ammoprop = 17 - item_definition_index = 81 parent_class = "weapon_molotov" - tags = "all,grenade,incendiary" + tags = "all,grenade,incendiary,cant_find" [[flashbang]] - slot = 3 + id = "FLASHBANG" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_grenade_limit_flashbang" ammoprop = 15 cost = 200 - item_definition_index = 43 tags = "all,grenade" [[frag_grenade]] - slot = 3 + id = "FRAG_GRENADE" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_grenade_limit_default" ammoprop = 14 - item_definition_index = 83 parent_class = "weapon_hegrenade" - tags = "all,grenade,explosive" + tags = "all,grenade,explosive,cant_find" [[hegrenade]] - slot = 3 + id = "HEGRENADE" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_grenade_limit_default" ammoprop = 14 cost = 300 - item_definition_index = 44 - tags = "all,grenade,explosive" + tags = "all,grenade,explosive,parent" [[incgrenade]] - slot = 3 + id = "INCGRENADE" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_grenade_limit_default" ammoprop = 17 cost = 600 - item_definition_index = 48 tags = "all,grenade,incendiary" [[molotov]] - slot = 3 + id = "MOLOTOV" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_grenade_limit_default" ammoprop = 17 cost = 400 - item_definition_index = 46 - tags = "all,grenade,incendiary" + tags = "all,grenade,incendiary,parent" [[smokegrenade]] - slot = 3 + id = "SMOKEGRENADE" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_grenade_limit_default" ammoprop = 16 cost = 300 - item_definition_index = 45 tags = "all,grenade" [[snowball]] - slot = 3 + id = "SNOWBALL" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_grenade_limit_snowballs" ammoprop = 24 - item_definition_index = 84 tags = "all,grenade" [[tagrenade]] - slot = 3 + id = "TAGRENADE" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_grenade_limit_default" ammoprop = 22 tags = "all,grenade,tool,coop" - # ========================================================================= # TOOLS # ========================================================================= [[breachcharge]] - slot = 4 + id = "BREACHCHARGE" + type = "BREACHCHARGE" + slot = "C4" maxammo = "ammo_grenade_limit_breachcharge" ammoprop = 23 - item_definition_index = 70 tags = "all,grenade,tool,explosive" - [[c4]] - slot = 4 - item_definition_index = 49 - tags = "all,objective" - [[bumpmine]] - slot = 4 - item_definition_index = 85 + id = "BUMPMINE" + type = "BUMPMINE" + slot = "C4" maxammo = "ammo_grenade_limit_bumpmine" tags = "all,tool" + [[c4]] + id = "C4" + type = "C4" + slot = "C4" + tags = "all,objective" + [[healthshot]] - slot = 11 - item_definition_index = 57 + id = "HEALTHSHOT" + type = "STACKABLEITEM" + slot = "SHIELD" maxammo = "ammo_item_limit_healthshot" ammoprop = 21 tags = "all,tool,coop" [[shield]] - slot = 11 - item_definition_index = 37 + id = "SHIELD" + type = "SHIELD" + slot = "SHIELD" tags = "all,tool" [[tablet]] - slot = 12 - item_definition_index = 72 + id = "TABLET" + type = "TABLET" + slot = "TABLET" + tags = "all,tool" + + [[zone_repulsor]] + id = "ZONE_REPULSOR" + type = "ZONEREPULSOR" + slot = "SHIELD" tags = "all,tool" diff --git a/addons/source-python/data/source-python/weapons/cstrike.ini b/addons/source-python/data/source-python/weapons/cstrike.ini old mode 100644 new mode 100755 index 97190f2fd..9f1164886 --- a/addons/source-python/data/source-python/weapons/cstrike.ini +++ b/addons/source-python/data/source-python/weapons/cstrike.ini @@ -17,130 +17,162 @@ # ========================================================================= # Snipers [[awp]] - slot = 0 + id = "AWP" + type = "SNIPERRIFLE" + slot = "PRIMARY" maxammo = "ammo_338mag_max" ammoprop = 5 clip = 10 cost = 4750 - tags = "all,primary,rifle,sniper" + tags = "all,primary,rifle,sniper,sniperrifle" [[g3sg1]] - slot = 0 + id = "G3SG1" + type = "SNIPERRIFLE" + slot = "PRIMARY" maxammo = "ammo_762mm_max" ammoprop = 2 clip = 20 cost = 5000 - tags = "all,primary,rifle,sniper" + tags = "all,primary,rifle,sniper,sniperrifle" [[scout]] - slot = 0 + id = "SCOUT" + type = "SNIPERRIFLE" + slot = "PRIMARY" maxammo = "ammo_762mm_max" ammoprop = 2 clip = 10 cost = 2750 - tags = "all,primary,rifle,sniper" + tags = "all,primary,rifle,sniper,sniperrifle" [[sg550]] - slot = 0 + id = "SG550" + type = "SNIPERRIFLE" + slot = "PRIMARY" maxammo = "ammo_556mm_max" ammoprop = 3 clip = 30 cost = 4200 - tags = "all,primary,rifle,sniper" + tags = "all,primary,rifle,sniper,sniperrifle" # Assault Rifles [[ak47]] - slot = 0 + id = "AK47" + type = "RIFLE" + slot = "PRIMARY" maxammo = "ammo_762mm_max" ammoprop = 2 clip = 30 cost = 2500 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle" [[aug]] - slot = 0 + id = "AUG" + type = "RIFLE" + slot = "PRIMARY" maxammo = "ammo_762mm_max" ammoprop = 2 clip = 30 cost = 3500 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle" [[famas]] - slot = 0 + id = "FAMAS" + type = "RIFLE" + slot = "PRIMARY" maxammo = "ammo_556mm_max" ammoprop = 3 clip = 25 cost = 2250 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle" [[galil]] - slot = 0 + id = "GALIL" + type = "RIFLE" + slot = "PRIMARY" maxammo = "ammo_556mm_max" ammoprop = 3 clip = 35 cost = 2000 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle" [[m4a1]] - slot = 0 + id = "M4A1" + type = "RIFLE" + slot = "PRIMARY" maxammo = "ammo_556mm_max" ammoprop = 3 clip = 30 cost = 3100 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle" [[sg552]] - slot = 0 + id = "SG552" + type = "RIFLE" + slot = "PRIMARY" maxammo = "ammo_556mm_max" ammoprop = 3 clip = 30 cost = 3500 - tags = "all,primary,rifle" + tags = "all,primary,rifle,assaultrifle" # SMGs [[mac10]] - slot = 0 + id = "MAC10" + type = "SMG" + slot = "PRIMARY" maxammo = "ammo_45acp_max" ammoprop = 8 clip = 30 cost = 1400 - tags = "all,primary,smg" + tags = "all,primary,smg,submachinegun" [[mp5navy]] - slot = 0 + id = "MP5NAVY" + type = "SMG" + slot = "PRIMARY" maxammo = "ammo_9mm_max" ammoprop = 6 clip = 30 cost = 1500 - tags = "all,primary,smg" + tags = "all,primary,smg,submachinegun" [[p90]] - slot = 0 + id = "P90" + type = "SMG" + slot = "PRIMARY" maxammo = "ammo_57mm_max" ammoprop = 10 clip = 50 cost = 2350 - tags = "all,primary,smg" + tags = "all,primary,smg,submachinegun" [[tmp]] - slot = 0 + id = "TMP" + type = "SMG" + slot = "PRIMARY" maxammo = "ammo_9mm_max" ammoprop = 6 clip = 30 cost = 1250 - tags = "all,primary,smg" + tags = "all,primary,smg,submachinegun" [[ump45]] - slot = 0 + id = "UMP45" + type = "SMG" + slot = "PRIMARY" maxammo = "ammo_45acp_max" ammoprop = 8 clip = 25 cost = 1700 - tags = "all,primary,smg" + tags = "all,primary,smg,submachinegun" # Shotguns [[m3]] - slot = 0 + id = "M3" + type = "SHOTGUN" + slot = "PRIMARY" maxammo = "ammo_buckshot_max" ammoprop = 7 clip = 8 @@ -148,7 +180,9 @@ tags = "all,primary,shotgun" [[xm1014]] - slot = 0 + id = "XM1014" + type = "SHOTGUN" + slot = "PRIMARY" maxammo = "ammo_buckshot_max" ammoprop = 7 clip = 7 @@ -157,18 +191,22 @@ # Heavy Machine Gun [[m249]] - slot = 0 + id = "M249" + type = "MACHINEGUN" + slot = "PRIMARY" maxammo = "ammo_556mm_box_max" ammoprop = 4 clip = 100 cost = 5750 - tags = "all,primary,machinegun" + tags = "all,primary,machinegun,mg" # ========================================================================= # SECONDARY WEAPONS # ========================================================================= [[deagle]] - slot = 1 + id = "DEAGLE" + type = "PISTOL" + slot = "SECONDARY" maxammo = "ammo_50AE_max" ammoprop = 1 clip = 7 @@ -176,7 +214,9 @@ tags = "all,secondary,pistol" [[elite]] - slot = 1 + id = "ELITE" + type = "PISTOL" + slot = "SECONDARY" maxammo = "ammo_9mm_max" ammoprop = 6 clip = 30 @@ -184,7 +224,9 @@ tags = "all,secondary,pistol" [[fiveseven]] - slot = 1 + id = "FIVESEVEN" + type = "PISTOL" + slot = "SECONDARY" maxammo = "ammo_57mm_max" ammoprop = 10 clip = 20 @@ -192,7 +234,9 @@ tags = "all,secondary,pistol" [[glock]] - slot = 1 + id = "GLOCK" + type = "PISTOL" + slot = "SECONDARY" maxammo = "ammo_9mm_max" ammoprop = 6 clip = 20 @@ -200,7 +244,9 @@ tags = "all,secondary,pistol" [[p228]] - slot = 1 + id = "P228" + type = "PISTOL" + slot = "SECONDARY" maxammo = "ammo_357sig_max" ammoprop = 9 clip = 13 @@ -208,7 +254,9 @@ tags = "all,secondary,pistol" [[usp]] - slot = 1 + id = "USP" + type = "PISTOL" + slot = "SECONDARY" maxammo = "ammo_45acp_max" ammoprop = 8 clip = 12 @@ -219,28 +267,37 @@ # MELEE WEAPONS # ========================================================================= [[knife]] - slot = 2 + id = "KNIFE" + type = "KNIFE" + slot = "KNIFE" tags = "all,knife,melee" # ========================================================================= # PROJECTILE WEAPONS # ========================================================================= [[hegrenade]] - slot = 3 + id = "HEGRENADE" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_hegrenade_max" ammoprop = 11 cost = 300 tags = "all,grenade,explosive" [[flashbang]] - slot = 3 + id = "FLASHBANG" + type = "GRENADE" + slot = "GRENADE" maxammo = "ammo_flashbang_max" ammoprop = 12 cost = 200 tags = "all,grenade" [[smokegrenade]] - slot = 3 + id = "SMOKEGRENADE" + # This is the type in the actual game. + type = "UNKNOWN" + slot = "GRENADE" maxammo = "ammo_smokegrenade_max" ammoprop = 13 cost = 300 @@ -250,5 +307,7 @@ # TOOLS # ========================================================================= [[c4]] - slot = 4 + id = "C4" + type = "C4" + slot = "C4" tags = "all,objective" diff --git a/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py b/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py index 70007f06e..8ff237160 100755 --- a/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py +++ b/addons/source-python/packages/source-python/entities/engines/csgo/csgo.py @@ -10,24 +10,25 @@ from . import Entity as _Entity from entities import BaseEntityGenerator from entities.helpers import pointer_from_inthandle -# Weapons -from weapons.manager import weapon_manager +# Filters +from filters.weapons import WeaponClassIter # ============================================================================= # >> GLOBAL VARIABLES # ============================================================================= -_weapon_names_for_definition = { - weapon_manager[weapon].name: values.get('item_definition_index') - for weapon, values in weapon_manager.ini.get('weapons', {}).items() - if values.get('item_definition_index') +_cant_create_weapons = { + weapon_class.name: weapon_class + for weapon_class in WeaponClassIter('cant_create') } -_weapon_parents = { - weapon_manager[weapon].name: values.get('parent_class') - for weapon, values in weapon_manager.ini.get('weapons', {}).items() - if values.get('parent_class') +_cant_find_weapons = { + weapon_class.name: weapon_class + for weapon_class in WeaponClassIter('cant_find') +} +_parent_weapons = { + weapon_class.name: weapon_class.item_definition_index + for weapon_class in WeaponClassIter('parent') } -_parent_weapons = set(_weapon_parents.values()) # ============================================================================= @@ -41,35 +42,45 @@ class Entity(_Entity): @classmethod def create(cls, classname): - index = _weapon_names_for_definition.get(classname) - if index is not None: - parent_class = _weapon_parents.get(classname) - entity = super().create(parent_class or classname) - entity.item_definition_index = index + # Specific weapons cannot be created directly, create a parent class + # for the weapon and set the item_definition_index. + weapon_class = _cant_create_weapons.get(classname, None) + if weapon_class is not None: + entity = super().create(weapon_class.parent_class) + entity.item_definition_index = weapon_class.item_definition_index else: entity = super().create(classname) return entity @classmethod def find(cls, classname): - index = _weapon_names_for_definition.get(classname) - if classname in _weapon_parents and index is not None: - parent_classname = _weapon_parents[classname] + # Specific weapons cannot be found directly, instead iterate over + # the parent class and detect if the item_definition_index matches. + weapon_class = _cant_find_weapons.get(classname, None) + if weapon_class is not None: + parent_classname = weapon_class.parent_class + item_definition_index = weapon_class.item_definition_index for entity in BaseEntityGenerator(parent_classname, True): if not entity.is_networked(): continue if entity.get_network_property_int( 'm_AttributeManager.m_Item.m_iItemDefinitionIndex' - ) == index: + ) == item_definition_index: return cls(entity.index) - elif classname in _parent_weapons: + + # Parent weapon class is equivalent to the child class, therefore + # iterates over the parent class to detect if + # the item_definition_index matches. + parent_item_definition_index = _parent_weapons.get(classname, None) + if parent_item_definition_index is not None: for entity in BaseEntityGenerator(classname, True): if not entity.is_networked(): continue if entity.get_network_property_int( 'm_AttributeManager.m_Item.m_iItemDefinitionIndex' - ) in (index, 0): + ) in (parent_item_definition_index, 0): return cls(entity.index) + return super().find(classname) thrower = property( diff --git a/addons/source-python/packages/source-python/weapons/engines/csgo/csgo.py b/addons/source-python/packages/source-python/weapons/engines/csgo/csgo.py old mode 100644 new mode 100755 index 2756e8041..7e367abe0 --- a/addons/source-python/packages/source-python/weapons/engines/csgo/csgo.py +++ b/addons/source-python/packages/source-python/weapons/engines/csgo/csgo.py @@ -7,16 +7,17 @@ # ============================================================================= # Source.Python from . import Weapon as _Weapon -from weapons.manager import weapon_manager +# Filters +from filters.weapons import WeaponClassIter # ============================================================================= # >> GLOBAL VARIABLES # ============================================================================= _item_definition_indexes = { - values.get('item_definition_index'): weapon_manager[weapon].name - for weapon, values in weapon_manager.ini['weapons'].items() - if values.get('item_definition_index') + weapon_class.item_definition_index: weapon_class.name + for weapon_class in WeaponClassIter('all') + if weapon_class.item_definition_index is not None } diff --git a/addons/source-python/packages/source-python/weapons/instance.py b/addons/source-python/packages/source-python/weapons/instance.py old mode 100644 new mode 100755 index 79c155b0c..10101cae1 --- a/addons/source-python/packages/source-python/weapons/instance.py +++ b/addons/source-python/packages/source-python/weapons/instance.py @@ -8,6 +8,10 @@ # Source.Python Imports # Cvars from cvars import ConVar +# Weapons +from weapons.constants import WeaponID +from weapons.constants import WeaponSlot +from weapons.constants import WeaponType # ============================================================================= @@ -31,8 +35,17 @@ def __init__(self, name, basename, properties): # Store the weapon's base name self._basename = basename + # Store the weapon's id number + self._id = self.parse_weapon_constants( + properties.get('id', None), WeaponID) + + # Store the weapon's type number + self._type = self.parse_weapon_constants( + properties.get('type', None), WeaponType) + # Store the weapon's slot number - self._slot = properties.get('slot', None) + self._slot = self.parse_weapon_constants( + properties.get('slot', None), WeaponSlot) # Store the weapon's max ammo amount self._maxammo = properties.get('maxammo', None) @@ -46,8 +59,8 @@ def __init__(self, name, basename, properties): # Store the weapon's cost self._cost = properties.get('cost', None) - # Store the weapon's item definition index - self._item_definition_index = properties.get('item_definition_index', None) + # Store the weapon's parent_class + self._parent_class = properties.get('parent_class', None) # Store the weapon's tags self._tags = properties.get('tags', 'all').split(',') @@ -68,11 +81,27 @@ def basename(self): """ return self._basename + @property + def id(self): + """Return the id of the weapon. + + :rtype: int/WeaponID + """ + return self._id + + @property + def type(self): + """Return the type of the weapon. + + :rtype: int/WeaponType + """ + return self._type + @property def slot(self): """Return the slot of the weapon. - :rtype: int + :rtype: int/WeaponSlot """ return self._slot @@ -123,6 +152,16 @@ def cost(self): """ return self._cost + @property + def parent_class(self): + """Return the parent class of the weapon. + + :return: + None if the parent class data is missing. + :rtype: str + """ + return self._parent_class + @property def item_definition_index(self): """Return the item definition index of the weapon. @@ -131,7 +170,7 @@ def item_definition_index(self): None if the item defition index data is missing. :rtype: int """ - return self._item_definition_index + return int(self._id) if self._id is not None else None @property def tags(self): @@ -140,3 +179,23 @@ def tags(self): :rtype: list """ return self._tags + + @staticmethod + def parse_weapon_constants(value, weapon_constants): + """Parses weapon constants. + + :return: + Returns the value as it is if weapon constants cannot be found. + """ + if isinstance(value, int): + try: + return weapon_constants(value) + except ValueError: + pass + elif isinstance(value, str): + try: + return getattr(weapon_constants, value) + except AttributeError: + pass + + return value