Browse Source

New Option & Fix.

Added new option to hide the annoying mystic's(or/and other classes) mana numbers. Hide category => `HpMp Nums`

Settings version 10. :partly_sunny:
Risenio 7 years ago
parent
commit
d1865537ec
8 changed files with 57 additions and 27 deletions
  1. 3 2
      README.md
  2. 0 0
      lib/data/npc.json
  3. 0 0
      lib/data/skill.json
  4. 34 13
      lib/index.js
  5. 8 2
      lib/setting_migration.js
  6. 9 7
      manifest.json
  7. 2 2
      module.json
  8. 1 1
      package.json

+ 3 - 2
README.md

@@ -4,12 +4,13 @@
 ## How to use.
   * Put the script folder "fps-utils" into the `mods` folder.
   * Log the game using the proxy.
+  * To get access to the built-in GUI type `!fps g` into the chat.
 
 ## Capability.
   * Should work on both (Caali's & Pony's) proxies.
   * No dependencies.
 
-## Commands can be found in [this Wiki](https://github.com/Risenio/fps-utils/wiki/Commands).
+## List of commands can be found in [this Wiki](https://github.com/Risenio/fps-utils/wiki/Commands).
 
 ## Suggestions/Issues/Reports of all kinds are welcome.
   * If you have suggestions, need help, or want to comment on my coding, dm me on discord `@Risenio#1785` or leave an issue report.
@@ -25,7 +26,7 @@ Contributers:
 
 ---
 
