Skip to content

Commit

Permalink
Merge pull request #136 from felpsds/feature/weaponId
Browse files Browse the repository at this point in the history
Feature - Add Weapons ID
  • Loading branch information
ByMykel authored Dec 28, 2024
2 parents bd73dd0 + 85eb4fc commit 820c21d
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
3 changes: 3 additions & 0 deletions services/skins.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
getWears,
getDopplerPhase,
getRarityColor,
weaponIDMapping,
} from "../utils/index.js";
import { saveDataJson } from "../utils/saveDataJson.js";
import { $t, $tTag, $tc, languageData } from "./translations.js";
Expand Down Expand Up @@ -112,6 +113,7 @@ const parseItem = (item, items) => {
description: getDescription(translatedDescription, paintKits, pattern),
weapon: {
id: weapon,
weapon_id: weaponIDMapping[weapon],
name: translatedName,
},
category: {
Expand Down Expand Up @@ -179,6 +181,7 @@ export const getSkins = () => {
description: $t(knife.item_description),
weapon: {
id: knife.item_name,
weapon_id: weaponIDMapping[knife.name],
name: $t(knife.item_name),
},
category: {
Expand Down
5 changes: 4 additions & 1 deletion services/skinsNotGrouped.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
getCategory,
getRarityColor,
formatSkinImage,
getFinishStyleLink
getFinishStyleLink,
weaponIDMapping
} from "../utils/index.js";
import { saveDataJson } from "../utils/saveDataJson.js";
import specialNotes from "../utils/specialNotes.json" assert { type: "json" };
Expand Down Expand Up @@ -154,6 +155,7 @@ const parseItem = (item, items) => {
),
weapon: {
id: weapon,
weapon_id: weaponIDMapping[weapon],
name: translatedName,
},
category: {
Expand Down Expand Up @@ -244,6 +246,7 @@ export const getSkinsNotGrouped = () => {
}),
weapon: {
id: knife.item_name,
weapon_id: weaponIDMapping[knife.name],
name: $t(knife.item_name),
},
category: {
Expand Down
58 changes: 58 additions & 0 deletions utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,64 @@ export const weaponsNames = [
"studded_hydra_gloves",
];

export const weaponIDMapping = {
"weapon_taser": 31,
"weapon_deagle": 1,
"weapon_elite": 2,
"weapon_fiveseven": 3,
"weapon_glock": 4,
"weapon_ak47": 7,
"weapon_aug": 8,
"weapon_awp": 9,
"weapon_famas": 10,
"weapon_g3sg1": 11,
"weapon_galilar": 13,
"weapon_m249": 14,
"weapon_mac10": 17,
"weapon_p90": 19,
"weapon_mp5sd": 23,
"weapon_ump45": 24,
"weapon_xm1014": 25,
"weapon_bizon": 26,
"weapon_mag7": 27,
"weapon_negev": 28,
"weapon_sawedoff": 29,
"weapon_tec9": 30,
"weapon_hkp2000": 32,
"weapon_mp7": 33,
"weapon_mp9": 34,
"weapon_nova": 35,
"weapon_p250": 36,
"weapon_scar20": 38,
"weapon_sg556": 39,
"weapon_ssg08": 40,
"weapon_m4a1_silencer": 60,
"weapon_m4a1": 16,
"weapon_usp_silencer": 61,
"weapon_cz75a": 63,
"weapon_revolver": 64,
"weapon_bayonet": 500,
"weapon_knife_css": 503,
"weapon_knife_flip": 505,
"weapon_knife_gut": 506,
"weapon_knife_karambit": 507,
"weapon_knife_m9_bayonet": 508,
"weapon_knife_tactical": 509,
"weapon_knife_falchion": 512,
"weapon_knife_survival_bowie": 514,
"weapon_knife_butterfly": 515,
"weapon_knife_push": 516,
"weapon_knife_cord": 517,
"weapon_knife_canis": 518,
"weapon_knife_ursus": 519,
"weapon_knife_gypsy_jackknife": 520,
"weapon_knife_outdoor": 521,
"weapon_knife_stiletto": 522,
"weapon_knife_widowmaker": 523,
"weapon_knife_skeleton": 525,
"weapon_knife_kukri": 526,
};

export const knives = [
{
name: "weapon_bayonet",
Expand Down

0 comments on commit 820c21d

Please sign in to comment.