Browse Source

Fixes + Classic for Pp.

Classic support for pinkie proxy:
 - Hardcoded defs.
 - Skill ids are treated as uint32.
 - Lets hope it doesn't break other modules.
Fixes:
 - Fix fear on mobs where you don't see the fear animation and just see the mob teleport when the fear duration over.
 - NPC search list were showing no result.
Mie 7 years ago
parent
commit
c834b14c1b
2 changed files with 179 additions and 148 deletions
  1. 178 147
      lib/index.js
  2. 1 1
      manifest.json

+ 178 - 147
lib/index.js

@@ -1,10 +1,49 @@
 'use strict'
 /* global __dirname */
 
+function LoadThis() { //Lets hope this won't break other modules.
+	const { protocol } = require('tera-data-parser');
+
+	protocol.messages.set('S_LOGIN', new Map().set(12, [['name', 'offset'], ['details', 'count'], ['details', 'offset'], ['shape', 'count'], ['shape', 'offset'], ['templateId', 'int32'], ['gameId', 'uint64'], ['serverId', 'uint32'], ['playerId', 'uint32'], ['actionMode', 'int32'], ['alive', 'bool'], ['status', 'int32'], ['walkSpeed', 'int32'], ['runSpeed', 'int32'], ['appearance', 'customize'], ['visible', 'bool'], ['isSecondCharacter', 'bool'], ['level', 'uint16'], ['profMineral', 'uint16'], ['profBug', 'uint16'], ['profHerb', 'uint16'], ['profEnergy', 'uint16'], ['profPet', 'uint16'], ['pkDeclareCount', 'int32'], ['pkKillCount', 'int32'], ['totalXp', 'int64'], ['levelXp', 'int64'], ['totalLevelXp', 'int64'], ['unkn1', 'int32'], ['restBonusXp', 'int32'], ['maxRestBonusXp', 'int32'], ['xpBonusPercent', 'float'], ['dropBonusPercent', 'float'], ['weapon', 'int32'], ['body', 'int32'], ['hand', 'int32'], ['feet', 'int32'], ['underwear', 'int32'], ['head', 'int32'], ['face', 'int32'], ['serverTime', 'int64'], ['isPkServer', 'bool'], ['chatBanEndTime', 'int64'], ['title', 'uint32'], ['weaponModel', 'int32'], ['bodyModel', 'int32'], ['handModel', 'int32'], ['feetModel', 'int32'], ['weaponDye', 'uint32'], ['bodyDye', 'uint32'], ['handDye', 'uint32'], ['feetDye', 'uint32'], ['unkn2', 'uint32'], ['weaponEnchant', 'uint32'], ['isWorldEventTarget', 'bool'], ['infamy', 'int32'], ['showFace', 'bool'], ['styleHead', 'uint32'], ['styleFace', 'uint32'], ['styleBack', 'uint32'], ['styleWeapon', 'uint32'], ['styleBody', 'uint32'], ['styleBodyDye', 'uint32'], ['unionId', 'uint32'], ['unionClass', 'uint32'], ['unionEchelon', 'uint32'], ['showStyle', 'bool'], ['titleCount', 'int64'], ['appearance2', 'int32'], ['scale', 'float'], ['name', 'string'], ['details', 'bytes'], ['shape', 'bytes']]))
+	protocol.messages.set('S_ABNORMALITY_BEGIN', new Map().set(3, [['target', 'uint64'], ['source', 'uint64'], ['id', 'uint32'], ['duration', 'int32'], ['unk', 'int32'], ['stacks', 'int32']]))
+	protocol.messages.set('S_CREATURE_CHANGE_HP', new Map().set(6, [['curHp', 'uint32'], ['maxHp', 'uint32'], ['diff', 'int32'], ['type', 'uint32'], ['target', 'uint64'], ['source', 'uint64'], ['crit', 'byte']]))
+	protocol.messages.set('S_USER_LOCATION', new Map().set(5, [['gameId', 'uint64'], ['loc', 'vec3'], ['w', 'angle'], ['speed', 'int16'], ['dest', 'vec3'], ['type', 'int32'], ['inShuttle', 'bool']]))
+	protocol.messages.set('S_START_USER_PROJECTILE', new Map().set(9, [['gameId', 'uint64'], ['templateId', 'int32'], ['unk1', 'int32'], ['id', 'uint64'], ['skill', 'uint32'], ['loc', 'vec3'], ['dest', 'vec3'], ['speed', 'float']]))
+	protocol.messages.set('S_SPAWN_USER', new Map().set(14, [['icons', 'count'], ['icons', 'offset'], ['name', 'offset'], ['guildName', 'offset'], ['guildRank', 'offset'], ['details', 'count'], ['details', 'offset'], ['guildTitle', 'offset'], ['guildLogo', 'offset'], ['shape', 'count'], ['shape', 'offset'], ['serverId', 'uint32'], ['playerId', 'uint32'], ['gameId', 'uint64'], ['loc', 'vec3'], ['w', 'angle'], ['relation', 'int32'], ['templateId', 'int32'], ['huntingZoneId', 'int16'], ['walkSpeed', 'int16'], ['runSpeed', 'int16'], ['actionMode', 'int16'], ['status', 'int16'], ['visible', 'bool'], ['alive', 'bool'], ['appearance', 'customize'], ['weapon', 'uint32'], ['body', 'uint32'], ['hand', 'uint32'], ['feet', 'uint32'], ['underwear', 'uint32'], ['head', 'uint32'], ['face', 'uint32'], ['spawnFx', 'int32'], ['mount', 'int32'], ['pose', 'int32'], ['title', 'int32'], ['shuttleId', 'int64'], ['guildLogoId', 'int32'], ['exarch', 'bool'], ['gm', 'bool'], ['gmInvisible', 'bool'], ['weaponModel', 'uint32'], ['bodyModel', 'uint32'], ['handModel', 'uint32'], ['feetModel', 'uint32'], ['weaponDye', 'uint32'], ['bodyDye', 'uint32'], ['handDye', 'uint32'], ['feetDye', 'uint32'], ['weaponEnchant', 'uint32'], ['isWorldEventTarget', 'bool'], ['pkEnabled', 'bool'], ['level', 'int32'], ['vehicleEx', 'uint64'], ['showFace', 'bool'], ['styleHead', 'uint32'], ['styleFace', 'uint32'], ['styleBack', 'uint32'], ['styleWeapon', 'uint32'], ['styleBody', 'uint32'], ['styleBodyDye', 'uint32'], ['partyServer', 'int32'], ['partyId', 'int32'], ['raid', 'bool'], ['unionId', 'uint32'], ['unionClass', 'uint32'], ['unionEchelon', 'uint32'], ['showStyle', 'bool'], ['titleCount', 'int64'], ['appearance2', 'int32'], ['scale', 'float'], ['icons', [['icon', 'int32']]], ['name', 'string'], ['guildName', 'string'], ['guildRank', 'string'], ['details', 'bytes'], ['guildTitle', 'string'], ['guildLogo', 'string'], ['shape', 'bytes']]))
+	protocol.messages.set('S_SPAWN_PROJECTILE', new Map().set(5, [['id', 'uint64'], ['unk1', 'uint32'], ['skill', 'uint32'], ['loc', 'vec3'], ['dest', 'vec3'], ['moving', 'bool'], ['speed', 'float'], ['gameId', 'uint64'], ['templateId', 'int32']]))
+	protocol.messages.set('S_SPAWN_NPC', new Map().set(11, [['seats', 'count'], ['seats', 'offset'], ['npcName', 'offset'], ['gameId', 'uint64'], ['target', 'uint64'], ['loc', 'vec3'], ['w', 'angle'], ['relation', 'int32'], ['templateId', 'uint32'], ['huntingZoneId', 'uint16'], ['walkSpeed', 'int16'], ['runSpeed', 'int16'], ['status', 'int16'], ['mode', 'int16'], ['hpLevel', 'int16'], ['questInfo', 'int16'], ['visible', 'bool'], ['villager', 'bool'], ['spawnType', 'int32'], ['replaceId', 'uint64'], ['spawnScript', 'uint32'], ['replaceDespawnScript', 'uint32'], ['aggressive', 'bool'], ['owner', 'uint64'], ['occupiedByPartyId', 'uint64'], ['occupiedByPlayerId', 'uint64'], ['unk1', 'uint32'], ['unk2', 'byte'], ['seats', [['id', 'uint32'], ['passengerId', 'uint64'], ['pitch', 'angle'], ['yaw', 'angle'], ['passengerMaxHp', 'int32'], ['passengerMaxMp', 'int32'], ['passengerHp', 'int32'], ['passengerMp', 'int32']]], ['npcName', 'string']]))
+	protocol.messages.set('S_SPAWN_DROPITEM', new Map().set(6, [['owners', 'count'], ['owners', 'offset'], ['gameId', 'uint64'], ['loc', 'vec3'], ['item', 'int32'], ['amount', 'int32'], ['expiry', 'int32'], ['explode', 'bool'], ['masterwork', 'bool'], ['enchant', 'int32'], ['source', 'uint64'], ['owners', [['gameId', 'uint64']]]]))
+	protocol.messages.set('S_PARTY_MEMBER_LIST', new Map().set(7, [['members', 'count'], ['members', 'offset'], ['ims', 'bool'], ['raid', 'bool'], ['unk1', 'uint32'], ['unk2', 'uint32'], ['unk3', 'uint16'], ['unk4', 'uint16'], ['leaderServerId', 'uint32'], ['leaderPlayerId', 'uint32'], ['unk5', 'uint32'], ['unk6', 'uint32'], ['unk7', 'byte'], ['unk8', 'uint32'], ['unk9', 'byte'], ['unk10', 'uint32'], ['unk11', 'byte'], ['members', [['name', 'offset'], ['serverId', 'uint32'], ['playerId', 'uint32'], ['level', 'uint32'], ['class', 'uint32'], ['online', 'bool'], ['gameId', 'uint64'], ['order', 'int32'], ['canInvite', 'byte'], ['name', 'string']]]]))
+	protocol.messages.set('S_ACTION_STAGE', new Map().set(9, [['animSeq', 'count'], ['animSeq', 'offset'], ['gameId', 'uint64'], ['loc', 'vec3'], ['w', 'angle'], ['templateId', 'int32'], ['skill', 'uint32'], ['stage', 'int32'], ['speed', 'float'], ['id', 'uint32'], ['animSeq', [['duration', 'int32'], ['xyRate', 'float'], ['zRate', 'float'], ['distance', 'float']]]]))
+	const ReactionObject12 = [['movement', 'count'], ['movement', 'offset'], ['enable', 'bool'], ['instantPush', 'bool'], ['loc', 'vec3'], ['w', 'angle'], ['skill', 'uint32'], ['stage', 'int32'], ['id', 'uint32'], ['movement', [['duration', 'int32'], ['speed', 'float'], ['unk', 'float'], ['distance', 'float']]]]
+	ReactionObject12.type = 'object';
+	protocol.messages.set('S_EACH_SKILL_RESULT', new Map().set(12, [['source', 'uint64'], ['target', 'uint64'], ['templateId', 'int32'], ['skill', 'uint32'], ['stage', 'int32'], ['targeting', 'int16'], ['area', 'int16'], ['id', 'uint32'], ['time', 'int32'], ['damage', 'int32'], ['type', 'int16'], ['noctEffect', 'int16'], ['crit', 'bool'], ['stackExplode', 'bool'], ['reaction', ReactionObject12]]))
+	//const ReactionObject13 = [['enable', 'bool'], ['push', 'bool'], ['loc', 'vec3'], ['w', 'angle'], ['skill', 'uint32'], ['stage', 'int32'], ['id', 'uint32'], ['animSeq', [['duration', 'int32'], ['xyRate', 'float'], ['zRate', 'float'], ['distance', 'float']]]]
+	//ReactionObject13.type = 'object';
+	//protocol.messages.set('S_EACH_SKILL_RESULT', new Map().set(13, [['source', 'uint64'], ['target', 'uint64'], ['templateId', 'int32'], ['skill', 'uint32'], ['targeting', 'int32'], ['area', 'int32'], ['id', 'uint32'], ['time', 'int32'], ['value', 'int32'], ['type', 'int16'], ['noctEffect', 'int16'], ['crit', 'bool'], ['stackExplode', 'bool'], ['reaction', ReactionObject13]]))
+
+	// Misc.
+	protocol.messages.set('S_JOIN_PRIVATE_CHAT', new Map().set(1, [['name', 'offset'], ['index', 'int32'], ['id', 'int32'], ['name', 'string']]))
+	protocol.messages.set('S_USER_EFFECT', new Map().set(1, [['target', 'uint64'], ['circle', 'int32'], ['operation', 'int32']]))
+	protocol.messages.set('C_PLAYER_LOCATION', new Map().set(5, [['loc', 'vec3'], ['w', 'angle'], ['dest', 'vec3'], ['type', 'int32'], ['jumpDistance', 'int16'], ['inShuttle', 'bool'], ['time', 'uint32']]))
+	protocol.messages.set('S_ACTION_END', new Map().set(5, [['gameId', 'uint64'], ['loc', 'vec3'], ['w', 'angle'], ['templateId', 'int32'], ['skill', 'uint32'], ['type', 'int32'], ['id', 'uint32']]))
+	protocol.messages.set('S_NPC_STATUS', new Map().set(2, [['gameId', 'uint64'], ['enraged', 'bool'], ['hpLevel', 'int32'], ['target', 'uint64'], ['status', 'int32']]))
+	protocol.messages.set('C_USE_ITEM', new Map().set(3, [['gameId', 'uint64'], ['id', 'int32'], ['dbid', 'uint64'], ['target', 'uint64'], ['dest', 'vec3'], ['loc', 'vec3'], ['w', 'angle'], ['unk1', 'uint32'], ['unk2', 'uint32'], ['unk3', 'uint32'], ['unk4', 'bool']]))
+	//protocol.messages.set('S_USER_EXTERNAL_CHANGE', new Map().set(7, [['gameId', 'uint64'], ['weapon', 'int32'], ['body', 'int32'], ['hand', 'int32'], ['feet', 'int32'], ['underwear', 'int32'], ['head', 'int32'], ['face', 'int32'], ['weaponModel', 'int32'], ['bodyModel', 'uint32'], ['handModel', 'uint32'], ['feetModel', 'uint32'], ['weaponDye', 'uint32'], ['bodyDye', 'uint32'], ['handDye', 'uint32'], ['feetDye', 'uint32'], ['underwearDye', 'uint32'], ['weaponEnchant', 'uint32'], ['styleHead', 'int32'], ['styleFace', 'int32'], ['styleBack', 'int32'], ['styleWeapon', 'int32'], ['styleBody', 'int32'], ['styleBodyDye', 'uint32'], ['showStyle', 'bool']]))
+	//protocol.messages.set('S_INVEN', new Map().set(16, [['items', 'count'], ['items', 'offset'], ['gameId', 'uint64'], ['gold', 'int64'], ['open', 'bool'], ['first', 'bool'], ['more', 'bool'], ['size', 'int32'], ['itemLevelInventory', 'int32'], ['itemLevel', 'int32'], ['tcat', 'int64'], ['brokerUseTcat', 'int32'], ['items', [['passivities', 'count'], ['passivities', 'offset'], ['customString', 'offset'], ['id', 'int32'], ['dbid', 'uint64'], ['ownerId', 'uint64'], ['slot', 'uint32'], ['storageType', 'int32'], ['amount', 'int32'], ['enchant', 'int32'], ['durability', 'int32'], ['soulbound', 'bool'], ['crystal1', 'int32'], ['crystal2', 'int32'], ['crystal3', 'int32'], ['crystal4', 'int32'], ['crystal5', 'int32'], ['remodel', 'int32'], ['dye', 'uint32'], ['dyeSecRemaining', 'int32'], ['dyeDate', 'int64'], ['dyeExpiryDate', 'int64'], ['masterwork', 'bool'], ['enigma', 'int32'], ['masterworkBonus', 'int32'], ['itemLevel', 'int32'], ['timesBrokered', 'int32'], ['enchantAdvantage', 'int32'], ['enchantBonus', 'int32'], ['enchantBonusMaxPlus', 'int32'], ['boundToPlayer', 'uint64'], ['passivities', [['id', 'int32']]], ['customString', 'string']]]]))
+	//const path = require('path');
+	//protocol.messages.clear();
+	//protocol.load(path.join(__dirname, 'Classic-tera-data'));
+	//for (const [k, v] of protocol.messages.entries()) protocol.maps.set(k, v);
+}
+
 module.exports = function FpsUtils(mod) {
+
 	// ~~~ * Data * ~~~ \\
 
 	const NotCP = typeof global.TeraProxy === 'undefined';
+	const Classic_NOTCP = mod.majorPatchVersion === 27 && NotCP;
+	if (Classic_NOTCP) LoadThis(); //Pinkie's Proxy classic-server capability.
 	const NpcData = require("./data/npcData.json"), SkillData = require("./data/skillString.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 = '#5BC0BE', HBlC = '#08B3E5', GryC = '#778899', YlwC = '#C0B94D';
 	const InvisibleNpcs = { 8: [6011], 12: [1, 2], 23: [201, 202], 34: [8000], 61: [9901], 62: [1039, 1040, 1041, 1042, 1900, 1901, 1902, 1903, 9001, 9002, 9003, 9004, 9901], 83: [9901], 207: [9901], 212: [1034], 223: [9901], 230: [9901] };
@@ -72,10 +111,10 @@ module.exports = function FpsUtils(mod) {
 	function GuiHandler(page, arg) {
 		switch (page) {
 			case "searchnpc": case "npcsearch":
-				NpcJsonSearch(arg, NpcData, "search", `<font color="${LBlC}" size="+16">Search results for '${arg}'</font>.`)
+				NpcJsonSearch("search", arg);
 				break;
 			case "npc":
-				NpcJsonSearch(arg, NpcData, "starts", `<font color="${LBlC}" size="+16">Search results for '${arg}'</font>.`)
+				NpcJsonSearch("starts", arg);
 				break;
 			case "npclist":
 				TmpData = []
@@ -161,28 +200,28 @@ module.exports = function FpsUtils(mod) {
 				gui.parse([
 					{ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
 					{ text: `<font color="${YlwC}" size="+20">By Roles:</font>` }, { text: "&#09;" },
-					{ text: `<font color="${mod.settings.RolesBlacklist.includes('tank') ? GrnC : RedC}" size="+18">[Tankers]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('tank') ? `show` : `hide`} tank;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.RolesBlacklist.includes('healer') ? GrnC : RedC}" size="+18">[Healers]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('healer') ? `show` : `hide`} healer;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.RolesBlacklist.includes('dps') ? GrnC : RedC}" size="+18" >[Dps-All]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('dps') ? `show` : `hide`} dps;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.RolesBlacklist.includes('ranged') ? GrnC : RedC}" size="+18">[Dps-Ranged]</font><br><br><br><br>`, command: `fps ${mod.settings.RolesBlacklist.includes('ranged') ? `show` : `hide`} ranged;fps gui role` },
+					{ text: `<font color="${mod.settings.RolesBlacklist.includes('tank') ? GrnC : RedC}" size="+18">[Tankers]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('tank') ? "show" : "hide"} tank;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.RolesBlacklist.includes('healer') ? GrnC : RedC}" size="+18">[Healers]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('healer') ? "show" : "hide"} healer;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.RolesBlacklist.includes('dps') ? GrnC : RedC}" size="+18" >[Dps-All]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('dps') ? "show" : "hide"} dps;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.RolesBlacklist.includes('ranged') ? GrnC : RedC}" size="+18">[Dps-Ranged]</font><br><br><br><br>`, command: `fps ${mod.settings.RolesBlacklist.includes('ranged') ? "show" : "hide"} ranged;fps gui role` },
 					{ text: `<font color="${DBlC}" size="+22">By Classes</font><br><br>` },
 					{ text: `<font color="${YlwC}" size="+20">Tankers:</font>` }, { text: "&#09;&#09;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('lancer') ? GrnC : RedC}" size="+18">[Lancer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('lancer') ? `show` : `hide`} lancer;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('brawler') ? GrnC : RedC}" size="+18">[Brawler]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('brawler') ? `show` : `hide`} brawler;fps gui role` },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('lancer') ? GrnC : RedC}" size="+18">[Lancer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('lancer') ? "show" : "hide"} lancer;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('brawler') ? GrnC : RedC}" size="+18">[Brawler]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('brawler') ? "show" : "hide"} brawler;fps gui role` },
 					{ text: `<font color="${YlwC}" size="+20">Healers:</font>` }, { text: "&#09;&#09;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('priest') ? GrnC : RedC}" size="+18">[Priest]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('priest') ? `show` : `hide`} priest;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('mystic') ? GrnC : RedC}" size="+18">[Mystic]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('mystic') ? `show` : `hide`} mystic;fps gui role` },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('priest') ? GrnC : RedC}" size="+18">[Priest]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('priest') ? "show" : "hide"} priest;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('mystic') ? GrnC : RedC}" size="+18">[Mystic]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('mystic') ? "show" : "hide"} mystic;fps gui role` },
 					{ text: `<font color="${YlwC}" size="+20">Dpsers(melee):</font>` }, { text: "&#09;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('warrior') ? GrnC : RedC}" size="+18">[Warrior]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('warrior') ? `show` : `hide`} warrior;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('slayer') ? GrnC : RedC}" size="+18">[Slayer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('slayer') ? `show` : `hide`} slayer;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('berserker') ? GrnC : RedC}" size="+18">[Berserker]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('berserker') ? `show` : `hide`} berserker;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('ninja') ? GrnC : RedC}" size="+18">[Ninja]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('ninja') ? `show` : `hide`} ninja;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('valkyrie') ? GrnC : RedC}" size="+18">[Valkyrie]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('valkyrie') ? `show` : `hide`} valkyrie;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('reaper') ? GrnC : RedC}" size="+18">[Reaper]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('reaper') ? `show` : `hide`} reaper;fps gui role` },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('warrior') ? GrnC : RedC}" size="+18">[Warrior]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('warrior') ? "show" : "hide"} warrior;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('slayer') ? GrnC : RedC}" size="+18">[Slayer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('slayer') ? "show" : "hide"} slayer;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('berserker') ? GrnC : RedC}" size="+18">[Berserker]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('berserker') ? "show" : "hide"} berserker;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('ninja') ? GrnC : RedC}" size="+18">[Ninja]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('ninja') ? "show" : "hide"} ninja;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('valkyrie') ? GrnC : RedC}" size="+18">[Valkyrie]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('valkyrie') ? "show" : "hide"} valkyrie;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('reaper') ? GrnC : RedC}" size="+18">[Reaper]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('reaper') ? "show" : "hide"} reaper;fps gui role` },
 					{ text: `<font color="${YlwC}" size="+20">Dpsers(ranged):</font>` }, { text: "&#09;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('sorcerer') ? GrnC : RedC}" size="+18">[Sorcerer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('sorcerer') ? `show` : `hide`} sorcerer;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('archer') ? GrnC : RedC}" size="+18">[Archer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('archer') ? `show` : `hide`} archer;fps gui role` }, { text: "&nbsp;&nbsp;" },