-Thanks to the following people in helping me maintaining this module.
+Thanks to the following people for helping in maintaining this module.
   - [Caali](https://github.com/hackerman-caali)
   - [Pinkie Pie](https://github.com/pinkipi)
   - [Bernkastel](https://github.com/Bernkastel-0)

File diff suppressed because it is too large
+ 0 - 0
lib/data/npc.json


File diff suppressed because it is too large
+ 0 - 0
lib/data/skill.json


+ 34 - 13
lib/index.js

@@ -2,11 +2,9 @@
 /* global __dirname */
 
 module.exports = function FpsUtils(mod) {
-	const NotCP = typeof global.TeraProxy === 'undefined'; //For niceName forced thing and broken settings auto-save For Caali's Proxy users.
-	const NpcData = require("./data/npcData.json");
-	const SkillData = require("./data/skillString.json");
+	const NotCP = typeof global.TeraProxy === 'undefined';
+	const NpcData = require("./data/npc.json"), SkillData = require("./data/skill.json");
 	const BnzC = '#BC8F8F', SlvC = '#9A9A9A', GldC = '#DAA520', PnkC = '#FFB7C5', HPkC = '#FF69B4', CPKC = '#ED5D92', RedC = '#FE6F5E', GrnC = '#4DE19C', LPrC = '#E0B0FF', PrpC = '#9966CC', LBlC = '#4DDCE1', BluC = '#436EEE', DBlC = '#00575e', HBlC = '#08B3E5', GryC = '#778899', YlwC = '#C0B94D', OngC = '#FFBE5E';
-
 	const FishingNpcs = { 8: [6011], 12: [1, 2], 23: [201, 202], 34: [8000], 61: [9901], 62: [1017, 1035, 1039, 1040, 1041, 1042, 1900, 1901, 1902, 1903, 9001, 9002, 9003, 9004, 9901], 83: [9901], 207: [9901], 212: [1034], 223: [9901, 9906, 9907, 9915, 9925], 230: [9901], 362: [1201, 1202, 1301, 1302] };
 	const PvPProjs = [30120, 30220, 30320, 90120, 90220, 90320, 90420, 90520, 90620, 90720, 90820, 90920, 100120, 100220, 100320, 100420, 100520, 120220, 120320, 120420, 120520, 120620, 120720, 120820, 120920, 150120, 150220, 150320, 150420, 150520, 150620, 150720, 170120, 170220, 170320, 170420, 170520, 170620, 170720, 170820, 170920, 230120, 230220, 230320, 250120, 250220, 250320, 250420, 250520, 250620, 250720, 250820, 250920, 251020];
 	const UserSumNPCs = [12345, 1100100, 1100101, 1023000, 1023001, 1023002, 1023003, 1023004, 1023005, 1023006, 1023007, 1023008, 1023009, 1023010, 1023011, 1023012, 1023013, 1023014, 1023200, 1023201, 1023202, 1023203, 1023204, 1023205, 1023206, 1023207, 1023208, 1023209, 1023210, 1023211, 1023300, 1023301, 1023302, 1023303, 1023304, 1023305, 1023306, 1023307, 1023308, 1023309, 1023310, 1023311, 1023312, 1023400, 1023401, 1023402, 1023403, 1023404, 1023405, 1024000, 1024001, 1024100, 1024200, 1024300, 2100100, 2100101, 10235001, 10235002, 10235003, 10235004, 10235005, 10235006, 10235007, 10235008, 10235009, 10235010, 10235011, 10235012, 10235013, 10235014, 10235015, 10235016, 10235017, 10235100, 10236001, 10236002, 10236003, 10236004, 10236005, 10236006, 10236007, 10236008, 10236009, 10236010, 10236011, 10236012, 10236013, 10236014, 10236015, 10236100, 10237001, 10237002, 10237003, 10237004, 10237005, 10237006, 10237007, 10237008, 10237009, 10237010, 10237011, 10237012, 10237013, 10237014, 10237015, 10237100, 10238001, 10238002, 10238003, 10238004, 10238005, 10238006, 10238007, 10238008, 10238100, 10239003, 30301001, 30301002, 30301003, 30301004, 30301005, 30302001, 30302002, 30302003, 30302004, 30302005, 30302006, 30302007, 30303001, 30303002, 30303003, 30303004, 30303005, 30303006, 30303007];
@@ -31,7 +29,7 @@ module.exports = function FpsUtils(mod) {
 
 	const Xmap = new WeakMap();
 
-	if (!Xmap.has(mod.dispatch || mod)) { //TODO; sth for this.
+	if (!Xmap.has(mod.dispatch || mod)) {
 		Xmap.set(mod.dispatch || mod, {});
 
 		mod.hook('C_CONFIRM_UPDATE_NOTIFICATION', 'raw', () => false)
@@ -246,8 +244,8 @@ module.exports = function FpsUtils(mod) {
 					{ text: `<font color="${mod.settings.Fishing ? GrnC : RedC}" size="+18">[Fishing]</font><br><br>`, command: "fps fishing;fps gui" },
 					{ text: `<font color="${YlwC}" size="+21">Hit:</font>` }, { text: "&#09;&#09;&#09;" },
 					{ text: `<font color="${mod.settings.Hit_Other ? GrnC : RedC}" size="+18">[Players]</font>`, command: "fps hit other;fps gui" }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.Hit_Me ? GrnC : RedC}" size="+18">[Own(self)]</font>`, command: "fps hit me;fps gui" }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.Hit_Damage ? GrnC : RedC}" size="+18">[Damage numbers]</font>`, command: "fps hit damage;fps gui" }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.Hit_Me ? GrnC : RedC}" size="+18">[Own]</font>`, command: "fps hit me;fps gui" }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.Hit_Damage ? GrnC : RedC}" size="+18">[Dmg/heal numbers]</font>`, command: "fps hit damage;fps gui" }, { text: "&nbsp;&nbsp;" },
 					{ text: `<font color="${mod.settings.Hit_All ? GrnC : RedC}" size="+18">[ALL]</font><br><br>`, command: "fps hit all;fps gui" },
 					{ text: `<font color="${YlwC}" size="+21">Hide:</font>` }, { text: "&#09;&#09;" },
 					{ text: `<font color="${mod.settings.HideOthersSummons ? GrnC : RedC}" size="+17">[Players summons]</font>`, command: "fps summons;fps gui" }, { text: "&nbsp;&nbsp;" },
@@ -256,7 +254,8 @@ module.exports = function FpsUtils(mod) {
 					{ text: `<font color="${mod.settings.ShowStyle ? GrnC : RedC}" size="+17">[Style]</font>`, command: "fps style;fps gui" }, { text: "&nbsp;&nbsp;" },
 					{ text: `<font color="${mod.settings.Hideguildlogos ? GrnC : RedC}" size="+17">[Guild Logos]</font>`, command: "fps guildlogo;fps gui" }, { text: "&nbsp;&nbsp;" },
 					{ text: `<font color="${mod.settings.HideBlacklistedDrop ? GrnC : RedC}" size="+17">[Drops]</font>`, command: "fps dropitem;fps gui" }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.HideOwnBlacklistedAbns ? GrnC : RedC}" size="+17">[Dizziness]</font><br>`, command: "fps screenabns;fps gui" }, { text: "&#09;&#09;&#09;" },
+					{ text: `<font color="${mod.settings.HideOwnBlacklistedAbns ? GrnC : RedC}" size="+17">[Dizziness]</font>`, command: "fps screenabns;fps gui" }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.HideHpMpNumbers ? GrnC : RedC}" size="+17">[HpMp Nums]</font><br>`, command: "fps hpmpnumbers;fps gui" }, { text: "&#09;&#09;&#09;" },
 					{ text: `<font color="${mod.settings.HideAllAbnormalities ? GrnC : RedC}" size="+16">[All Abnormals]</font>`, command: "fps abn all;fps gui" }, { text: "&nbsp;&nbsp;" },
 					{ text: `<font color="${mod.settings.HideBlacklistedAbnormalities ? GrnC : RedC}" size="+16">[Abnormals BList]</font>`, command: "fps abn blacklist;fps gui" }, { text: "&nbsp;&nbsp;" },
 					{ text: `<font color="${mod.settings.HideAllProjectiles ? GrnC : RedC}" size="+16">[All Projs]</font>`, command: "fps proj all;fps gui" }, { text: "&nbsp;&nbsp;" },
@@ -694,11 +693,11 @@ module.exports = function FpsUtils(mod) {
 		if ([1, 2, 3, 31, 32, 33].includes(event.animation)) return false;
 	}
 
-	function sSystemMessage(event) { // TODO; probably delete this, as it's useless.
+	function sSystemMessage(event) {
 		if (!mod.settings.Fishing) return;
 		const msg = mod.parseSystemMessage(event.message)
-		if (msg.id === 'SMT_KOREAN_RATING_TEENAGER_PROHIBITED') return false;
-		if (msg.id === 'SMT_FIELD_EVENT_WORLD_ANNOUNCE') return false;
+		if (msg.id === 'SMT_FIELD_EVENT_WORLD_ANNOUNCE') return false;			// Superior guardian spam.
+		if (msg.id === 'SMT_KOREAN_RATING_TEENAGER_PROHIBITED') return false;	// You've been playing for X hours spam.
 	}
 
 	function sPartyMatchLink() {
@@ -934,6 +933,22 @@ module.exports = function FpsUtils(mod) {
 		if (!EqGid(event.gameId) && SUsers[event.gameId] && (HUsers[event.gameId] || mod.settings.Mode > 0 || mod.settings.HideAllProjectiles)) return false;
 	}
 
+	function sPlayerChangeMp(event) {
+		if (!mod.settings.HideHpMpNumbers || !EqGid(event.target)) return;
+		if (event.type != 0) {
+			event.type = 0;
+			return true;
+		}
+	}
+
+	function sCreatureChangeHp(event) {
+		if (!mod.settings.HideHpMpNumbers || !EqGid(event.target)) return;
+		if (event.type != 10) {
+			event.type = 10;
+			return true;
+		}
+	}
+
 	function sEachSkillResult(event) {
 		return ModifySkillResult(event);
 	}
@@ -973,7 +988,7 @@ module.exports = function FpsUtils(mod) {
 	mod.hook('S_SYSTEM_MESSAGE', 1, sSystemMessage)
 	mod.hook('S_PARTY_MATCH_LINK', 'raw', sPartyMatchLink)
 	mod.hook('S_VIEW_PARTY_INVITE', 'raw', sViewPartyInvite)
-	//mod.hook('S_QUEST_VILLAGER_INFO', 'raw', sQuestVillagerInfo) opcode currently not public, but soon it will be. **someday** qq
+	//mod.hook('S_QUEST_VILLAGER_INFO', 'raw', sQuestVillagerInfo) Currently the opcode for this ain't public, but it will be soon™.
 	mod.hook('S_UPDATE_ACHIEVEMENT_PROGRESS', 'raw', sUpdateAchievementProgress)
 	mod.hook('S_CURRENT_CHANNEL', 2, sCurrentChannel)
 	mod.hook('S_ITEM_CUSTOM_STRING', 2, sItemCustomString)
@@ -1009,6 +1024,8 @@ module.exports = function FpsUtils(mod) {
 	mod.hook('S_ACTION_STAGE', 9, { order: 999 }, sActionStage)
 	mod.hook('S_SPAWN_PROJECTILE', 5, { order: 999 }, sSpawnProjectile)
 	mod.hook('S_START_USER_PROJECTILE', 9, { order: 999 }, sStartUserProjectile)
+	mod.hook('S_PLAYER_CHANGE_MP', 1, sPlayerChangeMp)
+	mod.hook('S_CREATURE_CHANGE_HP', 6, sCreatureChangeHp)
 	mod.hook('S_EACH_SKILL_RESULT', 12, { order: 999 }, sEachSkillResult)
 	mod.hook('S_SPAWN_DROPITEM', 6, sSpawnDropItem)
 	mod.hook('S_FONT_SWAP_INFO', 'raw', sFontSwapInfo)
@@ -1475,6 +1492,10 @@ module.exports = function FpsUtils(mod) {
 				Msg(`Fishing mode is ${mod.settings.Fishing ? `<font color="${GrnC}">Enabled</font>` : `<font color="${RedC}">Disabled</font>`}.`);
 				mod.settings.Fishing ? HideNpcs('fish') : ShowNpcs('fish');
 				break;
+			case "hpmpnumbers":
+				mod.settings.HideHpMpNumbers = !mod.settings.HideHpMpNumbers;
+				Msg(`Own HpMp numbers ${mod.settings.HideHpMpNumbers ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`)
+				break;
 			case "help":
 				mod.command.exec("fps gui help");
 				break;
@@ -1483,6 +1504,6 @@ module.exports = function FpsUtils(mod) {
 				mod.command.exec("fps gui help");
 				break;
 		}
-		if (!NotCP) mod.saveSettings(); // for some reason settings still.... doesn't save properly on first run for caali's proxy so we have this here now as temp fix I guess. 🤷
+		if (!NotCP) mod.saveSettings();
 	})
 }

+ 8 - 2
lib/setting_migration.js

@@ -1,7 +1,7 @@
 'use strict'
 
 const DefaultSettings = {
-	_version: 9,
+	_version: 10,
 	Mode: 0,
 	Fishing: false,
 	OnlyParty: false,
@@ -16,6 +16,7 @@ const DefaultSettings = {
 	HideFireworks: true,
 	Hideguildlogos: false,
 	HideMonsterDeathAnimation: true,
+	HideHpMpNumbers: false,
 	HideMySummons: false,
 	HideOthersSummons: false,
 	HideAllAbnormalities: false,
@@ -98,10 +99,15 @@ function MigrateSettings(from_ver, to_ver, settings) {
 				settings.PvpTraps = DefaultSettings.PvpTraps;
 				break;
 			case 9:
+				settings._version = 9;
 				settings.Hit_All = DefaultSettings.Hit_All;
 				break;
+			case 10:
+				settings._version = 10;
+				settings.HideHpMpNumbers = DefaultSettings.HideHpMpNumbers;
+				break;
 			default:
-				console.log(`[FPS-UTILS] -\x1b[31m Your 'config.json' seems to be too old.\x1b[32m Re-created new one.\x1b[0m`);
+				console.log(`\x1b[94mINFO\x1b[34m [FPS-UTILS]\x1b[39m - Your \x1b[31m'config.json'(caali's proxy)/'settings/fps-utils.json'(pinkie's proxy)\x1b[39m seems to be mega outdated.\x1b[32m Re-created new one.\x1b[39m\x1b[0m`);
 				Object.keys(settings).forEach(key => delete settings[key]);
 				settings = JSON.parse(JSON.stringify(DefaultSettings));
 				break;

+ 9 - 7
manifest.json

@@ -1,12 +1,12 @@
 {
     "files": {
-        "README.md": "c60e209ff27cf5363b147186c20ccac2fcdc339d12af40f201a7dd9151c33d41",
-        "lib/data/npcData.json": "737fd1ff6b53121fc2fa716bc7f1c5688a4db2353dedf9c024bb879cd0cfa5a0",
-        "lib/data/skillString.json": "9d69876fea0be8e6ac5dd43b3fc74ea023f6b8a6145384f8f780dd977045d8ef",
-        "lib/index.js": "b2f54e8b7de0bae69854065e4cc598d6eb952705e0ca70d9e50885a22aac2e45",
-        "lib/setting_migration.js": "1c2766f31b067510c4aa964382f6b9949a0098fe4d6c2805b696e0e71414f546",
-        "module.json": "58359cb9ec21bbca8bee51974026774b2ae8287db7cea164f7165ace99ef39f4",
-        "package.json": "948e48143610cdfb056b0dbcb6fae6833f4930ed9fe20a9c70688fdf6f8c316e"
+        "README.md": "87158ad01812602aae6b490f754ae30a14765d5369d1fa31e0fac1e0d1be63e2",
+        "lib/data/npc.json": "737fd1ff6b53121fc2fa716bc7f1c5688a4db2353dedf9c024bb879cd0cfa5a0",
+        "lib/data/skill.json": "9d69876fea0be8e6ac5dd43b3fc74ea023f6b8a6145384f8f780dd977045d8ef",
+        "lib/index.js": "2c31b7dd8829cf81cee2089391fe7931145319596d4f6f4a233e024871366d46",
+        "lib/setting_migration.js": "4d6163bcd97785739a1e7e9af800eb3f92dd7bca32824ae148c93fd4dbd16107",
+        "module.json": "58b10fc0f18f3452d3f044a82dc44a9e3809d9ad7840be312b53d7991c991d8b",
+        "package.json": "026fcecb19ecb5825e62a0409be84f5e207a24a1417de147d93d801f1e5758e4"
     },
     "defs": {
         "C_ADMIN": 1,
@@ -24,6 +24,7 @@
         "S_ACTION_STAGE": 9,
         "S_ANNOUNCE_UPDATE_NOTIFICATION": 1,
         "S_APPLY_TITLE": 2,
+        "S_CREATURE_CHANGE_HP": 6,
         "S_CREATURE_ROTATE": 2,
         "S_CURRENT_CHANNEL": 2,
         "S_DEAD_LOCATION": 2,
@@ -47,6 +48,7 @@
         "S_PARTY_MATCH_LINK": "raw",
         "S_PARTY_MEMBER_LIST": 7,
         "S_PCBANGINVENTORY_DATALIST": 1,
+        "S_PLAYER_CHANGE_MP": 1,
         "S_SHOW_AWESOMIUMWEB_SHOP": 1,
         "S_SOCIAL": 1,
         "S_SPAWN_DROPITEM": 6,

+ 2 - 2
module.json

@@ -5,11 +5,11 @@
     "homepage": "https://github.com/Risenio/fps-utils/wiki",
     "description": "A free script filled with features dedicated to improve your fps.",
     "contributors": ["codeagon","Saegusae","SerenTera","Kyoukaya","SaltyMonkey","Leyki"],
-    "version": "9",
+    "version": "10",
     "options": {
         "niceName": "FPS",
         "guiName": "Fps Utils",
-        "settingsVersion": 9,
+        "settingsVersion": 10,
         "settingsFile": "config.json",
         "settingsMigrator": "./lib/setting_migration.js"
     },

+ 1 - 1
package.json

@@ -3,7 +3,7 @@
 	"name": "fps-utils",
 	"author": "Risenio",
 	"description": "A free script filled with features dedicated to improve your fps.",
-	"version": "9",
+	"version": "10",
 	"homepage": "https://github.com/Risenio/fps-utils/wiki",
 	"keywords": [ "fps", "tera", "tera-proxy", "tera-fps" ],
     "contributors": ["codeagon", "Saegusae", "SerenTera", "Kyoukaya", "SaltyMonkey", "Leyki"],

Some files were not shown because too many files changed in this diff