TeraProxy лет назад: 7
Родитель
Сommit
969ae8e420
4 измененных файлов с 41 добавлено и 16 удалено
  1. 2 0
      README.md
  2. 31 10
      index.js
  3. 6 4
      manifest.json
  4. 2 2
      module.json

+ 2 - 0
README.md

@@ -44,6 +44,8 @@ Based on true-everful-nostrum by Caali https://github.com/caali-hackerman
 ## Changelog
 ## Changelog
 <details>
 <details>
 
 
+### 2.2.1
+* [*] Fixed for patch 82
 ### 2.2.0
 ### 2.2.0
 * [+] Added "nostrumTime" and "CCBTime" to config settings
 * [+] Added "nostrumTime" and "CCBTime" to config settings
 ### 2.1.1
 ### 2.1.1

+ 31 - 10
index.js

@@ -9,7 +9,7 @@ module.exports = function Essentials(mod) {
 
 
 	mod.game.initialize("contract")
 	mod.game.initialize("contract")
 
 
-	let slot = null,
+	let item = null,
 		interval = null,
 		interval = null,
 		enabled = true,
 		enabled = true,
 		abnormalities = {},
 		abnormalities = {},
@@ -32,14 +32,32 @@ module.exports = function Essentials(mod) {
 		start()
 		start()
 	})
 	})
 
 
-	mod.hook('S_PCBANGINVENTORY_DATALIST', 1, event => {
-		for(let item of event.inventory)
-			if(ITEMS_NOSTRUM.includes(item.item)) {
-				slot = item.slot
-				item.cooldown = 0 // Cooldowns from this packet don't seem to do anything except freeze your client briefly
-				return true
-			}
-	})
+	if(mod.majorPatchVersion >= 82) {
+		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
+					}
+		})
+	}
+	else {
+		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_ABNORMALITY_BEGIN', 3, abnormality.bind(null, 'S_ABNORMALITY_BEGIN'))
 	mod.hook('S_ABNORMALITY_BEGIN', 3, abnormality.bind(null, 'S_ABNORMALITY_BEGIN'))
 	mod.hook('S_ABNORMALITY_REFRESH', 1, abnormality.bind(null, 'S_ABNORMALITY_REFRESH'))
 	mod.hook('S_ABNORMALITY_REFRESH', 1, abnormality.bind(null, 'S_ABNORMALITY_REFRESH'))
@@ -84,7 +102,10 @@ module.exports = function Essentials(mod) {
 		if(mod.game.me.zone < 9000 && mod.settings.dungeonOnly) return
 		if(mod.game.me.zone < 9000 && mod.settings.dungeonOnly) return
 
 
 		if(enabled) {
 		if(enabled) {
-			if(slot) mod.toServer('C_PCBANGINVENTORY_USE_SLOT', 1, {slot})
+			if(item) {
+				if(mod.majorPatchVersion >= 82) mod.send('C_USE_PREMIUM_SLOT', 1, item)
+				else mod.send('C_PCBANGINVENTORY_USE_SLOT', 1, item)
+			}
 			else useItem(mod.settings.nostrum)
 			else useItem(mod.settings.nostrum)
 		}
 		}
 	}
 	}

+ 6 - 4
manifest.json

@@ -1,21 +1,23 @@
 {
 {
     "files": {
     "files": {
         "LICENSE": "589ed823e9a84c56feb95ac58e7cf384626b9cbf4fda2a907bc36e103de1bad2",
         "LICENSE": "589ed823e9a84c56feb95ac58e7cf384626b9cbf4fda2a907bc36e103de1bad2",
-        "README.md": "8ef6b68d460a74f1c44ae6599106f22b4c50a90e1eca5f45842c806042c0f652",
+        "README.md": "7b6e3b5c7edb14e5a100b7d0904bc2e3950e5170e9dc2c3a13ae2bdf7ec132c2",
         "config.json": {
         "config.json": {
             "overwrite": false,
             "overwrite": false,
             "hash": "f37583b51ed6c475cc38f812a13ae52b784f5f319be8560f94cbf0c7f7a80db2"
             "hash": "f37583b51ed6c475cc38f812a13ae52b784f5f319be8560f94cbf0c7f7a80db2"
         },
         },
-        "index.js": "48a1d269381dd8c3a7b693a0e436559bbd8298923e1e12d4869f28f2613c0a03",
-        "module.json": "07c83caebfb5cabe27f161d07253e4b37c48451c374309b6c21ef41b7d5c5a0a",
+        "index.js": "33b2eeb7a3152ebd54130e1566aed50fbae9c8ad1b50a8b9abf072cc96a884fd",
+        "module.json": "ff96042db6fa6829e2e64aca2593d4352693244a8433ada6268683521b9ca80d",
         "settings_migrator.js": "0da6c1e6f7d14d980db286eb577e2e181cfcba44d9bc7dc0601db6c0020a2a03"
         "settings_migrator.js": "0da6c1e6f7d14d980db286eb577e2e181cfcba44d9bc7dc0601db6c0020a2a03"
     },
     },
     "defs": {
     "defs": {
         "C_PCBANGINVENTORY_USE_SLOT": 1,
         "C_PCBANGINVENTORY_USE_SLOT": 1,
         "C_USE_ITEM": 3,
         "C_USE_ITEM": 3,
+        "C_USE_PREMIUM_SLOT": 1,
         "S_ABNORMALITY_BEGIN": 3,
         "S_ABNORMALITY_BEGIN": 3,
         "S_ABNORMALITY_END": 1,
         "S_ABNORMALITY_END": 1,
         "S_ABNORMALITY_REFRESH": 1,
         "S_ABNORMALITY_REFRESH": 1,
-        "S_PCBANGINVENTORY_DATALIST": 1
+        "S_PCBANGINVENTORY_DATALIST": 1,
+        "S_PREMIUM_SLOT_DATALIST": 2
     }
     }
 }
 }

+ 2 - 2
module.json

@@ -1,9 +1,9 @@
 {
 {
     "disableAutoUpdate": false,
     "disableAutoUpdate": false,
     "name": "Essentials",
     "name": "Essentials",
-    "author": "Pinkie Pie / Caali / TeraProxy",
+    "author": "TeraProxy / Caali / Pinkie Pie",
     "description": "A tera-proxy module that automatically uses Nostrum/Battle Solution and Complete Crystalbind items whenever needed.",
     "description": "A tera-proxy module that automatically uses Nostrum/Battle Solution and Complete Crystalbind items whenever needed.",
-    "version": "2.2.0",
+    "version": "2.2.1",
     "donationUrl": "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=A3KBZUCSEQ5RJ",
     "donationUrl": "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=A3KBZUCSEQ5RJ",
     "options": {
     "options": {
         "niceName": "Essentials",
         "niceName": "Essentials",