|
|
@@ -1,845 +1,1262 @@
|
|
|
+"use strict"
|
|
|
/* global __dirname */
|
|
|
-let BadGui
|
|
|
-
|
|
|
-try {
|
|
|
- BadGui = require('badGui')
|
|
|
-} catch (e) {
|
|
|
- try {
|
|
|
- BadGui = require('badGui-master')
|
|
|
- } catch (e) {
|
|
|
- console.log(`[FPS-UTILS] - badGUI not installed, GUI functionality disabled, please see the readme for more information`)
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-module.exports = function FpsUtils2(mod) {
|
|
|
- const npcData = require(`./npcData.json`)
|
|
|
- const skills = require(`./skillString.json`)
|
|
|
- let data = [],
|
|
|
- gui,
|
|
|
- NASux,
|
|
|
- useGui = false,
|
|
|
- red = `#e3d6d9`,
|
|
|
- green = `#204ed3`,
|
|
|
- myId,
|
|
|
- alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''),
|
|
|
- partyMembers = [],
|
|
|
- spawnedPlayers = {},
|
|
|
- hiddenUsers = {},
|
|
|
- hiddenNpcs = {};
|
|
|
- try {
|
|
|
- gui = new BadGui(mod);
|
|
|
- useGui = true
|
|
|
- } catch (e) {
|
|
|
- useGui = false
|
|
|
- console.log(`[FPS-UTILS] - badGUI not installed, GUI functionality disabled, please see the readme for more information`)
|
|
|
- }
|
|
|
- // ~~~ * GUI handling stuff I should put somewhere else * ~~~
|
|
|
-
|
|
|
- function listSkills(value) {
|
|
|
- let keys = []
|
|
|
- let data = []
|
|
|
- let skillIds = []
|
|
|
- data.push(
|
|
|
- { text: `<font color="#4dd0e1" size="+18">Select the skills that you wish to hide</font><br>` },
|
|
|
- { text: `Click here to return to the main menu<br><font size="+17">`, command: `fps gui` }
|
|
|
- )
|
|
|
- for (let key in skills[value]) {
|
|
|
- keys.push(key);
|
|
|
- }
|
|
|
- skillIds.push(Object.values(skills[value]))
|
|
|
- for (var i = 0; i < keys.length; i++) {
|
|
|
- data.push({ command: `fps skill class ${value} ${skillIds[0][i]};fps gui class ${value}`, text: `<font color="${mod.settings.classes[classId(value)].blockedSkills.includes(skillIds[0][i].toString()) ? green : red}"> [${keys[i]}]</font><br>` })
|
|
|
- //this is by far the worse and best thing I have ever seen
|
|
|
- }
|
|
|
- return data
|
|
|
- }
|
|
|
-
|
|
|
- function search(nameKey, array, arg) {
|
|
|
- for (let i = 0; i < array.length; i++) {
|
|
|
- if (array[i].Name.startsWith(nameKey) && arg == `starts`) {
|
|
|
- data.push({
|
|
|
- command: `fps npc hide ${array[i].HuntingZoneId} ${array[i].TemplateId};fps gui npc ${nameKey}`, text: `<font color="${mod.settings.hiddenNpcs.some(() => {
|
|
|
- return mod.settings.hiddenNpcs.some((arrVal) => {
|
|
|
- if (array[i].HuntingZoneId == arrVal.zone && array[i].TemplateId == arrVal.templateId) {
|
|
|
- return true
|
|
|
- } else
|
|
|
- return false
|
|
|
- })
|
|
|
- }) ? green : red}"> [${array[i].Name}]</font><br>`
|
|
|
- })
|
|
|
- }
|
|
|
- if (array[i].Name.includes(nameKey) && arg == `search`) {
|
|
|
- data.push({ command: `fps npc hide ${array[i].HuntingZoneId} ${array[i].TemplateId};fps gui npc ${nameKey}`, text: ` [${array[i].Name}]<br>` })
|
|
|
- }
|
|
|
- if (!isNaN(arg)) {//ho boy wow what are you dooooing
|
|
|
- if (array[i].nameKey == arg) {
|
|
|
- return true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- gui.parse(data, `<font color="#dcc856"> FPS-UTILS Options - NPCs`)
|
|
|
- data = []
|
|
|
- }
|
|
|
-
|
|
|
- function classId(name) { //this should really be reused for things other than GUI but can't be without adding their bloat here or changing the structure of the commands
|
|
|
- for (let ass of Object.keys(mod.settings.classes)) {
|
|
|
- if (mod.settings.classes[ass].name == name) {
|
|
|
- return ass
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- function handleGui(page, arg) {
|
|
|
- switch (page) {
|
|
|
- case 'searchnpc':
|
|
|
- case 'npcsearch':
|
|
|
- data = []
|
|
|
- data.push(
|
|
|
- { text: `<font color="#4dd0e1" size="+22">Search results for "${arg}":<br>` },
|
|
|
- { text: `Click here to return to the main menu<br><font size="+18">`, command: `fps gui` }
|
|
|
- )
|
|
|
- search(arg, npcData, `search`)
|
|
|
- break
|
|
|
- case 'npc':
|
|
|
- data = []
|
|
|
- data.push(
|
|
|
- { text: `<font color="#4dd0e1" size="+22">Search results for "${arg}":<br>` },
|
|
|
- { text: `Click here to return to the main menu<br><font size="+18">`, command: `fps gui` }
|
|
|
- )
|
|
|
- search(arg, npcData, `starts`)
|
|
|
- break
|
|
|
- case 'npclist':
|
|
|
- data = []
|
|
|
- data.push(
|
|
|
- { text: `<font color="#4dd0e1" size="+22">Select an NPC ID to remove it from the blacklist:<br><font size="+18">` },
|
|
|
- { text: `Click here to return to the main menu<br>`, command: `fps gui` },
|
|
|
- { text: `Click here to return to the main NPC page<br><font size="+18">`, command: `fps gui npcMain` },
|
|
|
- )
|
|
|
- for (let i = 0; i < mod.settings.hiddenNpcs.length; i++) {
|
|
|
- data.push({ text: `${mod.settings.hiddenNpcs[i].zone}, ${mod.settings.hiddenNpcs[i].templateId}<br>`, command: `fps npc hide ${mod.settings.hiddenNpcs[i].zone} ${mod.settings.hiddenNpcs[i].templateId};fps gui npclist` })
|
|
|
- }
|
|
|
- gui.parse(data, `<font color="#dcc856"> FPS-UTILS Options - NPCs`)
|
|
|
- break
|
|
|
- case 'npcMain':
|
|
|
- data = []
|
|
|
- data.push(
|
|
|
- { text: `<font color="#4dd0e1" size="+22">Click here to return to the main menu<br><font size="+18">`, command: `fps gui` },
|
|
|
- { text: `Click here to list currently hidden NPCs by Zone/TemplateId<br>`, command: `fps gui npclist` },
|
|
|
- { text: `<font color="${mod.settings.blacklistNpcs ? green : red}">[Toggle hiding of blacklisted NPCs]</font><br></br>`, command: `fps npc;fps gui npcMain` },
|
|
|
- { text: `<font color="#4dd0e1" size="+22">Select a letter to view all NPCs starting with that letter:<br>` },
|
|
|
- { text: `<font color="#dcc856" size="+16">You can also use the command "fps gui searchnpc [name]" to search for a specific NPC by name</font><br><br>` },
|
|
|
-
|
|
|
- )
|
|
|
- for (var i = 0; i < alphabet.length; i++) {
|
|
|
- data.push({ text: `${alphabet[i]} `, command: `fps gui npc ${alphabet[i]}` })
|
|
|
- }
|
|
|
- gui.parse(data, `<font color="#dcc856"> FPS-UTILS Options - NPCs`)
|
|
|
- break
|
|
|
- case "hide":
|
|
|
- data = []
|
|
|
- data.push(
|
|
|
- { text: `<font color="#4dd0e1" size="+22">Select a player to hide them and add them to the blacklist<br>` },
|
|
|
- { text: `<font color="#4dd0e1" size="+18">You can also use the command "fps hide <playername>" to hide someone that does not appear here<br><br>` },
|
|
|
- { text: `Click here to return to the main menu<br><font size="+17">`, command: `fps gui` }
|
|
|
- )
|
|
|
- for (let i in spawnedPlayers) {
|
|
|
- data.push({ text: `<font color="${mod.settings.blacklistedNames.includes(spawnedPlayers[i].name) ? green : red}">${spawnedPlayers[i].name}</font><br>`, command: `fps hide ${spawnedPlayers[i].name};fps gui hide` })
|
|
|
- }
|
|
|
- gui.parse(data, `<font color="#dcc856"> FPS-UTILS Options - Players`)
|
|
|
- break
|
|
|
- case "show":
|
|
|
- data = []
|
|
|
- data.push(
|
|
|
- { text: `<font color="#4dd0e1" size="+22">Select a player to unhide them and remove them from the blacklist<br>` },
|
|
|
- { text: `Click here to return to the main menu<br><font size="+18">`, command: `fps gui` }
|
|
|
- )
|
|
|
- mod.settings.blacklistedNames.forEach((mem) => { data.push({ text: `${mem}<br>`, command: `fps show ${mem};fps gui show` }) }) //yes this is not the best
|
|
|
- gui.parse(data, `<font color="#dcc856"> FPS-UTILS Options - Hidden Users`)
|
|
|
- break
|
|
|
- case "skills":
|
|
|
- gui.parse([
|
|
|
- { text: `<font color="#4dd0e1" size="+22">Hide skills by class:<br><br>` },
|
|
|
- { text: `Click here to return to the main menu<br>`, command: `fps gui` },
|
|
|
- { text: `<font color="${mod.settings.blacklistSkills ? green : red}">[toggle skill blacklisting]</font><br>`, command: `fps skill black` },
|
|
|
- { text: `Hide Specific Skills (Click a class name to open up a list of its skills):<font size="+17"><br>` },
|
|
|
- { text: `Warrior<br>`, command: `fps gui class warrior` },
|
|
|
- { text: `Lancer<br>`, command: `fps gui class lancer` },
|
|
|
- { text: `Slayer<br>`, command: `fps gui class slayer` },
|
|
|
- { text: `Berserker<br>`, command: `fps gui class berserker` },
|
|
|
- { text: `Sorcerer<br>`, command: `fps gui class sorcerer` },
|
|
|
- { text: `Archer<br>`, command: `fps gui class archer` },
|
|
|
- { text: `Priest<br>`, command: `fps gui class priest` },
|
|
|
- { text: `Mystic<br>`, command: `fps gui class mystic` },
|
|
|
- { text: `Reaper<br>`, command: `fps gui class reaper` },
|
|
|
- { text: `Gunner<br>`, command: `fps gui class gunner` },
|
|
|
- { text: `Brawler<br>`, command: `fps gui class brawler` },
|
|
|
- { text: `Ninja<br>`, command: `fps gui class ninja` },
|
|
|
- { text: `Valkyrie<br>`, command: `fps gui class valkyrie` }
|
|
|
- ], `<font color="#dcc856"> FPS-UTILS Options - Skills`)
|
|
|
- break
|
|
|
- case "class":
|
|
|
- gui.parse(listSkills(arg), `<font color="#dcc856"> FPS-UTILS Options - Skill list for ${arg}`)
|
|
|
- break
|
|
|
- case "role":
|
|
|
- gui.parse([
|
|
|
- { text: `<font color="#4dd0e1" size="+22">Hide classes/roles:<br><br>` },
|
|
|
- { text: `Click here to return to the main menu<br><font size="+18">`, command: `fps gui` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('warrior') ? green : red}">Warrior</font><br>`, command: `fps ${mod.settings.hiddenClasses.includes('warrior') ? `show` : `hide`} warrior;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('lancer') ? green : red}">Lancer</font><br>`, command: `fps ${mod.settings.hiddenClasses.includes('lancer') ? `show` : `hide`} lancer;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('slayer') ? green : red}">Slayer</font><br>`, command: `fps ${mod.settings.hiddenClasses.includes('slayer') ? `show` : `hide`} slayer;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('berserker') ? green : red}">Berserker</font><br>`, command: `fps ${mod.settings.hiddenClasses.includes('berserker') ? `show` : `hide`} berserker;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('sorcerer') ? green : red}">Sorcerer</font><br>`, command: `fps ${mod.settings.hiddenClasses.includes('sorcerer') ? `show` : `hide`} sorcerer;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('archer') ? green : red}">Archer</font><br>`, command: `fps ${mod.settings.hiddenClasses.includes('archer') ? `show` : `hide`} archer;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('priest') ? green : red}">Priest</font><br>`, command: `fps ${mod.settings.hiddenClasses.includes('priest') ? `show` : `hide`} priest;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('mystic') ? green : red}">Mystic</font><br>`, command: `fps ${mod.settings.hiddenClasses.includes('mystic') ? `show` : `hide`} mystic;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('reaper') ? green : red}">Reaper</font><br>`, command: `fps ${mod.settings.hiddenClasses.includes('reaper') ? `show` : `hide`} reaper;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('gunner') ? green : red}">Gunner</font><br>`, command: `fps ${mod.settings.hiddenClasses.includes('gunner') ? `show` : `hide`} gunner;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('brawler') ? green : red}">Brawler</font><br>`, command: `fps ${mod.settings.hiddenClasses.includes('brawler') ? `show` : `hide`} brawler;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenClasses.includes('ninja') ? green : red}">Ninja</font><br><br>`, command: `fps ${mod.settings.hiddenClasses.includes('ninja') ? `show` : `hide`} ninja;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenRoles.includes('dps') ? green : red}">DPS</font><br>`, command: `fps ${mod.settings.hiddenRoles.includes('dps') ? `show` : `hide`} dps;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenRoles.includes('healer') ? green : red}">Healers</font><br>`, command: `fps ${mod.settings.hiddenRoles.includes('healer') ? `show` : `hide`} healer;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenRoles.includes('tank') ? green : red}">Tanks</font><br>`, command: `fps ${mod.settings.hiddenRoles.includes('tank') ? `show` : `hide`} tank;fps gui role` },
|
|
|
- { text: `<font color="${mod.settings.hiddenRoles.includes('ranged') ? green : red}">Ranged</font><br>`, command: `fps ${mod.settings.hiddenRoles.includes('ranged') ? `show` : `hide`} ranged;fps gui role` },
|
|
|
- ], `<font color="#dcc856"> FPS-UTILS Options - Hide Roles`)
|
|
|
- break
|
|
|
- case "abn":
|
|
|
- gui.parse([
|
|
|
- { text: `<font color="#4dd0e1" size="+22">Abnormality/Effect Options:<br><br>` },
|
|
|
- { text: `Click here to return to the main menu<br><font size="+18">`, command: `fps gui` },
|
|
|
- { text: `<font color="${mod.settings.blacklistAbnormies ? green : red}"> [Hide ALL Abnormalities/Effects] </font><br>`, command: `fps proj all;fps gui abn` },
|
|
|
- { text: `<font color="${mod.settings.hideAllAbnormies ? green : red}"> [Hide ALL Anormalities/Effects in the blacklist (option to select these ingame soon, sorry!)] </font><br>`, command: `fps proj blacklist;fps gui abn` },
|
|
|
- ], `<font color="#dcc856"> FPS-UTILS Options - Abnormies`)
|
|
|
- break
|
|
|
- case "proj":
|
|
|
- gui.parse([
|
|
|
- { text: `<font color="#4dd0e1" size="+22">Projectile Options:<br><br>` },
|
|
|
- { text: `Click here to return to the main menu<br><font size="+18">`, command: `fps gui` },
|
|
|
- { text: `<font color="${mod.settings.hideProjectiles ? green : red}"> [Hide ALL Projectiles] </font><br>`, command: `fps proj all;fps gui proj` },
|
|
|
- { text: `<font color="${mod.settings.blacklistProjectiles ? green : red}"> [Hide ALL Projectiles in the blacklist (option to select these ingame soon, sorry!)] </font><br>`, command: `fps proj blacklist;fps gui proj` },
|
|
|
- ], `<font color="#dcc856"> FPS-UTILS Options - Projectiles`)
|
|
|
- break
|
|
|
- default:
|
|
|
- gui.parse([
|
|
|
- { text: `<font color="#dcc856" size="+16">Red = disabled, green = enabled:<br>` },
|
|
|
- { text: `Make sure you scroll down to see all the options!</font>:<br><font color="#4dd0e1" size="+18">` },
|
|
|
- { text: `Modes (mode effects from the previous are included in the next):<br>` },
|
|
|
- { text: `	<font color="${mod.settings.mode === 0 ? green : red}"> [0 - Disable all other modes] </font><br>`, command: `fps mode 0;fps gui` },
|
|
|
- { text: `	<font color="${mod.settings.mode === 1 ? green : red}"> [1 - Hide all projectiles and disable hit effects for other players] </font><br>`, command: `fps mode 1;fps gui` },
|
|
|
- { text: `	<font color="${mod.settings.mode === 2 ? green : red}"> [2 - Hide skill casts] </font><br>`, command: `fps mode 2;fps gui` },
|
|
|
- { text: `	<font color="${mod.settings.mode === 3 ? green : red}"> [3 - Hide all players] </font><br><br>`, command: `fps mode 3;fps gui` },
|
|
|
- { text: `Hit mode:<br>` },
|
|
|
- { text: `	<font color="${mod.settings.hitMe ? green : red}"> [Hide your own effects and damage numbers] </font><br>`, command: `fps hit me;fps gui` },
|
|
|
- { text: `	<font color="${mod.settings.hitOther ? green : red}"> [Hide other players hit effects] </font><br>`, command: `fps hit other;fps gui` },
|
|
|
- { text: `	<font color="${mod.settings.hitDamage ? green : red}"> [Hide damage numbers] </font><br><br>`, command: `fps hit other;fps gui` },
|
|
|
- { text: `<font color="${mod.settings.party ? green : red}"> [Hide players not in your party] </font><br>`, command: `fps party;fps gui` },
|
|
|
- { text: `<font color="${mod.settings.hideAllSummons ? green : red}"> [Hide Summons] </font><br>`, command: `fps summons;fps gui` },
|
|
|
- { text: `<font color="${mod.settings.keepMySummons ? green : red}"> [Hide your own summons] </font><br>`, command: `fps summons mine;fps gui` },
|
|
|
- { text: `<font color="${mod.settings.hideFireworks ? green : red}"> [Hide Fireworks] </font><br>`, command: `fps fireworks;fps gui` },
|
|
|
- { text: `<font color="${mod.settings.showStyle ? green : red}"> [Hide other players costumes- requires a loading screen] </font><br><br>`, command: `fps style;fps gui` },
|
|
|
- { text: `Hide Classes/Roles (click here for more options)<br><br>`, command: `fps gui role` },
|
|
|
- { text: `Hide Skills (click here for more options)<br><br>`, command: `fps gui skills` },
|
|
|
- { text: `Hide Players (click here for more options)<br><br>`, command: `fps gui hide` },
|
|
|
- { text: `Show Players (click here for more options)<br><br>`, command: `fps gui show` },
|
|
|
- { text: `NPC's (click here for more options)<br><br>`, command: `fps gui npcMain` },
|
|
|
- { text: `Abnormalities/Effects (click here for more options)<br><br>`, command: `fps gui abn` }, //Need a less bad list/sorting method
|
|
|
- { text: `Projectiles (click here for more options)<br><br>`, command: `fps gui proj` }, //Need a better list
|
|
|
- ], `<font color="#dcc856"> FPS-UTILS Options`)
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // ~~~ * commands * ~~~
|
|
|
- mod.command.add('fps', (cmd, arg, arg2, arg3) => {
|
|
|
- mod.saveSettings() // for some reason settings weren't saving so we have this here now I guess 🤷
|
|
|
- switch (cmd) {
|
|
|
- case "gui":
|
|
|
- if (useGui) {
|
|
|
- handleGui(arg, arg2);
|
|
|
- } else {
|
|
|
- message(`badGUI not installed, please see the FPS-Utils readme for more information`)
|
|
|
- }
|
|
|
- break;
|
|
|
- case "mode":
|
|
|
- case "state":
|
|
|
- switch (arg) {
|
|
|
- case "0":
|
|
|
- case "off":
|
|
|
- if (mod.settings.mode === 3) {
|
|
|
- showAll();
|
|
|
- }
|
|
|
- mod.settings.hideAllAbnormies = false
|
|
|
- mod.settings.hitOther = false
|
|
|
- mod.settings.mode = 0;
|
|
|
- message(`All FPS improvements disabled`);
|
|
|
- break
|
|
|
- case "1":
|
|
|
- if (mod.settings.mode === 3) {
|
|
|
- showAll();
|
|
|
- }
|
|
|
- mod.settings.mode = 1;
|
|
|
- //mod.settings.hideAllAbnormies = true;
|
|
|
- mod.settings.hitOther = true;
|
|
|
- message(`FPS mode set to 1, projectiles hidden and abnormalities disabled`);
|
|
|
- break
|
|
|
- case "2":
|
|
|
- if (mod.settings.mode === 3) {
|
|
|
- showAll();
|
|
|
- }
|
|
|
- mod.settings.mode = 2;
|
|
|
- // mod.settings.hideAllAbnormies = true;
|
|
|
- mod.settings.hitOther = true;
|
|
|
- message(`FPS mode set to 2, all skill effects disabled`);
|
|
|
- break
|
|
|
- case "3":
|
|
|
- hideAll();
|
|
|
- mod.settings.mode = 3;
|
|
|
- mod.settings.hideAllAbnormies = true;
|
|
|
- mod.settings.hitOther = true;
|
|
|
- message(`FPS mode set to 3, hiding all players, their effects and their hit effects.`);
|
|
|
- break
|
|
|
- default:
|
|
|
- message(`Invalid mode ${arg}, valid modes are : 0,1,2,3`);
|
|
|
- }
|
|
|
- break
|
|
|
- case "hide":
|
|
|
- if (typeof arg === "string" && arg !== null) {
|
|
|
- if (mod.settings.blacklistedNames.includes(arg)) {
|
|
|
- message(`Player "${arg}" already hidden!`);
|
|
|
- return;
|
|
|
- } else
|
|
|
- if ((mod.settings.classNames.includes(arg) && !mod.settings.hiddenClasses.includes(arg)) || (mod.settings.roleNames.includes(arg) && !mod.settings.hiddenRoles.includes(arg))) {
|
|
|
- for (let i in mod.settings.classes) {
|
|
|
- if ((mod.settings.classes[i].name === arg || mod.settings.classes[i].role.includes(arg)) && mod.settings.classes[i].isHidden !== true) { //loops are fun, right?
|
|
|
- mod.settings.classes[i].isHidden = true;
|
|
|
- if (mod.settings.classes[i].name === arg) {
|
|
|
- mod.settings.hiddenClasses.push(arg);
|
|
|
- }
|
|
|
- if (mod.settings.classes[i].role.includes(arg)) {
|
|
|
- mod.settings.hiddenRoles.push(arg);
|
|
|
- }
|
|
|
- let classtohide = mod.settings.classes[i].model;
|
|
|
- for (let i in spawnedPlayers) {
|
|
|
- if (getClass(spawnedPlayers[i].templateId) === classtohide) {
|
|
|
- hidePlayer(spawnedPlayers[i].name);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- message(`Class/Role ${arg} hidden`);
|
|
|
- return;
|
|
|
- } else if (mod.settings.hiddenClasses.includes(arg) || mod.settings.hiddenRoles.includes(arg)) {
|
|
|
- message(`Class/Role "${arg}" already hidden!`);
|
|
|
- return;
|
|
|
- }
|
|
|
- // if (!spawnedPlayers[arg]) {
|
|
|
- // message(`Player ${arg} not spawned in, hiding anyway!`);
|
|
|
- // } else {
|
|
|
- message(`Player "${arg}" hidden!`);
|
|
|
- // }
|
|
|
- mod.settings.blacklistedNames.push(arg);
|
|
|
- hidePlayer(arg);
|
|
|
- } else
|
|
|
- message(`Invalid name "${arg}"`);
|
|
|
- break
|
|
|
- case "show":
|
|
|
- if (typeof arg === "string" && arg !== null) {
|
|
|
- if (mod.settings.blacklistedNames.includes(arg)) {
|
|
|
- showPlayer(arg);
|
|
|
- removeName(mod.settings.blacklistedNames, arg);
|
|
|
- message(`Player "${arg}" shown!`);
|
|
|
- return;
|
|
|
- }
|
|
|
- if ((mod.settings.classNames.includes(arg) && mod.settings.hiddenClasses.includes(arg)) || (mod.settings.hiddenRoles.includes(arg) && mod.settings.roleNames.includes(arg))) {
|
|
|
- for (let i in mod.settings.classes) {
|
|
|
- if (mod.settings.classes[i].name === arg || mod.settings.classes[i].role.includes(arg)) {//loops are fun, right?
|
|
|
- if (mod.settings.classes[i].name === arg) {
|
|
|
- removeName(mod.settings.hiddenClasses, arg);
|
|
|
- }
|
|
|
- if (mod.settings.classes[i].role.includes(arg)) {
|
|
|
- removeName(mod.settings.hiddenRoles, arg);
|
|
|
- }
|
|
|
- mod.settings.classes[i].isHidden = false;
|
|
|
- let classToShow = mod.settings.classes[i].model;
|
|
|
- for (let i in hiddenUsers) {
|
|
|
- if (getClass(hiddenUsers[i].templateId) === classToShow) {
|
|
|
- showPlayer(hiddenUsers[i].name);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- message(`Class "${arg}" redisplayed!`);
|
|
|
- } else if (!mod.settings.hiddenClasses.includes(arg) || !mod.settings.hiddenRoles.includes(arg)) {
|
|
|
- message(`Class/Role "${arg}" already displayed!!`);
|
|
|
- } else
|
|
|
- if (!mod.settings.blacklistedNames.includes(arg)) {
|
|
|
- message(`Player "${arg}" is not hidden!`);
|
|
|
- }
|
|
|
- }
|
|
|
- break
|
|
|
- case "party":
|
|
|
- mod.settings.party = !mod.settings.party
|
|
|
- if (mod.settings.party) {
|
|
|
- for (let i in spawnedPlayers) {
|
|
|
- if (!partyMembers.includes(spawnedPlayers[i].name)) {
|
|
|
- mod.send('S_DESPAWN_USER', 3, {
|
|
|
- gameId: spawnedPlayers[i].gameId,
|
|
|
- type: 1
|
|
|
- });
|
|
|
- hiddenUsers[spawnedPlayers[i].gameId] = spawnedPlayers[i];
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- showAll()
|
|
|
- }
|
|
|
- message(`Hiding of everyone but your group ${mod.settings.party ? 'en' : 'dis'}abled`);
|
|
|
-
|
|
|
- break
|
|
|
- case "list":
|
|
|
- message(`Hidden players: ${mod.settings.blacklistedNames}`);
|
|
|
- message(`Hidden classes: ${mod.settings.hiddenClasses}`);
|
|
|
- message(`Hidden roles: ${mod.settings.hiddenRoles}`);
|
|
|
- break
|
|
|
- case "summons":
|
|
|
- switch (arg) {
|
|
|
- case undefined:
|
|
|
- mod.settings.hideAllSummons = !mod.settings.hideAllSummons;
|
|
|
- message(`Hiding of summoned NPCs ${mod.settings.hideAllSummons ? 'en' : 'dis'}abled`);
|
|
|
- break;
|
|
|
- case "mine":
|
|
|
- mod.settings.keepMySummons = !mod.settings.keepMySummons;
|
|
|
- message(`Hiding of owned summoned NPCs ${mod.settings.keepMySummons ? 'dis' : 'en'}abled`);
|
|
|
- break;
|
|
|
- }
|
|
|
- break
|
|
|
- case "skills":
|
|
|
- case "skill":
|
|
|
- switch (arg) {
|
|
|
- case "blacklist":
|
|
|
- case "black":
|
|
|
- mod.settings.blacklistSkills = !mod.settings.blacklistSkills;
|
|
|
- message(`Hiding of blacklisted skills ${mod.settings.blacklistSkills ? 'en' : 'dis'}abled`);
|
|
|
- break
|
|
|
- case "class":
|
|
|
- if (mod.settings.classNames.includes(arg2)) {
|
|
|
- for (let i in mod.settings.classes) {
|
|
|
- if (mod.settings.classes[i].name === arg2) {
|
|
|
- if (arg3 != null && !isNaN(arg3) && arg3 < 50) {
|
|
|
- if (mod.settings.classes[i].blockedSkills.includes(arg3)) {
|
|
|
- let index = mod.settings.classes[i].blockedSkills.indexOf(arg3)
|
|
|
- if (index !== -1) {
|
|
|
- mod.settings.classes[i].blockedSkills.splice(index, 1)
|
|
|
- message(`Skill ID ${arg3} showing for class ${arg2}`)
|
|
|
- }
|
|
|
- return
|
|
|
- } else {
|
|
|
- mod.settings.classes[i].blockedSkills.push(arg3)
|
|
|
- message(`Skill ID ${arg3} hidden for class ${arg2}`)
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- mod.settings.classes[i].blockingSkills = !mod.settings.classes[i].blockingSkills;
|
|
|
- message(`Hidding ALL skills for the class ${arg2} ${mod.settings.classes[i].blockingSkills ? 'en' : 'dis'}abled`);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- } else
|
|
|
- message(`Class ${arg2} not found!`);
|
|
|
- break
|
|
|
- }
|
|
|
- break
|
|
|
- case "npcs":
|
|
|
- case "npc":
|
|
|
- if (arg == 'hide') {
|
|
|
- let found = mod.settings.hiddenNpcs.some((s) => {
|
|
|
- return s.zone === arg2 && s.templateId === arg3;
|
|
|
- });
|
|
|
- if (found) {
|
|
|
- message(`NPC form huntingZone "${arg2} with templateId "${arg3}" now showing`)
|
|
|
- mod.settings.hiddenNpcs = mod.settings.hiddenNpcs.filter((obj) => {
|
|
|
- return obj.zone != arg2 || obj.templateId != arg3;
|
|
|
- })
|
|
|
-
|
|
|
- } else {
|
|
|
- message(`NPC form huntingZone "${arg2} with templateId "${arg3}" hidden`)
|
|
|
- mod.settings.hiddenNpcs.push({ zone: arg2, templateId: arg3 })
|
|
|
- }
|
|
|
- return
|
|
|
-
|
|
|
- /*mod.settings.hiddenNpcs = mod.settings.hiddenNpcs.filter((e) => { // wow an arrow thanks eslint
|
|
|
- if (e.zone == arg2 || e.templateId == arg3) {
|
|
|
- message(`NPC form huntingZone "${arg2} with templateId "${arg3}" now showing`)
|
|
|
- return e.zone != arg2 || e.templateId != arg3
|
|
|
- } else {
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- mod.settings.hiddenNpcs.push({ zone: arg2, templateId: arg3 })
|
|
|
- message(`NPC form huntingZone "${arg2} with templateId "${arg3}" hidden`)
|
|
|
- return*/
|
|
|
- } else
|
|
|
- mod.settings.blacklistNpcs = !mod.settings.blacklistNpcs;
|
|
|
- message(`Hiding of blacklisted NPCs ${mod.settings.blacklistNpcs ? 'en' : 'dis'}abled`);
|
|
|
- break
|
|
|
- case "hit":
|
|
|
- switch (arg) {
|
|
|
- case "me":
|
|
|
- mod.settings.hitMe = !mod.settings.hitMe;
|
|
|
- message(`Hiding of the players skill hits ${mod.settings.hitMe ? 'en' : 'dis'}abled`);
|
|
|
- break
|
|
|
- case "other":
|
|
|
- mod.settings.hitOther = !mod.settings.hitOther;
|
|
|
- message(`Hiding of other players skill hits ${mod.settings.hitOther ? 'en' : 'dis'}abled`);
|
|
|
- break
|
|
|
- case "damage":
|
|
|
- mod.settings.hitDamage = !mod.settings.hitDamage;
|
|
|
- message(`Hiding of the players skill damage numbers ${mod.settings.hitDamage ? 'en' : 'dis'}abled`);
|
|
|
- break
|
|
|
- default:
|
|
|
- message(`Unrecognized sub-mod.command "${arg}"!`);
|
|
|
- break
|
|
|
- }
|
|
|
- break
|
|
|
- case "fireworks":
|
|
|
- case "firework":
|
|
|
- mod.settings.hideFireworks = !mod.settings.hideFireworks;
|
|
|
- message(`Hiding of firework effects ${mod.settings.hideFireworks ? 'en' : 'dis'}abled`);
|
|
|
- break
|
|
|
- case "fpsbooster9001":
|
|
|
- case "effects":
|
|
|
- case "abnormies":
|
|
|
- switch (arg) {
|
|
|
- case "all":
|
|
|
- mod.settings.hideAllAbnormies = !mod.settings.hideAllAbnormies;
|
|
|
- message(`Hiding of ALL abnormality effects on players ${mod.settings.hideAllAbnormies ? 'en' : 'dis'}abled`);
|
|
|
- break
|
|
|
- case "blacklist":
|
|
|
- case "black":
|
|
|
- mod.settings.blacklistAbnormies = !mod.settings.blacklistAbnormies;
|
|
|
- message(`Hiding of blacklisted abnormality effects ${mod.settings.blacklistAbnormies ? 'en' : 'dis'}abled`);
|
|
|
- break
|
|
|
- }
|
|
|
- break
|
|
|
- case "costume":
|
|
|
- case "style":
|
|
|
- mod.settings.showStyle = !mod.settings.showStyle;
|
|
|
- message(`Displaying of all players as wearing default costumes ${mod.settings.showStyle ? 'en' : 'dis'}abled, you will have to leave and re-enter the zone for this to take effect`);
|
|
|
- break
|
|
|
- case "proj":
|
|
|
- case "projectile":
|
|
|
- switch (arg) {
|
|
|
- case "all":
|
|
|
- mod.settings.hideProjectiles = !mod.settings.hideProjectiles;
|
|
|
- message(`Hiding of ALL projectile effects ${mod.settings.hideProjectiles ? 'en' : 'dis'}abled`);
|
|
|
- break
|
|
|
- case "blacklist":
|
|
|
- mod.settings.blacklistProjectiles = !mod.settings.blacklistProjectiles;
|
|
|
- message(`Hiding of ALL projectile effects ${mod.settings.blacklistProjectiles ? 'en' : 'dis'}abled`);
|
|
|
- break
|
|
|
- }
|
|
|
- break
|
|
|
- default:
|
|
|
- message(`Unknown command! Please refer to the readme for more information`);
|
|
|
- break
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
- // ~~~ * Functions * ~~~
|
|
|
- function message(msg) {
|
|
|
- mod.command.message(`<font color="#e0d3f5">${msg}`);
|
|
|
- }
|
|
|
-
|
|
|
- function getClass(m) {
|
|
|
- return (m % 100);
|
|
|
- }
|
|
|
-
|
|
|
- function hidePlayer(name) {
|
|
|
- for (let i in spawnedPlayers) {
|
|
|
- if (spawnedPlayers[i].name.toString().toLowerCase() === name.toLowerCase()) {
|
|
|
- mod.send('S_DESPAWN_USER', 3, {
|
|
|
- gameId: spawnedPlayers[i].gameId,
|
|
|
- type: 1
|
|
|
- });
|
|
|
- hiddenUsers[spawnedPlayers[i].gameId] = spawnedPlayers[i];
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function removeName(name) {
|
|
|
- var what, a = arguments, L = a.length, ax;
|
|
|
- while (L > 1 && name.length) {
|
|
|
- what = a[--L];
|
|
|
- while ((ax = name.indexOf(what)) !== -1) {
|
|
|
- name.splice(ax, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- return name;
|
|
|
- }
|
|
|
-
|
|
|
- function showPlayer(name) {
|
|
|
- for (let i in hiddenUsers) {
|
|
|
- if (hiddenUsers[i].name.toString().toLowerCase() === name.toLowerCase()) {
|
|
|
- mod.send('S_SPAWN_USER', 13, hiddenUsers[i]);
|
|
|
- delete hiddenUsers[i];
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function hideAll() {
|
|
|
- if (!mod.settings.party) {
|
|
|
- for (let i in spawnedPlayers) {
|
|
|
- mod.send('S_DESPAWN_USER', 3, {
|
|
|
- gameId: spawnedPlayers[i].gameId,
|
|
|
- type: 1
|
|
|
- });
|
|
|
- hiddenUsers[spawnedPlayers[i].gameId] = spawnedPlayers[i];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function showAll() {
|
|
|
- for (let i in hiddenUsers) {
|
|
|
- mod.send('S_SPAWN_USER', 13, hiddenUsers[i]);
|
|
|
- delete hiddenUsers[i];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function updateLoc(event) {
|
|
|
- mod.send('S_USER_LOCATION', 5, {
|
|
|
- gameId: event.gameId,
|
|
|
- loc: event.loc,
|
|
|
- dest: event.loc,
|
|
|
- w: event.w,
|
|
|
- speed: 300,
|
|
|
- type: 7
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- // ~~~* Hooks * ~~~
|
|
|
- // note: for skills, do if classes[event.templateId].blockedSkills !==
|
|
|
-
|
|
|
- mod.hook('S_LOGIN', 10, (event) => {
|
|
|
- myId = event.gameId;
|
|
|
- });
|
|
|
-
|
|
|
- mod.game.on('leave_game', () => {
|
|
|
- clearInterval(NASux)
|
|
|
- })
|
|
|
- mod.hook('S_SPAWN_USER', 13, { order: 9999 }, (event) => {
|
|
|
- spawnedPlayers[event.gameId] = event;
|
|
|
- if (mod.settings.mode === 3 || mod.settings.blacklistedNames.includes(event.name.toString().toLowerCase()) || mod.settings.classes[getClass(event.templateId)].isHidden === true || (mod.settings.party && !partyMembers.includes(event.name))) { //includes should work!!
|
|
|
- hiddenUsers[event.gameId] = event;
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (mod.settings.showStyle) {
|
|
|
- event.weaponEnchant = 0;
|
|
|
- event.body = 0;
|
|
|
- event.hand = 0;
|
|
|
- event.feet = 0;
|
|
|
- event.underwear = 0;
|
|
|
- event.head = 0;
|
|
|
- event.face = 0;
|
|
|
- event.weapon = 0;
|
|
|
- event.showStyle = false;
|
|
|
- return true;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_USER_EXTERNAL_CHANGE', 6, { order: 9999 }, (event) => {
|
|
|
- if (mod.settings.showStyle && !event.gameId.equals(myId)) {
|
|
|
- event.weaponEnchant = 0;
|
|
|
- event.body = 0;
|
|
|
- event.hand = 0;
|
|
|
- event.feet = 0;
|
|
|
- event.underwear = 0;
|
|
|
- event.head = 0;
|
|
|
- event.face = 0;
|
|
|
- event.weapon = 0;
|
|
|
- event.showStyle = false;
|
|
|
- return true;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_SPAWN_USER', 13, { order: 99999, filter: { fake: null } }, (event) => {
|
|
|
- if (mod.settings.showStyle) {
|
|
|
- event.weaponEnchant = 0;
|
|
|
- event.body = 0;
|
|
|
- event.hand = 0;
|
|
|
- event.feet = 0;
|
|
|
- event.underwear = 0;
|
|
|
- event.head = 0;
|
|
|
- event.face = 0;
|
|
|
- event.weapon = 0;
|
|
|
- event.showStyle = false;
|
|
|
- return true;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_DESPAWN_USER', 3, { order: 999 }, (event) => {
|
|
|
- delete hiddenUsers[event.gameId];
|
|
|
- delete spawnedPlayers[event.gameId];
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_LOAD_TOPO', 'raw', () => {
|
|
|
- spawnedPlayers = {};
|
|
|
- hiddenUsers = {};
|
|
|
- hiddenNpcs = {};
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_LEAVE_PARTY', 1, () => {
|
|
|
- partyMembers = []
|
|
|
- })
|
|
|
-
|
|
|
- mod.hook('S_PARTY_MEMBER_LIST', 7, (event) => {
|
|
|
- event.members.map((value) => {
|
|
|
- partyMembers.push(value.name)
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- mod.hook('S_SPAWN_NPC', 9, (event) => {
|
|
|
- if (mod.settings.hideAllSummons && event.huntingZoneId === 1023) {
|
|
|
- if (mod.settings.keepMySummons && mod.game.me.is(event.owner)) return true;
|
|
|
- hiddenNpcs[event.gameId] = event; // apparently NPCs get feared and crash the client too
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (mod.settings.blacklistNpcs) {
|
|
|
- for (var i = 0; i < mod.settings.hiddenNpcs.length; i++) {
|
|
|
- if (event.huntingZoneId == mod.settings.hiddenNpcs[i].zone && event.templateId == mod.settings.hiddenNpcs[i].templateId) {
|
|
|
- hiddenNpcs[event.gameId] = event;
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (mod.settings.hideFireworks && event.huntingZoneId === 1023 && (event.templateId === 60016000 || event.templateId === 80037000)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_DESPAWN_NPC', 3, (event) => {
|
|
|
- delete hiddenNpcs[event.gameId];
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_EACH_SKILL_RESULT', 12, { order: 200 }, (event) => {
|
|
|
- if (event.source.equals(myId) || event.owner.equals(myId)) {
|
|
|
- if (mod.settings.hitMe) {
|
|
|
- event.skill.id = '';
|
|
|
- return true;
|
|
|
- }
|
|
|
- if (mod.settings.hitDamage) {
|
|
|
- event.damage = '';
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- if (mod.settings.hitOther && (spawnedPlayers[event.owner] || spawnedPlayers[event.source]) && !event.target.equals(myId)) {
|
|
|
- event.skill.id = '';
|
|
|
- return true;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_USER_LOCATION', 5, (event) => {
|
|
|
- if (hiddenUsers[event.gameId] === undefined) {
|
|
|
- return;
|
|
|
- }
|
|
|
- hiddenUsers[event.gameId].loc = event.dest;
|
|
|
- if (hiddenUsers[event.gameId]) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- mod.hook('S_ACTION_STAGE', mod.base.majorPatchVersion >= 75 ? 8 : 7, { order: 999 }, (event) => {
|
|
|
- if (!event.gameId.equals(myId) && spawnedPlayers[event.gameId]) {
|
|
|
- if (!event.target.equals(myId) && (mod.settings.mode === 2 || hiddenUsers[event.gameId])) {
|
|
|
- updateLoc(event);
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (mod.settings.blacklistSkills) {
|
|
|
- if (typeof mod.settings.classes[getClass(event.templateId)].blockedSkills !== "undefined" && mod.settings.classes[getClass(event.templateId)].blockedSkills.includes(Math.floor((event.skill.id / 10000)))) {
|
|
|
- updateLoc(event);
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- if (mod.settings.classes[getClass(event.templateId)].blockingSkills) {
|
|
|
- updateLoc(event);
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_START_USER_PROJECTILE', mod.base.majorPatchVersion >= 75 ? 9 : 8, { order: 999 }, (event) => { // end my life
|
|
|
- if (!event.gameId.equals(myId) && spawnedPlayers[event.gameId] && (hiddenUsers[event.gameId] || mod.settings.mode > 0 || mod.settings.hideProjectiles)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (mod.settings.blacklistProjectiles && mod.settings.hiddenProjectiles.includes(event.skill.id)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_SPAWN_PROJECTILE', 5, { order: 999 }, (event) => {
|
|
|
- if (!event.gameId.equals(myId) && spawnedPlayers[event.gameId] && (hiddenUsers[event.gameId] || mod.settings.mode > 0 || mod.settings.hideProjectiles)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (mod.settings.blacklistProjectiles && mod.settings.hiddenProjectiles.includes(event.skill.id)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_FEARMOVE_STAGE', 1, (event) => { // we block these to prevent game crashes
|
|
|
- if ((!event.target.equals(myId) && mod.settings.mode === 3) || hiddenUsers[event.target] || hiddenNpcs[event.target]) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- mod.hook('S_FEARMOVE_END', 1, (event) => {
|
|
|
- if ((!event.target.equals(myId) && mod.settings.mode === 3) || hiddenUsers[event.target] || hiddenNpcs[event.target]) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_MOUNT_VEHICLE', 2, (event) => {
|
|
|
- if (hiddenUsers[event.gameId]) {
|
|
|
- hiddenUsers[event.gameId].mount = event.id
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_UNMOUNT_VEHICLE', 2, (event) => {
|
|
|
- if (hiddenUsers[event.gameId]) {
|
|
|
- hiddenUsers[event.gameId].mount = 0
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_UNICAST_TRANSFORM_DATA', 3, { order: 99999 }, (event) => { //Thanks Trance!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
- if (mod.settings.showStyle && !event.gameId.equals(myId)) { //Thanks Trance!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
- return false;//Thanks Trance!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
- }//Thanks Trance!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
- });//Thanks Trance!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
-
|
|
|
- mod.hook('S_USER_MOVETYPE', 'raw', () => { //this little boi crashes us, raw due to def missing from caali
|
|
|
- return false;
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_ABNORMALITY_REFRESH', 1, (event) => {
|
|
|
- if (hiddenUsers[event.target]) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- mod.hook('S_ABNORMALITY_BEGIN', 3, { order: 999 }, (event) => {
|
|
|
- if (hiddenUsers[event.target]) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (mod.settings.blacklistAbnormies && mod.settings.hiddenAbnormies.includes(event.id)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (mod.settings.hideAllAbnormies && !event.target.equals(myId) && (spawnedPlayers[event.target] && spawnedPlayers[event.source])) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-};
|
|
|
+
|
|
|
+String.prototype.clr = function (HexClr) { return `<font color='${HexClr}'>${this}</font>` }
|
|
|
+const Gui = require('Gui')
|
|
|
+let BronzeClr = '#BC8F8F',
|
|
|
+ SilverClr = '#9A9A9A',
|
|
|
+ GoldClr = '#DAA520',
|
|
|
+ PinkClr = '#FFB7C5',
|
|
|
+ HPinkClr = '#FF69B4',
|
|
|
+ CPinkClr = '#ED5D92',
|
|
|
+ RedClr = '#FE6F5E',
|
|
|
+ GreenClr = '#4DE19C',
|
|
|
+ LPurpleClr = '#E0B0FF',
|
|
|
+ PurpleClr = '#9966CC',
|
|
|
+ DPurpleClr = '#957DAD',
|
|
|
+ LBlueClr = '#4DDCE1',
|
|
|
+ BlueClr = '#436EEE',
|
|
|
+ DBlueClr = '#00575e',
|
|
|
+ HBlueClr = '#08B3E5',
|
|
|
+ GrayClr = '#778899',
|
|
|
+ YellowClr = '#DCE14D',
|
|
|
+ OrangeClr = '#FFBE5E';
|
|
|
+
|
|
|
+module.exports = function FpsUtils(mod) {
|
|
|
+ var notcaaliproxy = mod.proxyAuthor !== 'caali' || mod.base.proxyAuthor !== 'caali';
|
|
|
+
|
|
|
+ const NpcData = require(`./data/npcData.json`),
|
|
|
+ SkillData = require(`./data/skillString.json`)
|
|
|
+
|
|
|
+ let MyGameId,
|
|
|
+ MyName,
|
|
|
+ ChangeOnCd,
|
|
|
+ laststate,
|
|
|
+ lastrange,
|
|
|
+ TmpData = [],
|
|
|
+ partyMembers = [],
|
|
|
+ hiddenNpcs = {},
|
|
|
+ hiddenUsers = {},
|
|
|
+ spawnedPlayers = {},
|
|
|
+ alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''),
|
|
|
+ gui = new Gui(mod);
|
|
|
+
|
|
|
+ if (notcaaliproxy) {
|
|
|
+ const options = require('../module').options
|
|
|
+ if (options) {
|
|
|
+ const settingsVersion = options.settingsVersion
|
|
|
+ if (settingsVersion) {
|
|
|
+ mod.settings = require('./setting_migration')(mod.settings._version === settingsVersion ? settingsVersion : undefined, settingsVersion, mod.settings)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // ~~~ * Gui Handler * ~~~ \\
|
|
|
+
|
|
|
+ function GuiHandler(page, arg) {
|
|
|
+ switch (page) {
|
|
|
+ case 'searchnpc':
|
|
|
+ case 'npcsearch':
|
|
|
+ TmpData = []
|
|
|
+ TmpData.push({ text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: `fps gui` })
|
|
|
+ JsonSearch(arg, NpcData, `search`, `<font color="${LBlueClr}" size="+16">Search results for "${arg}"</font>.`)
|
|
|
+ break
|
|
|
+ case 'npc':
|
|
|
+ TmpData = []
|
|
|
+ TmpData.push({ text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: `fps gui` })
|
|
|
+ JsonSearch(arg, NpcData, `starts`, `<font color="${LBlueClr}" size="+16">Search results for "${arg}"</font>.`)
|
|
|
+ break
|
|
|
+ case 'npclist':
|
|
|
+ TmpData = []
|
|
|
+ TmpData.push(
|
|
|
+ { text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: `fps gui` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+20"><p align="right">[Main NPC page]</p></font><br>`, command: `fps gui npcMain` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+19">Click a NPC ID to remove it from the blacklist:</font><br>` }
|
|
|
+ )
|
|
|
+ for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
|
|
|
+ TmpData.push({ text: `<font color="${BronzeClr}" size="+17">${mod.settings.NpcsBlacklist[i].zone}, ${mod.settings.NpcsBlacklist[i].templateId}</font><br>`, command: `fps npc hide ${mod.settings.NpcsBlacklist[i].zone} ${mod.settings.NpcsBlacklist[i].templateId};fps gui npclist` })
|
|
|
+ }
|
|
|
+ gui.parse(TmpData, `<font color="${LPurpleClr}">[FPS] Options - NPCs </font><font color="${GreenClr}">(Blacklist)</font>`)
|
|
|
+ TmpData = []
|
|
|
+ break
|
|
|
+ case 'npcMain':
|
|
|
+ TmpData = []
|
|
|
+ TmpData.push(
|
|
|
+ { text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: `fps gui` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+20"><p align="right">[Blacklisted NPCs list]</p></font><br>`, command: `fps gui npclist` },
|
|
|
+ { text: `<font color="${mod.settings.HideBlacklistedNpcs ? GreenClr : RedClr}" size="+20"><p align="right">[Blacklisted NPCs are ${mod.settings.HideBlacklistedNpcs ? 'Blocked' : 'Not-Blocked'}]</p></font><br><br>`, command: `fps npc;fps gui npcMain` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+19">Click a letter to view all NPCs starting with that letter:<br><br>` }
|
|
|
+ )
|
|
|
+ for (var i = 0; i < alphabet.length; i++) {
|
|
|
+ TmpData.push(
|
|
|
+ { text: `<font color="${BronzeClr}" size="+18">${alphabet[i]}</font>`, command: `fps gui npc ${alphabet[i]}` },
|
|
|
+ { text: ` ` }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ TmpData.push({ text: `<br><br><font color="${PinkClr}" size="+16">(Command </font><font color="${HPinkClr}" size="+16">"fps gui searchnpc <name>"</font><font color="${PinkClr}" size="+16"> to search for a specific NPC's name, Case sensitive)</font>` })
|
|
|
+ gui.parse(TmpData, `<font color="${LPurpleClr}">[FPS] Options - NPCs </font><font color="${YellowClr}">(Main)</font>`)
|
|
|
+ TmpData = []
|
|
|
+ break
|
|
|
+ case "show":
|
|
|
+ TmpData = []
|
|
|
+ TmpData.push(
|
|
|
+ { text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: `fps gui` },
|
|
|
+ { text: `<font color="${PinkClr}" size="+16">(Command </font><font color="${HPinkClr}" size="+16">"fps hide <name>"</font><font color="${PinkClr}" size="+16"> to hide someone that does not appear here)</font><br><br>` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+19">Click to hide & add to blacklist.</font><br>` }
|
|
|
+ )
|
|
|
+ for (let i in spawnedPlayers) {
|
|
|
+ TmpData.push(
|
|
|
+ { text: `<font color="${mod.settings.PlayersBlacklist.includes(spawnedPlayers[i].name) ? GreenClr : RedClr}" size="+17">${spawnedPlayers[i].name}</font>`, command: mod.settings.PlayersBlacklist.includes(spawnedPlayers[i].name) ? `fps show ${spawnedPlayers[i].name};fps gui show` : `fps hide ${spawnedPlayers[i].name};fps gui show` },
|
|
|
+ { text: `${JustifySpaces(spawnedPlayers[i].name.length)}<font color="${mod.settings.PlayersBlacklist.includes(spawnedPlayers[i].name) ? GreenClr : RedClr}" size="+17">${mod.settings.PlayersBlacklist.includes(spawnedPlayers[i].name) ? 'is Hidden' : 'is Shown'}.</font><br>` }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ gui.parse(TmpData, `<font color="${LPurpleClr}">[FPS] Options - Players </font><font color="${RedClr}">(Shown)</font>`)
|
|
|
+ TmpData = []
|
|
|
+ break
|
|
|
+ case "hide":
|
|
|
+ TmpData = []
|
|
|
+ TmpData.push(
|
|
|
+ { text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: `fps gui` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+19">Click to show & remove from blacklist.</font><br>` }
|
|
|
+ )
|
|
|
+ mod.settings.PlayersBlacklist.forEach((mem) => { TmpData.push({ text: `<font color="${BronzeClr}" size="+17">${mem}</font><br>`, command: `fps show ${mem};fps gui hide` }) })
|
|
|
+ gui.parse(TmpData, `<font color="${LPurpleClr}">[FPS] Options - Players </font><font color="${GreenClr}">(Hidden)</font>`)
|
|
|
+ TmpData = []
|
|
|
+ break
|
|
|
+ case "skills":
|
|
|
+ gui.parse([
|
|
|
+ { text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: `fps gui` },
|
|
|
+ { text: `<font color="${mod.settings.HideBlacklistedSkills ? GreenClr : RedClr}" size="+22"><p align="right">[Blacklisted skills are ${mod.settings.HideBlacklistedSkills ? 'Blocked' : 'Not-Blocked'}]</p></font><br><br>`, command: `fps skill blacklist;fps gui skills` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+20">Tankers:</font>		` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Lancer)</font>`, command: `fps gui class lancer` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Brawler)</font><br><br>`, command: `fps gui class brawler` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+20">Healers:</font>		` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Priest)</font>`, command: `fps gui class priest` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Mystic)</font><br><br>`, command: `fps gui class mystic` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+20">Dpsers(melee):</font>	` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Warrior)</font>`, command: `fps gui class warrior` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Slayer)</font>`, command: `fps gui class slayer` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Berserker)</font>`, command: `fps gui class berserker` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Ninja)</font>`, command: `fps gui class ninja` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Valkyrie)</font>`, command: `fps gui class valkyrie` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Reaper)</font><br><br>`, command: `fps gui class reaper` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+20">Dpsers(ranged):</font>	` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Sorcerer)</font>`, command: `fps gui class sorcerer` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Archer)</font>`, command: `fps gui class archer` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">(Gunner)</font>`, command: `fps gui class gunner` }
|
|
|
+ ], `<font color="${LPurpleClr}">[FPS] Options - Skills </font><font color="${YellowClr}">(Choose class)</font>`)
|
|
|
+ break
|
|
|
+ case "class":
|
|
|
+ gui.parse(SkillsList(arg), `<font color="${LPurpleClr}">[FPS] Options - Skill list for "${arg}"</font>`)
|
|
|
+ break
|
|
|
+ case "role":
|
|
|
+ gui.parse([
|
|
|
+ { text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: `fps gui` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+20">By Roles:</font>	` },
|
|
|
+ { text: `<font color="${mod.settings.RolesBlacklist.includes('tank') ? GreenClr : RedClr}" size="+18">[Tankers]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('tank') ? `show` : `hide`} tank;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.RolesBlacklist.includes('healer') ? GreenClr : RedClr}" size="+18">[Healers]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('healer') ? `show` : `hide`} healer;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.RolesBlacklist.includes('dps') ? GreenClr : RedClr}" size="+18" >[Dps-All]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('dps') ? `show` : `hide`} dps;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.RolesBlacklist.includes('ranged') ? GreenClr : RedClr}" 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="${DBlueClr}" size="+22">By Classes</font><br><br>` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+20">Tankers:</font>		` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('lancer') ? GreenClr : RedClr}" size="+18">[Lancer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('lancer') ? `show` : `hide`} lancer;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('brawler') ? GreenClr : RedClr}" size="+18">[Brawler]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('brawler') ? `show` : `hide`} brawler;fps gui role` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+20">Healers:</font>		` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('priest') ? GreenClr : RedClr}" size="+18">[Priest]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('priest') ? `show` : `hide`} priest;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('mystic') ? GreenClr : RedClr}" size="+18">[Mystic]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('mystic') ? `show` : `hide`} mystic;fps gui role` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+20">Dpsers(melee):</font>	` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('warrior') ? GreenClr : RedClr}" size="+18">[Warrior]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('warrior') ? `show` : `hide`} warrior;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('slayer') ? GreenClr : RedClr}" size="+18">[Slayer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('slayer') ? `show` : `hide`} slayer;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('berserker') ? GreenClr : RedClr}" size="+18">[Berserker]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('berserker') ? `show` : `hide`} berserker;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('ninja') ? GreenClr : RedClr}" size="+18">[Ninja]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('ninja') ? `show` : `hide`} ninja;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('valkyrie') ? GreenClr : RedClr}" size="+18">[Valkyrie]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('valkyrie') ? `show` : `hide`} valkyrie;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('reaper') ? GreenClr : RedClr}" size="+18">[Reaper]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('reaper') ? `show` : `hide`} reaper;fps gui role` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+20">Dpsers(ranged):</font>	` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('sorcerer') ? GreenClr : RedClr}" size="+18">[Sorcerer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('sorcerer') ? `show` : `hide`} sorcerer;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('archer') ? GreenClr : RedClr}" size="+18">[Archer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('archer') ? `show` : `hide`} archer;fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.ClassesBlacklist.includes('gunner') ? GreenClr : RedClr}" size="+18">[Gunner]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('gunner') ? `show` : `hide`} gunner;fps gui role` }
|
|
|
+ ], `<font color="${LPurpleClr}">[FPS] Options - Roles/Classes</font>`)
|
|
|
+ break
|
|
|
+ case "abn":
|
|
|
+ TmpData = []
|
|
|
+ TmpData.push(
|
|
|
+ { text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: `fps gui` },
|
|
|
+ { text: `<font color="${mod.settings.AbnDebug ? GreenClr : RedClr}" size="+19"><p align="right">Debug</p></font><br>`, command: `fps abn log;fps gui abn` },
|
|
|
+ { text: `<font color="${mod.settings.HideAllAbnormalities ? GreenClr : RedClr}" size="+22">[All Abnormalities are ${mod.settings.HideAllAbnormalities ? 'Hidden' : 'Shown'}]</font><br>`, command: `fps abn all;fps gui abn` },
|
|
|
+ { text: `<font color="${mod.settings.HideBlacklistedAbnormalities ? GreenClr : RedClr}" size="+22">[Blacklisted Abnormalities are ${mod.settings.HideBlacklistedAbnormalities ? 'Hidden' : 'Shown'}]</font><br><br>`, command: `fps abn blacklist;fps gui abn` },
|
|
|
+ { text: `<font color="${LPurpleClr}" size="+19">Blacklist: </font><font color="${PinkClr}" size="17+">Click to remove from the blacklist.</font><br>` }
|
|
|
+ )
|
|
|
+ mod.settings.AbnormalitiesBlacklist.forEach((abnmem) => { TmpData.push({ text: `<font color="${BronzeClr}" size="+16">${abnmem}<br></font>`, command: `fps abn blacklist remv ${abnmem};fps gui abn` }) })
|
|
|
+ gui.parse(TmpData, `<font color="${LPurpleClr}">[FPS] Options - Abnormalities</font>`)
|
|
|
+ TmpData = []
|
|
|
+ break
|
|
|
+ case "proj":
|
|
|
+ TmpData = []
|
|
|
+ TmpData.push(
|
|
|
+ { text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: `fps gui` },
|
|
|
+ { text: `<font color="${mod.settings.ProjDebug ? GreenClr : RedClr}" size="+19"><p align="right">Debug</p></font><br>`, command: `fps proj log;fps gui proj` },
|
|
|
+ { text: `<font color="${mod.settings.HideAllProjectiles ? GreenClr : RedClr}" size="+22">[All Projectiles are ${mod.settings.HideAllProjectiles ? 'Hidden' : 'Shown'}]</font><br>`, command: `fps proj all;fps gui proj` },
|
|
|
+ { text: `<font color="${mod.settings.HideBlacklistedProjectiles ? GreenClr : RedClr}" size="+22">[Blacklisted Projectiles are ${mod.settings.HideBlacklistedProjectiles ? 'Hidden' : 'Shown'}] </font><br><br>`, command: `fps proj blacklist;fps gui proj` },
|
|
|
+ { text: `<font color="${LPurpleClr}" size="+19">Blacklist: </font><font color="${PinkClr}" size="17+">Click to remove from the blacklist.</font><br>` }
|
|
|
+ )
|
|
|
+ mod.settings.ProjectilesBlacklist.forEach((projmem) => { TmpData.push({ text: `<font color="${BronzeClr}" size="+16">${projmem}<br></font>`, command: `fps proj blacklist remv ${projmem};fps gui proj` }) })
|
|
|
+ gui.parse(TmpData, `<font color="${LPurpleClr}">[FPS] Options - Projectiles</font>`)
|
|
|
+ TmpData = []
|
|
|
+ break
|
|
|
+ case "help": //TO_DO - Better formating, it looks messy :sad:
|
|
|
+ gui.parse([
|
|
|
+ { text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: `fps gui` },
|
|
|
+ { text: `<font color="${PinkClr}" size="+17"><p align="right">Note: This page not yet completely developed, if you can't understand anything, just go check the README, Thank you.</p></font><br>` },
|
|
|
+ { text: `<font color="${HBlueClr}" size="16" style="font-family:Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace;">` },
|
|
|
+ { text: `| Command(s) | Argument(s) | Example | Details |<br>` },
|
|
|
+ { text: `| 'gui' | 'g' | N/A |'!fps gui' | Opens GUI. |<br>` },
|
|
|
+ { text: `| N/A | N/A |'!fps-util' | Opens Help. |<br>` },
|
|
|
+ { text: `| '0'|'1'|'2'|'3' | N/A |'!0'|'!1'|'!2' |'!3' | Changes Mode. |<br>` },
|
|
|
+ { text: `| 'mode' | 'state' | '0' | '1' | '2' | '3' |'!fps mode 2' | Changes Mode. |<br>` },
|
|
|
+ { text: `| 'hide' | 'show' | Player|Class|Role |'!fps hide mie' | Hides/shows Player|Class|Role. |<br>` },
|
|
|
+ { text: `| 'party' | N/A |'!fps party' | Hides all but your party. |<br>` },
|
|
|
+ { text: `| 'raid' | N/A |'!fps raid' |Auto 'mode 2' when party 18+ ppls.|<br>` },
|
|
|
+ { text: `| 'list' | N/A |'!fps list' | Prints list of hidden things. |<br>` },
|
|
|
+ { text: `|'summons' | 'sums'| 'other' | 'me' |'!fps sums me' |oth hide others sums; 'me' yours. |<br>` },
|
|
|
+ { text: `|'skill' | 'skills'|'blacklist' | Class \<arg3\> |'!fps skill blacklist'|Blacklist on/off; arg3 = classname|<br>` },
|
|
|
+ { text: `| 'npc' | 'npcs' | N/A |'!fps npc' |Hides/shows blacklisted npcs. |<br>` },
|
|
|
+ { text: `| 'hit' | 'me' | 'other' | 'damage'|'!fps hit me' |Hides/shows skill results for each|<br>` },
|
|
|
+ { text: `| 'firework' | N/A |'!fps firework' |Hides/shows Dragon fireworks. |<br>` },
|
|
|
+ { text: `| 'abn'|'all' |'blacklist' \<add|remv num\> |'!fps abn blacklist' |Hides/shows effects. |<br>` },
|
|
|
+ { text: `| 'proj'|'all' |'blacklist' \<add|remv num\> |'!fps proj all' |Hides/shows projectiles. |<br>` },
|
|
|
+ { text: `| 'guildlogo' | N/A |'!fps guildlogo' |Hides/shows guild logos |<br>` },
|
|
|
+ { text: `| 'style'|'costume'| N/A |'!fps style' |Hides/shows style for ppl|npc |<br>` },
|
|
|
+ { text: `| 'gui npcsearch' | \<arg1\> |'!fps gui npcsearch E'|Opens list of npcs matching arg1. |<br>` },
|
|
|
+ { text: `| 'npczoom' | N/A |'!fps npczoom' |If enabled, prevent zoom on npcs. |<br>` },
|
|
|
+ { text: `| 'dropitem' | N/A |'!fps dropitem' |Hides/shows blacklisted drops. |<br>` },
|
|
|
+ { text: `</font>` }
|
|
|
+ ], `<font color="${LPurpleClr}">[FPS] HELP </font>`)
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ gui.parse([
|
|
|
+ { text: `<font color="${PurpleClr}" size="+24"><p align="right">REFRESH</p></font><br><br>`, command: `fps gui` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+21">Modes:</font>		` },
|
|
|
+ { text: `<font color="${mod.settings.Mode === 0 ? GreenClr : RedClr}" size="+18">[Mode 0]</font>`, command: `fps mode 0;fps gui` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.Mode === 1 ? GreenClr : RedClr}" size="+18">[Mode 1]</font>`, command: `fps mode 1;fps gui` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.Mode === 2 ? GreenClr : RedClr}" size="+18">[Mode 2]</font>`, command: `fps mode 2;fps gui` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.Mode === 3 ? GreenClr : RedClr}" size="+18">[Mode 3]</font><br><br>`, command: `fps mode 3;fps gui` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+21">Hit:</font>			` },
|
|
|
+ { text: `<font color="${mod.settings.Hit_Me ? GreenClr : RedClr}" size="+18">[Own effect]</font>`, command: `fps hit me;fps gui` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.Hit_Other ? GreenClr : RedClr}" size="+18">[Players effect]</font>`, command: `fps hit other;fps gui` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.Hit_Damage ? GreenClr : RedClr}" size="+18">[Damage numbers]</font><br><br>`, command: `fps hit damage;fps gui` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+21">Hide:</font>		` },
|
|
|
+ { text: `<font color="${mod.settings.HideMySummons ? GreenClr : RedClr}" size="+17">[Own summons]</font>`, command: `fps summons me;fps gui` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.HideOthersSummons ? GreenClr : RedClr}" size="+17">[Players summons]</font>`, command: `fps summons;fps gui` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.HideFireworks ? GreenClr : RedClr}" size="+17">[Fireworks]</font><br>`, command: `fps fireworks;fps gui` },
|
|
|
+ { text: `			` },
|
|
|
+ { text: `<font color="${mod.settings.OnlyParty ? GreenClr : RedClr}" size="+17">[Everyone but party]</font>`, command: `fps party;fps gui` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.Hideguildlogos ? GreenClr : RedClr}" size="+17">[Guild Logos]</font>`, command: `fps guildlogo;fps gui` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.ShowStyle ? GreenClr : RedClr}" size="+17">[Style]</font>`, command: `fps style;fps gui` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.HideBlacklistedDrop ? GreenClr : RedClr}" size="+17">[Drops]</font><br><br>`, command: `fps dropitem;fps gui` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+21">Players:</font>	` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">[Hidden list]</font>`, command: `fps gui hide` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+18">[Shown list]</font><br><br>`, command: `fps gui show` },
|
|
|
+ { text: `<font color="${YellowClr}" size="+21">ETC:</font>		` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+17">[Classes/Roles]</font>`, command: `fps gui role` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+17">[Skills]</font>`, command: `fps gui skills` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+17">[NPCs]</font>`, command: `fps gui npcMain` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+17">[Abnormals]</font><br>`, command: `fps gui abn` },
|
|
|
+ { text: `			` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+17">[Projectiles]</font>`, command: `fps gui proj` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.RaidAutoChange ? GreenClr : RedClr}" size="+17">[Raid auto state]</font>`, command: `fps raid;fps gui` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${mod.settings.NoZoomingToNpc ? GreenClr : RedClr}" size="+17">[Npc zoom-ins]</font>`, command: `fps npczoom;fps gui` },
|
|
|
+ { text: `<br><br><br><br><br><br>` },
|
|
|
+ { text: `<font color="${BlueClr}" size="+22">Quick Links:</font><br>` },
|
|
|
+ { text: `<font color="${DBlueClr}" size="+21">UI:</font>		` },
|
|
|
+ { text: `<font color="${PurpleClr}" size="+17">[Mail]</font>`, command: `fps quicklink parcel` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${PurpleClr}" size="+17">[Broker]</font>`, command: `fps quicklink broker` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${PurpleClr}" size="+17">[Talent]</font>`, command: `fps quicklink talents` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${PurpleClr}" size="+17">[Dress]</font>`, command: `fps quicklink dressingroom` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${PurpleClr}" size="+17">[Hat Style]</font>`, command: `fps quicklink hatrestyle` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${PurpleClr}" size="+17">[Search-Engine]</font><br>`, command: `fps quicklink searchengine` },
|
|
|
+ { text: `<font color="${DBlueClr}" size="+21">Group:</font>	` },
|
|
|
+ { text: `<font color="${OrangeClr}" size="+17">[Reset]</font>`, command: `fps quicklink reset` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${CPinkClr}" size="+17">[Leave]</font>`, command: `fps quicklink drop` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${CPinkClr}" size="+17">[Disband]</font><br>`, command: `fps quicklink disband` },
|
|
|
+ { text: `<font color="${DBlueClr}" size="+21">Extra:</font>	` },
|
|
|
+ { text: `<font color="${CPinkClr}" size="+17">[Lobby]</font>`, command: `fps quicklink lobby` },
|
|
|
+ { text: ` ` },
|
|
|
+ { text: `<font color="${CPinkClr}" size="+17">[Exit]</font><br>`, command: `fps quicklink exit` }
|
|
|
+
|
|
|
+ ], `<font color="${LPurpleClr}">[FPS] Options</font> | <font color="${RedClr}" size="+16">Red</font><font color="${LPurpleClr}" size="+16"> = disabled, <font color="${GreenClr}" size="+16">Green</font><font color="${LPurpleClr}" size="+16"> = enabled</font>`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // ~~~ * Gui Functions * ~~~ \\
|
|
|
+
|
|
|
+ function JustifySpaces(ToJustify) {
|
|
|
+ if (ToJustify <= 3) return '								';
|
|
|
+ else if (ToJustify <= 7) return '							';
|
|
|
+ else if (ToJustify <= 12) return '						';
|
|
|
+ else if (ToJustify <= 15) return '					';
|
|
|
+ else return '				';
|
|
|
+ }
|
|
|
+
|
|
|
+ function SkillsList(value) {
|
|
|
+ let keys = [],
|
|
|
+ skilldata = [],
|
|
|
+ skillIds = []
|
|
|
+ skilldata.push(
|
|
|
+ { text: `<font color="${PurpleClr}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: `fps gui` },
|
|
|
+ { text: `<font color="${mod.settings.HideBlacklistedSkills ? GreenClr : RedClr}" size="+22"><p align="right">[Blacklisted skills are ${mod.settings.HideBlacklistedSkills ? 'Blocked' : 'Not-Blocked'}]</p></font><br>`, command: `fps skill blacklist;fps gui skills` },
|
|
|
+ { text: `<font color="${LBlueClr}" size="+19">Click skill to blacklist it.</font><br>` }
|
|
|
+ )
|
|
|
+ for (let key in SkillData[value]) {
|
|
|
+ keys.push(key);
|
|
|
+ }
|
|
|
+ skillIds.push(Object.values(SkillData[value]))
|
|
|
+ for (var 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()) ? GreenClr : RedClr}" size="+17">[${keys[i]}]</font><br>` })
|
|
|
+ }
|
|
|
+ return skilldata
|
|
|
+ }
|
|
|
+
|
|
|
+ function JsonSearch(nameKey, array, arg, title) {
|
|
|
+ for (let i = 0; i < array.length; i++) {
|
|
|
+ if (array[i].Name.startsWith(nameKey) && arg == `starts`) {
|
|
|
+ TmpData.push({
|
|
|
+ command: `fps npc hide ${array[i].HuntingZoneId} ${array[i].TemplateId};fps gui npc ${nameKey}`, text: `<font color="${mod.settings.NpcsBlacklist.some(() => {
|
|
|
+ return mod.settings.NpcsBlacklist.some((arrVal) => {
|
|
|
+ if (array[i].HuntingZoneId == arrVal.zone && array[i].TemplateId == arrVal.templateId) return true
|
|
|
+ return false
|
|
|
+ })
|
|
|
+ }) ? GreenClr : RedClr}" size="+17">${array[i].Name}</font><br>`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (array[i].Name.includes(nameKey) && arg == `search`) {
|
|
|
+ TmpData.push({ command: `fps npc hide ${array[i].HuntingZoneId} ${array[i].TemplateId};fps gui npc ${nameKey}`, text: `<font color="${BronzeClr}" size="+17">${array[i].Name}</font><br>` })
|
|
|
+ }
|
|
|
+ if (!isNaN(arg)) {
|
|
|
+ if (array[i].nameKey == arg) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ gui.parse(TmpData, `<font color="${LPurpleClr}">[FPS] Options - NPCs</font> | ` + title)
|
|
|
+ TmpData = []
|
|
|
+ }
|
|
|
+
|
|
|
+ function ClassNameFromID(name) {
|
|
|
+ for (let Class_data of Object.keys(mod.settings.ClassesData)) {
|
|
|
+ if (mod.settings.ClassesData[Class_data].name == name) {
|
|
|
+ return Class_data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // ~~~ * Command Functions * ~~~ \\
|
|
|
+
|
|
|
+ function Msg(msg) {
|
|
|
+ mod.command.message(`[FPS] ${msg}`.clr(LPurpleClr))
|
|
|
+ }
|
|
|
+
|
|
|
+ function HideSpecificPlayer(name) {
|
|
|
+ for (let i in spawnedPlayers) {
|
|
|
+ if (spawnedPlayers[i].name.toString().toLowerCase() === name.toLowerCase()) {
|
|
|
+ mod.send('S_DESPAWN_USER', 3, { gameId: spawnedPlayers[i].gameId, type: 1 });
|
|
|
+ hiddenUsers[spawnedPlayers[i].gameId] = spawnedPlayers[i];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function RemoveEntry(name) {
|
|
|
+ var what, a = arguments, L = a.length, ax;
|
|
|
+ while (L > 1 && name.length) {
|
|
|
+ what = a[--L];
|
|
|
+ while ((ax = name.indexOf(what)) !== -1) { name.splice(ax, 1); }
|
|
|
+ }
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+
|
|
|
+ function ShowSpecificPlayer(name) {
|
|
|
+ for (let i in hiddenUsers) {
|
|
|
+ if (hiddenUsers[i].name.toString().toLowerCase() === name.toLowerCase()) {
|
|
|
+ ModifyAppearance(hiddenUsers[i]);
|
|
|
+ mod.send('S_SPAWN_USER', 13, hiddenUsers[i]);
|
|
|
+ delete hiddenUsers[i];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function HideAll() {
|
|
|
+ if (!mod.settings.OnlyParty) {
|
|
|
+ for (let i in spawnedPlayers) {
|
|
|
+ mod.send('S_DESPAWN_USER', 3, { gameId: spawnedPlayers[i].gameId, type: 1 });
|
|
|
+ hiddenUsers[spawnedPlayers[i].gameId] = spawnedPlayers[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function ShowAll() {
|
|
|
+ for (let i in hiddenUsers) {
|
|
|
+ ModifyAppearance(hiddenUsers[i]);
|
|
|
+ mod.send('S_SPAWN_USER', 13, hiddenUsers[i]);
|
|
|
+ delete hiddenUsers[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // ~~~ * Functions * ~~~ \\
|
|
|
+
|
|
|
+ function EqGid(xg) {
|
|
|
+ if (notcaaliproxy) return (xg === MyGameId)
|
|
|
+ return (xg.equals(MyGameId))
|
|
|
+ }
|
|
|
+
|
|
|
+ function ModifyAppearance(event) {
|
|
|
+ let modified = false;
|
|
|
+
|
|
|
+ if (mod.settings.ShowStyle) {
|
|
|
+ event.ShowStyle = false;
|
|
|
+ event.weaponEnchant = event.body = event.hand = event.feet = event.underwear = event.head = event.face = event.weapon = 0;
|
|
|
+ event.title = event.underwearDye = event.styleBackDye = event.styleHeadDye = event.styleFaceDye = event.styleBodyDye = event.showFace = event.styleHead = event.styleFace = event.styleBack = event.styleWeapon = event.styleBody = event.styleFootprint = 0;
|
|
|
+ event.icons = [];
|
|
|
+ if (event.mount) event.mount = 231;
|
|
|
+ modified = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mod.settings.Hideguildlogos) {
|
|
|
+ event.guildEmblem = '';
|
|
|
+ modified = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return modified;
|
|
|
+ }
|
|
|
+
|
|
|
+ function ModifySkillResult(event) {
|
|
|
+ let modified = false;
|
|
|
+
|
|
|
+ if (mod.settings.Hit_Me) {
|
|
|
+ event.skill = { npc: 0, type: 0, id: 0 };
|
|
|
+ modified = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mod.settings.Hit_Damage) {
|
|
|
+ event.damage = event.type = 0;
|
|
|
+ modified = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return modified;
|
|
|
+ }
|
|
|
+
|
|
|
+ function ClassID(m) {
|
|
|
+ return (m % 100)
|
|
|
+ }
|
|
|
+
|
|
|
+ function UpdateLoc(event) {
|
|
|
+ mod.send('S_USER_LOCATION', 5, { gameId: event.gameId, loc: event.loc, dest: event.loc, w: event.w, speed: 300, type: 7 });
|
|
|
+ }
|
|
|
+
|
|
|
+ // ~~~* Hook functions * ~~~ \\
|
|
|
+
|
|
|
+ function sLogin(event) {
|
|
|
+ MyGameId = event.gameId;
|
|
|
+ MyName = event.name;
|
|
|
+ laststate = undefined;
|
|
|
+ if (mod.settings.ProjDebug) {
|
|
|
+ mod.settings.ProjDebug = false
|
|
|
+ Msg('Detected Projectile debug on, ' + 'Made off'.clr(HPinkClr) + '.')
|
|
|
+ }
|
|
|
+ if (mod.settings.AbnDebug) {
|
|
|
+ mod.settings.AbnDebug = false
|
|
|
+ Msg('Detected Abnormalities debug on, ' + 'Made off'.clr(HPinkClr) + '.')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sLoadTopo() {
|
|
|
+ spawnedPlayers = {};
|
|
|
+ hiddenUsers = {};
|
|
|
+ hiddenNpcs = {};
|
|
|
+ if (mod.settings.ProjDebug) {
|
|
|
+ mod.settings.ProjDebug = false
|
|
|
+ Msg('Detected Projectile debug on, ' + 'Made off'.clr(HPinkClr) + '.')
|
|
|
+ }
|
|
|
+ if (mod.settings.AbnDebug) {
|
|
|
+ mod.settings.AbnDebug = false
|
|
|
+ Msg('Detected Abnormalities debug on, ' + 'Made off'.clr(HPinkClr) + '.')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sLeaveParty() {
|
|
|
+ partyMembers = []
|
|
|
+ if (mod.settings.RaidAutoChange) {
|
|
|
+ if (mod.settings.Mode !== 2 || laststate === undefined) return;
|
|
|
+ mod.command.exec(`fps mode ${laststate}`)
|
|
|
+ laststate = undefined;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sMountVehicle(event) {
|
|
|
+ if (EqGid(event.gameId)) return;
|
|
|
+ spawnedPlayers[event.gameId].mount = event.id
|
|
|
+ if (hiddenUsers[event.gameId]) hiddenUsers[event.gameId].mount = event.id;
|
|
|
+ if (mod.settings.ShowStyle) {
|
|
|
+ event.id = 231
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sUnmountVehicle(event) {
|
|
|
+ if (EqGid(event.gameId)) return;
|
|
|
+ spawnedPlayers[event.gameId].mount = 0
|
|
|
+ if (hiddenUsers[event.gameId]) hiddenUsers[event.gameId].mount = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ function cSetVisibleRange(event) {
|
|
|
+ lastrange = event.range
|
|
|
+ }
|
|
|
+
|
|
|
+ function sStartCooltimeItem(event) {
|
|
|
+ if (event.cooldown == 0) return false
|
|
|
+ }
|
|
|
+
|
|
|
+ function sStartActionScript(event) {
|
|
|
+ if ([40000, 40001, 40002].includes(event.script)) return;
|
|
|
+ if (mod.settings.NoZoomingToNpc) return false
|
|
|
+ }
|
|
|
+
|
|
|
+ function sPcBangInventory(event) {
|
|
|
+ for (let item of event.inventory)
|
|
|
+ if ([152898, 184659, 201005, 201006, 201007, 201008, 201022, 855604].includes(item.item)) {
|
|
|
+ item.cooldown = 0;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sLoadingScreenControlInfo() {
|
|
|
+ if (mod.settings.Mode >= 2) return false
|
|
|
+ }
|
|
|
+
|
|
|
+ function sGuildName(event) {
|
|
|
+ if (mod.settings.Hideguildlogos) {
|
|
|
+ event.guildEmblem = '';
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sApplyTitle(event) {
|
|
|
+ if (EqGid(event.gameId)) return;
|
|
|
+ if (mod.settings.ShowStyle) return false
|
|
|
+ }
|
|
|
+
|
|
|
+ function sImageData() {
|
|
|
+ if (mod.settings.Hideguildlogos) return false
|
|
|
+ }
|
|
|
+
|
|
|
+ function sRequestCityWarMapInfoDetail(event) {
|
|
|
+ if (mod.settings.Hideguildlogos) {
|
|
|
+ for (let lgd in event.guilds) {
|
|
|
+ if (typeof event.guilds[lgd].id !== 'undefined') {
|
|
|
+ event.guilds[lgd].emblem = '';
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sSpawnUser(event) {
|
|
|
+ spawnedPlayers[event.gameId] = event;
|
|
|
+ if (mod.settings.Mode === 3 || mod.settings.PlayersBlacklist.includes(event.name) || mod.settings.ClassesData[ClassID(event.templateId)].isHidden === true || (mod.settings.OnlyParty && !partyMembers.includes(event.name))) {
|
|
|
+ hiddenUsers[event.gameId] = event;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (ModifyAppearance(event)) return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ function sSpawnUserfn(event) {
|
|
|
+ if (ModifyAppearance(event)) return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ function sDespawnUser(event) {
|
|
|
+ delete hiddenUsers[event.gameId];
|
|
|
+ delete spawnedPlayers[event.gameId];
|
|
|
+ }
|
|
|
+
|
|
|
+ function sUserLocation(event) {
|
|
|
+ if (spawnedPlayers[event.gameId]) spawnedPlayers[event.gameId].loc = event.dest;
|
|
|
+ if (hiddenUsers[event.gameId]) {
|
|
|
+ hiddenUsers[event.gameId].loc = event.dest;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sUserMoveType() { return false; }
|
|
|
+
|
|
|
+ function sPartyMemberList(event) {
|
|
|
+ event.members.map((value) => { partyMembers.push(value.name) })
|
|
|
+ if (mod.settings.RaidAutoChange) {
|
|
|
+ if (event.members.length >= 18) {
|
|
|
+ if (mod.settings.Mode === 3) return;
|
|
|
+ laststate = mod.settings.Mode
|
|
|
+ mod.command.exec(`fps mode 2`)
|
|
|
+ } else {
|
|
|
+ if (mod.settings.Mode !== 2 || laststate === undefined) return;
|
|
|
+ mod.command.exec(`fps mode ${laststate}`)
|
|
|
+ laststate = undefined;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sUserExternalChange(event) {
|
|
|
+ if (EqGid(event.gameId)) return;
|
|
|
+ if (mod.settings.ShowStyle) {
|
|
|
+ event.ShowStyle = false;
|
|
|
+ event.weaponEnchant = event.body = event.hand = event.feet = event.underwear = event.head = event.face = event.weapon = 0;
|
|
|
+ event.title = event.underwearDye = event.styleBackDye = event.styleHeadDye = event.styleFaceDye = event.styleBodyDye = event.showFace = event.styleHead = event.styleFace = event.styleBack = event.styleWeapon = event.styleBody = event.styleFootprint = 0;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sUnicastTransformData(event) {
|
|
|
+ if (EqGid(event.gameId)) return;
|
|
|
+ if (mod.settings.ShowStyle) return false;
|
|
|
+ if (mod.settings.Hideguildlogos) {
|
|
|
+ event.guildLogo = '';
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sSpawnNpc(event) {
|
|
|
+ if (event.huntingZoneId === 1023) {
|
|
|
+ if (EqGid(event.owner)) {
|
|
|
+ if (!mod.settings.HideMySummons) return;
|
|
|
+ hiddenNpcs[event.gameId] = event;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!mod.settings.HideOthersSummons) return;
|
|
|
+ hiddenNpcs[event.gameId] = event;
|
|
|
+ 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.ShowStyle) {
|
|
|
+ event.repairable = false;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sDespawnNpc(event) {
|
|
|
+ delete hiddenNpcs[event.gameId];
|
|
|
+ if (event.type !== 5) return;
|
|
|
+ event.type = 1;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ function sFearMoveStage(event) {
|
|
|
+ if ((!EqGid(event.target) && mod.settings.Mode === 3) || hiddenUsers[event.target] || hiddenNpcs[event.target]) return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ function sFearMoveEnd(event) {
|
|
|
+ if ((!EqGid(event.target) && mod.settings.Mode === 3) || hiddenUsers[event.target] || hiddenNpcs[event.target]) return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ function sAbnormalityBegin(event) {
|
|
|
+ if (mod.settings.AbnDebug) {
|
|
|
+ if (EqGid(event.target)) console.log(`\x1b[2m[${new Date().toTimeString().slice(0, 8)}]\x1b[0m \x1b[31m->\x1b[0m \x1b[36mAbnormality \x1b[4mStarted\x1b[0m \x1b[44mon\x1b[0m \x1b[37m'${MyName}'\x1b[0m:\x1b[33m \ID "\x1b[32m${event.id}\x1b[0m"`);
|
|
|
+ if (EqGid(event.source)) console.log(`\x1b[2m[${new Date().toTimeString().slice(0, 8)}]\x1b[0m \x1b[31m->\x1b[0m \x1b[36mAbnormality \x1b[4mStarted\x1b[0m \x1b[45mfrom\x1b[0m \x1b[37m'${MyName}'\x1b[0m:\x1b[33m \ID "\x1b[32m${event.id}\x1b[0m"`);
|
|
|
+ if (spawnedPlayers[event.target]) console.log(`\x1b[2m[${new Date().toTimeString().slice(0, 8)}]\x1b[0m \x1b[31m->\x1b[0m \x1b[36mAbnormality \x1b[4mStarted\x1b[0m \x1b[44mon\x1b[0m \x1b[37m'${spawnedPlayers[event.target].name}'\x1b[0m:\x1b[33m \ID "\x1b[32m${event.id}\x1b[0m"`);
|
|
|
+ if (spawnedPlayers[event.source]) console.log(`\x1b[2m[${new Date().toTimeString().slice(0, 8)}]\x1b[0m \x1b[31m->\x1b[0m \x1b[36mAbnormality \x1b[4mStarted\x1b[0m \x1b[45mfrom\x1b[0m \x1b[37m'${spawnedPlayers[event.source].name}'\x1b[0m:\x1b[33m \ID "\x1b[32m${event.id}\x1b[0m"`);
|
|
|
+ }
|
|
|
+ if (EqGid(event.target)) return;
|
|
|
+ if (hiddenUsers[event.target]) return false;
|
|
|
+ if (mod.settings.HideBlacklistedAbnormalities && mod.settings.AbnormalitiesBlacklist.includes(event.id)) return false;
|
|
|
+ if (mod.settings.HideAllAbnormalities && (spawnedPlayers[event.target] || spawnedPlayers[event.source] || mod.settings.AbnormalitiesBlacklist.includes(event.id))) return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ function sAbnormalityRefresh(event) {
|
|
|
+ if (hiddenUsers[event.target]) return false;
|
|
|
+ if ((mod.settings.HideBlacklistedAbnormalities || mod.settings.HideAllAbnormalities) && (spawnedPlayers[[10306, 10316, 12001, 12003, 12120, 12130].includes(event.target)] || spawnedPlayers[[10306, 10316, 12001, 12003, 12120, 12130].includes(event.source)])) return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ function sAbnormalityFail(event) {
|
|
|
+ if (event.id === 3000021) return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ function sActionStage(event) {
|
|
|
+ if (EqGid(event.gameId) || !spawnedPlayers[event.gameId]) return;
|
|
|
+ if ((mod.settings.Mode >= 2) || hiddenUsers[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) {
|
|
|
+ UpdateLoc(event);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sStartUserProjectile(event) {
|
|
|
+ if (mod.settings.ProjDebug) {
|
|
|
+ if (EqGid(event.gameId)) console.log(`\x1b[2m[${new Date().toTimeString().slice(0, 8)}]\x1b[0m \x1b[31m->\x1b[0m \x1b[36mProjectile \x1b[4mStarted\x1b[0m \x1b[45mfrom\x1b[0m \x1b[37m'${MyName}'\x1b[0m:\x1b[33m \Skill_ID "\x1b[32m${event.skill.id}\x1b[0m"`);
|
|
|
+ if (spawnedPlayers[event.gameId]) console.log(`\x1b[2m[${new Date().toTimeString().slice(0, 8)}]\x1b[0m \x1b[31m->\x1b[0m \x1b[36mProjectile \x1b[4mStarted\x1b[0m \x1b[45mfrom\x1b[0m \x1b[37m'${spawnedPlayers[event.source].name}'\x1b[0m:\x1b[33m \Skill_ID "\x1b[32m${event.skill.id}\x1b[0m"`);
|
|
|
+ }
|
|
|
+ if (mod.settings.HideBlacklistedProjectiles && mod.settings.ProjectilesBlacklist.includes(event.skill.id)) return false;
|
|
|
+ if (!EqGid(event.gameId) && spawnedPlayers[event.gameId] && (hiddenUsers[event.gameId] || mod.settings.Mode > 0 || mod.settings.HideAllProjectiles)) return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ function sSpawnProjectile(event) {
|
|
|
+ if (mod.settings.ProjDebug) {
|
|
|
+ if (EqGid(event.gameId)) console.log(`\x1b[2m[${new Date().toTimeString().slice(0, 8)}]\x1b[0m \x1b[31m->\x1b[0m \x1b[36mProjectile \x1b[4mSpawned\x1b[0m \x1b[45mfrom\x1b[0m \x1b[37m'${MyName}'\x1b[0m:\x1b[33m \Skill_ID "\x1b[32m${event.skill.id}\x1b[0m"`);
|
|
|
+ if (spawnedPlayers[event.gameId]) console.log(`\x1b[2m[${new Date().toTimeString().slice(0, 8)}]\x1b[0m \x1b[31m->\x1b[0m \x1b[36mProjectile \x1b[4mSpawned\x1b[0m \x1b[45mfrom\x1b[0m \x1b[37m'${spawnedPlayers[event.source].name}'\x1b[0m:\x1b[33m \Skill_ID "\x1b[32m${event.skill.id}\x1b[0m"`);
|
|
|
+ }
|
|
|
+ if (mod.settings.HideBlacklistedProjectiles && mod.settings.ProjectilesBlacklist.includes(event.skill.id)) return false;
|
|
|
+ if (!EqGid(event.gameId) && spawnedPlayers[event.gameId] && (hiddenUsers[event.gameId] || mod.settings.Mode > 0 || mod.settings.HideAllProjectiles)) return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ function sEachSkillResult(event) {
|
|
|
+ if (EqGid(event.source) || EqGid(event.owner)) {
|
|
|
+ if (ModifySkillResult(event)) return true;
|
|
|
+ }
|
|
|
+ if (!EqGid(event.target) && mod.settings.Hit_Other && (spawnedPlayers[event.owner] || spawnedPlayers[event.source])) {
|
|
|
+ event.skill = { npc: 0, type: 0, id: 0 };
|
|
|
+ event.id = event.damage = event.type = event.noctEffect = event.crit = event.stackExplode = event.blocked = 0;
|
|
|
+ event.reaction.skill = 0;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sSpawnDropItem(event) {
|
|
|
+ if (EqGid(event.source)) return;
|
|
|
+ if (mod.settings.HideBlacklistedDrop) {
|
|
|
+ if (DropBlacklist.includes(event.item)) return false;
|
|
|
+ }
|
|
|
+ if (mod.settings.ShowStyle) {
|
|
|
+ event.explode = 0;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sFontSwapInfo() {
|
|
|
+ if (mod.settings.Hit_Damage) return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // ~~~ * Packet Hooks * ~~~ \\
|
|
|
+
|
|
|
+ mod.hook('S_LOGIN', 10, sLogin)
|
|
|
+ mod.hook('S_LOAD_TOPO', 'raw', sLoadTopo)
|
|
|
+ mod.hook('S_LEAVE_PARTY', 'raw', sLeaveParty)
|
|
|
+ mod.hook('S_MOUNT_VEHICLE', 2, sMountVehicle)
|
|
|
+ mod.hook('S_UNMOUNT_VEHICLE', 2, sUnmountVehicle)
|
|
|
+ mod.hook('C_SET_VISIBLE_RANGE', 1, cSetVisibleRange)
|
|
|
+ mod.hook('S_START_COOLTIME_ITEM', 1, sStartCooltimeItem)
|
|
|
+ mod.hook('S_START_ACTION_SCRIPT', 3, sStartActionScript)
|
|
|
+ mod.hook('S_PCBANGINVENTORY_DATALIST', 1, sPcBangInventory)
|
|
|
+ mod.hook('S_LOADING_SCREEN_CONTROL_INFO', 'raw', sLoadingScreenControlInfo)
|
|
|
+
|
|
|
+ mod.hook('S_GUILD_NAME', 1, sGuildName)
|
|
|
+ mod.hook('S_APPLY_TITLE', 2, sApplyTitle)
|
|
|
+ mod.hook('S_IMAGE_DATA', 'raw', sImageData)
|
|
|
+ mod.hook('S_REQUEST_CITY_WAR_MAP_INFO_DETAIL', 1, sRequestCityWarMapInfoDetail)
|
|
|
+
|
|
|
+ mod.hook('S_SPAWN_USER', 13, { order: 9999 }, sSpawnUser)
|
|
|
+ mod.hook('S_SPAWN_USER', 13, { order: 99999, filter: { fake: null } }, sSpawnUserfn)
|
|
|
+ mod.hook('S_DESPAWN_USER', 3, { order: 999 }, sDespawnUser)
|
|
|
+ mod.hook('S_USER_LOCATION', 5, sUserLocation)
|
|
|
+ mod.hook('S_USER_MOVETYPE', 'raw', sUserMoveType)
|
|
|
+ mod.hook('S_PARTY_MEMBER_LIST', 7, sPartyMemberList)
|
|
|
+ mod.hook('S_USER_EXTERNAL_CHANGE', 6, { order: 9999 }, sUserExternalChange)
|
|
|
+ mod.hook('S_UNICAST_TRANSFORM_DATA', 3, { order: 99999 }, sUnicastTransformData)
|
|
|
+
|
|
|
+ mod.hook('S_SPAWN_NPC', 9, sSpawnNpc)
|
|
|
+ mod.hook('S_DESPAWN_NPC', 3, sDespawnNpc)
|
|
|
+ mod.hook('S_FEARMOVE_STAGE', 1, sFearMoveStage)
|
|
|
+ mod.hook('S_FEARMOVE_END', 1, sFearMoveEnd)
|
|
|
+
|
|
|
+ mod.hook('S_ABNORMALITY_BEGIN', 3, { order: 999 }, sAbnormalityBegin)
|
|
|
+ mod.hook('S_ABNORMALITY_REFRESH', 1, { order: 999 }, sAbnormalityRefresh)
|
|
|
+ mod.hook('S_ABNORMALITY_FAIL', 1, sAbnormalityFail)
|
|
|
+
|
|
|
+ mod.hook('S_ACTION_STAGE', 8, { 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_EACH_SKILL_RESULT', 12, { order: 999 }, sEachSkillResult)
|
|
|
+ mod.hook('S_SPAWN_DROPITEM', 6, sSpawnDropItem)
|
|
|
+ mod.hook('S_FONT_SWAP_INFO', 'raw', sFontSwapInfo)
|
|
|
+
|
|
|
+
|
|
|
+ // ~~~ * Commands * ~~~ \\
|
|
|
+
|
|
|
+ mod.command.add('0', () => mod.command.exec('fps mode 0'))
|
|
|
+ mod.command.add('1', () => mod.command.exec('fps mode 1'))
|
|
|
+ mod.command.add('2', () => mod.command.exec('fps mode 2'))
|
|
|
+ mod.command.add('3', () => mod.command.exec('fps mode 3'))
|
|
|
+
|
|
|
+ mod.command.add(['fps', 'fps-utils', 'fpsutil', 'fpsutils'], (key, arg, arg2, arg3) => {
|
|
|
+ switch (key) {
|
|
|
+ case "g":
|
|
|
+ case "gui":
|
|
|
+ GuiHandler(arg, arg2);
|
|
|
+ break
|
|
|
+ case "0":
|
|
|
+ mod.command.exec(`fps mode 0`);
|
|
|
+ break
|
|
|
+ case "1":
|
|
|
+ mod.command.exec(`fps mode 1`);
|
|
|
+ break
|
|
|
+ case "2":
|
|
|
+ mod.command.exec(`fps mode 2`)
|
|
|
+ break
|
|
|
+ case "3":
|
|
|
+ mod.command.exec(`fps mode 3`);
|
|
|
+ break
|
|
|
+ case "mode":
|
|
|
+ case "state":
|
|
|
+ switch (arg) {
|
|
|
+ case "0":
|
|
|
+ case "off":
|
|
|
+ if (mod.settings.Mode === 3) ShowAll();
|
|
|
+ mod.settings.Mode = 0;
|
|
|
+
|
|
|
+ mod.settings.HideAllAbnormalities = false;
|
|
|
+ mod.settings.HideAllProjectiles = false;
|
|
|
+ mod.settings.Hit_Other = false;
|
|
|
+
|
|
|
+ Msg(`Mode 0.`.clr(RedClr));
|
|
|
+ break
|
|
|
+ case "1":
|
|
|
+ case "one":
|
|
|
+ if (mod.settings.Mode === 3) ShowAll();
|
|
|
+ mod.settings.Mode = 1;
|
|
|
+
|
|
|
+ mod.settings.HideAllAbnormalities = false;
|
|
|
+ mod.settings.HideAllProjectiles = true;
|
|
|
+ mod.settings.Hit_Other = true;
|
|
|
+
|
|
|
+ Msg(`Mode 1.`.clr(BronzeClr));
|
|
|
+ break
|
|
|
+ case "2":
|
|
|
+ case "two":
|
|
|
+ if (mod.settings.Mode === 3) ShowAll();
|
|
|
+ mod.settings.Mode = 2;
|
|
|
+
|
|
|
+ mod.settings.HideAllAbnormalities = true;
|
|
|
+ mod.settings.HideAllProjectiles = true;
|
|
|
+ mod.settings.Hit_Other = true;
|
|
|
+
|
|
|
+ Msg(`Mode 2.`.clr(SilverClr));
|
|
|
+ break
|
|
|
+ case "3":
|
|
|
+ case "three":
|
|
|
+ HideAll();
|
|
|
+ mod.settings.Mode = 3;
|
|
|
+
|
|
|
+ mod.settings.HideAllAbnormalities = true;
|
|
|
+ mod.settings.HideBlacklistedAbnormalities = true;
|
|
|
+ mod.settings.HideAllProjectiles = true;
|
|
|
+ mod.settings.HideBlacklistedProjectiles = true;
|
|
|
+ mod.settings.Hit_Other = true;
|
|
|
+
|
|
|
+ mod.settings.OnlyParty = false;
|
|
|
+
|
|
|
+ Msg(`Mode 3.`.clr(GoldClr));
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ Msg(`Invalid" ${arg}".`.clr(GrayClr));
|
|
|
+ Msg(`Modes: ` + `[0, 1, 2, 3]`.clr(PinkClr) + '.');
|
|
|
+ break
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case "hide":
|
|
|
+ if (typeof arg === "string" && arg !== null) {
|
|
|
+ if (mod.settings.PlayersBlacklist.includes(arg)) {
|
|
|
+ Msg(`Player "${arg}"` + ` Already hidden`.clr(RedClr) + '.');
|
|
|
+ return;
|
|
|
+ } else
|
|
|
+ if ((mod.settings.ClassesNames.includes(arg) && !mod.settings.ClassesBlacklist.includes(arg)) || (mod.settings.RolesNames.includes(arg) && !mod.settings.RolesBlacklist.includes(arg))) {
|
|
|
+ for (let i in mod.settings.ClassesData) {
|
|
|
+ if ((mod.settings.ClassesData[i].name === arg || mod.settings.ClassesData[i].role.includes(arg)) && mod.settings.ClassesData[i].isHidden !== true) {
|
|
|
+ mod.settings.ClassesData[i].isHidden = true;
|
|
|
+ if (mod.settings.ClassesData[i].name === arg) mod.settings.ClassesBlacklist.push(arg);
|
|
|
+ if (mod.settings.ClassesData[i].role.includes(arg)) mod.settings.RolesBlacklist.push(arg);
|
|
|
+ let classtohide = mod.settings.ClassesData[i].model;
|
|
|
+ for (let i in spawnedPlayers) {
|
|
|
+ if (ClassID(spawnedPlayers[i].templateId) === classtohide) HideSpecificPlayer(spawnedPlayers[i].name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Msg(`Class/Role ${arg}` + ` Hidden`.clr(GreenClr) + '.');
|
|
|
+ return;
|
|
|
+ } else if (mod.settings.ClassesBlacklist.includes(arg) || mod.settings.RolesBlacklist.includes(arg)) {
|
|
|
+ Msg(`Class/Role "${arg}"` + ` Already hidden`.clr(RedClr) + '.');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Msg(`Player "${arg}"` + ` Hidden`.clr(GreenClr) + '.');
|
|
|
+ mod.settings.PlayersBlacklist.push(arg);
|
|
|
+ HideSpecificPlayer(arg);
|
|
|
+ } else
|
|
|
+ Msg(`Invalid ${arg2}.`.clr(GrayClr));
|
|
|
+ break
|
|
|
+ case "show":
|
|
|
+ if (typeof arg === "string" && arg !== null) {
|
|
|
+ if (mod.settings.PlayersBlacklist.includes(arg)) {
|
|
|
+ ShowSpecificPlayer(arg);
|
|
|
+ RemoveEntry(mod.settings.PlayersBlacklist, arg);
|
|
|
+ Msg(`Player "${arg}"` + ` Shown`.clr(RedClr) + '.');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if ((mod.settings.ClassesNames.includes(arg) && mod.settings.ClassesBlacklist.includes(arg)) || (mod.settings.RolesBlacklist.includes(arg) && mod.settings.RolesNames.includes(arg))) {
|
|
|
+ for (let i in mod.settings.ClassesData) {
|
|
|
+ if (mod.settings.ClassesData[i].name === arg || mod.settings.ClassesData[i].role.includes(arg)) {
|
|
|
+ if (mod.settings.ClassesData[i].name === arg) RemoveEntry(mod.settings.ClassesBlacklist, arg);
|
|
|
+ if (mod.settings.ClassesData[i].role.includes(arg)) RemoveEntry(mod.settings.RolesBlacklist, arg);
|
|
|
+ mod.settings.ClassesData[i].isHidden = false;
|
|
|
+ let classToShow = mod.settings.ClassesData[i].model;
|
|
|
+ for (let i in hiddenUsers) {
|
|
|
+ if (ClassID(hiddenUsers[i].templateId) === classToShow) ShowSpecificPlayer(hiddenUsers[i].name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Msg(`Class "${arg}"` + ` Shown`.clr(RedClr) + '.');
|
|
|
+ } else if (!mod.settings.ClassesBlacklist.includes(arg) || !mod.settings.RolesBlacklist.includes(arg)) {
|
|
|
+ Msg(`Class/Role "${arg}"` + ` Already shown`.clr(RedClr) + '.');
|
|
|
+ } else if (!mod.settings.PlayersBlacklist.includes(arg)) {
|
|
|
+ Msg(`Player "${arg}"` + ` Already shown`.clr(RedClr) + '.');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case "party":
|
|
|
+ if (mod.settings.Mode === 3) return Msg(`You've to disable mode 3 first.`.clr(RedClr));
|
|
|
+ mod.settings.OnlyParty = !mod.settings.OnlyParty
|
|
|
+ if (mod.settings.OnlyParty) {
|
|
|
+ for (let i in spawnedPlayers) {
|
|
|
+ if (!partyMembers.includes(spawnedPlayers[i].name)) {
|
|
|
+ mod.send('S_DESPAWN_USER', 3, { gameId: spawnedPlayers[i].gameId, type: 1 })
|
|
|
+ hiddenUsers[spawnedPlayers[i].gameId] = spawnedPlayers[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ShowAll()
|
|
|
+ }
|
|
|
+ Msg(`Everyone but party ${mod.settings.OnlyParty ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "raid":
|
|
|
+ mod.settings.RaidAutoChange = !mod.settings.RaidAutoChange
|
|
|
+ Msg(`Raid auto-state ${mod.settings.RaidAutoChange ? 'Enabled'.clr(GreenClr) : 'Disabled'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "list":
|
|
|
+ Msg(`Hidden players: ${mod.settings.PlayersBlacklist}.`.clr(PinkClr));
|
|
|
+ Msg(`Hidden classes: ${mod.settings.ClassesBlacklist}.`.clr(PinkClr));
|
|
|
+ Msg(`Hidden roles: ${mod.settings.RolesBlacklist}.`.clr(PinkClr));
|
|
|
+ break
|
|
|
+ case "summons":
|
|
|
+ case "sums":
|
|
|
+ switch (arg) {
|
|
|
+ case "me":
|
|
|
+ mod.settings.HideMySummons = !mod.settings.HideMySummons;
|
|
|
+ Msg(`Own summoned NPCs ${mod.settings.HideMySummons ? 'Hidden'.clr(RedClr) : 'Shown'.clr(GreenClr)}.`);
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ mod.settings.HideOthersSummons = !mod.settings.HideOthersSummons;
|
|
|
+ Msg(`Others summoned NPCs ${mod.settings.HideOthersSummons ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case "skills":
|
|
|
+ case "skill":
|
|
|
+ switch (arg) {
|
|
|
+ case "blacklist":
|
|
|
+ mod.settings.HideBlacklistedSkills = !mod.settings.HideBlacklistedSkills;
|
|
|
+ Msg(`Blacklisted skills ${mod.settings.HideBlacklistedSkills ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "class":
|
|
|
+ if (mod.settings.ClassesNames.includes(arg2)) {
|
|
|
+ for (let i in mod.settings.ClassesData) {
|
|
|
+ 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)
|
|
|
+ if (index !== -1) {
|
|
|
+ mod.settings.ClassesData[i].CD_SkillsBlacklist.splice(index, 1)
|
|
|
+ Msg(`Skill ID '${arg3}'` + ` Shown`.clr(RedClr) + ` for class '${arg2}'.`)
|
|
|
+ }
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ mod.settings.ClassesData[i].CD_SkillsBlacklist.push(arg3)
|
|
|
+ Msg(`Skill ID '${arg3}'` + ` Hidden`.clr(GreenClr) + ` for class '${arg2}'.`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ mod.settings.ClassesData[i].CD_HideBlacklistedSkills = !mod.settings.ClassesData[i].CD_HideBlacklistedSkills;
|
|
|
+ Msg(`Skills for '${arg2}' class ${mod.settings.ClassesData[i].CD_HideBlacklistedSkills ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else
|
|
|
+ Msg(`Class ${arg2} not found.`.clr(RedClr));
|
|
|
+ break
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case "npcs":
|
|
|
+ case "npc":
|
|
|
+ if (arg == 'hide') {
|
|
|
+ let found = mod.settings.NpcsBlacklist.some((s) => {
|
|
|
+ return s.zone === arg2 && s.templateId === arg3;
|
|
|
+ });
|
|
|
+ if (found) {
|
|
|
+ Msg(`NPC HntZone '${arg2}', TmpId '${arg3}'` + ` Removed from the blacklist`.clr(RedClr) + '.')
|
|
|
+ mod.settings.NpcsBlacklist = mod.settings.NpcsBlacklist.filter((obj) => {
|
|
|
+ return obj.zone != arg2 || obj.templateId != arg3;
|
|
|
+ })
|
|
|
+
|
|
|
+ } else {
|
|
|
+ Msg(`NPC HntZone '${arg2}', TmpId '${arg3}'` + ` Added to the blacklist`.clr(GreenClr) + '.')
|
|
|
+ mod.settings.NpcsBlacklist.push({ zone: arg2, templateId: arg3 })
|
|
|
+ }
|
|
|
+ return
|
|
|
+ } else
|
|
|
+ mod.settings.HideBlacklistedNpcs = !mod.settings.HideBlacklistedNpcs;
|
|
|
+ Msg(`Blacklisted NPCs ${mod.settings.HideBlacklistedNpcs ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "hit":
|
|
|
+ switch (arg) {
|
|
|
+ case "me":
|
|
|
+ mod.settings.Hit_Me = !mod.settings.Hit_Me;
|
|
|
+ Msg(`Own hits effect ${mod.settings.Hit_Me ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "other":
|
|
|
+ mod.settings.Hit_Other = !mod.settings.Hit_Other;
|
|
|
+ Msg(`Players hit effect ${mod.settings.Hit_Other ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "damage":
|
|
|
+ mod.settings.Hit_Damage = !mod.settings.Hit_Damage;
|
|
|
+ Msg(`Damage numbers ${mod.settings.Hit_Damage ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ Msg(`Invalid (hit) "${arg}".`.clr(GrayClr));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case "fireworks":
|
|
|
+ case "firework":
|
|
|
+ mod.settings.HideFireworks = !mod.settings.HideFireworks;
|
|
|
+ Msg(`Fireworks ${mod.settings.HideFireworks ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "abn":
|
|
|
+ case "effects":
|
|
|
+ case "abnormal":
|
|
|
+ case "abnormalities":
|
|
|
+ switch (arg) {
|
|
|
+ case "all":
|
|
|
+ mod.settings.HideAllAbnormalities = !mod.settings.HideAllAbnormalities;
|
|
|
+ Msg(`All Abnormalities ${mod.settings.HideAllAbnormalities ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "blacklist":
|
|
|
+ if (!arg2 || !arg3) {
|
|
|
+ mod.settings.HideBlacklistedAbnormalities = !mod.settings.HideBlacklistedAbnormalities;
|
|
|
+ Msg(`Blacklisted Abnormalities ${mod.settings.HideBlacklistedAbnormalities ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ } else if (arg2 && arg3) {
|
|
|
+ arg3 = Number(arg3);
|
|
|
+ if (!mod.settings.AbnormalitiesBlacklist.includes(arg3)) {
|
|
|
+ if (arg2 == 'add') {
|
|
|
+ mod.settings.AbnormalitiesBlacklist.push(arg3)
|
|
|
+ Msg(`Blacklisted Abnormalities` + ` added "${arg3}"`.clr(GreenClr) + '.')
|
|
|
+ return
|
|
|
+ } else if (arg2 == 'remv') {
|
|
|
+ Msg(`Blacklisted Abnormalities` + ` can't remove "${arg3}" as it's not there`.clr(GrayClr) + '.')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else if (mod.settings.AbnormalitiesBlacklist.includes(arg3)) {
|
|
|
+ if (arg2 == 'add') {
|
|
|
+ Msg(`Blacklisted Abnormalities` + ` can't add "${arg3}" as it's already there`.clr(GrayClr) + '.')
|
|
|
+ return
|
|
|
+ } else if (arg2 == 'remv') {
|
|
|
+ let index = mod.settings.AbnormalitiesBlacklist.indexOf(arg3)
|
|
|
+ if (index !== -1) {
|
|
|
+ mod.settings.AbnormalitiesBlacklist.splice(index, 1)
|
|
|
+ Msg(`Blacklisted Abnormalities` + ` removed "${arg3}"`.clr(RedClr) + '.')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else return Msg(`Invalid (abnormalities Blacklist) "${arg}".`.clr(GrayClr));
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case "log":
|
|
|
+ case "debug":
|
|
|
+ mod.settings.AbnDebug = !mod.settings.AbnDebug
|
|
|
+ Msg(`Abnormalities debug ${mod.settings.AbnDebug ? 'started'.clr(GreenClr) : 'stopped'.clr(RedClr)}, check your console for details.`)
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ Msg(`Invalid (abnormalities) "${arg}".`.clr(GrayClr));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case "guildlogo":
|
|
|
+ if (ChangeOnCd) return Msg(`Try again in 4 seconds.`.clr(PinkClr));
|
|
|
+ mod.settings.Hideguildlogos = !mod.settings.Hideguildlogos;
|
|
|
+ mod.send('C_SET_VISIBLE_RANGE', 1, { range: 0 })
|
|
|
+ setTimeout(() => { mod.send('C_SET_VISIBLE_RANGE', 1, { range: lastrange }) }, 1500);
|
|
|
+ ChangeOnCd = true
|
|
|
+ setTimeout(() => { ChangeOnCd = false }, 4000);
|
|
|
+ Msg(`Guild Logos ${mod.settings.Hideguildlogos ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "costume":
|
|
|
+ case "style":
|
|
|
+ if (ChangeOnCd) return Msg(`Try again in 4 seconds.`.clr(PinkClr));
|
|
|
+ mod.settings.ShowStyle = !mod.settings.ShowStyle;
|
|
|
+ mod.send('C_SET_VISIBLE_RANGE', 1, { range: 0 })
|
|
|
+ setTimeout(() => { mod.send('C_SET_VISIBLE_RANGE', 1, { range: lastrange }) }, 1500);
|
|
|
+ ChangeOnCd = true
|
|
|
+ setTimeout(() => { ChangeOnCd = false }, 4000);
|
|
|
+ Msg(`Style of NPCs & others ${mod.settings.ShowStyle ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "proj":
|
|
|
+ case "projectile":
|
|
|
+ switch (arg) {
|
|
|
+ case "all":
|
|
|
+ mod.settings.HideAllProjectiles = !mod.settings.HideAllProjectiles;
|
|
|
+ Msg(`Projectiles ${mod.settings.HideAllProjectiles ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "blacklist":
|
|
|
+ if (!arg2 || !arg3) {
|
|
|
+ mod.settings.HideBlacklistedProjectiles = !mod.settings.HideBlacklistedProjectiles;
|
|
|
+ Msg(`Blacklisted projectile ${mod.settings.HideBlacklistedProjectiles ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ } else if (arg2 && arg3) {
|
|
|
+ arg3 = Number(arg3);
|
|
|
+ if (!mod.settings.ProjectilesBlacklist.includes(arg3)) {
|
|
|
+ if (arg2 == 'add') {
|
|
|
+ mod.settings.ProjectilesBlacklist.push(arg3)
|
|
|
+ Msg(`Blacklisted projectile` + ` added "${arg3}"`.clr(GreenClr) + '.')
|
|
|
+ return
|
|
|
+ } else if (arg2 == 'remv') {
|
|
|
+ Msg(`Blacklisted projectile` + ` can't remove "${arg3}" as it's not there`.clr(GrayClr) + '.')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else if (mod.settings.ProjectilesBlacklist.includes(arg3)) {
|
|
|
+ if (arg2 == 'add') {
|
|
|
+ Msg(`Blacklisted projectile` + ` can't add "${arg3}" as it's already there`.clr(GrayClr) + '.')
|
|
|
+ return
|
|
|
+ } else if (arg2 == 'remv') {
|
|
|
+ let index = mod.settings.ProjectilesBlacklist.indexOf(arg3)
|
|
|
+ if (index !== -1) {
|
|
|
+ mod.settings.ProjectilesBlacklist.splice(index, 1)
|
|
|
+ Msg(`Blacklisted projectile` + ` removed "${arg3}"`.clr(RedClr) + '.')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else return Msg(`Invalid (projectile Blacklist) "${arg}".`.clr(GrayClr));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "log":
|
|
|
+ case "debug":
|
|
|
+ mod.settings.ProjDebug = !mod.settings.ProjDebug
|
|
|
+ Msg(`Projectile debug ${mod.settings.ProjDebug ? 'started'.clr(GreenClr) : 'stopped'.clr(RedClr)}, check your console for details.`)
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ Msg(`Invalid (projectile) "${arg}".`.clr(GrayClr));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case "quicklink":
|
|
|
+ switch (arg) {
|
|
|
+ case "parcel":
|
|
|
+ mod.send('C_REQUEST_CONTRACT', 1, { type: 8 });
|
|
|
+ break;
|
|
|
+ case "talents":
|
|
|
+ mod.send('S_REQUEST_CONTRACT', 1, { type: 77 });
|
|
|
+ break;
|
|
|
+ case "broker":
|
|
|
+ mod.send('S_NPC_MENU_SELECT', 1, { type: 28 });
|
|
|
+ break;
|
|
|
+ case "dressingroom":
|
|
|
+ mod.send('C_REQUEST_CONTRACT', 1, { type: 76 });
|
|
|
+ break;
|
|
|
+ case "hatrestyle":
|
|
|
+ mod.send('C_REQUEST_CONTRACT', 1, { type: 90 });
|
|
|
+ break;
|
|
|
+ case "lobby":
|
|
|
+ mod.send('C_RETURN_TO_LOBBY', 1, {});
|
|
|
+ break;
|
|
|
+ case "exit":
|
|
|
+ mod.send('C_EXIT', 1, {});
|
|
|
+ break;
|
|
|
+ case "drop":
|
|
|
+ mod.send('C_LEAVE_PARTY', 1, {});
|
|
|
+ break;
|
|
|
+ case "disband":
|
|
|
+ mod.send('C_DISMISS_PARTY', 1, {});
|
|
|
+ break;
|
|
|
+ case "reset":
|
|
|
+ mod.send('C_RESET_ALL_DUNGEON', 1, {});
|
|
|
+ break;
|
|
|
+ case "searchengine":
|
|
|
+ mod.send('S_SHOW_AWESOMIUMWEB_SHOP', 1, { link: 'https://duckduckgo.com/' });
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ Msg(`Invalid (quicklink) "${arg}".`.clr(GrayClr));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "npczoom":
|
|
|
+ mod.settings.NoZoomingToNpc = !mod.settings.NoZoomingToNpc;
|
|
|
+ Msg(`Npc zoom-ins ${mod.settings.NoZoomingToNpc ? 'Disabled'.clr(GreenClr) : 'ON'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "dropitem":
|
|
|
+ mod.settings.HideBlacklistedDrop = !mod.settings.HideBlacklistedDrop
|
|
|
+ Msg(`Drop blacklist ${mod.settings.HideBlacklistedDrop ? 'Hidden'.clr(GreenClr) : 'Shown'.clr(RedClr)}.`);
|
|
|
+ break
|
|
|
+ case "help":
|
|
|
+ mod.command.exec(`fps gui help`)
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ Msg('Unknown command, check command list.'.clr(RedClr));
|
|
|
+ mod.command.exec(`fps gui help`)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|