index.js 86 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570
  1. 'use strict'
  2. /* global __dirname */
  3. module.exports = function FpsUtils(mod) {
  4. // ~~~ * Data * ~~~ \\
  5. const NotCP = typeof global.TeraProxy === 'undefined' || typeof global.TeraProxy.UILanguage === 'undefined';
  6. const NpcData = require("./data/npcData.json"), SkillData = require("./data/skillString.json");
  7. const BnzC = '#BC8F8F', SlvC = '#9A9A9A', GldC = '#DAA520', PnkC = '#FFB7C5', HPkC = '#FF69B4', CPKC = '#ED5D92', RedC = '#FE6F5E', GrnC = '#4DE19C', LPrC = '#E0B0FF', PrpC = '#9966CC', LBlC = '#4DDCE1', BluC = '#436EEE', DBlC = '#5BC0BE', HBlC = '#08B3E5', GryC = '#778899', YlwC = '#C0B94D';
  8. const InvisibleNpcs = { 8: [6011], 12: [1], 23: [201, 202], 34: [8000], 61: [9901], 62: [9001, 9002, 9003, 9004, 9901], 83: [9901], 207: [9901], 223: [9901], 230: [9901] };
  9. const TrapsIds = [30120, 30220, 30320, 90220, 90320, 90420, 90520, 90620, 90720, 90820, 90920, 100120, 100220, 100320, 100420, 100520, 120220, 120320, 120420, 120520, 120620, 120720, 120820, 120920, 150120, 150220, 150320, 150420, 150520, 150620, 150720, 170120, 170220, 170320, 170420, 170520, 170620, 170720, 170820, 170920, 230120, 230220, 230320, 250120, 250220, 250320, 250420, 250520, 250620, 250720, 250820, 250920, 251020];
  10. const UserNPCs = [12345, 1100100, 1100101, 1023000, 1023001, 1023002, 1023003, 1023004, 1023005, 1023006, 1023007, 1023008, 1023009, 1023010, 1023011, 1023012, 1023013, 1023014, 1023200, 1023201, 1023202, 1023203, 1023204, 1023205, 1023206, 1023207, 1023208, 1023209, 1023210, 1023211, 1023300, 1023301, 1023302, 1023303, 1023304, 1023305, 1023306, 1023307, 1023308, 1023309, 1023310, 1023311, 1023312, 1023400, 1023401, 1023402, 1023403, 1023404, 1023405, 1024000, 1024001, 1024100, 1024200, 1024300, 2100100, 2100101, 10235001, 10235002, 10235003, 10235004, 10235005, 10235006, 10235007, 10235008, 10235009, 10235010, 10235011, 10235012, 10235013, 10235014, 10235015, 10235016, 10235017, 10235100, 10236001, 10236002, 10236003, 10236004, 10236005, 10236006, 10236007, 10236008, 10236009, 10236010, 10236011, 10236012, 10236013, 10236014, 10236015, 10236100, 10237001, 10237002, 10237003, 10237004, 10237005, 10237006, 10237007, 10237008, 10237009, 10237010, 10237011, 10237012, 10237013, 10237014, 10237015, 10237100, 10238001, 10238002, 10238003, 10238004, 10238005, 10238006, 10238007, 10238008, 10238100, 10239003, 30301001, 30301002, 30301003, 30301004, 30301005, 30302001, 30302002, 30302003, 30302004, 30302005, 30302006, 30302007, 30303001, 30303002, 30303003, 30303004, 30303005, 30303006, 30303007];
  11. const SpamAchIds = [6, 51, 377, 391, 466, 467, 468, 469, 470, 471, 472, 473, 476, 611, 1408, 1744, 1745, 1769, 1770, 1771, 1942, 1943, 1952, 1992, 2032, 2033, 2036, 2037, 2038, 2057, 2062, 2071, 2078, 2081, 2082, 2083, 2084, 2088, 2089, 2095, 6005, 9817, 28723, 28724, 28725, 28726, 28727, 28728, 28729, 28730, 28731, 28732, 28733, 28734, 28735, 28736, 510005, 510012, 510019, 510026, 510027, 510033, 510034, 510035, 510036, 510037, 510038, 510039, 510040, 510041, 520029, 520030, 520032, 520033, 520034, 520035, 520048, 520049, 520050, 520051, 525000, 525001, 525002, 525003, 525004, 525005, 525006, 525007, 525008, 525009, 525010, 525011, 525012, 525013, 525014, 525015, 525016, 525017, 525018, 525019, 525020, 525021, 525022, 525023, 525024, 525025, 5010000];
  12. const ImportantAbns = [90440009, 90442106, 90442110, 90442111, 90442112, 90442113, 90442114, 90442400, 90442401, 90442402, 90442403, 90442404, 90442405, 90442406, 90442407, 90442408, 90442502, 78200123, 78200126, 78200130, 78200131, 78200161, 78200162, 78200203, 78200204, 78200205, 78200209, 78200234, 78200235, 78200236];
  13. const BlockedAbns = [201, 202, 902, 903, 908, 910, 911, 912, 913, 916, 917, 920, 921, 922, 1130, 1131, 1133, 1461, 1462, 1490, 1491, 1495, 1510, 1511, 1512, 1610, 1630, 1800, 2040, 2041, 2042, 2057, 2058, 2059, 2060, 2066, 2067, 2068, 2081, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 4401, 4600, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4950, 5060, 6005, 6006, 6007, 6009, 6016, 10400, 10401, 10402, 10403, 10404, 10405, 10501, 10502, 10503, 10504, 10505, 10506, 10510, 10511, 10512, 10513, 10514, 10515, 10516, 10520, 10521, 10522, 10523, 10524, 10525, 10600, 10601, 10602, 10603, 10604, 10605, 10606, 10610, 10611, 10612, 10613, 10614, 10615, 10616, 10620, 10621, 10622, 10623, 10624, 10625, 10625, 10700, 10701, 10702, 10703, 10704, 10705, 10706, 10710, 10711, 10712, 10713, 10714, 10715, 10716, 10720, 10721, 10722, 10723, 10724, 10725, 10800, 10801, 10802, 10803, 10804, 10805, 10806, 12230, 12240, 27050, 40175, 40176, 48732, 48733, 48734, 48735, 48736, 48737, 48738, 48739, 60005, 60018, 60026, 70214, 70221, 70222, 70223, 70224, 70225, 70226, 70227, 70228, 70231, 70232, 70233, 70234, 70235, 70241, 70242, 70243, 70244, 70245, 70251, 70252, 70253, 70254, 70255, 70256, 70261, 70262, 70263, 70264, 70271, 70272, 70273, 70274, 70275, 70281, 70282, 70283, 70284, 70285, 70286, 70287, 70288, 70289, 70290, 70300, 70301, 70302, 70303, 70304, 70305, 70310, 70311, 70312, 70313, 70314, 70315, 70321, 70322, 70323, 70324, 70325, 70330, 70331, 70332, 70333, 70334, 70335, 70336, 70337, 70338, 70341, 70342, 70343, 70344, 70345, 70346, 70347, 70348, 70351, 70352, 70353, 70354, 70355, 70356, 70357, 70358, 70359, 70360, 70361, 70362, 70363, 70364, 70365, 70366, 70367, 70368, 70369, 70370, 70462, 88611, 88612, 100200, 100201, 100202, 100203, 100294, 100295, 100296, 100297, 100298, 100299, 100800, 100801, 101801, 101900, 102600, 103100, 103102, 103104, 103130, 103131, 200200, 200201, 200202, 200230, 200231, 200232, 200500, 200900, 200901, 200930, 200931, 201200, 201300, 201301, 201302, 201303, 201304, 201305, 201700, 201807, 201808, 201811, 201812, 201830, 201831, 300300, 300301, 400100, 400101, 400102, 400103, 400104, 400105, 401705, 401706, 401710, 401711, 401721, 401722, 401723, 401724, 401727, 401728, 457017, 457052, 476615, 476616, 476617, 476618, 500200, 500500, 500600, 500601, 500602, 500700, 500701, 500702, 500703, 500704, 500705, 500706, 500707, 500720, 500721, 500722, 500723, 500724, 500725, 500726, 500727, 501000, 501001, 501002, 501003, 501004, 501005, 501006, 501020, 501021, 501022, 501023, 501024, 501025, 501026, 501400, 501402, 600900, 600901, 600902, 600903, 600904, 600905, 600906, 600907, 600908, 600920, 600921, 600922, 600923, 600924, 600925, 600926, 600927, 600928, 601450, 620000, 620001, 621000, 622001, 622002, 700200, 700201, 700202, 700203, 700230, 700231, 700232, 700233, 700300, 700400, 700401, 700402, 700403, 700404, 700405, 700406, 700407, 700408, 700409, 700600, 700601, 700602, 700603, 700630, 700631, 700700, 700701, 700730, 700731, 701001, 701002, 701003, 701004, 701005, 701006, 701007, 701008, 701009, 701010, 701011, 701012, 701511, 701540, 701541, 701542, 701543, 701544, 701545, 701546, 701547, 701548, 701549, 701550, 701551, 701560, 701561, 701562, 701563, 701564, 701565, 701566, 701567, 701568, 701569, 701570, 701571, 701604, 701605, 701606, 701607, 701800, 701801, 701802, 701803, 701804, 701805, 701806, 701807, 701808, 701820, 701821, 701822, 701823, 701824, 701825, 701826, 701827, 701828, 701900, 702000, 702001, 702002, 702003, 702005, 702012, 757002, 757003, 757004, 757005, 757006, 757007, 757008, 757009, 757016, 757017, 757018, 757029, 757031, 757032, 757033, 757049, 757052, 757054, 760009, 760015, 760031, 760032, 776021, 776022, 776023, 776024, 776025, 776026, 776028, 776029, 800100, 800101, 800102, 800103, 800104, 800105, 800106, 800107, 800108, 800300, 800301, 800302, 800303, 800304, 801000, 801001, 801100, 801101, 801400, 801401, 806020, 806021, 806022, 806023, 806028, 830004, 905434, 905932, 999996, 4510004, 4510005, 4510006, 4510007, 4510008, 4510009, 4510010, 4510011, 4510012, 4510013, 4510014, 4510015, 5000000, 5000003, 5020003, 5020006, 5020007, 5020008, 5020010, 5020011, 5030004, 5030005, 5690001, 7691000, 7691007, 9691000, 9691007, 9691011, 9943049, 10152050, 10152096, 10154030, 10154054, 10155550, 14400002, 14400003, 44300066, 44300073, 44300078, 44300079, 47630300, 47650400, 47660100, 47660200, 47660300, 47660400, 47660500, 47660600, 47660700, 47660800, 47660900, 47662300, 47662800, 47680400, 74300078, 74300081, 75000016, 76600024, 77600017, 77702400, 77703433, 77703437, 78200379, 78200383, 80401500, 81121101, 81121102, 81121103, 81121104, 81121105, 81121201, 81121202, 81121203, 81121204, 81121205, 90341010, 90442101, 91600019, 93503301, 93503302, 93503303, 93503401, 93503402, 98200379, 98200383, 98850027, 98850030, 98850035, 98850036, 99000900, 99000910, 99000920, 99000930, 99000940, 99000950, 99000960, 99000970, 99001000, 99001010, 99001020, 99001030, 99001040, 99001050, 99001060, 99001070, 99001200, 99001210, 99001220, 99001230, 99001240, 99001250, 99001260, 99001270, 99001300, 99001301, 99001302, 99001303, 99001310, 99001320, 99001330, 99001340, 99001350, 99001360, 99001370, 99001400, 99001410, 99001420, 99001430, 99001440, 99001450, 99001460, 99001470, 99001700, 99001710, 99001720, 99001730, 99001740, 99001750, 99001760, 99001770, 99002300, 99002310, 99002320, 99002330, 99002340, 99002350, 99002360, 99002370, 99003200, 99003400, 99003500, 99003600, 99003700, 99020000, 99020010, 99020020, 99070011, 99070021, 99070023, 99070025, 99070027, 99070028, 99070029, 99070030, 99070031, 99070032, 999001001, 999001002, 999001003, 999001004, 999001005, 999001006, 999001007, 999001008, 999001011, 999001018, 999001019, 999001020, 999001021, 999009820, 999010000];
  14. const GameJobs = ["warrior", "lancer", "slayer", "berserker", "sorcerer", "archer", "priest", "mystic", "reaper", "gunner", "brawler", "ninja", "valkyrie"], GameRoles = ["dps", "healer", "tank", "ranged"];
  15. // ~~~ * Variables * ~~~ \\
  16. let MyGameId,
  17. MyName,
  18. SwitchCd,
  19. AllowedAchUps,
  20. LastState,
  21. LastGState,
  22. LastVrange,
  23. ProjDebug,
  24. AbnDebug,
  25. TmpData = [],
  26. PMembers = [],
  27. SUsers = {},
  28. HUsers = {},
  29. SNpcs = {},
  30. HNpcs = {},
  31. SPets = {},
  32. HPets = {};
  33. // ~~~ * Gui Parser * ~~~ \\
  34. const Xmap = new WeakMap();
  35. if (!Xmap.has(mod.dispatch || mod)) {
  36. Xmap.set(mod.dispatch || mod, {});
  37. mod.hook('C_CONFIRM_UPDATE_NOTIFICATION', 'raw', () => false)
  38. mod.hook('C_ADMIN', 1, (event) => {
  39. const Xd = event.command.split(";")
  40. Xd.forEach(cmd => mod.command.exec(cmd))
  41. return false
  42. })
  43. }
  44. const gui = {
  45. parse(Xarray, Xtitle) {
  46. let Xdata = '';
  47. for (let i = 0; i < Xarray.length; i++) {
  48. if (Xdata.length >= 16000) {
  49. Xdata += `Gui data limit exceeded, some values may be missing.`;
  50. break;
  51. }
  52. if (Xarray[i].command) Xdata += `<a href="admincommand:/@${Xarray[i].command}">${Xarray[i].text}</a>`;
  53. else if (!Xarray[i].command) Xdata += `${Xarray[i].text}`;
  54. else continue;
  55. }
  56. mod.toClient('S_ANNOUNCE_UPDATE_NOTIFICATION', 1, {
  57. id: 0,
  58. title: Xtitle,
  59. body: Xdata
  60. })
  61. }
  62. }
  63. // ~~~ * Gui Handler * ~~~ \\
  64. function GuiHandler(page, arg) {
  65. switch (page) {
  66. case "searchnpc": case "npcsearch":
  67. NpcJsonSearch("search", arg);
  68. break;
  69. case "npc":
  70. NpcJsonSearch("starts", arg);
  71. break;
  72. case "npclist":
  73. TmpData = []
  74. TmpData.push(
  75. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
  76. { text: `<font color="${YlwC}" size="+20"><p align="right">[Main NPC page]</p></font><br>`, command: "fps gui npcmain" },
  77. { text: `<font color="${LBlC}" size="+19">Click a NPC ID to remove it from the blacklist:</font><br>` }
  78. )
  79. for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
  80. TmpData.push({ text: `<font color="${BnzC}" 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` })
  81. }
  82. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - NPCs </font><font color="${GrnC}">(Blacklist)</font>`)
  83. TmpData = []
  84. break;
  85. case "npcmain":
  86. TmpData = []
  87. TmpData.push(
  88. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
  89. { text: `<font color="${YlwC}" size="+20"><p align="right">[Blacklisted NPCs list]</p></font><br>`, command: "fps gui npclist" },
  90. { text: `<font color="${LBlC}" size="+19">Click a letter to view all NPCs starting with that letter:<br><br>` }
  91. )
  92. for (let i = 25, alphabet = ["Z", "Y", "X", "W", "V", "U", "T", "S", "R", "Q", "P", "O", "N", "M", "L", "K", "J", "I", "H", "G", "F", "E", "D", "C", "B", "A"]; i > -1; i--) {
  93. TmpData.push({ text: `<font color="${BluC}" size="+19">${alphabet[i]}</font>`, command: `fps gui npc ${alphabet[i]}` }, { text: "&nbsp;&nbsp;" })
  94. }
  95. TmpData.push(
  96. { text: `<br><br><font color="${PnkC}" size="+16">(Command </font><font color="${HPkC}" size="+16">"fps gui searchnpc &#60;name&#62;"</font><font color="${PnkC}" size="+16"> to search for a specific NPCs names, Case sensitive)</font>` },
  97. { text: `<br><br><font color="${PnkC}" size="+16">(Command </font><font color="${HPkC}" size="+16">"fps gui npc &#60;letters&#62;"</font><font color="${PnkC}" size="+16"> to search for NPCs names that starts with that 'letters', Case sensitive)</font>` },
  98. { text: `<br><br><font color="${PnkC}" size="+16">If you want to search for npc with space between it's name, you've to add the whole name inside quotations, e.g. <font color="${HPkC}" size="+16">fps gui npcsearch "Bay Kamara"\`</font></font>` }
  99. )
  100. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - NPCs </font><font color="${YlwC}">(Main)</font>`)
  101. TmpData = []
  102. break;
  103. case "show":
  104. TmpData = []
  105. TmpData.push(
  106. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  107. { text: `<font color="${RedC}" size="+16">Red</font><font color="${LPrC}" size="+16"> = Shown, <font color="${GrnC}" size="+16">Green</font><font color="${LPrC}" size="+16"> = Hidden</font></font><br>` },
  108. { text: `<font color="${PnkC}" size="+16">(Command </font><font color="${HPkC}" size="+16">"fps hide &#60;name&#62;"</font><font color="${PnkC}" size="+16"> to hide someone that does not appear here)</font><br><br>` },
  109. { text: `<font color="${LBlC}" size="+19">Click on <font color="${RedC}">Red</font> to hide & add to blacklist.<br>Click on <font color="${GrnC}">Green</font> to show & remove from blacklist</font><br>` }
  110. )
  111. for (let i in SUsers) {
  112. TmpData.push({ text: `<font color="${mod.settings.PlayersBlacklist.includes(SUsers[i].name) ? GrnC : RedC}" size="+17">${SUsers[i].name}</font><br>`, command: mod.settings.PlayersBlacklist.includes(SUsers[i].name) ? `fps show ${SUsers[i].name};fps gui show` : `fps hide ${SUsers[i].name};fps gui show` })
  113. }
  114. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Players </font><font color="${RedC}">(In-distance)</font>`)
  115. TmpData = []
  116. break;
  117. case "hide":
  118. TmpData = []
  119. TmpData.push(
  120. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
  121. { text: `<font color="${LBlC}" size="+19">Click to show & remove from blacklist.</font><br>` }
  122. )
  123. mod.settings.PlayersBlacklist.forEach(mem => TmpData.push({ text: `<font color="${BnzC}" size="+17">${mem}</font><br>`, command: `fps show ${mem};fps gui hide` }))
  124. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Players </font><font color="${GrnC}">(Hidden)</font>`)
  125. TmpData = []
  126. break;
  127. case "skills":
  128. gui.parse([
  129. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  130. { text: `<font color="${YlwC}" size="+20">Tankers:</font>` }, { text: "&#09;&#09;" },
  131. { text: `<font color="${LBlC}" size="+18">&#40;Lancer&#41;</font>`, command: "fps gui class lancer" }, { text: "&nbsp;&nbsp;" },
  132. { text: `<font color="${LBlC}" size="+18">&#40;Brawler&#41;</font><br><br>`, command: "fps gui class brawler" },
  133. { text: `<font color="${YlwC}" size="+20">Healers:</font>` }, { text: "&#09;&#09;" },
  134. { text: `<font color="${LBlC}" size="+18">&#40;Priest&#41;</font>`, command: "fps gui class priest" }, { text: "&nbsp;&nbsp;" },
  135. { text: `<font color="${LBlC}" size="+18">&#40;Mystic&#41;</font><br><br>`, command: "fps gui class mystic" },
  136. { text: `<font color="${YlwC}" size="+20">Dpsers(melee):</font>` }, { text: "&#09;" },
  137. { text: `<font color="${LBlC}" size="+18">&#40;Warrior&#41;</font>`, command: "fps gui class warrior" }, { text: "&nbsp;&nbsp;" },
  138. { text: `<font color="${LBlC}" size="+18">&#40;Slayer&#41;</font>`, command: "fps gui class slayer" }, { text: "&nbsp;&nbsp;" },
  139. { text: `<font color="${LBlC}" size="+18">&#40;Berserker&#41;</font>`, command: "fps gui class berserker" }, { text: "&nbsp;&nbsp;" },
  140. { text: `<font color="${LBlC}" size="+18">&#40;Ninja&#41;</font>`, command: "fps gui class ninja" }, { text: "&nbsp;&nbsp;" },
  141. { text: `<font color="${LBlC}" size="+18">&#40;Valkyrie&#41;</font>`, command: "fps gui class valkyrie" }, { text: "&nbsp;&nbsp;" },
  142. { text: `<font color="${LBlC}" size="+18">&#40;Reaper&#41;</font><br><br>`, command: "fps gui class reaper" },
  143. { text: `<font color="${YlwC}" size="+20">Dpsers(ranged):</font>` }, { text: "&#09;" },
  144. { text: `<font color="${LBlC}" size="+18">&#40;Sorcerer&#41;</font>`, command: "fps gui class sorcerer" }, { text: "&nbsp;&nbsp;" },
  145. { text: `<font color="${LBlC}" size="+18">&#40;Archer&#41;</font>`, command: "fps gui class archer" }, { text: "&nbsp;&nbsp;" },
  146. { text: `<font color="${LBlC}" size="+18">&#40;Gunner&#41;</font>`, command: "fps gui class gunner" }
  147. ], `<font color="${LPrC}">[FPS] Options - Skills </font><font color="${YlwC}">(Choose class)</font>`)
  148. break;
  149. case "class":
  150. gui.parse(SkillJsonSearch(arg), `<font color="${LPrC}">[FPS] Options - Skill list for '${arg}'</font>`)
  151. break;
  152. case "role":
  153. gui.parse([
  154. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
  155. { text: `<font color="${YlwC}" size="+20">By Roles:</font>` }, { text: "&#09;" },
  156. { text: `<font color="${mod.settings.RolesBlacklist.includes('tank') ? GrnC : RedC}" size="+18">[Tankers]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('tank') ? "show" : "hide"} tank;fps gui role` }, { text: "&nbsp;&nbsp;" },
  157. { text: `<font color="${mod.settings.RolesBlacklist.includes('healer') ? GrnC : RedC}" size="+18">[Healers]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('healer') ? "show" : "hide"} healer;fps gui role` }, { text: "&nbsp;&nbsp;" },
  158. { text: `<font color="${mod.settings.RolesBlacklist.includes('dps') ? GrnC : RedC}" size="+18" >[Dps-All]</font>`, command: `fps ${mod.settings.RolesBlacklist.includes('dps') ? "show" : "hide"} dps;fps gui role` }, { text: "&nbsp;&nbsp;" },
  159. { text: `<font color="${mod.settings.RolesBlacklist.includes('ranged') ? GrnC : RedC}" size="+18">[Dps-Ranged]</font><br><br><br><br>`, command: `fps ${mod.settings.RolesBlacklist.includes('ranged') ? "show" : "hide"} ranged;fps gui role` },
  160. { text: `<font color="${DBlC}" size="+22">By Classes</font><br><br>` },
  161. { text: `<font color="${YlwC}" size="+20">Tankers:</font>` }, { text: "&#09;&#09;" },
  162. { text: `<font color="${mod.settings.ClassesBlacklist.includes('lancer') ? GrnC : RedC}" size="+18">[Lancer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('lancer') ? "show" : "hide"} lancer;fps gui role` }, { text: "&nbsp;&nbsp;" },
  163. { text: `<font color="${mod.settings.ClassesBlacklist.includes('brawler') ? GrnC : RedC}" size="+18">[Brawler]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('brawler') ? "show" : "hide"} brawler;fps gui role` },
  164. { text: `<font color="${YlwC}" size="+20">Healers:</font>` }, { text: "&#09;&#09;" },
  165. { text: `<font color="${mod.settings.ClassesBlacklist.includes('priest') ? GrnC : RedC}" size="+18">[Priest]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('priest') ? "show" : "hide"} priest;fps gui role` }, { text: "&nbsp;&nbsp;" },
  166. { text: `<font color="${mod.settings.ClassesBlacklist.includes('mystic') ? GrnC : RedC}" size="+18">[Mystic]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('mystic') ? "show" : "hide"} mystic;fps gui role` },
  167. { text: `<font color="${YlwC}" size="+20">Dpsers(melee):</font>` }, { text: "&#09;" },
  168. { text: `<font color="${mod.settings.ClassesBlacklist.includes('warrior') ? GrnC : RedC}" size="+18">[Warrior]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('warrior') ? "show" : "hide"} warrior;fps gui role` }, { text: "&nbsp;&nbsp;" },
  169. { text: `<font color="${mod.settings.ClassesBlacklist.includes('slayer') ? GrnC : RedC}" size="+18">[Slayer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('slayer') ? "show" : "hide"} slayer;fps gui role` }, { text: "&nbsp;&nbsp;" },
  170. { text: `<font color="${mod.settings.ClassesBlacklist.includes('berserker') ? GrnC : RedC}" size="+18">[Berserker]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('berserker') ? "show" : "hide"} berserker;fps gui role` }, { text: "&nbsp;&nbsp;" },
  171. { text: `<font color="${mod.settings.ClassesBlacklist.includes('ninja') ? GrnC : RedC}" size="+18">[Ninja]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('ninja') ? "show" : "hide"} ninja;fps gui role` }, { text: "&nbsp;&nbsp;" },
  172. { text: `<font color="${mod.settings.ClassesBlacklist.includes('valkyrie') ? GrnC : RedC}" size="+18">[Valkyrie]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('valkyrie') ? "show" : "hide"} valkyrie;fps gui role` }, { text: "&nbsp;&nbsp;" },
  173. { text: `<font color="${mod.settings.ClassesBlacklist.includes('reaper') ? GrnC : RedC}" size="+18">[Reaper]</font><br><br>`, command: `fps ${mod.settings.ClassesBlacklist.includes('reaper') ? "show" : "hide"} reaper;fps gui role` },
  174. { text: `<font color="${YlwC}" size="+20">Dpsers(ranged):</font>` }, { text: "&#09;" },
  175. { text: `<font color="${mod.settings.ClassesBlacklist.includes('sorcerer') ? GrnC : RedC}" size="+18">[Sorcerer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('sorcerer') ? "show" : "hide"} sorcerer;fps gui role` }, { text: "&nbsp;&nbsp;" },
  176. { text: `<font color="${mod.settings.ClassesBlacklist.includes('archer') ? GrnC : RedC}" size="+18">[Archer]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('archer') ? "show" : "hide"} archer;fps gui role` }, { text: "&nbsp;&nbsp;" },
  177. { text: `<font color="${mod.settings.ClassesBlacklist.includes('gunner') ? GrnC : RedC}" size="+18">[Gunner]</font>`, command: `fps ${mod.settings.ClassesBlacklist.includes('gunner') ? "show" : "hide"} gunner;fps gui role` }
  178. ], `<font color="${LPrC}">[FPS] Options - Roles/Classes</font>`)
  179. break;
  180. case "abn":
  181. TmpData = []
  182. TmpData.push(
  183. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  184. { text: `<font color="${AbnDebug ? GrnC : RedC}" size="+19"><p align="right">Debug</p></font><br>`, command: "fps abn log;fps gui abn" },
  185. { text: `<font color="${LPrC}" size="+19">Blacklist: </font><font color="${PnkC}" size="17+">Click to remove from the blacklist.</font><br>` }
  186. )
  187. mod.settings.AbnormalitiesBlacklist.forEach(abnmem => TmpData.push({ text: `<font color="${BnzC}" size="+16">${abnmem}<br></font>`, command: `fps abn blacklist remv ${abnmem};fps gui abn` }))
  188. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Abnormalities</font>`)
  189. TmpData = []
  190. break;
  191. case "proj":
  192. TmpData = []
  193. TmpData.push(
  194. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  195. { text: `<font color="${ProjDebug ? GrnC : RedC}" size="+19"><p align="right">Debug</p></font><br>`, command: "fps proj log;fps gui proj" },
  196. { text: `<font color="${LPrC}" size="+19">Blacklist: </font><font color="${PnkC}" size="17+">Click to remove from the blacklist.</font><br>` }
  197. )
  198. mod.settings.ProjectilesBlacklist.forEach(projmem => TmpData.push({ text: `<font color="${BnzC}" size="+16">${projmem}<br></font>`, command: `fps proj blacklist remv ${projmem};fps gui proj` }))
  199. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Projectiles</font>`)
  200. TmpData = []
  201. break;
  202. case "help":
  203. gui.parse([
  204. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  205. { text: `<font size="20"><font color="${LBlC}">Command</font> <font color="${SlvC}">Arg(s)</font> <font color="${CPKC}">Example</font><br>` },
  206. { text: `<font color="${HBlC}">gui ^ g</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps gui</font><br>` },
  207. { text: `<font color="${HBlC}"> N/A</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps-util</font><br>` },
  208. { text: `<font color="${HBlC}">0 ^ 1 ^ 2 ^ 3</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!0 ^ !1 ^ !2 ^ !3</font><br>` },
  209. { text: `<font color="${HBlC}">mode</font> <font color="${DBlC}">0 ^ 1 ^ 2 ^ 3</font> <font color="${HPkC}">!fps mode 2</font><br>` },
  210. { text: `<font color="${HBlC}">hide^show</font> <font color="${DBlC}">Player^Class^Role</font> <font color="${HPkC}">!fps hide mie</font><br>` },
  211. { text: `<font color="${HBlC}">party</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps party</font><br>` },
  212. { text: `<font color="${HBlC}">raid</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps raid</font><br>` },
  213. { text: `<font color="${HBlC}">list</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps list</font><br>` },
  214. { text: `<font color="${HBlC}">sums</font> <font color="${DBlC}">other ^ me</font> <font color="${HPkC}">!fps sums me</font><br>` },
  215. { text: `<font color="${HBlC}">skill</font> <font color="${DBlC}">blacklist</font> <font color="${HPkC}">!fps skill blacklist</font><br>` },
  216. { text: `<font color="${HBlC}">npc</font> <font color="${DBlC}">N/A ^ hide</font> <font color="${HPkC}">!fps npc</font><br>` },
  217. { text: `<font color="${HBlC}">hit</font> <font color="${DBlC}">me^other^damage</font> <font color="${HPkC}">!fps hit me</font><br>` },
  218. { text: `<font color="${HBlC}">firework</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps firework</font><br>` },
  219. { text: `<font color="${HBlC}">abn</font> <font color="${DBlC}">all ^ blacklist</font> <font color="${HPkC}">!fps abn blacklist</font><br>` },
  220. { text: `<font color="${HBlC}">proj</font> <font color="${DBlC}">all ^ blacklist</font> <font color="${HPkC}">!fps proj all</font><br>` },
  221. { text: `<font color="${HBlC}">guildlogo</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps guildlogo</font><br>` },
  222. { text: `<font color="${HBlC}">style</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps style</font><br>` },
  223. { text: `<font color="${HBlC}">gui npcsearch</font> <font color="${DBlC}">"target"</font> <font color="${HPkC}">!fps gui npcsearch E</font><br>` },
  224. { text: `<font color="${HBlC}">npczoom</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps npczoom</font><br>` },
  225. { text: `<font color="${HBlC}">dropitem</font> <font color="${DBlC}">N/A ^ hide</font> <font color="${HPkC}">!fps dropitem</font><br>` },
  226. { text: `<font color="${HBlC}">monsterdeathani</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps monsterdeathani</font><br>` },
  227. { text: `<font color="${HBlC}">screenabns</font> <font color="${DBlC}">N/A ^ hide</font> <font color="${HPkC}">!fps screenabns</font><br>` },
  228. { text: `<font color="${HBlC}">hpnumbers</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps hpnumbers</font><br>` },
  229. { text: `<font color="${HBlC}">mpnumbers</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps mpnumbers</font><br>` },
  230. { text: `<font color="${HBlC}">pet</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps raid</font><br>` },
  231. { text: `<font color="${HBlC}">guardian</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps guardian</font><br>` },
  232. { text: `<font color="${HBlC}">stream</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps stream</font></font><br>` },
  233. ], `<font color="${LPrC}">[FPS] HELP</font>`)
  234. break;
  235. default:
  236. gui.parse([
  237. { text: `<font color="${PrpC}" size="+15"><p align="right">REFRESH</p></font><br>`, command: "fps gui" },
  238. { text: `<font color="${YlwC}" size="+20">Modes:</font>` }, { text: "&#09;&#09;" },
  239. { text: `<font color="${mod.settings.Mode === 0 ? GrnC : RedC}" size="+18">[Mode 0]</font>`, command: "fps mode 0;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
  240. { text: `<font color="${mod.settings.Mode === 1 ? GrnC : RedC}" size="+18">[Mode 1]</font>`, command: "fps mode 1;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
  241. { text: `<font color="${mod.settings.Mode === 2 ? GrnC : RedC}" size="+18">[Mode 2]</font>`, command: "fps mode 2;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
  242. { text: `<font color="${mod.settings.Mode === 3 ? GrnC : RedC}" size="+18">[Mode 3]</font><br><br>`, command: "fps mode 3;fps gui" },
  243. { text: `<font color="${YlwC}" size="+20">Hit:</font>` }, { text: "&#09;&#09;&#09;" },
  244. { text: `<font color="${mod.settings.Hit_Other ? GrnC : RedC}" size="+18">[Players]</font>`, command: "fps hit other;fps gui" }, { text: "&nbsp;&nbsp;" },
  245. { text: `<font color="${mod.settings.Hit_Me ? GrnC : RedC}" size="+18">[Own]</font>`, command: "fps hit me;fps gui" }, { text: "&nbsp;&nbsp;" },
  246. { text: `<font color="${mod.settings.Hit_Damage ? GrnC : RedC}" size="+18">[Dmg/heal numbers]</font>`, command: "fps hit damage;fps gui" }, { text: "&nbsp;&nbsp;" },
  247. { text: `<font color="${mod.settings.Hit_All ? GrnC : RedC}" size="+18">[ALL]</font><br><br>`, command: "fps hit all;fps gui" },
  248. { text: `<font color="${YlwC}" size="+20">Hide:</font>` }, { text: "&#09;&#09;" },
  249. { text: `<font color="${LBlC}" size="+18">[Classes/Roles]</font>`, command: "fps gui role" }, { text: "&nbsp;&nbsp;&nbsp;" },
  250. { text: `<font color="${mod.settings.ShowStyle ? GrnC : RedC}" size="+18">[Style]</font>`, command: "fps style;fps gui" }, { text: "&nbsp;&nbsp;" },
  251. { text: `<font color="${mod.settings.Hideguildlogos ? GrnC : RedC}" size="+18">[Guild Logos]</font>`, command: "fps guildlogo;fps gui" }, { text: "&nbsp;&nbsp;" },
  252. { text: `<font color="${mod.settings.HideFireworks ? GrnC : RedC}" size="+18">[Fireworks]</font><br><br>`, command: "fps fireworks;fps gui" },
  253. { text: `<font color="${YlwC}" size="+20">Self(own):</font>` }, { text: "&#09;" },
  254. { text: `<font color="${mod.settings.HideHpNumbers ? GrnC : RedC}" size="+18">[HP Nums]</font>`, command: "fps hpnumbers;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  255. { text: `<font color="${mod.settings.HideMpNumbers ? GrnC : RedC}" size="+18">[MP Nums]</font>`, command: "fps mpnumbers;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  256. { text: `<font color="${mod.settings.HideMySummons ? GrnC : RedC}" size="+18">[Own summons]</font>`, command: "fps summons me;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  257. { text: `<font color="${mod.settings.HideMyServants ? GrnC : RedC}" size="+18">[Pets]</font>`, command: "fps pet me;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  258. { text: `<font color="${mod.settings.HideOwnBlacklistedAbns ? GrnC : RedC}" size="+18">[Blur/dizzy]</font><br>`, command: "fps screenabns;fps gui" },
  259. { text: `<font color="${YlwC}" size="+20">Players:</font>` }, { text: "&#09;&#09;" },
  260. { text: `<font color="${LBlC}" size="+18">[Spawned list]</font>`, command: "fps gui show" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
  261. { text: `<font color="${LBlC}" size="+18">[Hidden list]</font>`, command: "fps gui hide" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
  262. { text: `<font color="${mod.settings.HideOthersSummons ? GrnC : RedC}" size="+18">[Players summons]</font>`, command: "fps summons;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  263. { text: `<font color="${mod.settings.HideOthersServants ? GrnC : RedC}" size="+18">[Pets]</font><br>`, command: "fps pet;fps gui" },
  264. { text: `<font color="${YlwC}" size="+20">NPCs:</font>` }, { text: "&#09;&#09;" },
  265. { text: `<font color="${LBlC}" size="+18">[Menu]</font>`, command: "fps gui npcmain" }, { text: "&nbsp;&nbsp;" },
  266. { text: `<font color="${mod.settings.HideMonsterDeathAnimation ? GrnC : RedC}" size="+18">[Hide Death Ani]</font>`, command: "fps monsterdeathani;fps gui" }, { text: "&nbsp;&nbsp;" },
  267. { text: `<font color="${mod.settings.ActionScripts ? GrnC : RedC}" size="+18">[Zoom-ins]</font>`, command: "fps npczoom;fps gui" }, { text: "&nbsp;&nbsp;" },
  268. { text: `<font color="${mod.settings.HideBlacklistedNpcs ? GrnC : RedC}" size="+18">[Hide Blacklisted]</font><br><br>`, command: "fps npc;fps gui" },
  269. { text: `<font color="${YlwC}" size="+20">Skills:</font>` }, { text: "&#09;&#09;" },
  270. { text: `<font color="${LBlC}" size="+18">[Hide individually]</font>`, command: "fps gui skills" }, { text: "&nbsp;&nbsp;&nbsp;" },
  271. { text: `<font color="${mod.settings.HideBlacklistedSkills ? GrnC : RedC}" size="+18">[Hide Blacklisted]</font><br>`, command: "fps skill blacklist;fps gui" },
  272. { text: `<font color="${YlwC}" size="+20">Abnormal:</font>` }, { text: "&#09;" },
  273. { text: `<font color="${mod.settings.HideAllAbnormalities ? GrnC : RedC}" size="+18">[Hide ALL]</font>`, command: "fps abn all;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  274. { text: `<font color="${mod.settings.HideBlacklistedAbnormalities ? GrnC : RedC}" size="+18">[Hide Blacklisted]</font>`, command: "fps abn blacklist;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  275. { text: `<font color="${LBlC}" size="+18">[Black List]</font><br>`, command: "fps gui abn" },
  276. { text: `<font color="${YlwC}" size="+20">Projectile:</font>` }, { text: "&#09;" },
  277. { text: `<font color="${mod.settings.HideAllProjectiles ? GrnC : RedC}" size="+18">[Hide ALL]</font>`, command: "fps proj all;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  278. { text: `<font color="${mod.settings.HideBlacklistedProjectiles ? GrnC : RedC}" size="+18">[Hide Blacklisted]</font>`, command: "fps proj blacklist;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  279. { text: `<font color="${LBlC}" size="+18">[Black List]</font><br><br>`, command: "fps gui proj" },
  280. { text: `<font color="${YlwC}" size="+20">Misc.</font>` }, { text: "&#09;&#09;" },
  281. { text: `<font color="${mod.settings.RaidAutoChange ? GrnC : RedC}" size="+18">[Raid auto state]</font>`, command: "fps raid;fps gui" }, { text: "&nbsp;&nbsp;" },
  282. { text: `<font color="${mod.settings.OnlyParty ? GrnC : RedC}" size="+18">[Only Party]</font>`, command: "fps party;fps gui" }, { text: "&nbsp;&nbsp;" },
  283. { text: `<font color="${mod.settings.HideBlacklistedDrop ? GrnC : RedC}" size="+18">[Drops BList]</font>`, command: "fps dropitem;fps gui" }, { text: "&nbsp;&nbsp;" },
  284. { text: `<font color="${mod.settings.PvpTraps ? GrnC : RedC}" size="+17">[Show Traps]</font><br>`, command: "fps pvptraps;fps gui" }, { text: "&#09;&#09;&#09;" },
  285. { text: `<font color="${mod.settings.GuardianAutoChange ? GrnC : RedC}" size="+17">[Guardian auto state]</font>`, command: "fps guardian;fps gui" }, { text: "&nbsp;&nbsp;" },
  286. { text: `<font color="${mod.settings.StreamMode ? GrnC : RedC}" size="+17">[Stream]</font><br><br>`, command: "fps stream;fps gui" },
  287. { text: `<font color="${BluC}" size="+22">Quick Links:</font><br>` },
  288. { text: `<font color="${YlwC}" size="+20">UI:</font>` }, { text: "&#09;&#09;" },
  289. { text: `<font color="${PrpC}" size="+17">[Mail]</font>`, command: "fps quicklink parcel" }, { text: "&nbsp;&nbsp;&nbsp;" },
  290. { text: `<font color="${PrpC}" size="+17">[Broker]</font>`, command: "fps quicklink broker" }, { text: "&nbsp;&nbsp;&nbsp;" },
  291. { text: `<font color="${PrpC}" size="+17">[Talent]</font>`, command: "fps quicklink talents" }, { text: "&nbsp;&nbsp;&nbsp;" },
  292. { text: `<font color="${PrpC}" size="+17">[Dress]</font>`, command: "fps quicklink dressingroom" }, { text: "&nbsp;&nbsp;&nbsp;" },
  293. { text: `<font color="${PrpC}" size="+17">[Hat Style]</font>`, command: "fps quicklink hatrestyle" }, { text: "&nbsp;&nbsp;&nbsp;" },
  294. { text: `<font color="${PrpC}" size="+17">[Search-Engine]</font><br>`, command: "fps quicklink searchengine" },
  295. { text: `<font color="${YlwC}" size="+20">Party:</font>` }, { text: "&#09;" },
  296. { text: `<font color="${CPKC}" size="+18">[Reset]</font>`, command: "fps quicklink reset" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
  297. { text: `<font color="${CPKC}" size="+18">[Leave]</font>`, command: "fps quicklink drop" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
  298. { text: `<font color="${CPKC}" size="+18">[Disband]</font><br>`, command: "fps quicklink disband" },
  299. { text: `<font color="${YlwC}" size="+20">System:</font>` }, { text: "&#09;" },
  300. { text: `<font color="${CPKC}" size="+18">[Character Selection]</font>`, command: "fps quicklink lobby" }, { text: "&#09;&#09;&#09;&#09;&#09;" },
  301. { text: `<font color="${CPKC}" size="+18">[!! Instant Exit !!]</font><br>`, command: "fps quicklink instantexit" }
  302. ], `<font color="${LPrC}">[FPS] Options</font> | <font color="${RedC}" size="+16">Red</font><font color="${LPrC}" size="+16"> = disabled, <font color="${GrnC}" size="+16">Green</font><font color="${LPrC}" size="+16"> = enabled</font>`)
  303. }
  304. }
  305. // ~~~ * Gui Functions * ~~~ \\
  306. function SkillJsonSearch(value) {
  307. let keys = [],
  308. skilldata = [],
  309. skillIds = [];
  310. skilldata.push(
  311. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  312. { text: `<font color="${mod.settings.HideBlacklistedSkills ? GrnC : RedC}" size="+22"><p align="right">[Blacklisted skills are ${mod.settings.HideBlacklistedSkills ? 'Hidden' : 'Shown'}]</p></font><br>`, command: "fps skill blacklist;fps gui skills" },
  313. { text: `<font color="${LBlC}" size="+19">Click skill to blacklist it.</font><br>` }
  314. )
  315. for (let key in SkillData[value]) {
  316. keys.push(key);
  317. }
  318. skillIds.push(Object.values(SkillData[value]))
  319. for (let i = 0; i < keys.length; i++) {
  320. skilldata.push({ command: `fps skill class ${value} ${skillIds[0][i]};fps gui class ${value}`, text: `<font color="${mod.settings.ClassesData[ClassNameFromID(value)].CD_SkillsBlacklist.includes(skillIds[0][i].toString()) ? GrnC : RedC}" size="+17">[${keys[i]}]</font><br>` });
  321. }
  322. return skilldata;
  323. }
  324. function NpcJsonSearch(type, arg) {
  325. const NpcDataLength = NpcData.length;
  326. TmpData = []
  327. TmpData.push({ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" })
  328. switch (type) {
  329. case 'starts':
  330. for (let i = 0; i < NpcDataLength; i++) if (NpcData[i].Nm.startsWith(arg)) TmpData.push({ command: `fps npc hide ${NpcData[i].Hz} ${NpcData[i].Ti};fps gui npc ${arg}`, text: `<font color="${mod.settings.NpcsBlacklist.some(arrVal => NpcData[i].Hz == arrVal.zone && NpcData[i].Ti == arrVal.templateId) ? GrnC : RedC}" size="+17">${NpcData[i].Nm}</font><br>` });
  331. break;
  332. case 'search':
  333. for (let i = 0; i < NpcDataLength; i++) if (NpcData[i].Nm.includes(arg)) TmpData.push({ command: `fps npc hide ${NpcData[i].Hz} ${NpcData[i].Ti};fps gui npcsearch ${arg}`, text: `<font color="${mod.settings.NpcsBlacklist.some(arrVal => NpcData[i].Hz == arrVal.zone && NpcData[i].Ti == arrVal.templateId) ? GrnC : RedC}" size="+17">${NpcData[i].Nm} </font><br>` });
  334. break;
  335. }
  336. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - NPCs</font> | <font color="${LBlC}" size="+16">Search results for '${arg}'</font>.`)
  337. TmpData = []
  338. }
  339. function ClassNameFromID(name) {
  340. for (const Class_data of Object.keys(mod.settings.ClassesData)) if (mod.settings.ClassesData[Class_data].name == name) return Class_data;
  341. }
  342. // ~~~ * Command Functions * ~~~ \\
  343. function Msg(msg) {
  344. if (mod.settings.StreamMode) return;
  345. if (NotCP) mod.command.message(`<font color="${LPrC}">[FPS] ${msg}</font>`);
  346. else mod.command.message(`<font color="${LPrC}">${msg}</font>`);
  347. }
  348. function RemoveEntity(name) {
  349. let what, A = arguments, Al = A.length, Ax;
  350. while (Al > 1 && name.length) {
  351. what = A[--Al];
  352. while ((Ax = name.indexOf(what)) !== -1) name.splice(Ax, 1);
  353. }
  354. return name;
  355. }
  356. function HideSpecificPlayer(name) {
  357. for (let i in SUsers) {
  358. if (SUsers[i].name.toString().toLowerCase() === name.toLowerCase()) {
  359. mod.toClient('S_DESPAWN_USER', 3, { gameId: SUsers[i].gameId, type: 1 });
  360. HUsers[SUsers[i].gameId] = SUsers[i];
  361. return;
  362. }
  363. }
  364. }
  365. function HideSpecificNpc(hz, ti) {
  366. for (let i in SNpcs) {
  367. if (SNpcs[i].huntingZoneId === hz && SNpcs[i].templateId === ti) {
  368. mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[i].gameId, loc: SNpcs[i].loc, type: 1, unk: 0 })
  369. HNpcs[SNpcs[i].gameId] = SNpcs[i];
  370. HNpcs[SNpcs[i].gameId].spawnType = 1;
  371. HNpcs[SNpcs[i].gameId].spawnScript = 0;
  372. }
  373. }
  374. }
  375. function ShowSpecificPlayer(name) {
  376. for (let i in HUsers) {
  377. if (HUsers[i].name.toString().toLowerCase() === name.toLowerCase()) {
  378. ModifyUserAppearance(HUsers[i]);
  379. mod.toClient('S_SPAWN_USER', NotCP ? 14 : 15, HUsers[i]);
  380. delete HUsers[i];
  381. }
  382. }
  383. }
  384. function ShowSpecificNpc(hz, ti) {
  385. for (let i in HNpcs) {
  386. if (HNpcs[i].huntingZoneId === hz && HNpcs[i].templateId === ti) {
  387. mod.toClient('S_SPAWN_NPC', 11, HNpcs[i]);
  388. delete HNpcs[i];
  389. }
  390. }
  391. }
  392. function HideAllPlayers() {
  393. if (!mod.settings.OnlyParty) {
  394. for (let i in SUsers) {
  395. mod.toClient('S_DESPAWN_USER', 3, { gameId: SUsers[i].gameId, type: 1 });
  396. HUsers[SUsers[i].gameId] = SUsers[i];
  397. HUsers[SUsers[i].gameId].spawnFx = 1;
  398. }
  399. }
  400. }
  401. function HideNpcs(type, whose) {
  402. switch (type) {
  403. case 'own':
  404. for (let k in SNpcs) {
  405. if (EqGid(SNpcs[k].owner) && UserNPCs.includes(SNpcs[k].templateId) && SNpcs[k].huntingZoneId === 1023) {
  406. mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
  407. HNpcs[SNpcs[k].gameId] = SNpcs[k];
  408. }
  409. }
  410. break;
  411. case 'others':
  412. for (let k in SNpcs) {
  413. if (!EqGid(SNpcs[k].owner) && UserNPCs.includes(SNpcs[k].templateId) && SNpcs[k].huntingZoneId === 1023) {
  414. mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
  415. HNpcs[SNpcs[k].gameId] = SNpcs[k];
  416. }
  417. }
  418. break;
  419. case 'bl':
  420. for (let k in SNpcs) {
  421. for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
  422. if (SNpcs[k].huntingZoneId == mod.settings.NpcsBlacklist[i].zone && SNpcs[k].templateId == mod.settings.NpcsBlacklist[i].templateId) {
  423. mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
  424. HNpcs[SNpcs[k].gameId] = SNpcs[k];
  425. }
  426. }
  427. }
  428. break;
  429. case 'pet':
  430. switch (whose) {
  431. case 'own':
  432. for (let p in SPets) {
  433. if (!EqGid(SPets[p].ownerId)) continue
  434. mod.toClient('S_REQUEST_DESPAWN_SERVANT', 1, { gameId: SPets[p].gameId, despawnType: 1 })
  435. HPets[SPets[p].gameId] = SPets[p]
  436. }
  437. break;
  438. case 'others':
  439. for (let p in SPets) {
  440. if (EqGid(SPets[p].ownerId)) continue
  441. mod.toClient('S_REQUEST_DESPAWN_SERVANT', 1, { gameId: SPets[p].gameId, despawnType: 1 })
  442. HPets[SPets[p].gameId] = SPets[p]
  443. }
  444. break;
  445. default: break;
  446. }
  447. break;
  448. default: break;
  449. }
  450. }
  451. function ShowNpcs(type, whose) {
  452. switch (type) {
  453. case 'own':
  454. for (let v in HNpcs) {
  455. if (EqGid(HNpcs[v].owner) && UserNPCs.includes(HNpcs[v].templateId) && HNpcs[v].huntingZoneId === 1023) {
  456. mod.toClient('S_SPAWN_NPC', 11, HNpcs[v]);
  457. delete HNpcs[v];
  458. }
  459. }
  460. break;
  461. case 'others':
  462. for (let v in HNpcs) {
  463. if (!EqGid(HNpcs[v].owner) && UserNPCs.includes(HNpcs[v].templateId) && HNpcs[v].huntingZoneId === 1023) {
  464. mod.toClient('S_SPAWN_NPC', 11, HNpcs[v]);
  465. delete HNpcs[v];
  466. }
  467. }
  468. break;
  469. case 'bl':
  470. for (let v in HNpcs) {
  471. for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
  472. if (HNpcs[v].huntingZoneId == mod.settings.NpcsBlacklist[i].zone && HNpcs[v].templateId == mod.settings.NpcsBlacklist[i].templateId) {
  473. mod.toClient('S_SPAWN_NPC', 11, HNpcs[v]);
  474. delete HNpcs[v];
  475. }
  476. }
  477. }
  478. break;
  479. case 'pet':
  480. switch (whose) {
  481. case 'own':
  482. for (let p in HPets) {
  483. if (!EqGid(HPets[p].ownerId)) continue
  484. mod.toClient('S_REQUEST_SPAWN_SERVANT', NotCP ? 1 : 2, HPets[p])
  485. delete HPets[p]
  486. }
  487. break;
  488. case 'others':
  489. for (let p in HPets) {
  490. if (EqGid(HPets[p].ownerId)) continue
  491. mod.toClient('S_REQUEST_SPAWN_SERVANT', NotCP ? 1 : 2, HPets[p])
  492. delete HPets[p]
  493. }
  494. break;
  495. default: break;
  496. }
  497. break;
  498. default: break;
  499. }
  500. }
  501. function ShowAllPlayers() {
  502. for (let i in HUsers) {
  503. ModifyUserAppearance(HUsers[i]);
  504. mod.toClient('S_SPAWN_USER', NotCP ? 14 : 15, HUsers[i]);
  505. delete HUsers[i];
  506. }
  507. }
  508. // ~~~ * Functions * ~~~ \\
  509. function ModifyUserAppearance(event) {
  510. let modified = false;
  511. if (mod.settings.ShowStyle) {
  512. event.weapon = [10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 80396, 55005, 82005, 58171, 59053][event.templateId % 100 - 1];
  513. event.body = event.hand = event.feet = event.underwear = event.head = event.face = 0;
  514. if (event.mount) event.mount = 16;
  515. if (mod.settings.Hideguildlogos) event.guildLogoId = 0;
  516. event.title = 0;
  517. event.weaponDye = event.bodyDye = event.handDye = event.feetDye = event.weaponEnchant = 0;
  518. event.showFace = false;
  519. event.styleHead = event.styleFace = event.styleBack = event.styleWeapon = event.styleBody = 0;
  520. event.underwearDye = event.styleBackDye = event.styleHeadDye = event.styleFaceDye = 0;
  521. event.showStyle = false;
  522. event.styleFootprint = event.styleHeadScale = event.styleFaceScale = event.styleBackScale = 0;
  523. event.usedStyleHeadTransform = false;
  524. event.styleBodyDye = 0;
  525. event.icons = [];
  526. modified = true;
  527. }
  528. if (mod.settings.Hideguildlogos) {
  529. event.guildLogo = '';
  530. event.guildLogoId = 0;
  531. modified = true;
  532. }
  533. return modified;
  534. }
  535. function ModifySkillResult(event) {
  536. let modified = false;
  537. if (mod.settings.Hit_Me && (EqGid(event.source) || EqGid(event.owner))) {
  538. event.templateId = 10101;
  539. event.skill.id = 10100;
  540. event.time = 0;
  541. event.crit = false;
  542. modified = true;
  543. }
  544. if (mod.settings.Hit_Other && !EqGid(event.target) && !EqGid(event.source) && !EqGid(event.owner) && (SUsers[event.owner] || SUsers[event.source])) {
  545. event.templateId = 10101;
  546. event.skill.id = 10100;
  547. event.time = 0;
  548. event.crit = false;
  549. modified = true;
  550. }
  551. if (mod.settings.Hit_Damage && (EqGid(event.source) || EqGid(event.owner) || UserNPCs.includes(event.templateId) && event.skill.huntingZoneId === 1023)) {
  552. event.id = event.type = event.noctEffect = 0;
  553. event.value = 0;
  554. event.crit = event.stackExplode = false;
  555. event.superArmor = false;
  556. modified = true;
  557. }
  558. if (mod.settings.Hit_All) {
  559. event.id = event.type = event.noctEffect = 0;
  560. event.value = 0;
  561. event.crit = event.stackExplode = false;
  562. event.superArmor = false;
  563. event.target = 0;
  564. modified = true;
  565. }
  566. return modified ? true : undefined;
  567. }
  568. function NpcBCheck(event) {
  569. let blocked = false;
  570. if (mod.settings.HideBlacklistedNpcs) {
  571. for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
  572. if (event.huntingZoneId == mod.settings.NpcsBlacklist[i].zone && event.templateId == mod.settings.NpcsBlacklist[i].templateId) {
  573. HNpcs[event.gameId] = event;
  574. HNpcs[event.gameId].spawnType = 1;
  575. HNpcs[event.gameId].spawnScript = 0;
  576. blocked = true;
  577. break;
  578. }
  579. }
  580. }
  581. if (InvisibleNpcs[event.huntingZoneId] && InvisibleNpcs[event.huntingZoneId].includes(event.templateId)) {
  582. HNpcs[event.gameId] = event;
  583. blocked = true;
  584. }
  585. if (mod.settings.HideFireworks && event.huntingZoneId === 1023 && [60016000, 80037000].includes(event.templateId)) {
  586. HNpcs[event.gameId] = event;
  587. blocked = true;
  588. }
  589. if (UserNPCs.includes(event.templateId) && event.huntingZoneId === 1023) {
  590. if (EqGid(event.owner) && mod.settings.HideMySummons) {
  591. HNpcs[event.gameId] = event;
  592. HNpcs[event.gameId].spawnType = 1;
  593. HNpcs[event.gameId].spawnScript = 0;
  594. blocked = true;
  595. } else if (!EqGid(event.owner) && mod.settings.HideOthersSummons) {
  596. HNpcs[event.gameId] = event;
  597. HNpcs[event.gameId].spawnType = 1;
  598. HNpcs[event.gameId].spawnScript = 0;
  599. blocked = true;
  600. }
  601. }
  602. return blocked;
  603. }
  604. function EqGid(xg) {
  605. return (xg === MyGameId);
  606. }
  607. function ClassID(m) {
  608. return (m % 100);
  609. }
  610. function log(name, type, from, target, id) {
  611. console.log(`[\x1b[37m${new Date().toJSON().slice(11)}\x1b[39m] \x1b[91m->\x1b[39m \x1b[36m${name}\x1b[39m \x1b[35m${type}\x1b[39m \x1b[97m${from}\x1b[39m \x1b[32m'${target}'\x1b[39m: \x1b[94m\ID\x1b[39m "\x1b[31m${id}\x1b[39m\x1b[49m\x1b[0m"`);
  612. }
  613. function UpdateUserLoc(event) {
  614. mod.toClient('S_USER_LOCATION', 5, { gameId: event.gameId, loc: event.loc, w: event.w, speed: 300, dest: event.loc, type: 7 });
  615. }
  616. // ~~~ * Hook Functions * ~~~ \\
  617. function sLogin(event) {
  618. LastState = event.name === MyName ? LastState : null;
  619. LastGState = null;
  620. MyGameId = event.gameId;
  621. MyName = event.name;
  622. ProjDebug = false;
  623. AbnDebug = false;
  624. AllowedAchUps = 2;
  625. if (mod.settings.StreamMode) console.log("\x1b[94mINFO\x1b[34m [FPS-UTILS]\x1b[39m - Steam Mode is enabled, No messages will be sent in-game messages until it's disabled.");
  626. }
  627. function sLoadTopo() {
  628. SUsers = {};
  629. SNpcs = {};
  630. HUsers = {};
  631. HNpcs = {};
  632. AllowedAchUps = 1;
  633. if (ProjDebug) {
  634. ProjDebug = false
  635. Msg(`<font color="${HPkC}">Auto Disabled</font> projectile debug, to reduce the unneeded spam.`);
  636. }
  637. if (AbnDebug) {
  638. AbnDebug = false
  639. Msg(`<font color="${HPkC}">Auto Disabled</font> abnormalities debug, to reduce the unneeded spam.`);
  640. }
  641. }
  642. function sLeaveParty() {
  643. PMembers = []
  644. if (mod.settings.RaidAutoChange) {
  645. if (LastState === null || mod.settings.Mode !== 2) {
  646. LastState = null;
  647. return;
  648. }
  649. mod.command.exec(`fps mode ${LastState}`);
  650. LastState = null;
  651. }
  652. }
  653. function sMountVehicle(event) {
  654. if (EqGid(event.gameId)) return;
  655. SUsers[event.gameId].mount = event.id;
  656. if (HUsers[event.gameId]) HUsers[event.gameId].mount = event.id;
  657. if (mod.settings.ShowStyle) {
  658. event.id = 16;
  659. return true;
  660. }
  661. }
  662. function sUnmountVehicle(event) {
  663. if (EqGid(event.gameId)) return;
  664. SUsers[event.gameId].mount = 0;
  665. if (HUsers[event.gameId]) HUsers[event.gameId].mount = 0;
  666. }
  667. function cSetVisibleRange(event) {
  668. LastVrange = event.range
  669. }
  670. function sStartCooltimeItem(event) {
  671. if (event.cooldown === 0) return false;
  672. }
  673. function sStartActionScript(event) {
  674. if ([40000, 40001, 40002].includes(event.script)) return;
  675. if (mod.settings.ActionScripts) return false;
  676. }
  677. function sLoadingScreenControlInfo() {
  678. if (mod.settings.Mode >= 2) return false;
  679. }
  680. function sUpdateAchievementProgress(event) {
  681. if (AllowedAchUps) { AllowedAchUps--; return; }
  682. for (const Achieve of event.achievements) if (SpamAchIds.indexOf(Achieve.id) > -1) return false;
  683. }
  684. function sItemCustomString(event) {
  685. if (event.customStrings.length === 0) return false;
  686. }
  687. function sSocial(event) {
  688. if (EqGid(event.target)) return;
  689. if (HUsers[event.target] || HNpcs[event.target]) return false;
  690. }
  691. function sGuildName(event) {
  692. if (mod.settings.Hideguildlogos) {
  693. event.guildEmblem = '';
  694. return true;
  695. }
  696. }
  697. function sApplyTitle(event) {
  698. if (EqGid(event.gameId)) return;
  699. if (mod.settings.ShowStyle) return false;
  700. }
  701. function sImageData() {
  702. if (mod.settings.Hideguildlogos) return false;
  703. }
  704. function sSpawnUser(event) {
  705. SUsers[event.gameId] = event;
  706. SUsers[event.gameId].spawnFx = 1;
  707. if (mod.settings.Mode === 3 || mod.settings.PlayersBlacklist.includes(event.name) || mod.settings.ClassesData[ClassID(event.templateId)].isHidden || (mod.settings.OnlyParty && !PMembers.includes(event.name))) {
  708. HUsers[event.gameId] = event;
  709. HUsers[event.gameId].spawnFx = 1;
  710. return false;
  711. }
  712. if (ModifyUserAppearance(event)) return true;
  713. }
  714. function sSpawnUserfn(event) {
  715. if (ModifyUserAppearance(event)) return true;
  716. }
  717. function sDespawnUser(event) {
  718. delete HUsers[event.gameId];
  719. delete SUsers[event.gameId];
  720. }
  721. function sUserLocation(event) {
  722. if (SUsers[event.gameId]) {
  723. SUsers[event.gameId].loc = event.dest;
  724. SUsers[event.gameId].w = event.w;
  725. }
  726. if (HUsers[event.gameId]) {
  727. HUsers[event.gameId].loc = event.dest;
  728. HUsers[event.gameId].w = event.w;
  729. return false;
  730. }
  731. }
  732. function sUserStatus(event) {
  733. if (SUsers[event.gameId]) SUsers[event.gameId].status = event.status;
  734. if (HUsers[event.gameId]) {
  735. HUsers[event.gameId].status = event.status;
  736. return false;
  737. }
  738. }
  739. function sDeadLocation(event) {
  740. if (SUsers[event.gameId]) SUsers[event.gameId].loc = event.loc;
  741. if (HUsers[event.gameId]) HUsers[event.gameId].loc = event.loc;
  742. }
  743. function sUserMoveType() { return false; }
  744. function sPartyMemberList(event) {
  745. event.members.map(value => PMembers.push(value.name))
  746. if (mod.settings.RaidAutoChange) {
  747. if (event.members.length >= 18) {
  748. if (mod.settings.Mode >= 2 || (LastState === null && mod.settings.Mode === 2)) return;
  749. LastState = mod.settings.Mode;
  750. mod.command.exec("fps state 2");
  751. } else {
  752. if (LastState === null || mod.settings.Mode !== 2) {
  753. LastState = null;
  754. return;
  755. }
  756. mod.command.exec(`fps state ${LastState}`);
  757. LastState = null;
  758. }
  759. }
  760. }
  761. function sUserAppearanceChange(event) {
  762. if (EqGid(event.id)) return;
  763. if (mod.settings.ShowStyle) return false;
  764. }
  765. function sUserExternalChange(event) {
  766. if (EqGid(event.gameId)) return;
  767. if (mod.settings.ShowStyle) return false;
  768. }
  769. function sUnicastTransformData(event) {
  770. if (!event.gameId || EqGid(event.gameId)) return;
  771. if (mod.settings.ShowStyle) return false;
  772. if (mod.settings.Hideguildlogos) {
  773. event.guildLogo = '';
  774. return true;
  775. }
  776. }
  777. function sSpawnNpc(event) {
  778. SNpcs[event.gameId] = event;
  779. SNpcs[event.gameId].spawnType = 1;
  780. SNpcs[event.gameId].spawnScript = 0;
  781. if (NpcBCheck(event)) return false;
  782. }
  783. function sDespawnNpc(event) {
  784. delete HNpcs[event.gameId];
  785. delete SNpcs[event.gameId];
  786. if (!mod.settings.HideMonsterDeathAnimation || event.type !== 5) return;
  787. event.type = 1;
  788. return true;
  789. }
  790. function sNpcLocation(event) {
  791. if (SNpcs[event.gameId]) {
  792. SNpcs[event.gameId].loc = event.dest;
  793. SNpcs[event.gameId].w = event.w;
  794. }
  795. if (HNpcs[event.gameId]) {
  796. HNpcs[event.gameId].loc = event.dest;
  797. HNpcs[event.gameId].w = event.w;
  798. return false;
  799. }
  800. }
  801. function sCreatureRotate(event) {
  802. if (SNpcs[event.gameId]) SNpcs[event.gameId].w = event.w;
  803. if (HNpcs[event.gameId]) {
  804. HNpcs[event.gameId].w = event.w;
  805. return false;
  806. }
  807. }
  808. function sFearMoveStage(event) {
  809. if ((!EqGid(event.target) && mod.settings.Mode === 3) || HUsers[event.target] || HNpcs[event.target]) return false;
  810. }
  811. function sFearMoveEnd(event) {
  812. if ((!EqGid(event.target) && mod.settings.Mode === 3) || HUsers[event.target] || HNpcs[event.target]) return false;
  813. }
  814. function sRequestSpawnServant(event) {
  815. SPets[event.gameId] = event;
  816. if (EqGid(event.ownerId) && mod.settings.HideMyServants) {
  817. HPets[event.gameId] = event;
  818. return false;
  819. } else if (!EqGid(event.ownerId) && mod.settings.HideOthersServants) {
  820. HPets[event.gameId] = event;
  821. return false;
  822. }
  823. }
  824. function sRequestDespawnServant(event) {
  825. delete HPets[event.gameId];
  826. delete SPets[event.gameId];
  827. }
  828. function sAbnormalityBegin(event) {
  829. if (AbnDebug) {
  830. if (EqGid(event.target)) log('Abnormality', 'Applied', 'on', MyName, event.id);
  831. if (EqGid(event.source)) log('Abnormality', 'Started', 'from', MyName, event.id);
  832. if (SUsers[event.target]) log('Abnormality', 'Applied', 'on', SUsers[event.target].name, event.id);
  833. if (SUsers[event.source]) log('Abnormality', 'Started', 'from', SUsers[event.source].name, event.id);
  834. }
  835. if ([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
  836. if (ImportantAbns.includes(event.id)) return;
  837. if (EqGid(event.target)) {
  838. if (mod.settings.HideOwnBlacklistedAbns && mod.settings.OwnAbnormalsBlacklist.includes(event.id)) return false;
  839. return;
  840. }
  841. if (HUsers[event.target] || HNpcs[event.target]) return false;
  842. if (event.id === 9943049) return false;
  843. if (mod.settings.HideBlacklistedAbnormalities && (mod.settings.AbnormalitiesBlacklist.includes(event.id) || BlockedAbns.includes(event.id))) return false;
  844. if (mod.settings.HideAllAbnormalities && (SUsers[event.target] || SUsers[event.source] || mod.settings.AbnormalitiesBlacklist.includes(event.id) || BlockedAbns.includes(event.id))) return false;
  845. }
  846. function sAbnormalityRefresh(event) {
  847. if ([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
  848. if (ImportantAbns.includes(event.id)) return;
  849. if (HUsers[event.target] || HNpcs[event.target]) return false;
  850. if ((mod.settings.HideBlacklistedAbnormalities || mod.settings.HideAllAbnormalities) && (SUsers[[10306, 10316, 12001, 12003, 22040, 12120, 12130].includes(event.target)] || SUsers[[10306, 10316, 12001, 12003, 22040, 12120, 12130].includes(event.source)])) return false;
  851. }
  852. function sAbnormalityEnd(event) {
  853. if ([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
  854. if (event.id === 9943049) return false;
  855. }
  856. function sActionStage(event) {
  857. if (EqGid(event.gameId) || !SUsers[event.gameId]) return;
  858. if ((mod.settings.Mode >= 2) || HUsers[event.gameId] || mod.settings.ClassesData[ClassID(event.templateId)].CD_HideBlacklistedSkills || (mod.settings.HideBlacklistedSkills && mod.settings.ClassesData[ClassID(event.templateId)].CD_SkillsBlacklist.includes(Math.floor(event.skill.id / 10000).toString()))) {
  859. UpdateUserLoc(event);
  860. return false;
  861. }
  862. }
  863. function sStartUserProjectile(event) {
  864. if (ProjDebug) {
  865. if (EqGid(event.gameId)) log('Projectile', 'Started', 'from', MyName, event.skill.id);
  866. if (SUsers[event.gameId]) log('Projectile', 'Started', 'from', SUsers[event.gameId].name, event.skill.id);
  867. }
  868. if (mod.settings.Mode !== 3 && event.skill.id === 90120) return;
  869. if (mod.settings.PvpTraps && TrapsIds.includes(event.skill.id)) return;
  870. if ((mod.settings.HideBlacklistedProjectiles || mod.settings.HideAllProjectiles) && mod.settings.ProjectilesBlacklist.includes(event.skill.id)) return false;
  871. if (!EqGid(event.gameId) && SUsers[event.gameId] && (HUsers[event.gameId] || mod.settings.Mode >= 2 || mod.settings.HideAllProjectiles)) return false;
  872. }
  873. function sSpawnProjectile(event) {
  874. if (event.skill.npc) return;
  875. if (ProjDebug) {
  876. if (EqGid(event.gameId)) log('Projectile', 'Spawned', 'from', MyName, event.skill.id);
  877. if (SUsers[event.gameId]) log('Projectile', 'Spawned', 'from', SUsers[event.gameId].name, event.skill.id);
  878. }
  879. if (mod.settings.Mode !== 3 && event.skill.id === 90120) return;
  880. if (mod.settings.PvpTraps && TrapsIds.includes(event.skill.id)) return;
  881. if ((mod.settings.HideBlacklistedProjectiles || mod.settings.HideAllProjectiles) && mod.settings.ProjectilesBlacklist.includes(event.skill.id)) return false;
  882. if (!EqGid(event.gameId) && SUsers[event.gameId] && (HUsers[event.gameId] || mod.settings.Mode >= 2 || mod.settings.HideAllProjectiles)) return false;
  883. }
  884. function sPlayerChangeMp(event) {
  885. if (!mod.settings.HideMpNumbers || !EqGid(event.target)) return;
  886. if (event.type !== 0) {
  887. event.type = 0;
  888. return true;
  889. }
  890. }
  891. function sCreatureChangeHp(event) {
  892. if (!mod.settings.HideHpNumbers || !EqGid(event.target)) return;
  893. if (event.type !== 10) {
  894. event.type = 10;
  895. return true;
  896. }
  897. }
  898. function sEachSkillResult(event) {
  899. return ModifySkillResult(event);
  900. }
  901. function sSpawnDropItem(event) {
  902. if (EqGid(event.source)) return;
  903. if (mod.settings.HideBlacklistedDrop && mod.settings.DropBlacklist.includes(event.item)) return false;
  904. if (mod.settings.Mode >= 2) {
  905. event.explode = 0;
  906. return true;
  907. }
  908. }
  909. function sFontSwapInfo() {
  910. if (mod.settings.Hit_Damage || mod.settings.Hit_All) return false;
  911. }
  912. function sFieldEventOnEnter() {
  913. if (mod.settings.GuardianAutoChange) {
  914. if ((LastGState !== null && mod.settings.Mode === 2) || mod.settings.Mode >= 2) return;
  915. LastGState = mod.settings.Mode;
  916. mod.command.exec("fps state 2")
  917. }
  918. }
  919. function sFieldEventOnLeave() {
  920. if (mod.settings.GuardianAutoChange) {
  921. if (LastGState === null || mod.settings.Mode !== 2) {
  922. LastGState = null;
  923. return;
  924. }
  925. mod.command.exec(`fps state ${LastGState}`);
  926. LastGState = null;
  927. }
  928. }
  929. // ~~~ * Packet Hooks * ~~~ \\
  930. const Last_Hook = { order: 100010 }, Last_Hookfn = { order: 100010, filter: { fake: null } }
  931. mod.hook('S_LOGIN', 13, sLogin)
  932. mod.hook('S_LOAD_TOPO', 'raw', sLoadTopo)
  933. mod.hook('S_LEAVE_PARTY', 'raw', sLeaveParty)
  934. mod.hook('S_MOUNT_VEHICLE', 2, sMountVehicle)
  935. mod.hook('S_UNMOUNT_VEHICLE', 2, sUnmountVehicle)
  936. mod.hook('C_SET_VISIBLE_RANGE', 1, cSetVisibleRange)
  937. mod.hook('S_START_COOLTIME_ITEM', 1, sStartCooltimeItem)
  938. mod.hook('S_START_ACTION_SCRIPT', 3, sStartActionScript)
  939. mod.hook('S_LOADING_SCREEN_CONTROL_INFO', 'raw', sLoadingScreenControlInfo)
  940. mod.hook('S_UPDATE_ACHIEVEMENT_PROGRESS', 1, Last_Hookfn, sUpdateAchievementProgress)
  941. mod.hook('S_ITEM_CUSTOM_STRING', 2, sItemCustomString)
  942. mod.hook('S_SOCIAL', 1, sSocial)
  943. mod.hook('S_GUILD_NAME', 1, sGuildName)
  944. mod.hook('S_APPLY_TITLE', 2, sApplyTitle)
  945. mod.hook('S_IMAGE_DATA', 'raw', sImageData)
  946. mod.hook('S_SPAWN_USER', NotCP ? 14 : 15, Last_Hook, sSpawnUser)
  947. mod.hook('S_SPAWN_USER', NotCP ? 14 : 15, Last_Hookfn, sSpawnUserfn)
  948. mod.hook('S_DESPAWN_USER', 3, Last_Hook, sDespawnUser)
  949. mod.hook('S_USER_LOCATION', 5, sUserLocation)
  950. mod.hook('S_USER_STATUS', 3, sUserStatus)
  951. mod.hook('S_DEAD_LOCATION', 2, sDeadLocation)
  952. mod.hook('S_USER_MOVETYPE', 'raw', Last_Hook, sUserMoveType)
  953. mod.hook('S_PARTY_MEMBER_LIST', 7, sPartyMemberList)
  954. mod.hook('S_USER_APPEARANCE_CHANGE', 1, Last_Hookfn, sUserAppearanceChange)
  955. mod.hook('S_USER_EXTERNAL_CHANGE', 7, Last_Hookfn, sUserExternalChange)
  956. mod.hook('S_UNICAST_TRANSFORM_DATA', NotCP ? 5 : 6, Last_Hook, sUnicastTransformData)
  957. mod.hook('S_SPAWN_NPC', 11, sSpawnNpc)
  958. mod.hook('S_DESPAWN_NPC', 3, sDespawnNpc)
  959. mod.hook('S_NPC_LOCATION', 3, sNpcLocation)
  960. mod.hook('S_CREATURE_ROTATE', 2, sCreatureRotate)
  961. mod.hook('S_FEARMOVE_STAGE', 1, sFearMoveStage)
  962. mod.hook('S_FEARMOVE_END', 1, sFearMoveEnd)
  963. mod.hook('S_REQUEST_SPAWN_SERVANT', NotCP ? 1 : 2, sRequestSpawnServant)
  964. mod.hook('S_REQUEST_DESPAWN_SERVANT', 1, sRequestDespawnServant)
  965. mod.hook('S_ABNORMALITY_BEGIN', 3, Last_Hook, sAbnormalityBegin)
  966. mod.hook('S_ABNORMALITY_REFRESH', 1, Last_Hook, sAbnormalityRefresh)
  967. mod.hook('S_ABNORMALITY_END', 1, sAbnormalityEnd)
  968. mod.hook('S_ACTION_STAGE', 9, Last_Hook, sActionStage)
  969. mod.hook('S_SPAWN_PROJECTILE', 5, Last_Hook, sSpawnProjectile)
  970. mod.hook('S_START_USER_PROJECTILE', 9, Last_Hook, sStartUserProjectile)
  971. mod.hook('S_PLAYER_CHANGE_MP', 1, sPlayerChangeMp)
  972. mod.hook('S_CREATURE_CHANGE_HP', 6, sCreatureChangeHp)
  973. mod.hook('S_EACH_SKILL_RESULT', 13, Last_Hook, sEachSkillResult)
  974. mod.hook('S_SPAWN_DROPITEM', NotCP ? 7 : 8, sSpawnDropItem)
  975. mod.hook('S_FONT_SWAP_INFO', 'raw', sFontSwapInfo)
  976. mod.hook('S_FIELD_EVENT_ON_ENTER', 'raw', sFieldEventOnEnter)
  977. mod.hook('S_FIELD_EVENT_ON_LEAVE', 'raw', sFieldEventOnLeave)
  978. // ~~~ * Commands * ~~~ \\
  979. mod.command.add('0', () => mod.command.exec('fps mode 0'))
  980. mod.command.add('1', () => mod.command.exec('fps mode 1'))
  981. mod.command.add('2', () => mod.command.exec('fps mode 2'))
  982. mod.command.add('3', () => mod.command.exec('fps mode 3'))
  983. mod.command.add(['fps', '!fps', 'fps-utils', '!fps-utils'], (key, arg, arg2, arg3) => {
  984. switch (key) {
  985. case "g": case "gui":
  986. GuiHandler(arg, arg2);
  987. break;
  988. case "0":
  989. mod.command.exec('fps mode 0');
  990. break;
  991. case "1":
  992. mod.command.exec('fps mode 1');
  993. break;
  994. case "2":
  995. mod.command.exec('fps mode 2')
  996. break;
  997. case "3":
  998. mod.command.exec('fps mode 3');
  999. break;
  1000. case "mod": case "mode": case "state":
  1001. switch (arg) {
  1002. case "0": case "off": case "zero":
  1003. if (mod.settings.Mode === 3) ShowAllPlayers();
  1004. mod.settings.Mode = 0;
  1005. mod.settings.HideAllAbnormalities = false;
  1006. mod.settings.HideAllProjectiles = false;
  1007. mod.settings.Hit_Other = false;
  1008. Msg(`<font color="${RedC}">Mode 0</font>.`);
  1009. break;
  1010. case "1": case "one":
  1011. if (mod.settings.Mode === 3) ShowAllPlayers();
  1012. mod.settings.Mode = 1;
  1013. mod.settings.HideAllAbnormalities = false;
  1014. mod.settings.HideAllProjectiles = true;
  1015. mod.settings.Hit_Other = true;
  1016. Msg(`<font color="${BnzC}">Mode 1</font>.`);
  1017. break;
  1018. case "2": case "two":
  1019. if (mod.settings.Mode === 3) ShowAllPlayers();
  1020. mod.settings.Mode = 2;
  1021. mod.settings.HideAllAbnormalities = true;
  1022. mod.settings.HideAllProjectiles = true;
  1023. mod.settings.Hit_Other = true;
  1024. Msg(`<font color="${SlvC}">Mode 2</font>.`);
  1025. break;
  1026. case "3": case "three":
  1027. HideAllPlayers();
  1028. mod.settings.Mode = 3;
  1029. mod.settings.HideAllAbnormalities = true;
  1030. mod.settings.HideAllProjectiles = true;
  1031. mod.settings.Hit_Other = true;
  1032. mod.settings.OnlyParty = false;
  1033. Msg(`<font color="${GldC}">Mode 3</font>.`);
  1034. break;
  1035. default:
  1036. Msg(`<font color="${GryC}">Invalid" ${arg}"</font>.`);
  1037. Msg(`Modes: "<font color="${PnkC}">[0, 1, 2, 3]</font>.`);
  1038. break;
  1039. }
  1040. break;
  1041. case "hide":
  1042. if (typeof arg === "string" && arg !== null) {
  1043. if (mod.settings.PlayersBlacklist.includes(arg)) return Msg(`Player '${arg}' <font color="${RedC}">Already hidden</font>.`);
  1044. else
  1045. if ((GameJobs.includes(arg) && !mod.settings.ClassesBlacklist.includes(arg)) || (GameRoles.includes(arg) && !mod.settings.RolesBlacklist.includes(arg))) {
  1046. for (let i in mod.settings.ClassesData) {
  1047. if ((mod.settings.ClassesData[i].name === arg || mod.settings.ClassesData[i].role.includes(arg)) && mod.settings.ClassesData[i].isHidden !== true) {
  1048. mod.settings.ClassesData[i].isHidden = true;
  1049. if (mod.settings.ClassesData[i].name === arg) mod.settings.ClassesBlacklist.push(arg);
  1050. if (mod.settings.ClassesData[i].role.includes(arg)) mod.settings.RolesBlacklist.push(arg);
  1051. let classtohide = mod.settings.ClassesData[i].model;
  1052. for (let i in SUsers) { if (ClassID(SUsers[i].templateId) === classtohide) HideSpecificPlayer(SUsers[i].name); }
  1053. }
  1054. }
  1055. Msg(`Class/Role ${arg} <font color="${GrnC}">Hidden</font>.`);
  1056. return;
  1057. } else if (mod.settings.ClassesBlacklist.includes(arg) || mod.settings.RolesBlacklist.includes(arg)) return Msg(`Class/Role '${arg}' <font color="${RedC}">Already hidden</font>.`);
  1058. Msg(`Player '${arg}' <font color="${GrnC}">Hidden</font>.`);
  1059. mod.settings.PlayersBlacklist.push(arg);
  1060. HideSpecificPlayer(arg);
  1061. } else Msg(`<font color="${GryC}">Invalid ${arg2}</font>.`);
  1062. break;
  1063. case "show":
  1064. if (typeof arg === "string" && arg !== null) {
  1065. if (mod.settings.PlayersBlacklist.includes(arg)) {
  1066. ShowSpecificPlayer(arg);
  1067. RemoveEntity(mod.settings.PlayersBlacklist, arg);
  1068. Msg(`Player '${arg}' <font color="${RedC}">Shown</font>.`);
  1069. return;
  1070. }
  1071. if ((GameJobs.includes(arg) && mod.settings.ClassesBlacklist.includes(arg)) || (mod.settings.RolesBlacklist.includes(arg) && GameRoles.includes(arg))) {
  1072. for (let i in mod.settings.ClassesData) {
  1073. if (mod.settings.ClassesData[i].name === arg || mod.settings.ClassesData[i].role.includes(arg)) {
  1074. if (mod.settings.ClassesData[i].name === arg) RemoveEntity(mod.settings.ClassesBlacklist, arg);
  1075. if (mod.settings.ClassesData[i].role.includes(arg)) RemoveEntity(mod.settings.RolesBlacklist, arg);
  1076. mod.settings.ClassesData[i].isHidden = false;
  1077. let classToShow = mod.settings.ClassesData[i].model;
  1078. for (let i in HUsers) {
  1079. if (ClassID(HUsers[i].templateId) === classToShow) ShowSpecificPlayer(HUsers[i].name);
  1080. }
  1081. }
  1082. }
  1083. Msg(`Class '${arg}' <font color="${RedC}">Shown</font>.`);
  1084. } else if (!mod.settings.ClassesBlacklist.includes(arg) || !mod.settings.RolesBlacklist.includes(arg)) Msg(`Class/Role '${arg}' <font color="${RedC}">Already shown</font>.`);
  1085. else if (!mod.settings.PlayersBlacklist.includes(arg)) Msg(`Player '${arg}' <font color="${RedC}">Already shown</font>.`);
  1086. else Msg(`<font color="${GryC}">Invalid ${arg2}</font>.`);
  1087. }
  1088. break;
  1089. case "party":
  1090. if (mod.settings.Mode === 3) return Msg(`<font color="${RedC}">You've to disable mode 3 first</font>.`);
  1091. mod.settings.OnlyParty = !mod.settings.OnlyParty;
  1092. if (mod.settings.OnlyParty) {
  1093. for (let i in SUsers) {
  1094. if (!PMembers.includes(SUsers[i].name)) {
  1095. mod.toClient('S_DESPAWN_USER', 3, { gameId: SUsers[i].gameId, type: 1 })
  1096. HUsers[SUsers[i].gameId] = SUsers[i];
  1097. }
  1098. }
  1099. } else ShowAllPlayers();
  1100. Msg(`Everyone but party ${mod.settings.OnlyParty ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1101. break;
  1102. case "raid":
  1103. mod.settings.RaidAutoChange = !mod.settings.RaidAutoChange;
  1104. Msg(`Raid auto-state ${mod.settings.RaidAutoChange ? `<font color="${GrnC}">Enabled</font>` : `<font color="${RedC}">Disabled</font>`}.`);
  1105. break;
  1106. case "guardian":
  1107. mod.settings.GuardianAutoChange = !mod.settings.GuardianAutoChange;
  1108. Msg(`Guardian auto-state ${mod.settings.GuardianAutoChange ? `<font color="${GrnC}">Enabled</font>` : `<font color="${RedC}">Disabled</font>`}.`);
  1109. break;
  1110. case "pvptraps":
  1111. mod.settings.PvpTraps = !mod.settings.PvpTraps;
  1112. Msg(`Pvp Traps are ${mod.settings.PvpTraps ? `<font color="${GrnC}">Shown<font color="${PnkC}">(not affected by hide all projectiles)</font></font>` : `<font color="${RedC}">Normal<font color="${PnkC}">(affected by hide all projectiles)</font></font>`}.`);
  1113. break;
  1114. case "list":
  1115. Msg(`<font color="${PnkC}">Hidden players: ${mod.settings.PlayersBlacklist}</font>.`);
  1116. Msg(`<font color="${PnkC}">Hidden classes: ${mod.settings.ClassesBlacklist}</font>.`);
  1117. Msg(`<font color="${PnkC}">Hidden roles: ${mod.settings.RolesBlacklist}</font>.`);
  1118. break;
  1119. case "summons": case "sums":
  1120. switch (arg) {
  1121. case "me":
  1122. mod.settings.HideMySummons = !mod.settings.HideMySummons;
  1123. mod.settings.HideMySummons ? HideNpcs('own') : ShowNpcs('own');
  1124. Msg(`Own summoned NPCs ${mod.settings.HideMySummons ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1125. break;
  1126. default:
  1127. mod.settings.HideOthersSummons = !mod.settings.HideOthersSummons;
  1128. mod.settings.HideOthersSummons ? HideNpcs('others') : ShowNpcs('others');
  1129. Msg(`Others summoned NPCs ${mod.settings.HideOthersSummons ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1130. break;
  1131. }
  1132. break;
  1133. case "skills": case "skill":
  1134. switch (arg) {
  1135. case "blacklist":
  1136. mod.settings.HideBlacklistedSkills = !mod.settings.HideBlacklistedSkills;
  1137. Msg(`Blacklisted skills ${mod.settings.HideBlacklistedSkills ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1138. break;
  1139. case "class":
  1140. if (GameJobs.includes(arg2)) {
  1141. for (let i in mod.settings.ClassesData) {
  1142. if (mod.settings.ClassesData[i].name === arg2) {
  1143. if (arg3 != null && !isNaN(arg3) && arg3 < 50) {
  1144. if (mod.settings.ClassesData[i].CD_SkillsBlacklist.includes(arg3)) {
  1145. let index = mod.settings.ClassesData[i].CD_SkillsBlacklist.indexOf(arg3);
  1146. if (index !== -1) {
  1147. mod.settings.ClassesData[i].CD_SkillsBlacklist.splice(index, 1);
  1148. Msg(`Skill ID '${arg3}' <font color="${RedC}">Shown</font> for class '${arg2}'.`);
  1149. }
  1150. return;
  1151. } else {
  1152. mod.settings.ClassesData[i].CD_SkillsBlacklist.push(arg3);
  1153. Msg(`Skill ID '${arg3}' <font color="${GrnC}">Hidden</font> for class '${arg2}'.`);
  1154. return;
  1155. }
  1156. } else {
  1157. mod.settings.ClassesData[i].CD_HideBlacklistedSkills = !mod.settings.ClassesData[i].CD_HideBlacklistedSkills;
  1158. Msg(`Skills for '${arg2}' class ${mod.settings.ClassesData[i].CD_HideBlacklistedSkills ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1159. return;
  1160. }
  1161. }
  1162. }
  1163. } else Msg(`<font color="${RedC}">Class ${arg2} not found</font>.`);
  1164. break;
  1165. }
  1166. break;
  1167. case "npcs": case "npc":
  1168. if (arg === 'hide') {
  1169. if (!arg2 || !arg3) {
  1170. mod.settings.HideBlacklistedNpcs = !mod.settings.HideBlacklistedNpcs;
  1171. Msg(`Blacklisted NPCs ${mod.settings.HideBlacklistedNpcs ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1172. break;
  1173. }
  1174. const found = mod.settings.NpcsBlacklist.some(s => s.zone === arg2 && s.templateId === arg3);
  1175. if (found) {
  1176. if (mod.settings.HideBlacklistedNpcs) ShowSpecificNpc(Number(arg2), Number(arg3));
  1177. Msg(`NPC HntZone '${arg2}', TmpId '${arg3}' <font color="${RedC}">Removed from the blacklist</font>.`);
  1178. mod.settings.NpcsBlacklist = mod.settings.NpcsBlacklist.filter(obj => obj.zone != arg2 || obj.templateId != arg3);
  1179. } else {
  1180. if (mod.settings.HideBlacklistedNpcs) HideSpecificNpc(Number(arg2), Number(arg3));
  1181. Msg(`NPC HntZone '${arg2}', TmpId '${arg3}' <font color="${GrnC}">Added to the blacklist</font>.`);
  1182. mod.settings.NpcsBlacklist.push({ zone: arg2, templateId: arg3 });
  1183. }
  1184. return;
  1185. } else {
  1186. mod.settings.HideBlacklistedNpcs = !mod.settings.HideBlacklistedNpcs;
  1187. mod.settings.HideBlacklistedNpcs ? HideNpcs('bl') : ShowNpcs('bl');
  1188. Msg(`Blacklisted NPCs ${mod.settings.HideBlacklistedNpcs ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1189. }
  1190. break;
  1191. case "hit":
  1192. switch (arg) {
  1193. case "me":
  1194. if (mod.settings.Hit_All) return Msg(`<font color="${RedC}">You've to disable hit ALL first</font>.`);
  1195. mod.settings.Hit_Me = !mod.settings.Hit_Me;
  1196. Msg(`Own hits effect ${mod.settings.Hit_Me ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1197. break;
  1198. case "other":
  1199. if (mod.settings.Hit_All) return Msg(`<font color="${RedC}">You've to disable hit ALL first</font>.`);
  1200. mod.settings.Hit_Other = !mod.settings.Hit_Other;
  1201. Msg(`Players hit effect ${mod.settings.Hit_Other ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1202. break;
  1203. case "damage":
  1204. if (mod.settings.Hit_All) return Msg(`<font color="${RedC}">You've to disable hit ALL first</font>.`);
  1205. mod.settings.Hit_Damage = !mod.settings.Hit_Damage;
  1206. Msg(`Damage numbers ${mod.settings.Hit_Damage ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1207. break;
  1208. case "all":
  1209. mod.settings.Hit_Me = mod.settings.Hit_Other = mod.settings.Hit_Damage = false;
  1210. mod.settings.Hit_All = !mod.settings.Hit_All;
  1211. Msg(`Hit all ${mod.settings.Hit_All ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1212. break;
  1213. default:
  1214. Msg(`<font color="${GryC}">Invalid &#40;hit&#41; '${arg}'</font>.`);
  1215. break;
  1216. }
  1217. break;
  1218. case "fireworks": case "firework":
  1219. mod.settings.HideFireworks = !mod.settings.HideFireworks;
  1220. Msg(`Fireworks ${mod.settings.HideFireworks ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1221. break;
  1222. case "abn": case "effects": case "abnormal": case "abnormalities":
  1223. switch (arg) {
  1224. case "all":
  1225. mod.settings.HideAllAbnormalities = !mod.settings.HideAllAbnormalities;
  1226. Msg(`All Abnormalities ${mod.settings.HideAllAbnormalities ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1227. break;
  1228. case "blacklist":
  1229. if (!arg2 || !arg3) {
  1230. mod.settings.HideBlacklistedAbnormalities = !mod.settings.HideBlacklistedAbnormalities;
  1231. Msg(`Blacklisted Abnormalities ${mod.settings.HideBlacklistedAbnormalities ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1232. break;
  1233. } else if (arg2 && arg3) {
  1234. arg3 = Number(arg3);
  1235. if (!mod.settings.AbnormalitiesBlacklist.includes(arg3)) {
  1236. if (arg2 === 'add') {
  1237. mod.settings.AbnormalitiesBlacklist.push(arg3);
  1238. Msg(`Blacklisted Abnormalities <font color="${GrnC}">added '${arg3}'</font>.`);
  1239. return;
  1240. } else if (arg2 === 'remv') return Msg(`Blacklisted Abnormalities <font color="${RedC}">can't remove '${arg3}' as it's not there</font>.`);
  1241. } else if (mod.settings.AbnormalitiesBlacklist.includes(arg3)) {
  1242. if (arg2 === 'add') return Msg(`Blacklisted Abnormalities <font color="${RedC}">can't add '${arg3}' as it's already there</font>.`);
  1243. else if (arg2 === 'remv') {
  1244. let index = mod.settings.AbnormalitiesBlacklist.indexOf(arg3);
  1245. if (index !== -1) {
  1246. mod.settings.AbnormalitiesBlacklist.splice(index, 1);
  1247. Msg(`Blacklisted Abnormalities <font color="${RedC}">removed '${arg3}'</font>.`);
  1248. return;
  1249. }
  1250. }
  1251. } else return Msg(`<font color="${GryC}">Invalid &#40;abnormalities Blacklist&#41; '${arg}'</font>.`);
  1252. }
  1253. break;
  1254. case "log":
  1255. case "debug":
  1256. AbnDebug = !AbnDebug;
  1257. if (AbnDebug) Msg(`Abnormalities debug <font color="${GrnC}">started</font>, check your proxy console for details.`)
  1258. else Msg(`Abnormalities debug <font color="${RedC}">stopped</font>.`);
  1259. break;
  1260. default:
  1261. Msg(`<font color="${GryC}">Invalid &#40;abnormalities&#41; '${arg}'</font>.`);
  1262. break;
  1263. }
  1264. break;
  1265. case "guildlogo":
  1266. if (SwitchCd) return Msg(`<font color="${PnkC}">Try again in 3 seconds</font>.`);
  1267. mod.settings.Hideguildlogos = !mod.settings.Hideguildlogos;
  1268. mod.toServer('C_SET_VISIBLE_RANGE', 1, { range: 0 });
  1269. setTimeout(() => mod.toServer('C_SET_VISIBLE_RANGE', 1, { range: LastVrange }), 1500);
  1270. SwitchCd = true;
  1271. setTimeout(() => SwitchCd = false, 2800);
  1272. Msg(`Guild Logos ${mod.settings.Hideguildlogos ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1273. break;
  1274. case "costume": case "style":
  1275. if (SwitchCd) return Msg(`<font color="${PnkC}">Try again in 3 seconds</font>.`);
  1276. mod.settings.ShowStyle = !mod.settings.ShowStyle;
  1277. mod.toServer('C_SET_VISIBLE_RANGE', 1, { range: 0 });
  1278. setTimeout(() => mod.toServer('C_SET_VISIBLE_RANGE', 1, { range: LastVrange }), 1500);
  1279. SwitchCd = true;
  1280. setTimeout(() => SwitchCd = false, 2800);
  1281. Msg(`Style of NPCs & others ${mod.settings.ShowStyle ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1282. break;
  1283. case "proj": case "projectile":
  1284. switch (arg) {
  1285. case "all":
  1286. mod.settings.HideAllProjectiles = !mod.settings.HideAllProjectiles;
  1287. Msg(`Projectiles ${mod.settings.HideAllProjectiles ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1288. break;
  1289. case "blacklist":
  1290. if (!arg2 || !arg3) {
  1291. mod.settings.HideBlacklistedProjectiles = !mod.settings.HideBlacklistedProjectiles;
  1292. Msg(`Blacklisted projectile ${mod.settings.HideBlacklistedProjectiles ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1293. break;
  1294. } else if (arg2 && arg3) {
  1295. arg3 = Number(arg3);
  1296. if (!mod.settings.ProjectilesBlacklist.includes(arg3)) {
  1297. if (arg2 === 'add') {
  1298. mod.settings.ProjectilesBlacklist.push(arg3);
  1299. Msg(`Blacklisted projectile <font color="${GrnC}">added '${arg3}'</font>.`);
  1300. return;
  1301. } else if (arg2 === 'remv') return Msg(`Blacklisted projectile <font color="${RedC}">can't remove '${arg3}' as it's not there</font>.`);
  1302. } else if (mod.settings.ProjectilesBlacklist.includes(arg3)) {
  1303. if (arg2 === 'add') return Msg(`Blacklisted projectile <font color="${RedC}">can't add '${arg3}' as it's already there</font>.`);
  1304. else if (arg2 === 'remv') {
  1305. let index = mod.settings.ProjectilesBlacklist.indexOf(arg3);
  1306. if (index !== -1) {
  1307. mod.settings.ProjectilesBlacklist.splice(index, 1);
  1308. Msg(`Blacklisted projectile <font color="${RedC}">removed '${arg3}'</font>.`);
  1309. return;
  1310. }
  1311. }
  1312. } else return Msg(`<font color="${GryC}">Invalid &#40;projectile Blacklist&#41; '${arg}'</font>.`);
  1313. }
  1314. break;
  1315. case "log": case "debug":
  1316. ProjDebug = !ProjDebug;
  1317. if (ProjDebug) Msg(`Projectile debug <font color="${GrnC}">started</font>, check your proxy console for details.`);
  1318. else Msg(`Projectile debug <font color="${RedC}">stopped</font>.`);
  1319. break;
  1320. default:
  1321. Msg(`<font color="${GryC}">Invalid &#40;projectile&#41; '${arg}'</font>.`);
  1322. break;
  1323. }
  1324. break;
  1325. case "quicklink":
  1326. switch (arg) {
  1327. case "mail": case "parcel":
  1328. mod.toServer('C_REQUEST_CONTRACT', 1, { type: 8 });
  1329. break;
  1330. case "talent": case "talents":
  1331. mod.toServer('C_REQUEST_CONTRACT', 1, { type: 77 });
  1332. break;
  1333. case "broker":
  1334. mod.toClient('S_NPC_MENU_SELECT', 1, { type: 28 });
  1335. break;
  1336. case "dress": case "dressingroom":
  1337. mod.toServer('C_REQUEST_CONTRACT', 1, { type: 76 });
  1338. break;
  1339. case "hat": case "hatrestyle":
  1340. mod.toServer('C_REQUEST_CONTRACT', 1, { type: 90 });
  1341. break;
  1342. case "lobby":
  1343. mod.toServer('C_RETURN_TO_LOBBY', 1, {});
  1344. break;
  1345. case "exit": case "instantexit":
  1346. mod.toClient('S_EXIT', 3, { category: 0, code: 0 });
  1347. break;
  1348. case "drop":
  1349. mod.toServer('C_LEAVE_PARTY', 1, {});
  1350. break;
  1351. case "disband":
  1352. mod.toServer('C_DISMISS_PARTY', 1, {});
  1353. break;
  1354. case "reset":
  1355. mod.toServer('C_RESET_ALL_DUNGEON', 1, {});
  1356. break;
  1357. case "searchengine":
  1358. mod.toClient('S_SHOW_AWESOMIUMWEB_SHOP', 1, { link: 'https://start.duckduckgo.com/' });
  1359. break;
  1360. default:
  1361. Msg(`<font color="${GryC}">Invalid &#40;quicklink&#41; '${arg}'</font>.`);
  1362. break;
  1363. }
  1364. break;
  1365. case "npczoom":
  1366. mod.settings.ActionScripts = !mod.settings.ActionScripts;
  1367. Msg(`Npc zoom-ins ${mod.settings.ActionScripts ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1368. break;
  1369. case "dropitem":
  1370. if (arg === 'hide') {
  1371. if (!arg2) {
  1372. mod.settings.HideBlacklistedDrop = !mod.settings.HideBlacklistedDrop;
  1373. Msg(`Blacklisted Drops ${mod.settings.HideBlacklistedDrop ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1374. break;
  1375. }
  1376. arg2 = Number(arg2);
  1377. const found1 = mod.settings.DropBlacklist.some(s => s === arg2);
  1378. if (found1) {
  1379. Msg(`Drops id '${arg2}' <font color="${RedC}">Removed from the blacklist</font>.`);
  1380. mod.settings.DropBlacklist = mod.settings.DropBlacklist.filter(obj => obj != arg2);
  1381. } else {
  1382. Msg(`Drops id '${arg2}' <font color="${GrnC}">Added to the blacklist</font>.`);
  1383. mod.settings.DropBlacklist.push(arg2);
  1384. }
  1385. return;
  1386. } else mod.settings.HideBlacklistedDrop = !mod.settings.HideBlacklistedDrop;
  1387. Msg(`Blacklisted Drops ${mod.settings.HideBlacklistedDrop ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1388. break;
  1389. case "monsterdeathani": case "monstersdeathani":
  1390. mod.settings.HideMonsterDeathAnimation = !mod.settings.HideMonsterDeathAnimation;
  1391. Msg(`Monsters Death Animation is ${mod.settings.HideMonsterDeathAnimation ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1392. break;
  1393. case "screenabns":
  1394. if (arg === 'hide') {
  1395. if (!arg2) {
  1396. mod.settings.HideOwnBlacklistedAbns = !mod.settings.HideOwnBlacklistedAbns;
  1397. Msg(`Blacklisted ScreenAbns ${mod.settings.OwnAbnormalsBlacklist ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1398. break;
  1399. }
  1400. arg2 = Number(arg2);
  1401. const found2 = mod.settings.OwnAbnormalsBlacklist.some(m => m === arg2);
  1402. if (found2) {
  1403. Msg(`Abnormal id '${arg2}' <font color="${RedC}">Removed from the blacklist</font>.`);
  1404. mod.settings.OwnAbnormalsBlacklist = mod.settings.OwnAbnormalsBlacklist.filter(obj => obj != arg2);
  1405. } else {
  1406. Msg(`Abnormal id '${arg2}' <font color="${GrnC}">Added to the blacklist</font>.`);
  1407. mod.settings.OwnAbnormalsBlacklist.push(arg2);
  1408. }
  1409. return;
  1410. } else mod.settings.HideOwnBlacklistedAbns = !mod.settings.HideOwnBlacklistedAbns;
  1411. Msg(`Blacklisted ScreenAbns ${mod.settings.HideOwnBlacklistedAbns ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1412. break;
  1413. case "pet": case "pets": case "servant": case "servants":
  1414. switch (arg) {
  1415. case "me":
  1416. mod.settings.HideMyServants = !mod.settings.HideMyServants;
  1417. mod.settings.HideMyServants ? HideNpcs('pet', 'own') : ShowNpcs('pet', 'own');
  1418. Msg(`Own Servants are ${mod.settings.HideMyServants ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1419. break;
  1420. default:
  1421. mod.settings.HideOthersServants = !mod.settings.HideOthersServants;
  1422. mod.settings.HideOthersServants ? HideNpcs('pet', 'others') : ShowNpcs('pet', 'others');
  1423. Msg(`Others summoned NPCs ${mod.settings.HideOthersServants ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1424. break;
  1425. }
  1426. break;
  1427. case "hpnumbers":
  1428. mod.settings.HideHpNumbers = !mod.settings.HideHpNumbers;
  1429. Msg(`Own Hp numbers ${mod.settings.HideHpNumbers ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1430. break;
  1431. case "mpnumbers":
  1432. mod.settings.HideMpNumbers = !mod.settings.HideMpNumbers;
  1433. Msg(`Own Mp numbers ${mod.settings.HideMpNumbers ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1434. break;
  1435. case "stream":
  1436. mod.settings.StreamMode = !mod.settings.StreamMode;
  1437. Msg(`Stream mode is ${mod.settings.StreamMode ? `<font color="${GrnC}">Enabled</font>` : `<font color="${RedC}">Disabled</font>`}.`); // It will only show when disabled.
  1438. if (mod.settings.StreamMode) console.log("\x1b[94mINFO\x1b[34m [FPS-UTILS]\x1b[39m - Steam Mode has been enabled, No messages will be sent in-game messages until it's disabled.");
  1439. else console.log("\x1b[94mINFO\x1b[34m [FPS-UTILS]\x1b[39m - Steam Mode has been disabled.");
  1440. break;
  1441. case "help": case "h":
  1442. mod.command.exec("fps gui help");
  1443. break;
  1444. default:
  1445. Msg(`<font color="${RedC}">Unknown command, check command list</font>.`);
  1446. mod.command.exec("fps gui help");
  1447. break;
  1448. }
  1449. if (!NotCP) mod.saveSettings();
  1450. })
  1451. }