Просмотр исходного кода

Moar fixes.

Added function to add/remv to drop blacklist from in-game `/!fps dropitem hide <num>`.
Fixed `/!fps npc hide` where if no arguments it will no longer return undefined.
Fixed "DropBlacklist" were throwing undefined.
Fixed Backlisted npcs huntingzone 1023 weren't getting blocked properly.
Mie лет назад: 8
Родитель
Сommit
116f01a4b1
3 измененных файлов с 46 добавлено и 19 удалено
  1. 3 3
      README.md
  2. 41 14
      lib/index.js
  3. 2 2
      manifest.json

+ 3 - 3
README.md

@@ -21,7 +21,7 @@ Written for tera-proxy, a free script filled with features dedicated to improve
 |      `list`      |             N/A            |`!fps list`           | Prints list of hidden things.    |
 |      `list`      |             N/A            |`!fps list`           | Prints list of hidden things.    |
 |`summons` \| `sums`|      `other`\| `me`        |`!fps sums me`        |`other` hide other sums; `me` yours.|
 |`summons` \| `sums`|      `other`\| `me`        |`!fps sums me`        |`other` hide other sums; `me` yours.|
 |`skill` \| `skills`|`blacklist` \| Class \<arg3\>|`!fps skill blacklist`|Blacklist on/off; arg3 = classname|
 |`skill` \| `skills`|`blacklist` \| Class \<arg3\>|`!fps skill blacklist`|Blacklist on/off; arg3 = classname|
-|  `npc` \| `npcs`  |             N/A            |`!fps npc`            |Hides/shows blacklisted npcs.     |
+|  `npc` \| `npcs`  |   N/A \| `hide` \<num\>       |`!fps npc`            |N/A blacklist npcs on/off; `hide` to add \<num\> to blacklist. |
 |      `hit`       |   `me` \| `other` \| `damage`|`!fps hit me`         |Hides/shows skill results for each|
 |      `hit`       |   `me` \| `other` \| `damage`|`!fps hit me`         |Hides/shows skill results for each|
 |    `firework`    |             N/A            |`!fps firework`       |Hides/shows Dragon fireworks.     |
 |    `firework`    |             N/A            |`!fps firework`       |Hides/shows Dragon fireworks.     |
 |   `abn`\|`all`    |`blacklist` \<add\|remv num\>|`!fps abn blacklist`  |Hides/shows effects.              |
 |   `abn`\|`all`    |`blacklist` \<add\|remv num\>|`!fps abn blacklist`  |Hides/shows effects.              |
@@ -30,12 +30,12 @@ Written for tera-proxy, a free script filled with features dedicated to improve
 | `style`\|`costume`|             N/A            |`!fps style`          |Hides/shows style for ppl\|npc     |
 | `style`\|`costume`|             N/A            |`!fps style`          |Hides/shows style for ppl\|npc     |
 |  `gui npcsearch` |           \<arg1\>         |`!fps gui npcsearch E`|Opens list of npcs matching arg1. |
 |  `gui npcsearch` |           \<arg1\>         |`!fps gui npcsearch E`|Opens list of npcs matching arg1. |
 |    `npczoom`     |             N/A            |`!fps npczoom`        |If enabled, prevent zoom on npcs. |
 |    `npczoom`     |             N/A            |`!fps npczoom`        |If enabled, prevent zoom on npcs. |
-|    `dropitem`    |             N/A            |`!fps dropitem`       |Hides/shows blacklisted drops.    |
+|    `dropitem`    |   N/A \| `hide` \<num\>       |`!fps dropitem hide 300`|N/A blacklist drops on/off; `hide` to add \<num\> to blacklist. |
 
 
 
 
 ### Additional explaination for some of the commands *in-case not clear*
 ### Additional explaination for some of the commands *in-case not clear*
 - Modes: Sets the current presets optimization to \<num\>; \<num\> can be:
 - Modes: Sets the current presets optimization to \<num\>; \<num\> can be:
-  -  `0`, `off`: Turns off preset optimization.
+  - `0`, `off`: Turns off preset optimization.
   - `1`, `one`: Activates hiding all effects
   - `1`, `one`: Activates hiding all effects
   - `2`, `two`: Activates hiding players' skills, their effects, projectiles, damage numbers
   - `2`, `two`: Activates hiding players' skills, their effects, projectiles, damage numbers
   - `3`, `three`: Activates hiding all players & their skills, effects, projectiles, damage numbers.
   - `3`, `three`: Activates hiding all players & their skills, effects, projectiles, damage numbers.

+ 41 - 14
lib/index.js

