From c2404ed71f8ad7bf09f9ffeca7b0d9c2513aca61 Mon Sep 17 00:00:00 2001 From: Preport Date: Thu, 6 May 2021 04:07:41 +0300 Subject: [PATCH 1/2] add ApplyStrangifier function - Adds ApplyXifier function with two inputs item id and strangifier id. - Upon completion we will receive 2 itemRemoved and 1 itemAcquired events. --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index c85171e..57e64c2 100644 --- a/index.js +++ b/index.js @@ -246,6 +246,13 @@ TeamFortress2.prototype.useItem = function(item) { this._send(Language.UseItemRequest, Schema.CMsgUseItem, {"item_id": item}); }; +TeamFortress2.prototype.applyStrangifier = function (item, strangifier) { + this._send(Language.ApplyXifier, Schema.CMsgGCCollectItem, { + "collection_item_id": strangifier, + "subject_item_id": item + }); +} + TeamFortress2.prototype.sortBackpack = function(sortType) { this._send(Language.SortItems, Schema.CMsgSortItems, {"sort_type": sortType}); }; From 8cc488589f58e800485c7a174d9e589f575c6c66 Mon Sep 17 00:00:00 2001 From: Preport Date: Thu, 6 May 2021 06:16:45 +0300 Subject: [PATCH 2/2] Add some more functions --- enums.js | 9 +++++++++ index.js | 19 ++++++++++++++++++- language.js | 5 ++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/enums.js b/enums.js index 4814dba..4458681 100644 --- a/enums.js +++ b/enums.js @@ -83,3 +83,12 @@ TeamFortress2.HeavyVsPyroWarSide = { Heavy: 0, Pyro: 1 }; + +TeamFortress2.Attributes = { + Paint: 1031, + CustomTexture: 1051, + MakersMark: 1053, + Killstreak: 1094, + GiftedBy: 2570, + Festivizer: 2572 +} \ No newline at end of file diff --git a/index.js b/index.js index 57e64c2..94ab68b 100644 --- a/index.js +++ b/index.js @@ -246,12 +246,29 @@ TeamFortress2.prototype.useItem = function(item) { this._send(Language.UseItemRequest, Schema.CMsgUseItem, {"item_id": item}); }; +TeamFortress2.prototype.tradeUP = function (items) { + this._send(Language.CraftCollectionUpgrade, Schema.CMsgCraftCollectionUpgrade, { + "item_id": items + }); +}; + +TeamFortress2.prototype.removeItemAttribute = function (item, attribute) { + this._send(attribute, Schema.CMsgGCRemoveCustomizationAttributeSimple, { "item_id": item }); +}; + +TeamFortress2.prototype.applyStrangePart = function (item, part) { + this._send(Language.ApplyStrangePart, Schema.CMsgApplyStrangePart, { + "strange_part_item_id": part, + "item_item_id": item + }); +}; + TeamFortress2.prototype.applyStrangifier = function (item, strangifier) { this._send(Language.ApplyXifier, Schema.CMsgGCCollectItem, { "collection_item_id": strangifier, "subject_item_id": item }); -} +}; TeamFortress2.prototype.sortBackpack = function(sortType) { this._send(Language.SortItems, Schema.CMsgSortItems, {"sort_type": sortType}); diff --git a/language.js b/language.js index 984c7a1..7770ea3 100644 --- a/language.js +++ b/language.js @@ -162,7 +162,10 @@ module.exports = { GCToGCGetUserServerMembersResponse: 2544, GCToGCGrantSelfMadeItemToAccount: 2555, GCToGCThankedByNewUser: 2556, - ShuffleCrateContents: 2557, + ShuffleCrateContents: 2557, + CraftCollectionUpgrade: 2567, + RemoveItemGiftedBy: 2570, + RemoveItemFestivizer: 2572, // EGCBaseClientMsg PingRequest: 3001,