Browse Source

Fix.

- The bug that caused `Hide blacklisted skills` to not function as it should be.
Mie 7 years ago
parent
commit
04ec9506c2
3 changed files with 32 additions and 16 deletions
  1. 3 2
      README.md
  2. 27 12
      lib/index.js
  3. 2 2
      manifest.json

+ 3 - 2
README.md

@@ -2,8 +2,9 @@
   Written for tera-proxy, a free script filled with features dedicated to improve your fps, in the open world, in dungeons and in battlegrounds.
 
 ## NOTE FOR CLASSIC SERVER.
-  - The module should function just fine, however the GUI that the module uses (welcome window) doesn't support clicking, so this been said. You've to write the commands by hand, You may still can open the GUI however it will be just a visual, nothing can be clicked inside.
-  - I've tested all it's functionality, All went good. If you found any bug/error/issue, please inform me, thank you.
+  - I've tested all it's functionality, Everything is good. If you found any bug/error/issue, please inform me, thank you. 
+  - Side note: The GUI that the module uses (welcome window) doesn't support clicking, this been said; You've to write the commands by hand, You may still however open the GUI but it will be just a visual, nothing can be clicked inside, a full list of commands can be found in [this Wiki](https://github.com/Risenio/fps-utils/wiki/Commands).
+  
 
 ## How to use.
   * Put the script folder "fps-utils" into the `mods` folder.

+ 27 - 12
lib/index.js

@@ -902,7 +902,7 @@ module.exports = function FpsUtils(mod) {
 			if (SUsers[event.target]) log('Abnormality', 'Applied', 'on', SUsers[event.target].name, event.id);
 			if (SUsers[event.source]) log('Abnormality', 'Started', 'from', SUsers[event.source].name, event.id);
 		}
-		if([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
+		if ([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
 		if (ImportantAbns.includes(event.id)) return;
 		if (EqGid(event.target)) {
 			if (mod.settings.HideOwnBlacklistedAbns && mod.settings.OwnAbnormalsBlacklist.includes(event.id)) return false;
@@ -915,14 +915,14 @@ module.exports = function FpsUtils(mod) {
 	}
 
 	function sAbnormalityRefresh(event) {
-		if([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
+		if ([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
 		if (ImportantAbns.includes(event.id)) return;
 		if (HUsers[event.target] || HNpcs[event.target]) return false;
 		if ((mod.settings.HideBlacklistedAbnormalities || mod.settings.HideAllAbnormalities) && (SUsers[[10306, 10316, 12001, 12003, 22040, 12120, 12130].includes(event.target)] || SUsers[[10306, 10316, 12001, 12003, 22040, 12120, 12130].includes(event.source)])) return false;
 	}
 
 	function sAbnormalityEnd(event) {
-		if([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
+		if ([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
 		if (event.id === 9943049) return false;
 	}
 
@@ -932,7 +932,16 @@ module.exports = function FpsUtils(mod) {
 
 	function sActionStage(event) {
 		if (EqGid(event.gameId) || !SUsers[event.gameId]) return;
-		if ((mod.settings.Mode >= 2) || HUsers[event.gameId] || (mod.settings.HideBlacklistedSkills && mod.settings.ClassesData[ClassID(event.templateId)].CD_SkillsBlacklist.includes(Math.floor(((Classic_NOTCP ? (event.skill - 0x4000000) : event.skill.id) / 10000).toString()))) || mod.settings.ClassesData[ClassID(event.templateId)].CD_HideBlacklistedSkills) {
+		if ((mod.settings.Mode >= 2) || HUsers[event.gameId] || mod.settings.ClassesData[ClassID(event.templateId)].CD_HideBlacklistedSkills) {
+			UpdateUserLoc(event);
+			return false;
+		}
+		if (Classic_NOTCP) {
+			if (mod.settings.HideBlacklistedSkills && mod.settings.ClassesData[ClassID(event.templateId)].CD_SkillsBlacklist.includes(Math.floor((event.skill - 0x4000000) / 10000).toString())) {
+				UpdateUserLoc(event);
+				return false;
+			}
+		} else if (mod.settings.HideBlacklistedSkills && mod.settings.ClassesData[ClassID(event.templateId)].CD_SkillsBlacklist.includes(Math.floor(event.skill.id / 10000).toString())) {
 			UpdateUserLoc(event);
 			return false;
 		}
@@ -940,22 +949,28 @@ module.exports = function FpsUtils(mod) {
 
 	function sStartUserProjectile(event) {
 		if (ProjDebug) {
-			if (EqGid(event.gameId)) log('Projectile', 'Started', 'from', MyName, (Classic_NOTCP ? (event.skill - 0x4000000) : event.skill.id));
-			if (SUsers[event.gameId]) log('Projectile', 'Started', 'from', SUsers[event.gameId].name, (Classic_NOTCP ? (event.skill - 0x4000000) : event.skill.id));
+			if (EqGid(event.gameId)) if (Classic_NOTCP) log('Projectile', 'Started', 'from', MyName, event.skill - 0x4000000); else log('Projectile', 'Started', 'from', MyName, event.skill.id);
+			if (SUsers[event.gameId]) if (Classic_NOTCP) log('Projectile', 'Started', 'from', SUsers[event.gameId].name, event.skill - 0x4000000); else log('Projectile', 'Started', 'from', SUsers[event.gameId].name, event.skill.id);
+		}
+		if (mod.settings.PvpTraps) {
+			if (Classic_NOTCP && TrapsIds.includes(event.skill - 0x4000000)) return;
+			else if (TrapsIds.includes(event.skill.id)) return;
 		}
-		if (mod.settings.PvpTraps && TrapsIds.includes((Classic_NOTCP ? (event.skill - 0x4000000) : event.skill.id))) return;
-		if ((mod.settings.HideBlacklistedProjectiles || mod.settings.HideAllProjectiles) && mod.settings.ProjectilesBlacklist.includes((Classic_NOTCP ? (event.skill - 0x4000000) : event.skill.id))) return false;
+		if ((mod.settings.HideBlacklistedProjectiles || mod.settings.HideAllProjectiles)) { if (Classic_NOTCP && mod.settings.ProjectilesBlacklist.includes(event.skill - 0x4000000)) return false; else if (mod.settings.ProjectilesBlacklist.includes(event.skill.id)) return false; }
 		if (!EqGid(event.gameId) && SUsers[event.gameId] && (HUsers[event.gameId] || mod.settings.Mode >= 2 || mod.settings.HideAllProjectiles)) return false;
 	}
 
 	function sSpawnProjectile(event) {
 		if (Classic_NOTCP ? (Boolean(event.skill & 0x40000000) === true) : event.skill.npc) return;
 		if (ProjDebug) {
-			if (EqGid(event.gameId)) log('Projectile', 'Spawned', 'from', MyName, (Classic_NOTCP ? (event.skill - 0x4000000) : event.skill.id));
-			if (SUsers[event.gameId]) log('Projectile', 'Spawned', 'from', SUsers[event.gameId].name, (Classic_NOTCP ? (event.skill - 0x4000000) : event.skill.id));
+			if (EqGid(event.gameId)) if (Classic_NOTCP) log('Projectile', 'Spawned', 'from', MyName, event.skill - 0x4000000); else log('Projectile', 'Spawned', 'from', MyName, event.skill.id);
+			if (SUsers[event.gameId]) if (Classic_NOTCP) log('Projectile', 'Spawned', 'from', SUsers[event.gameId].name, event.skill - 0x4000000); else log('Projectile', 'Spawned', 'from', SUsers[event.gameId].name, event.skill.id);
+		}
+		if (mod.settings.PvpTraps) {
+			if (Classic_NOTCP && TrapsIds.includes(event.skill - 0x4000000)) return;
+			else if (TrapsIds.includes(event.skill.id)) return;
 		}
-		if (mod.settings.PvpTraps && TrapsIds.includes((Classic_NOTCP ? (event.skill - 0x4000000) : event.skill.id))) return;
-		if ((mod.settings.HideBlacklistedProjectiles || mod.settings.HideAllProjectiles) && mod.settings.ProjectilesBlacklist.includes((Classic_NOTCP ? (event.skill - 0x4000000) : event.skill.id))) return false;
+		if ((mod.settings.HideBlacklistedProjectiles || mod.settings.HideAllProjectiles)) { if (Classic_NOTCP && mod.settings.ProjectilesBlacklist.includes(event.skill - 0x4000000)) return false; else if (mod.settings.ProjectilesBlacklist.includes(event.skill.id)) return false; }
 		if (!EqGid(event.gameId) && SUsers[event.gameId] && (HUsers[event.gameId] || mod.settings.Mode >= 2 || mod.settings.HideAllProjectiles)) return false;
 	}
 

+ 2 - 2
manifest.json

@@ -1,9 +1,9 @@
 {
     "files": {
-        "README.md": "422606400e058085470beceaa8a73a63255ce054764d85a09d572a9e87889ce3",
+        "README.md": "5265e5d92a17de8f85a3a0638258fb6623ab895f1aec59704171abfd3e12677f",
         "lib/data/npcData.json": "d3e7b59617ef841447567d69b074aa2dd6958eabb1a231c5821ffa7165daeac6",
         "lib/data/skillString.json": "9d69876fea0be8e6ac5dd43b3fc74ea023f6b8a6145384f8f780dd977045d8ef",
-        "lib/index.js": "11efa19d741ca0f1d04b03e49e9796baa24648db9ecce4b833955446c6f8de7d",
+        "lib/index.js": "bbf1472a4513167fbd53a16a3fa85f6aa099edfe39d4e4c386a0c5059bfdf867",
         "lib/setting_migration.js": "868abf1f54c8e91df415e19220a2046021fa67a905dcff6a799b01a83488f6a8",
         "module.json": "edcfd2361bc0f72ed7b3838f9f07ad3647738ed2564e230e7da8f7b4a08db715",
         "package.json": "f3e3cf2c845e54b6503108b6bef7f8f5bf33654f6ae1664c75bedbf7f6aa83c1"