@@ -30,6 +30,7 @@ module.exports = function FpsUtils(mod) {
 
 
 	let MyGameId,
 	let MyGameId,
 		MyName,
 		MyName,
+		MyPlayerId,
 		ChangeOnCd,
 		ChangeOnCd,
 		laststate,
 		laststate,
 		lastrange,
 		lastrange,
@@ -502,6 +503,7 @@ module.exports = function FpsUtils(mod) {
 	function sLogin(event) {
 	function sLogin(event) {
 		MyGameId = event.gameId;
 		MyGameId = event.gameId;
 		MyName = event.name;
 		MyName = event.name;
+		MyPlayerId = event.playerId;
 		laststate = undefined;
 		laststate = undefined;
 		if (mod.settings.ProjDebug) {
 		if (mod.settings.ProjDebug) {
 			mod.settings.ProjDebug = false
 			mod.settings.ProjDebug = false
@@ -667,6 +669,14 @@ module.exports = function FpsUtils(mod) {
 	}
 	}
 
 
 	function sSpawnNpc(event) {
 	function sSpawnNpc(event) {
+		if (mod.settings.HideBlacklistedNpcs) {
+			for (var i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
+				if (event.huntingZoneId == mod.settings.NpcsBlacklist[i].zone && event.templateId == mod.settings.NpcsBlacklist[i].templateId) {
+					hiddenNpcs[event.gameId] = event;
+					return false;
+				}
+			}
+		}
 		if (event.huntingZoneId === 1023) {
 		if (event.huntingZoneId === 1023) {
 			if (EqGid(event.owner)) {
 			if (EqGid(event.owner)) {
 				if (!mod.settings.HideMySummons) return;
 				if (!mod.settings.HideMySummons) return;
@@ -677,14 +687,6 @@ module.exports = function FpsUtils(mod) {
 			hiddenNpcs[event.gameId] = event;
 			hiddenNpcs[event.gameId] = event;
 			return false;
 			return false;
 		}
 		}
-		if (mod.settings.HideBlacklistedNpcs) {
-			for (var i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
-				if (event.huntingZoneId == mod.settings.NpcsBlacklist[i].zone && event.templateId == mod.settings.NpcsBlacklist[i].templateId) {
-					hiddenNpcs[event.gameId] = event;
-					return false;
-				}
-			}
-		}
 		if (mod.settings.HideFireworks && event.huntingZoneId === 1023 && (event.templateId === 60016000 || event.templateId === 80037000)) return false;
 		if (mod.settings.HideFireworks && event.huntingZoneId === 1023 && (event.templateId === 60016000 || event.templateId === 80037000)) return false;
 		if (mod.settings.ShowStyle) {
 		if (mod.settings.ShowStyle) {
 			event.repairable = false;
 			event.repairable = false;
@@ -770,9 +772,12 @@ module.exports = function FpsUtils(mod) {
 	function sSpawnDropItem(event) {
 	function sSpawnDropItem(event) {
 		if (EqGid(event.source)) return;
 		if (EqGid(event.source)) return;
 		if (mod.settings.HideBlacklistedDrop) {
 		if (mod.settings.HideBlacklistedDrop) {
-			if (DropBlacklist.includes(event.item)) return false;
+			for (let i in event.owners) {
+				if (event.owners[i].playerId.toString() == MyPlayerId.toString()) return;
+			}
+			if (mod.settings.DropBlacklist.includes(event.item)) return false;
 		}
 		}
-		if (mod.settings.ShowStyle) {
+		if (mod.settings.Mode >= 2) {
 			event.explode = 0;
 			event.explode = 0;
 			return true;
 			return true;
 		}
 		}
@@ -833,7 +838,7 @@ module.exports = function FpsUtils(mod) {
 	mod.command.add('3', () => mod.command.exec('fps mode 3'))
 	mod.command.add('3', () => mod.command.exec('fps mode 3'))
 
 
 	mod.command.add(['fps', 'fps-utils', 'fpsutil', 'fpsutils'], (key, arg, arg2, arg3) => {
 	mod.command.add(['fps', 'fps-utils', 'fpsutil', 'fpsutils'], (key, arg, arg2, arg3) => {
-		if (notcaaliproxy) mod.saveSettings(); // for some reason settings for caali's proxy weren't saving so we have this here now I guess 🤷
+		if (notcaaliproxy) mod.saveSettings();
 		switch (key) {
 		switch (key) {
 			case "g":
 			case "g":
 			case "gui":
 			case "gui":
@@ -1041,6 +1046,11 @@ module.exports = function FpsUtils(mod) {
 			case "npcs":
 			case "npcs":
 			case "npc":
 			case "npc":
 				if (arg == 'hide') {
 				if (arg == 'hide') {
+					if (!arg2 || !arg3) {
+						mod.settings.HideBlacklistedNpcs = !mod.settings.HideBlacklistedNpcs;
+						Msg(`Blacklisted NPCs ${mod.settings.HideBlacklistedNpcs ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
+						break;
+					}
 					let found = mod.settings.NpcsBlacklist.some((s) => {
 					let found = mod.settings.NpcsBlacklist.some((s) => {
 						return s.zone === arg2 && s.templateId === arg3;
 						return s.zone === arg2 && s.templateId === arg3;
 					});
 					});
@@ -1245,9 +1255,26 @@ module.exports = function FpsUtils(mod) {
 				Msg(`Npc zoom-ins ${mod.settings.NoZoomingToNpc ? 'Disabled'.clr(GreenClr) : 'ON'.clr(RedClr)}.`);
 				Msg(`Npc zoom-ins ${mod.settings.NoZoomingToNpc ? 'Disabled'.clr(GreenClr) : 'ON'.clr(RedClr)}.`);
 				break
 				break
 			case "dropitem":
 			case "dropitem":
-				mod.settings.HideBlacklistedDrop = !mod.settings.HideBlacklistedDrop
-				Msg(`Drop blacklist ${mod.settings.HideBlacklistedDrop ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
-				break
+				if (arg == 'hide') {
+					if (!arg2) {
+						mod.settings.HideBlacklistedDrop = !mod.settings.HideBlacklistedDrop;
+						Msg(`Blacklisted Drops ${mod.settings.HideBlacklistedDrop ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
+						break;
+					}
+					arg2 = Number(arg2);
+					let found = mod.settings.DropBlacklist.some((s) => { return s === arg2; });
+					if (found) {
+						Msg(`Drops id '${arg2}'` + ` Removed from the blacklist`.clr(RedClr) + '.')
+						mod.settings.DropBlacklist = mod.settings.DropBlacklist.filter((obj) => { return obj != arg2; })
+					} else {
+						Msg(`Drops id '${arg2}'` + ` Added to the blacklist`.clr(GreenClr) + '.')
+						mod.settings.DropBlacklist.push(arg2)
+					}
+					return
+				} else
+					mod.settings.HideBlacklistedDrop = !mod.settings.HideBlacklistedDrop;
+				Msg(`Blacklisted Drops ${mod.settings.HideBlacklistedDrop ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
+				break;
 			case "help":
 			case "help":
 				mod.command.exec(`fps gui help`)
 				mod.command.exec(`fps gui help`)
 				break
 				break

+ 2 - 2
manifest.json

@@ -1,9 +1,9 @@
 {
 {
 	"files": {
 	"files": {
-		"README.md": "d6805a4e8ed4f91e54b72d4c5455c1b97f1d6f14d410b8251d75296b833ee365",
+		"README.md": "7a91d2980573788ebeda1cfea04e6043762be6e2fb4a281b7a48fa1dde0c9a53",
 		"lib/data/npcData.json": "9949d5b7d18e347c29c46adf44e4ad8a519fc2e87166b0c402860ebaa082fb35",
 		"lib/data/npcData.json": "9949d5b7d18e347c29c46adf44e4ad8a519fc2e87166b0c402860ebaa082fb35",
 		"lib/data/skillString.json": "9d69876fea0be8e6ac5dd43b3fc74ea023f6b8a6145384f8f780dd977045d8ef",
 		"lib/data/skillString.json": "9d69876fea0be8e6ac5dd43b3fc74ea023f6b8a6145384f8f780dd977045d8ef",
-		"lib/index.js": "5de2b383e03fd4a5a92deeba2980aef6c9507b8fcdb4102a2d2cb3cd8d1d58d0",
+		"lib/index.js": "f1104b64f5074591090a043eee1ab3569f8c664ea99885375778d6618ddc7c56",
 		"lib/setting_migration.js": "a238f4bea218b0ec2a069088635347946ceb2a139e20dbc7c6936113a2778b49",
 		"lib/setting_migration.js": "a238f4bea218b0ec2a069088635347946ceb2a139e20dbc7c6936113a2778b49",
 		"module.json": "43a144bdbe953106b214023e3ed6496afb534dcf74b872a0e16f48fdf2dae260",
 		"module.json": "43a144bdbe953106b214023e3ed6496afb534dcf74b872a0e16f48fdf2dae260",
 		"node_modules/Gui/LICENSE": "589ed823e9a84c56feb95ac58e7cf384626b9cbf4fda2a907bc36e103de1bad2",
 		"node_modules/Gui/LICENSE": "589ed823e9a84c56feb95ac58e7cf384626b9cbf4fda2a907bc36e103de1bad2",