Lambda лет назад: 7
Родитель
Сommit
d25a55bc60
3 измененных файлов с 31 добавлено и 24 удалено
  1. 1 1
      README.md
  2. 24 18
      index.js
  3. 6 5
      manifest.json

+ 1 - 1
README.md

@@ -8,7 +8,7 @@ Also works on your party members! So you can lock onto them as Priest and use pu
 # Commands  
 - !`irevive` to toggle module (DEFAULT: ON)  
 - !`irevive party` to toggle party functions which are useful if you are a Priest (DEFAULT: OFF)  
-- !`irevive drama` to toggle drama when dying (DEFAULT: OFF) (might increase the probabily of dead body being in the wrong place for ressurection visually on your screen)   
+- !`irevive drama` to toggle drama when dying (DEFAULT: OFF) (during dying (first 5 sec) animation dead body might be slightly in the wrong place for ressurection visually on your screen)   
 
 # Notes
 

+ 24 - 18
index.js

@@ -13,11 +13,6 @@ module.exports = function Instant_revive(mod) {
 		party() {
 			mod.settings.party = !mod.settings.party;
 			command.message(`for Party: ${mod.settings.party ? 'En' : 'Dis'}abled`);
-			if (!mod.settings.party)
-			{
-				partyMembers.length = 0;
-				command.message(`If you enable it again later while you are in a party - you will need to rejoin your party after that for this to work again`);
-			}
 		},
 		drama() {
 			mod.settings.drama = !mod.settings.drama;
@@ -28,13 +23,13 @@ module.exports = function Instant_revive(mod) {
 	mod.hook('S_CREATURE_LIFE', 3, {order: 9999}, ({gameId, alive, loc})=>{
 		if(mod.settings.enabled)
 		{
-			const member = partyMembers.find((memb) => memb.gameId === gameId);
+			const member = mod.settings.party ? (partyMembers.find((memb) => memb.gameId === gameId)) : null;
 			if (!member && gameId !== mod.game.me.gameId) return;
 			
 			if(!alive)
 			{
 				isDead[gameId] = true;
-				setTimeout(moveBody, 299, gameId, loc); // not sure if helps at all
+				if(gameId === mod.game.me.gameId) { setTimeout(clearMyBuffs, 280);} // fix for bugged CC skills?
 				if(mod.settings.drama)
 				{
 					setTimeout(fakeDeath, 300, gameId, loc, 0);
@@ -42,7 +37,10 @@ module.exports = function Instant_revive(mod) {
 				}
 				else
 				{
-					setTimeout(fakeDeath, 300, gameId, loc, 1);
+					fakeDeath(gameId, loc, 1);
+					setTimeout(fakeDeath, 300, gameId, loc, 1); // in case player was moving\using skills during death
+					setTimeout(fakeDeath, 2000, gameId, loc, 1);
+					setTimeout(fakeDeath, 4000, gameId, loc, 1);
 				}
 				return false; // we wont't have to waste time reviving if we don't die
 			}
@@ -55,8 +53,6 @@ module.exports = function Instant_revive(mod) {
 	});
 	
 	mod.hook('S_PARTY_MEMBER_LIST', 7, ({members}) => {
-		if (!mod.settings.party) return;
-		
 		partyMembers = members;
 	});
 	
@@ -93,6 +89,13 @@ module.exports = function Instant_revive(mod) {
 					huntingZoneId: 0,
 					id: 70300
 				}});
+			if(Stage === 1)
+			{
+				mod.toClient('S_INSTANT_MOVE', 3, {
+					gameId: Id,
+					loc: Loc
+				});
+			}
 		}
 	}
 	
@@ -113,14 +116,17 @@ module.exports = function Instant_revive(mod) {
 			}});
 	}
 	
-	function moveBody(Id, Loc)
+	function clearMyBuffs()
 	{
-		mod.send('S_USER_LOCATION', 5, {	
-			gameId: Id,
-			loc: Loc,
-			speed: 250,
-			dest: Loc,
-			type: 7
-		});
+		if(mod.game.me.abnormalities && isDead[mod.game.me.gameId])
+		{
+			Object.values(mod.game.me.abnormalities).forEach(abnormality => {
+				mod.toClient('S_ABNORMALITY_END', 1, {
+					target: mod.game.me.gameId,
+					id: abnormality.id
+				});
+				command.message("Cleared abnormality " + abnormality.id)
+			});
+		}
 	}
 }

+ 6 - 5
manifest.json

@@ -1,17 +1,18 @@
 {
 	"files": {
-		"README.md": "bcd84495d10e10cf31f8ba6780416243530267874917697bb2f1b782088dca7b",
-		"index.js": "fab9a0ea1cc05092b0fa4407be52197509139c5f83afe8ac9562fbf7789aa525",
+		"README.md": "053c1efc4b467007f25cc3adccf34a73874dcd0a7d7ef24772a647a2ea63b208",
+		"index.js": "37b31ff7a2d405404a9c591f54c685e7b1ea3f4e3354a567cbec222452a6eecd",
 		"module.json": "ed003376acf3807b44a08b852397cc948e65574aaec9f9b891c2585fd35edc97",
 		"settings_migrator.js": "f97c5a0de378cdb754a0eede1ad14176d6cd6fc28013b6bc48063a6a80e48ec1"
 	},
 	"defs": {
+		"S_ABNORMALITY_END": 1,
 		"S_ACTION_END": 5,
 		"S_ACTION_STAGE": 9,
 		"S_CREATURE_LIFE": 3,
+		"S_INSTANT_MOVE": 3,
 		"S_LEAVE_PARTY": "raw",
 		"S_LEAVE_PARTY_MEMBER": 2,
-		"S_PARTY_MEMBER_LIST": 7,
-		"S_USER_LOCATION": 5
+		"S_PARTY_MEMBER_LIST": 7
 	}
-}
+}