Browse Source

i'm a fool

TeraProxy 7 years ago
parent
commit
02bae1863f
2 changed files with 19 additions and 11 deletions
  1. 16 8
      index.js
  2. 3 3
      manifest.json

+ 16 - 8
index.js

@@ -32,13 +32,19 @@ module.exports = function Essentials(mod) {
 		start()
 	})
 
-	mod.hook('S_PCBANGINVENTORY_DATALIST', 1, event => {
-		for(let entry of event.inventory)
-			if(ITEMS_NOSTRUM.includes(entry.item)) {
-				item = { slot: entry.slot }
-				entry.cooldown = 0 // Cooldowns from this packet don't seem to do anything except freeze your client briefly
-				return true
-			}
+	mod.hook('S_PREMIUM_SLOT_DATALIST', 2, event => {
+		for(let set of event.sets)
+			for(let entry of set.inventory)
+				if(ITEMS_NOSTRUM.includes(entry.id)) {
+					item = {
+						set: set.id,
+						slot: entry.slot,
+						type: entry.type,
+						id: entry.id
+					}
+					entry.cooldown = 0n // Cooldowns from this packet don't seem to do anything except freeze your client briefly
+					return true
+				}
 	})
 
 	mod.hook('S_ABNORMALITY_BEGIN', 3, abnormality.bind(null, 'S_ABNORMALITY_BEGIN'))
@@ -50,6 +56,8 @@ module.exports = function Essentials(mod) {
 			mod.command.message(niceName + 'Used item ID: ' + event.id)
 		})
 	}
+	
+	index.js
 
 	// ################# //
 	// ### Functions ### //
@@ -84,7 +92,7 @@ module.exports = function Essentials(mod) {
 		if(mod.game.me.zone < 9000 && mod.settings.dungeonOnly) return
 
 		if(enabled) {
-			if(item) mod.send('C_PCBANGINVENTORY_USE_SLOT', 1, item)
+			if(item) mod.send('C_USE_PREMIUM_SLOT', 1, item)
 			else useItem(mod.settings.nostrum)
 		}
 	}

+ 3 - 3
manifest.json

@@ -6,16 +6,16 @@
             "overwrite": false,
             "hash": "f37583b51ed6c475cc38f812a13ae52b784f5f319be8560f94cbf0c7f7a80db2"
         },
-        "index.js": "669b4781ff3ed51cfbbe0237c4fd090c7055b7e8b9d58c36d2c666461f9acb3b",
+        "index.js": "eb820863a2c6e205b9f4a810b30042324c8a1917556798b99e5138421c18693f",
         "module.json": "2b2aafb2a5f30009b0f4d8eb35a7b3229b75979e9bac8b39386d2f7dbf739b96",
         "settings_migrator.js": "0da6c1e6f7d14d980db286eb577e2e181cfcba44d9bc7dc0601db6c0020a2a03"
     },
     "defs": {
-        "C_PCBANGINVENTORY_USE_SLOT": 1,
         "C_USE_ITEM": 3,
+        "C_USE_PREMIUM_SLOT": 1,
         "S_ABNORMALITY_BEGIN": 3,
         "S_ABNORMALITY_END": 1,
         "S_ABNORMALITY_REFRESH": 1,
-        "S_PCBANGINVENTORY_DATALIST": 1
+        "S_PREMIUM_SLOT_DATALIST": 2
     }
 }