Fukki лет назад: 7
Родитель
Сommit
271f423f06
2 измененных файлов с 23 добавлено и 3 удалено
  1. 19 1
      index.js
  2. 4 2
      manifest.json

+ 19 - 1
index.js

@@ -1,7 +1,7 @@
 const path = require('path'); const fs = require('fs');
 module.exports = function AutoPOT(mod) {
 	const cmd = mod.command || mod.require.command, map = new WeakMap();
-	let config = getConfig(), hpPot = getHP(), mpPot = getMP();
+	let config = getConfig(), hpPot = getHP(), mpPot = getMP(), aLoc = null, wLoc = 0;
 	let gPot = null, inUpdate = false, TmpData = [], aRes = {cd: null, delay: 5000};
 	mod.game.initialize(['me', 'contract']);
 
@@ -224,6 +224,16 @@ module.exports = function AutoPOT(mod) {
 			mpPot[mp][1].amount = 0;
 	});
 	
+	mod.hook('C_PLAYER_LOCATION', 5, e => {
+		aLoc = e.loc;
+		wLoc = e.w;
+	});
+	
+	mod.hook('S_SPAWN_ME', 3, e => {
+		aLoc = e.loc;
+		wLoc = e.w;
+	});
+	
 	mod.game.me.on('resurrect', () => { 
 		if (aRes.cd) clearTimeout(aRes.cd);
 		aRes.cd = setTimeout(() => {aRes.cd = null;}, aRes.delay);
@@ -255,7 +265,15 @@ module.exports = function AutoPOT(mod) {
 		mod.send('C_USE_ITEM', 3, {
 			gameId: mod.game.me.gameId,
 			id: s2n(itemId[0]),
+			dbid: 0,
+			target: 0,
 			amount: 1,
+			dest: {x: 0, y: 0, z: 0},
+			loc: aLoc,
+			w: wLoc,
+			unk1: 0,
+			unk2: 0,
+			unk3: 0,
 			unk4: true
 		});
 	}

+ 4 - 2
manifest.json

@@ -1,15 +1,17 @@
 {
 	"files": {
-		"index.js": "0fa2f874c8bc1bf0e2bea88f0d80e9e332585ed207ef4fb0e685bf71e39e9a1c"
+		"index.js": "900c94dc952d22d5154dd3b9e1512dbd4ea1ee716136908b36dfacaf8ddb371c"
 	},
 	"defs": {
 		"C_ADMIN": 1,
 		"C_CONFIRM_UPDATE_NOTIFICATION": "raw",
+		"C_PLAYER_LOCATION": 5,
 		"C_SHOW_INVEN": 1,
 		"C_USE_ITEM": 3,
 		"S_ANNOUNCE_UPDATE_NOTIFICATION": 1,
 		"S_INVEN": [17,18],
 		"S_PLAYER_STAT_UPDATE": 10,
-		"S_RETURN_TO_LOBBY": "raw"
+		"S_RETURN_TO_LOBBY": "raw",
+		"S_SPAWN_ME": 3
 	}
 }