-					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('gunner') ? GrnC : RedC}" size="+18">[Gunner]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('gunner') ? `show` : `hide`} gunner;fps gui role` }
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('sorcerer') ? GrnC : RedC}" size="+18">[Sorcerer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('sorcerer') ? "show" : "hide"} sorcerer;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('archer') ? GrnC : RedC}" size="+18">[Archer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('archer') ? "show" : "hide"} archer;fps gui role` }, { text: "&nbsp;&nbsp;" },
+					{ text: `<font color="${mod.settings.ClassesBlacklist.includes('gunner') ? GrnC : RedC}" size="+18">[Gunner]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('gunner') ? "show" : "hide"} gunner;fps gui role` }
 				], `<font color="${LPrC}">[FPS] Options - Roles/Classes</font>`)
 				break;
 			case "abn":
@@ -209,7 +248,7 @@ module.exports = function FpsUtils(mod) {
 				break;
 			case "help":
 				gui.parse([
-					{ text: mod.majorPatchVersion < 79 ? `<font color="${PnkC}" size="+15"><p align="right">The GUI is only visual in classic server, buttons doesn't work, thanks for understanding.</p></font><br>` : '' },
+					{ text: mod.majorPatchVersion < 79 ? `<font color="${PnkC}" size="+15"><p align="right">Classic server detected, buttons doesn't work here, thanks for understanding.</p></font><br>` : '' },
 					{ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
 					{ text: `<font size="20"><font color="${LBlC}">Command</font>            <font color="${SlvC}">Arg(s)</font>                 <font color="${CPKC}">Example</font><br>` },
 					{ text: `<font color="${HBlC}">gui ^ g</font>                      <font color="${DBlC}">N/A</font>                    <font color="${HPkC}">!fps gui</font><br>` },
@@ -240,7 +279,7 @@ module.exports = function FpsUtils(mod) {
 				break;
 			default:
 				gui.parse([
-					{ text: mod.majorPatchVersion < 79 ? `<font color="${PnkC}" size="+15"><p align="right">The GUI is only visual in classic server, buttons doesn't work, thanks for understanding.</p></font><br>` : '' },
+					{ text: mod.majorPatchVersion < 79 ? `<font color="${PnkC}" size="+15"><p align="right">Classic server detected, buttons doesn't work here, thanks for understanding.</p></font><br>` : '' },
 					{ text: `<font color="${PrpC}" size="+15"><p align="right">REFRESH</p></font><br>`, command: "fps gui" },
 					{ text: `<font color="${YlwC}" size="+20">Modes:</font>` }, { text: "&#09;&#09;" },
 					{ text: `<font color="${mod.settings.Mode === 0 ? GrnC : RedC}" size="+18">[Mode 0]</font>`, command: "fps mode 0;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
@@ -311,7 +350,7 @@ module.exports = function FpsUtils(mod) {
 	function SkillJsonSearch(value) {
 		let keys = [],
 			skilldata = [],
-			skillIds = []
+			skillIds = [];
 		skilldata.push(
 			{ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
 			{ text: `<font color="${mod.settings.HideBlacklistedSkills ? GrnC : RedC}" size="+22"><p align="right">[Blacklisted skills are ${mod.settings.HideBlacklistedSkills ? 'Hidden' : 'Shown'}]</p></font><br>`, command: "fps skill blacklist;fps gui skills" },
@@ -322,26 +361,29 @@ module.exports = function FpsUtils(mod) {
 		}
 		skillIds.push(Object.values(SkillData[value]))
 		for (let i = 0; i < keys.length; i++) {
-			skilldata.push({ command: `fps skill class ${value} ${skillIds[0][i]};fps gui class ${value}`, text: `<font color="${mod.settings.ClassesData[ClassNameFromID(value)].CD_SkillsBlacklist.includes(skillIds[0][i].toString()) ? GrnC : RedC}" size="+17">[${keys[i]}]</font><br>` })
+			skilldata.push({ command: `fps skill class ${value} ${skillIds[0][i]};fps gui class ${value}`, text: `<font color="${mod.settings.ClassesData[ClassNameFromID(value)].CD_SkillsBlacklist.includes(skillIds[0][i].toString()) ? GrnC : RedC}" size="+17">[${keys[i]}]</font><br>` });
 		}
-		return skilldata
+		return skilldata;
 	}
 
-	function NpcJsonSearch(nameKey, array, arg, title) {
+	function NpcJsonSearch(type, arg) {
+		const NpcDataLength = NpcData.length;
 		TmpData = []
 		TmpData.push({ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" })
-		for (let i = 0; i < array.length; i++) {
-			if (array[i].Nm.startsWith(nameKey) && arg === "starts") TmpData.push({ command: `fps npc hide ${array[i].Hz} ${array[i].Ti};fps gui npc ${nameKey}`, text: `<font color="${mod.settings.NpcsBlacklist.some(arrVal => array[i].Hz == arrVal.zone && array[i].Ti == arrVal.templateId) ? GrnC : RedC}" size="+17">${array[i].Nm}</font><br>` });
-			if (array[i].Nm.includes(nameKey) && arg === "search") TmpData.push({ command: `fps npc hide ${array[i].Hz} ${array[i].Ti};fps gui npcsearch ${nameKey}`, text: `<font color="${mod.settings.NpcsBlacklist.some(arrVal => array[i].Hz == arrVal.zone && array[i].Ti == arrVal.templateId) ? GrnC : RedC}" size="+17">${array[i].Nm} </font><br>` });
+		switch (type) {
+			case 'starts':
+				for (let i = 0; i < NpcDataLength; i++) if (NpcData[i].Nm.startsWith(arg)) TmpData.push({ command: `fps npc hide ${NpcData[i].Hz} ${NpcData[i].Ti};fps gui npc ${arg}`, text: `<font color="${mod.settings.NpcsBlacklist.some(arrVal => NpcData[i].Hz == arrVal.zone && NpcData[i].Ti == arrVal.templateId) ? GrnC : RedC}" size="+17">${NpcData[i].Nm}</font><br>` });
+				break;
+			case 'search':
+				for (let i = 0; i < NpcDataLength; i++) if (NpcData[i].Nm.includes(arg)) TmpData.push({ command: `fps npc hide ${NpcData[i].Hz} ${NpcData[i].Ti};fps gui npcsearch ${arg}`, text: `<font color="${mod.settings.NpcsBlacklist.some(arrVal => NpcData[i].Hz == arrVal.zone && NpcData[i].Ti == arrVal.templateId) ? GrnC : RedC}" size="+17">${NpcData[i].Nm} </font><br>` });
+				break;
 		}
-		gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - NPCs</font> |  ${title}`)
+		gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - NPCs</font> | <font color="${LBlC}" size="+16">Search results for '${arg}'</font>.`)
 		TmpData = []
 	}
 
 	function ClassNameFromID(name) {
-		for (const Class_data of Object.keys(mod.settings.ClassesData)) {
-			if (mod.settings.ClassesData[Class_data].name == name) return Class_data;
-		}
+		for (const Class_data of Object.keys(mod.settings.ClassesData)) if (mod.settings.ClassesData[Class_data].name == name) return Class_data;
 	}
 
 	// ~~~ * Command Functions * ~~~ \\
@@ -415,7 +457,7 @@ module.exports = function FpsUtils(mod) {
 			case 'own':
 				for (let k in SNpcs) {
 					if (EqGid(SNpcs[k].owner) && UserNPCs.includes(SNpcs[k].templateId) && SNpcs[k].huntingZoneId === 1023) {
-						mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 })
+						mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
 						HNpcs[SNpcs[k].gameId] = SNpcs[k];
 					}
 				}
@@ -423,7 +465,7 @@ module.exports = function FpsUtils(mod) {
 			case 'others':
 				for (let k in SNpcs) {
 					if (!EqGid(SNpcs[k].owner) && UserNPCs.includes(SNpcs[k].templateId) && SNpcs[k].huntingZoneId === 1023) {
-						mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 })
+						mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
 						HNpcs[SNpcs[k].gameId] = SNpcs[k];
 					}
 				}
@@ -432,7 +474,7 @@ module.exports = function FpsUtils(mod) {
 				for (let k in SNpcs) {
 					for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
 						if (SNpcs[k].huntingZoneId == mod.settings.NpcsBlacklist[i].zone && SNpcs[k].templateId == mod.settings.NpcsBlacklist[i].templateId) {
-							mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 })
+							mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
 							HNpcs[SNpcs[k].gameId] = SNpcs[k];
 						}
 					}
@@ -522,7 +564,7 @@ module.exports = function FpsUtils(mod) {
 
 		if (mod.settings.Hit_Me && (EqGid(event.source) || EqGid(event.owner))) {
 			event.templateId = 10101;
-			event.skill.id = 10100;
+			if (!Classic_NOTCP) event.skill.id = 10100; else event.skill = 10100 + 0x4000000;
 			event.time = 0;
 			event.crit = false;
 
@@ -531,16 +573,17 @@ module.exports = function FpsUtils(mod) {
 
 		if (mod.settings.Hit_Other && !EqGid(event.target) && !EqGid(event.source) && !EqGid(event.owner) && (SUsers[event.owner] || SUsers[event.source])) {
 			event.templateId = 10101;
-			event.skill.id = 10100;
+			if (!Classic_NOTCP) event.skill.id = 10100; else event.skill = 10100 + 0x4000000;
 			event.time = 0;
 			event.crit = false;
 
 			modified = true;
 		}
 
-		if (mod.settings.Hit_Damage && (EqGid(event.source) || EqGid(event.owner) || UserNPCs.includes(event.templateId) && event.skill.huntingZoneId === 1023)) {
-			event.id = event.type = event.noctEffect = event.reaction.skill.id = 0;
-			if (NotCP) event.damage = 0; else event.value = 0;
+		if (mod.settings.Hit_Damage && (EqGid(event.source) || EqGid(event.owner) || UserNPCs.includes(event.templateId) && (Classic_NOTCP ? (((((Boolean(event.skill & 0x40000000) === true) && (event.skill >> 26 & 0xf) === 1)) ? (event.skill >> 16 & 0x3ff) : 0) === 1023) : event.skill.huntingZoneId === 1023))) {
+			event.id = event.type = event.noctEffect = 0;
+			if (!Classic_NOTCP) event.reaction.skill.id = 0; else event.reaction.skill = 0;
+			if (!NotCP) event.damage = 0; else event.value = 0;
 			event.crit = event.stackExplode = false;
 			if (mod.majorPatchVersion >= 79) if (NotCP) event.blocked = false; else event.superArmor = false; //!classic
 
@@ -548,8 +591,9 @@ module.exports = function FpsUtils(mod) {
 		}
 
 		if (mod.settings.Hit_All) {
-			event.id = event.type = event.noctEffect = event.reaction.skill.id = 0;
-			if (NotCP) event.damage = 0; else event.value = 0;
+			event.id = event.type = event.noctEffect = 0;
+			if (!Classic_NOTCP) event.reaction.skill.id = 0; else event.reaction.skill = 0;
+			if (!NotCP) event.damage = 0; else event.value = 0;
 			event.crit = event.stackExplode = false;
 			if (mod.majorPatchVersion >= 79) if (NotCP) event.blocked = false; else event.superArmor = false; //!classic
 			event.target = 0;
@@ -605,11 +649,11 @@ module.exports = function FpsUtils(mod) {
 	}
 
 	function EqGid(xg) {
-		return (xg === MyGameId)
+		return (xg === MyGameId);
 	}
 
 	function ClassID(m) {
-		return (m % 100)
+		return (m % 100);
 	}
 
 	function log(name, type, from, target, id) {
@@ -640,11 +684,11 @@ module.exports = function FpsUtils(mod) {
 		AllowedAchUps = 1;
 		if (ProjDebug) {
 			ProjDebug = false
-			Msg(`<font color="${HPkC}">Auto Disabled</font> projectile debug, to reduce the unneeded spam.`)
+			Msg(`<font color="${HPkC}">Auto Disabled</font> projectile debug, to reduce the unneeded spam.`);
 		}
 		if (AbnDebug) {
 			AbnDebug = false
-			Msg(`<font color="${HPkC}">Auto Disabled</font> abnormalities debug, to reduce the unneeded spam.`)
+			Msg(`<font color="${HPkC}">Auto Disabled</font> abnormalities debug, to reduce the unneeded spam.`);
 		}
 	}
 
@@ -652,14 +696,14 @@ module.exports = function FpsUtils(mod) {
 		PMembers = []
 		if (mod.settings.RaidAutoChange) {
 			if (!LastState || mod.settings.Mode !== 2) return;
-			mod.command.exec(`fps mode ${LastState}`)
+			mod.command.exec(`fps mode ${LastState}`);
 			LastState = null;
 		}
 	}
 
 	function sMountVehicle(event) {
 		if (EqGid(event.gameId)) return;
-		SUsers[event.gameId].mount = event.id
+		SUsers[event.gameId].mount = event.id;
 		if (HUsers[event.gameId]) HUsers[event.gameId].mount = event.id;
 		if (mod.settings.ShowStyle) {
 			event.id = 16; //231; 
@@ -669,7 +713,7 @@ module.exports = function FpsUtils(mod) {
 
 	function sUnmountVehicle(event) {
 		if (EqGid(event.gameId)) return;
-		SUsers[event.gameId].mount = 0
+		SUsers[event.gameId].mount = 0;
 		if (HUsers[event.gameId]) HUsers[event.gameId].mount = 0;
 	}
 
@@ -745,27 +789,27 @@ module.exports = function FpsUtils(mod) {
 
 	function sUserLocation(event) {
 		if (SUsers[event.gameId]) {
-			SUsers[event.gameId].loc = event.dest
-			SUsers[event.gameId].w = event.w
+			SUsers[event.gameId].loc = event.dest;
+			SUsers[event.gameId].w = event.w;
 		}
 		if (HUsers[event.gameId]) {
 			HUsers[event.gameId].loc = event.dest;
-			HUsers[event.gameId].w = event.w
+			HUsers[event.gameId].w = event.w;
 			return false;
 		}
 	}
 
 	function sUserStatus(event) {
-		if (SUsers[event.gameId]) SUsers[event.gameId].status = event.status
+		if (SUsers[event.gameId]) SUsers[event.gameId].status = event.status;
 		if (HUsers[event.gameId]) {
-			HUsers[event.gameId].status = event.status
+			HUsers[event.gameId].status = event.status;
 			return false;
 		}
 	}
 
 	function sDeadLocation(event) {
-		if (SUsers[event.gameId]) SUsers[event.gameId].loc = event.loc
-		if (HUsers[event.gameId]) HUsers[event.gameId].loc = event.loc
+		if (SUsers[event.gameId]) SUsers[event.gameId].loc = event.loc;
+		if (HUsers[event.gameId]) HUsers[event.gameId].loc = event.loc;
 	}
 
 	function sUserMoveType() { return false; }
@@ -775,14 +819,14 @@ module.exports = function FpsUtils(mod) {
 		if (mod.settings.RaidAutoChange) {
 			if (event.members.length >= 18) {
 				if (mod.settings.Mode === 3 || (LastState && mod.settings.Mode === 2)) return;
-				LastState = mod.settings.Mode
-				mod.command.exec("fps mode 2")
+				LastState = mod.settings.Mode;
+				mod.command.exec("fps mode 2");
 			} else {
 				if (!LastState || mod.settings.Mode !== 2) {
 					LastState = null;
 					return;
 				}
-				mod.command.exec(`fps mode ${LastState}`)
+				mod.command.exec(`fps mode ${LastState}`);
 				LastState = null;
 			}
 		}
@@ -825,38 +869,38 @@ module.exports = function FpsUtils(mod) {
 
 	function sNpcLocation(event) {
 		if (SNpcs[event.gameId]) {
-			SNpcs[event.gameId].loc = event.dest
-			SNpcs[event.gameId].w = event.w
+			SNpcs[event.gameId].loc = event.dest;
+			SNpcs[event.gameId].w = event.w;
 		}
 		if (HNpcs[event.gameId]) {
-			HNpcs[event.gameId].loc = event.dest
-			HNpcs[event.gameId].w = event.w
+			HNpcs[event.gameId].loc = event.dest;
+			HNpcs[event.gameId].w = event.w;
 			return false;
 		}
 	}
 
 	function sCreatureRotate(event) {
-		if (SNpcs[event.gameId]) SNpcs[event.gameId].w = event.w
+		if (SNpcs[event.gameId]) SNpcs[event.gameId].w = event.w;
 		if (HNpcs[event.gameId]) {
-			HNpcs[event.gameId].w = event.w
+			HNpcs[event.gameId].w = event.w;
 			return false;
 		}
 	}
 
 	function sFearMoveStage(event) {
-		if ((!EqGid(event.target) && mod.settings.Mode >= 1) || HUsers[event.target] || HNpcs[event.target]) return false;
+		if ((!EqGid(event.target) && mod.settings.Mode === 3) || HUsers[event.target] || HNpcs[event.target]) return false;
 	}
 
 	function sFearMoveEnd(event) {
-		if ((!EqGid(event.target) && mod.settings.Mode >= 1) || HUsers[event.target] || HNpcs[event.target]) return false;
+		if ((!EqGid(event.target) && mod.settings.Mode === 3) || HUsers[event.target] || HNpcs[event.target]) return false;
 	}
 
 	function sAbnormalityBegin(event) {
 		if (AbnDebug) {
-			if (EqGid(event.target)) log('Abnormality', 'Applied', 'on', MyName, event.id)
-			if (EqGid(event.source)) log('Abnormality', 'Started', 'from', MyName, event.id)
-			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 (EqGid(event.target)) log('Abnormality', 'Applied', 'on', MyName, event.id);
+			if (EqGid(event.source)) log('Abnormality', 'Started', 'from', MyName, event.id);
+			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 (ImportantAbns.includes(event.id)) return;
 		if (EqGid(event.target)) {
@@ -885,7 +929,7 @@ 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(event.skill.id / 10000).toString())) || mod.settings.ClassesData[ClassID(event.templateId)].CD_HideBlacklistedSkills) {
+		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) {
 			UpdateUserLoc(event);
 			return false;
 		}
@@ -893,22 +937,22 @@ module.exports = function FpsUtils(mod) {
 
 	function sStartUserProjectile(event) {
 		if (ProjDebug) {
-			if (EqGid(event.gameId)) log('Projectile', 'Started', 'from', MyName, event.skill.id)
-			if (SUsers[event.gameId]) log('Projectile', 'Started', 'from', SUsers[event.gameId].name, event.skill.id)
+			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 (mod.settings.PvpTraps && TrapsIds.includes(event.skill.id)) return;
-		if ((mod.settings.HideBlacklistedProjectiles || mod.settings.HideAllProjectiles) && mod.settings.ProjectilesBlacklist.includes(event.skill.id)) return false;
+		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 (!EqGid(event.gameId) && SUsers[event.gameId] && (HUsers[event.gameId] || mod.settings.Mode >= 2 || mod.settings.HideAllProjectiles)) return false;
 	}
 
 	function sSpawnProjectile(event) {
-		if (event.skill.npc) return;
+		if (Classic_NOTCP ? (Boolean(event.skill & 0x40000000) === true) : event.skill.npc) return;
 		if (ProjDebug) {
-			if (EqGid(event.gameId)) log('Projectile', 'Spawned', 'from', MyName, event.skill.id)
-			if (SUsers[event.gameId]) log('Projectile', 'Spawned', 'from', SUsers[event.gameId].name, event.skill.id)
+			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 (mod.settings.PvpTraps && TrapsIds.includes(event.skill.id)) return;
-		if ((mod.settings.HideBlacklistedProjectiles || mod.settings.HideAllProjectiles) && mod.settings.ProjectilesBlacklist.includes(event.skill.id)) return false;
+		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 (!EqGid(event.gameId) && SUsers[event.gameId] && (HUsers[event.gameId] || mod.settings.Mode >= 2 || mod.settings.HideAllProjectiles)) return false;
 	}
 
@@ -936,7 +980,8 @@ module.exports = function FpsUtils(mod) {
 		if (EqGid(event.source)) return;
 		if (mod.settings.HideBlacklistedDrop) {
 			for (let i in event.owners) {
-				if (event.owners[i].playerId.toString() === MyPlayerId.toString()) return;
+				if (mod.majorPatchVersion >= 79 && event.owners[i].playerId.toString() === MyPlayerId.toString()) return; //!classic
+				else if (mod.majorPatchVersion === 27 && event.owners[i].gameId.toString() === MyGameId.toString()) return;
 			}
 			if (mod.settings.DropBlacklist.includes(event.item)) return false;
 		}
@@ -987,11 +1032,11 @@ module.exports = function FpsUtils(mod) {
 	mod.hook('S_DESPAWN_USER', 3, Last_Hook, sDespawnUser)
 	mod.hook('S_USER_LOCATION', 5, sUserLocation)
 	mod.hook('S_USER_STATUS', 3, sUserStatus)
-	//'S_DEAD_LOCATION
+	//'S_DEAD_LOCATION'
 	//'S_USER_MOVETYPE'
 	mod.hook('S_PARTY_MEMBER_LIST', 7, sPartyMemberList)
-	//'S_USER_APPEARANCE_CHANGE
-	//'S_USER_EXTERNAL_CHANGE' meh, I can't figure out this definition for classic sth is messed up dunno why. :\
+	//'S_USER_APPEARANCE_CHANGE'
+	//'S_USER_EXTERNAL_CHANGE' Found it... but like 90% confirmed, need someone has everything (costume-wise and gear-wise) equiped so it can 100% confirmed so caali push it... guess that won't happen any soon.
 	//'S_UNICAST_TRANSFORM_DATA'
 
 	mod.hook('S_SPAWN_NPC', 11, sSpawnNpc)
@@ -1024,8 +1069,7 @@ module.exports = function FpsUtils(mod) {
 
 	mod.command.add(['fps', '!fps', 'fps-utils', '!fps-utils'], (key, arg, arg2, arg3) => {
 		switch (key) {
-			case "g":
-			case "gui":
+			case "g": case "gui":
 				GuiHandler(arg, arg2);
 				break;
 			case "0":
@@ -1040,9 +1084,7 @@ module.exports = function FpsUtils(mod) {
 			case "3":
 				mod.command.exec('fps mode 3');
 				break;
-			case "mod":
-			case "mode":
-			case "state":
+			case "mod": case "mode": case "state":
 				switch (arg) {
 					case "0":
 					case "off":
@@ -1138,7 +1180,7 @@ module.exports = function FpsUtils(mod) {
 				break;
 			case "party":
 				if (mod.settings.Mode === 3) return Msg(`<font color="${RedC}">You've to disable mode 3 first</font>.`);
-				mod.settings.OnlyParty = !mod.settings.OnlyParty
+				mod.settings.OnlyParty = !mod.settings.OnlyParty;
 				if (mod.settings.OnlyParty) {
 					for (let i in SUsers) {
 						if (!PMembers.includes(SUsers[i].name)) {
@@ -1150,7 +1192,7 @@ module.exports = function FpsUtils(mod) {
 				Msg(`Everyone but party ${mod.settings.OnlyParty ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
 				break;
 			case "raid":
-				mod.settings.RaidAutoChange = !mod.settings.RaidAutoChange
+				mod.settings.RaidAutoChange = !mod.settings.RaidAutoChange;
 				Msg(`Raid auto-state ${mod.settings.RaidAutoChange ? `<font color="${GrnC}">Enabled</font>` : `<font color="${RedC}">Disabled</font>`}.`);
 				break;
 			case "pvptraps":
@@ -1162,8 +1204,7 @@ module.exports = function FpsUtils(mod) {
 				Msg(`<font color="${PnkC}">Hidden classes: ${mod.settings.ClassesBlacklist}</font>.`);
 				Msg(`<font color="${PnkC}">Hidden roles: ${mod.settings.RolesBlacklist}</font>.`);
 				break;
-			case "summons":
-			case "sums":
+			case "summons": case "sums":
 				switch (arg) {
 					case "me":
 						mod.settings.HideMySummons = !mod.settings.HideMySummons;
@@ -1177,8 +1218,7 @@ module.exports = function FpsUtils(mod) {
 						break;
 				}
 				break;
-			case "skills":
-			case "skill":
+			case "skills": case "skill":
 				switch (arg) {
 					case "blacklist":
 						mod.settings.HideBlacklistedSkills = !mod.settings.HideBlacklistedSkills;
@@ -1190,15 +1230,15 @@ module.exports = function FpsUtils(mod) {
 								if (mod.settings.ClassesData[i].name === arg2) {
 									if (arg3 != null && !isNaN(arg3) && arg3 < 50) {
 										if (mod.settings.ClassesData[i].CD_SkillsBlacklist.includes(arg3)) {
-											let index = mod.settings.ClassesData[i].CD_SkillsBlacklist.indexOf(arg3)
+											let index = mod.settings.ClassesData[i].CD_SkillsBlacklist.indexOf(arg3);
 											if (index !== -1) {
-												mod.settings.ClassesData[i].CD_SkillsBlacklist.splice(index, 1)
-												Msg(`Skill ID '${arg3}' <font color="${RedC}">Shown</font> for class '${arg2}'.`)
+												mod.settings.ClassesData[i].CD_SkillsBlacklist.splice(index, 1);
+												Msg(`Skill ID '${arg3}' <font color="${RedC}">Shown</font> for class '${arg2}'.`);
 											}
 											return;
 										} else {
-											mod.settings.ClassesData[i].CD_SkillsBlacklist.push(arg3)
-											Msg(`Skill ID '${arg3}' <font color="${GrnC}">Hidden</font> for class '${arg2}'.`)
+											mod.settings.ClassesData[i].CD_SkillsBlacklist.push(arg3);
+											Msg(`Skill ID '${arg3}' <font color="${GrnC}">Hidden</font> for class '${arg2}'.`);
 											return;
 										}
 									} else {
@@ -1212,23 +1252,22 @@ module.exports = function FpsUtils(mod) {
 						break;
 				}
 				break;
-			case "npcs":
-			case "npc":
+			case "npcs": case "npc":
 				if (arg === 'hide') {
 					if (!arg2 || !arg3) {
 						mod.settings.HideBlacklistedNpcs = !mod.settings.HideBlacklistedNpcs;
 						Msg(`Blacklisted NPCs ${mod.settings.HideBlacklistedNpcs ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
 						break;
 					}
-					let found = mod.settings.NpcsBlacklist.some(s => s.zone === arg2 && s.templateId === arg3);
+					const found = mod.settings.NpcsBlacklist.some(s => s.zone === arg2 && s.templateId === arg3);
 					if (found) {
 						if (mod.settings.HideBlacklistedNpcs) ShowSpecificNpc(Number(arg2), Number(arg3));
-						Msg(`NPC HntZone '${arg2}', TmpId '${arg3}' <font color="${RedC}">Removed from the blacklist</font>.`)
+						Msg(`NPC HntZone '${arg2}', TmpId '${arg3}' <font color="${RedC}">Removed from the blacklist</font>.`);
 						mod.settings.NpcsBlacklist = mod.settings.NpcsBlacklist.filter(obj => obj.zone != arg2 || obj.templateId != arg3);
 					} else {
 						if (mod.settings.HideBlacklistedNpcs) HideSpecificNpc(Number(arg2), Number(arg3));
-						Msg(`NPC HntZone '${arg2}', TmpId '${arg3}' <font color="${GrnC}">Added to the blacklist</font>.`)
-						mod.settings.NpcsBlacklist.push({ zone: arg2, templateId: arg3 })
+						Msg(`NPC HntZone '${arg2}', TmpId '${arg3}' <font color="${GrnC}">Added to the blacklist</font>.`);
+						mod.settings.NpcsBlacklist.push({ zone: arg2, templateId: arg3 });
 					}
 					return;
 				} else {
@@ -1264,15 +1303,11 @@ module.exports = function FpsUtils(mod) {
 						break;
 				}
 				break;
-			case "fireworks":
-			case "firework":
+			case "fireworks": case "firework":
 				mod.settings.HideFireworks = !mod.settings.HideFireworks;
 				Msg(`Fireworks ${mod.settings.HideFireworks ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
 				break;
-			case "abn":
-			case "effects":
-			case "abnormal":
-			case "abnormalities":
+			case "abn": case "effects": case "abnormal": case "abnormalities":
 				switch (arg) {
 					case "all":
 						mod.settings.HideAllAbnormalities = !mod.settings.HideAllAbnormalities;
@@ -1287,17 +1322,17 @@ module.exports = function FpsUtils(mod) {
 							arg3 = Number(arg3);
 							if (!mod.settings.AbnormalitiesBlacklist.includes(arg3)) {
 								if (arg2 === 'add') {
-									mod.settings.AbnormalitiesBlacklist.push(arg3)
-									Msg(`Blacklisted Abnormalities <font color="${GrnC}">added '${arg3}'</font>..`)
+									mod.settings.AbnormalitiesBlacklist.push(arg3);
+									Msg(`Blacklisted Abnormalities <font color="${GrnC}">added '${arg3}'</font>.`);
 									return;
 								} else if (arg2 === 'remv') return Msg(`Blacklisted Abnormalities <font color="${RedC}">can't remove '${arg3}' as it's not there</font>.`);
 
 							} else if (mod.settings.AbnormalitiesBlacklist.includes(arg3)) {
 								if (arg2 === 'add') return Msg(`Blacklisted Abnormalities <font color="${RedC}">can't add '${arg3}' as it's already there</font>.`);
 								else if (arg2 === 'remv') {
-									let index = mod.settings.AbnormalitiesBlacklist.indexOf(arg3)
+									let index = mod.settings.AbnormalitiesBlacklist.indexOf(arg3);
 									if (index !== -1) {
-										mod.settings.AbnormalitiesBlacklist.splice(index, 1)
+										mod.settings.AbnormalitiesBlacklist.splice(index, 1);
 										Msg(`Blacklisted Abnormalities <font color="${RedC}">removed '${arg3}'</font>.`);
 										return;
 									}
@@ -1325,18 +1360,16 @@ module.exports = function FpsUtils(mod) {
 				setTimeout(() => SwitchCd = false, 2800);
 				Msg(`Guild Logos ${mod.settings.Hideguildlogos ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
 				break;
-			case "costume":
-			case "style":
+			case "costume": case "style":
 				if (SwitchCd) return Msg(`<font color="${PnkC}">Try again in 3 seconds</font>.`);
 				mod.settings.ShowStyle = !mod.settings.ShowStyle;
-				mod.toServer('C_SET_VISIBLE_RANGE', 1, { range: 0 })
+				mod.toServer('C_SET_VISIBLE_RANGE', 1, { range: 0 });
 				setTimeout(() => mod.toServer('C_SET_VISIBLE_RANGE', 1, { range: LastVrange }), 1500);
-				SwitchCd = true
+				SwitchCd = true;
 				setTimeout(() => SwitchCd = false, 2800);
 				Msg(`Style of NPCs & others ${mod.settings.ShowStyle ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
 				break;
-			case "proj":
-			case "projectile":
+			case "proj": case "projectile":
 				switch (arg) {
 					case "all":
 						mod.settings.HideAllProjectiles = !mod.settings.HideAllProjectiles;
@@ -1351,27 +1384,26 @@ module.exports = function FpsUtils(mod) {
 							arg3 = Number(arg3);
 							if (!mod.settings.ProjectilesBlacklist.includes(arg3)) {
 								if (arg2 === 'add') {
-									mod.settings.ProjectilesBlacklist.push(arg3)
-									Msg(`Blacklisted projectile <font color="${GrnC}">added '${arg3}'</font>.`)
+									mod.settings.ProjectilesBlacklist.push(arg3);
+									Msg(`Blacklisted projectile <font color="${GrnC}">added '${arg3}'</font>.`);
 									return;
 								} else if (arg2 === 'remv') return Msg(`Blacklisted projectile <font color="${RedC}">can't remove '${arg3}' as it's not there</font>.`);
 							} else if (mod.settings.ProjectilesBlacklist.includes(arg3)) {
 								if (arg2 === 'add') return Msg(`Blacklisted projectile <font color="${RedC}">can't add '${arg3}' as it's already there</font>.`);
 								else if (arg2 === 'remv') {
-									let index = mod.settings.ProjectilesBlacklist.indexOf(arg3)
+									let index = mod.settings.ProjectilesBlacklist.indexOf(arg3);
 									if (index !== -1) {
-										mod.settings.ProjectilesBlacklist.splice(index, 1)
-										Msg(`Blacklisted projectile <font color="${RedC}">removed '${arg3}'</font>.`)
+										mod.settings.ProjectilesBlacklist.splice(index, 1);
+										Msg(`Blacklisted projectile <font color="${RedC}">removed '${arg3}'</font>.`);
 										return;
 									}
 								}
 							} else return Msg(`<font color="${GryC}">Invalid &#40;projectile Blacklist&#41; '${arg}'</font>.`);
 						}
 						break;
-					case "log":
-					case "debug":
-						ProjDebug = !ProjDebug
-						if (ProjDebug) Msg(`Projectile debug <font color="${GrnC}">started</font>, check your proxy console for details.`)
+					case "log": case "debug":
+						ProjDebug = !ProjDebug;
+						if (ProjDebug) Msg(`Projectile debug <font color="${GrnC}">started</font>, check your proxy console for details.`);
 						else Msg(`Projectile debug <font color="${RedC}">stopped</font>.`);
 						break;
 					default:
@@ -1434,20 +1466,19 @@ module.exports = function FpsUtils(mod) {
 						break;
 					}
 					arg2 = Number(arg2);
-					let found = mod.settings.DropBlacklist.some(s => s === arg2);
-					if (found) {
-						Msg(`Drops id '${arg2}' <font color="${RedC}">Removed from the blacklist</font>.`)
-						mod.settings.DropBlacklist = mod.settings.DropBlacklist.filter(obj => obj != arg2)
+					const found1 = mod.settings.DropBlacklist.some(s => s === arg2);
+					if (found1) {
+						Msg(`Drops id '${arg2}' <font color="${RedC}">Removed from the blacklist</font>.`);
+						mod.settings.DropBlacklist = mod.settings.DropBlacklist.filter(obj => obj != arg2);
 					} else {
-						Msg(`Drops id '${arg2}' <font color="${GrnC}">Added to the blacklist</font>.`)
-						mod.settings.DropBlacklist.push(arg2)
+						Msg(`Drops id '${arg2}' <font color="${GrnC}">Added to the blacklist</font>.`);
+						mod.settings.DropBlacklist.push(arg2);
 					}
 					return;
 				} else mod.settings.HideBlacklistedDrop = !mod.settings.HideBlacklistedDrop;
 				Msg(`Blacklisted Drops ${mod.settings.HideBlacklistedDrop ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
 				break;
-			case "monsterdeathani":
-			case "monstersdeathani":
+			case "monsterdeathani": case "monstersdeathani":
 				mod.settings.HideMonsterDeathAnimation = !mod.settings.HideMonsterDeathAnimation;
 				Msg(`Monsters Death Animation is ${mod.settings.HideMonsterDeathAnimation ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
 				break;
@@ -1459,13 +1490,13 @@ module.exports = function FpsUtils(mod) {
 						break;
 					}
 					arg2 = Number(arg2);
-					let found = mod.settings.OwnAbnormalsBlacklist.some(m => m === arg2);
-					if (found) {
-						Msg(`Abnormal id '${arg2}' <font color="${RedC}">Removed from the blacklist</font>.`)
+					const found2 = mod.settings.OwnAbnormalsBlacklist.some(m => m === arg2);
+					if (found2) {
+						Msg(`Abnormal id '${arg2}' <font color="${RedC}">Removed from the blacklist</font>.`);
 						mod.settings.OwnAbnormalsBlacklist = mod.settings.OwnAbnormalsBlacklist.filter(obj => obj != arg2);
 					} else {
-						Msg(`Abnormal id '${arg2}' <font color="${GrnC}">Added to the blacklist</font>.`)
-						mod.settings.OwnAbnormalsBlacklist.push(arg2)
+						Msg(`Abnormal id '${arg2}' <font color="${GrnC}">Added to the blacklist</font>.`);
+						mod.settings.OwnAbnormalsBlacklist.push(arg2);
 					}
 					return;
 				} else mod.settings.HideOwnBlacklistedAbns = !mod.settings.HideOwnBlacklistedAbns;
@@ -1473,11 +1504,11 @@ module.exports = function FpsUtils(mod) {
 				break;
 			case "hpnumbers":
 				mod.settings.HideHpNumbers = !mod.settings.HideHpNumbers;
-				Msg(`Own Hp numbers ${mod.settings.HideHpNumbers ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`)
+				Msg(`Own Hp numbers ${mod.settings.HideHpNumbers ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
 				break;
 			case "mpnumbers":
 				mod.settings.HideMpNumbers = !mod.settings.HideMpNumbers;
-				Msg(`Own Mp numbers ${mod.settings.HideMpNumbers ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`)
+				Msg(`Own Mp numbers ${mod.settings.HideMpNumbers ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
 				break;
 			case "help":
 				mod.command.exec("fps gui help");

+ 1 - 1
manifest.json

@@ -3,7 +3,7 @@
         "README.md": "422606400e058085470beceaa8a73a63255ce054764d85a09d572a9e87889ce3",
         "lib/data/npcData.json": "d3e7b59617ef841447567d69b074aa2dd6958eabb1a231c5821ffa7165daeac6",
         "lib/data/skillString.json": "9d69876fea0be8e6ac5dd43b3fc74ea023f6b8a6145384f8f780dd977045d8ef",
-        "lib/index.js": "b7bc25d02aa35ac15c8b4178116a155c2f43f130f1961fec74702b480581479c",
+        "lib/index.js": "e492c94ac048c30aa191e81dcd56b48e9582e0a328204e0d971d00b89f0a30ad",
         "lib/setting_migration.js": "42a6b875cb5791276311f8c1344a5275b776c80ff81f21332660f31b2db8259c",
         "module.json": "96e03571c9b6e814679fe68468cbfcf8522234966091390882cd577b5a101c5c",
         "package.json": "da64d8c0f2201c8c9cc82dd9fffa3e6d92d4e67870eb02efaece83481a6304ed"