cs2-inventory-resolver 0.4.38 → 0.4.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/data/inventory.json +1 -1
- package/dist/resolver.d.ts +10 -9
- package/dist/resolver.js +32 -18
- package/dist/resolver.test.js +32 -0
- package/dist/types.d.ts +6 -2
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -66,8 +66,15 @@ resolveItem({ def_index: 1203 });
|
|
|
66
66
|
// status: "tradable",
|
|
67
67
|
// trade_hold_expires: null
|
|
68
68
|
// }
|
|
69
|
+
|
|
70
|
+
// Pet (def_index 4681): pet id from attribute 296, breed color from `style`
|
|
71
|
+
const pet = [{ def_index: 296, value_bytes: Buffer.from([5, 0, 0, 0]) }];
|
|
72
|
+
resolveItem({ def_index: 4681, style: 9, attribute: pet });
|
|
73
|
+
// => { name: "Pet Chicken | Polish (Pink)", entity: "pet", marketable: false, ... }
|
|
69
74
|
```
|
|
70
75
|
|
|
76
|
+
Pets without styles (the egg and the chick) are resolved by their pet id only.
|
|
77
|
+
|
|
71
78
|
Returns `null` if the item could not be identified.
|
|
72
79
|
|
|
73
80
|
#### Input (`GcItemInput`)
|
|
@@ -78,6 +85,7 @@ Returns `null` if the item could not be identified.
|
|
|
78
85
|
| `paint_index` | `number?` | Paint/skin index |
|
|
79
86
|
| `quality` | `number?` | Item quality (`3` = ★ knife/glove) |
|
|
80
87
|
| `paint_wear` | `number?` | Wear float (`0.0`–`1.0`) |
|
|
88
|
+
| `style` | `number \| null?` | Item style (for pets, the breed color) |
|
|
81
89
|
| `stickers` | `{sticker_id?: number}[]?` | Sticker slots |
|
|
82
90
|
| `attribute` | `{def_index: number; value_bytes?: Buffer}[]?` | Raw attribute array |
|
|
83
91
|
|