index.js 88 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578
  1. 'use strict'
  2. /* global __dirname */
  3. // ~~~ * Data * ~~~ \\
  4. const NotCP = typeof global.TeraProxy === "undefined" || typeof global.TeraProxy.UILanguage === "undefined";
  5. const NpcData = require("./data/npcData.json"), SkillData = require("./data/skillString.json");
  6. const Last_Hook = { order: 100010 }, Last_Hookfn = { order: 100010, filter: { fake: null } };
  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. module.exports = function FpsUtils(mod) {
  16. // ~~~ * Variables * ~~~ \\
  17. let MyGameId,
  18. MyName,
  19. SwitchCd,
  20. AllowedAchUps,
  21. LastState,
  22. LastGState,
  23. LastVrange,
  24. ProjDebug,
  25. AbnDebug,
  26. TmpData = [],
  27. PMembers = [],
  28. SUsers = {},
  29. HUsers = {},
  30. SNpcs = {},
  31. HNpcs = {},
  32. SPets = {},
  33. HPets = {};
  34. // ~~~ * Gui Parser * ~~~ \\
  35. const Xmap = new WeakMap();
  36. if (!Xmap.has(mod.dispatch || mod)) {
  37. Xmap.set(mod.dispatch || mod, {});
  38. mod.hook('C_CONFIRM_UPDATE_NOTIFICATION', 'raw', Last_Hook, () => false)
  39. mod.hook('C_ADMIN', 1, Last_Hookfn, (event) => {
  40. const Xd = event.command.split(";")
  41. Xd.forEach(cmd => mod.command.exec(cmd))
  42. return false
  43. })
  44. }
  45. const gui = {
  46. parse(Xarray, Xtitle) {
  47. let Xdata = '';
  48. for (let i = 0; i < Xarray.length; i++) {
  49. if (Xdata.length >= 16000) {
  50. Xdata += `Gui data limit exceeded, some values may be missing.`;
  51. break;
  52. }
  53. if (Xarray[i].command) Xdata += `<a href="admincommand:/@${Xarray[i].command}">${Xarray[i].text}</a>`;
  54. else if (!Xarray[i].command) Xdata += `${Xarray[i].text}`;
  55. else continue;
  56. }
  57. mod.toClient('S_ANNOUNCE_UPDATE_NOTIFICATION', 1, {
  58. id: 0,
  59. title: Xtitle,
  60. body: Xdata
  61. })
  62. }
  63. }
  64. // ~~~ * Gui Handler * ~~~ \\
  65. function GuiHandler(page, arg) {
  66. switch (page) {
  67. case "searchnpc": case "npcsearch":
  68. NpcJsonSearch("search", arg);
  69. break;
  70. case "npc":
  71. NpcJsonSearch("starts", arg);
  72. break;
  73. case "npclist":
  74. TmpData = []
  75. TmpData.push(
  76. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
  77. { text: `<font color="${YlwC}" size="+20"><p align="right">[Main NPC page]</p></font><br>`, command: "fps gui npcmain" },
  78. { text: `<font color="${LBlC}" size="+19">Click a NPC ID to remove it from the blacklist:</font><br>` }
  79. )
  80. for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
  81. 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` })
  82. }
  83. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - NPCs </font><font color="${GrnC}">(Blacklist)</font>`)
  84. TmpData = []
  85. break;
  86. case "npcmain":
  87. TmpData = []
  88. TmpData.push(
  89. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
  90. { text: `<font color="${YlwC}" size="+20"><p align="right">[Blacklisted NPCs list]</p></font><br>`, command: "fps gui npclist" },
  91. { text: `<font color="${LBlC}" size="+19">Click a letter to view all NPCs starting with that letter:<br><br>` }
  92. )
  93. 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--) {
  94. TmpData.push({ text: `<font color="${BluC}" size="+19">${alphabet[i]}</font>`, command: `fps gui npc ${alphabet[i]}` }, { text: "&nbsp;&nbsp;" })
  95. }
  96. TmpData.push(
  97. { 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>` },
  98. { 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>` },
  99. { 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>` }
  100. )
  101. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - NPCs </font><font color="${YlwC}">(Main)</font>`)
  102. TmpData = []
  103. break;
  104. case "show":
  105. TmpData = []
  106. TmpData.push(
  107. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  108. { 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>` },
  109. { 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>` },
  110. { 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>` }
  111. )
  112. for (let i in SUsers) {
  113. 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` })
  114. }
  115. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Players </font><font color="${RedC}">(In-distance)</font>`)
  116. TmpData = []
  117. break;
  118. case "hide":
  119. TmpData = []
  120. TmpData.push(
  121. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
  122. { text: `<font color="${LBlC}" size="+19">Click to show & remove from blacklist.</font><br>` }
  123. )
  124. mod.settings.PlayersBlacklist.forEach(mem => TmpData.push({ text: `<font color="${BnzC}" size="+17">${mem}</font><br>`, command: `fps show ${mem};fps gui hide` }))
  125. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Players </font><font color="${GrnC}">(Hidden)</font>`)
  126. TmpData = []
  127. break;
  128. case "skills":
  129. gui.parse([
  130. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  131. { text: `<font color="${YlwC}" size="+20">Tankers:</font>` }, { text: "&#09;&#09;" },
  132. { text: `<font color="${LBlC}" size="+18">&#40;Lancer&#41;</font>`, command: "fps gui class lancer" }, { text: "&nbsp;&nbsp;" },
  133. { text: `<font color="${LBlC}" size="+18">&#40;Brawler&#41;</font><br><br>`, command: "fps gui class brawler" },
  134. { text: `<font color="${YlwC}" size="+20">Healers:</font>` }, { text: "&#09;&#09;" },
  135. { text: `<font color="${LBlC}" size="+18">&#40;Priest&#41;</font>`, command: "fps gui class priest" }, { text: "&nbsp;&nbsp;" },
  136. { text: `<font color="${LBlC}" size="+18">&#40;Mystic&#41;</font><br><br>`, command: "fps gui class mystic" },
  137. { text: `<font color="${YlwC}" size="+20">Dpsers(melee):</font>` }, { text: "&#09;" },
  138. { text: `<font color="${LBlC}" size="+18">&#40;Warrior&#41;</font>`, command: "fps gui class warrior" }, { text: "&nbsp;&nbsp;" },
  139. { text: `<font color="${LBlC}" size="+18">&#40;Slayer&#41;</font>`, command: "fps gui class slayer" }, { text: "&nbsp;&nbsp;" },
  140. { text: `<font color="${LBlC}" size="+18">&#40;Berserker&#41;</font>`, command: "fps gui class berserker" }, { text: "&nbsp;&nbsp;" },
  141. { text: `<font color="${LBlC}" size="+18">&#40;Ninja&#41;</font>`, command: "fps gui class ninja" }, { text: "&nbsp;&nbsp;" },
  142. { text: `<font color="${LBlC}" size="+18">&#40;Valkyrie&#41;</font>`, command: "fps gui class valkyrie" }, { text: "&nbsp;&nbsp;" },
  143. { text: `<font color="${LBlC}" size="+18">&#40;Reaper&#41;</font><br><br>`, command: "fps gui class reaper" },
  144. { text: `<font color="${YlwC}" size="+20">Dpsers(ranged):</font>` }, { text: "&#09;" },
  145. { text: `<font color="${LBlC}" size="+18">&#40;Sorcerer&#41;</font>`, command: "fps gui class sorcerer" }, { text: "&nbsp;&nbsp;" },
  146. { text: `<font color="${LBlC}" size="+18">&#40;Archer&#41;</font>`, command: "fps gui class archer" }, { text: "&nbsp;&nbsp;" },
  147. { text: `<font color="${LBlC}" size="+18">&#40;Gunner&#41;</font>`, command: "fps gui class gunner" }
  148. ], `<font color="${LPrC}">[FPS] Options - Skills </font><font color="${YlwC}">(Choose class)</font>`)
  149. break;
  150. case "class":
  151. gui.parse(SkillJsonSearch(arg), `<font color="${LPrC}">[FPS] Options - Skill list for '${arg}'</font>`)
  152. break;
  153. case "role":
  154. gui.parse([
  155. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
  156. { text: `<font color="${YlwC}" size="+20">By Roles:</font>` }, { text: "&#09;" },
  157. { 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;" },
  158. { 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;" },
  159. { 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;" },
  160. { 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` },
  161. { text: `<font color="${DBlC}" size="+22">By Classes</font><br><br>` },
  162. { text: `<font color="${YlwC}" size="+20">Tankers:</font>` }, { text: "&#09;&#09;" },
  163. { 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;" },
  164. { 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` },
  165. { text: `<font color="${YlwC}" size="+20">Healers:</font>` }, { text: "&#09;&#09;" },
  166. { 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;" },
  167. { 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` },
  168. { text: `<font color="${YlwC}" size="+20">Dpsers(melee):</font>` }, { text: "&#09;" },
  169. { 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;" },
  170. { 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;" },
  171. { 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;" },
  172. { 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;" },
  173. { 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;" },
  174. { 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` },
  175. { text: `<font color="${YlwC}" size="+20">Dpsers(ranged):</font>` }, { text: "&#09;" },
  176. { 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;" },
  177. { 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;" },
  178. { 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` }
  179. ], `<font color="${LPrC}">[FPS] Options - Roles/Classes</font>`)
  180. break;
  181. case "abn":
  182. TmpData = []
  183. TmpData.push(
  184. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  185. { text: `<font color="${AbnDebug ? GrnC : RedC}" size="+19"><p align="right">Debug</p></font><br>`, command: "fps abn log;fps gui abn" },
  186. { text: `<font color="${LPrC}" size="+19">Blacklist: </font><font color="${PnkC}" size="17+">Click to remove from the blacklist.</font><br>` }
  187. )
  188. 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` }))
  189. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Abnormalities</font>`)
  190. TmpData = []
  191. break;
  192. case "proj":
  193. TmpData = []
  194. TmpData.push(
  195. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  196. { text: `<font color="${ProjDebug ? GrnC : RedC}" size="+19"><p align="right">Debug</p></font><br>`, command: "fps proj log;fps gui proj" },
  197. { text: `<font color="${LPrC}" size="+19">Blacklist: </font><font color="${PnkC}" size="17+">Click to remove from the blacklist.</font><br>` }
  198. )
  199. 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` }))
  200. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Projectiles</font>`)
  201. TmpData = []
  202. break;
  203. case "help":
  204. gui.parse([
  205. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  206. { text: `<font size="20"><font color="${LBlC}">Command</font> <font color="${SlvC}">Arg(s)</font> <font color="${CPKC}">Example</font><br>` },
  207. { text: `<font color="${HBlC}">gui ^ g</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps gui</font><br>` },
  208. { text: `<font color="${HBlC}"> N/A</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps-util</font><br>` },
  209. { text: `<font color="${HBlC}">0 ^ 1 ^ 2 ^ 3</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!0 ^ !1 ^ !2 ^ !3</font><br>` },
  210. { text: `<font color="${HBlC}">mode</font> <font color="${DBlC}">0 ^ 1 ^ 2 ^ 3</font> <font color="${HPkC}">!fps mode 2</font><br>` },
  211. { text: `<font color="${HBlC}">hide^show</font> <font color="${DBlC}">Player^Class^Role</font> <font color="${HPkC}">!fps hide mie</font><br>` },
  212. { text: `<font color="${HBlC}">party</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps party</font><br>` },
  213. { text: `<font color="${HBlC}">raid</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps raid</font><br>` },
  214. { text: `<font color="${HBlC}">list</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps list</font><br>` },
  215. { text: `<font color="${HBlC}">sums</font> <font color="${DBlC}">other ^ me</font> <font color="${HPkC}">!fps sums me</font><br>` },
  216. { text: `<font color="${HBlC}">skill</font> <font color="${DBlC}">blacklist</font> <font color="${HPkC}">!fps skill blacklist</font><br>` },
  217. { text: `<font color="${HBlC}">npc</font> <font color="${DBlC}">N/A ^ hide</font> <font color="${HPkC}">!fps npc</font><br>` },
  218. { text: `<font color="${HBlC}">hit</font> <font color="${DBlC}">me^other^damage</font> <font color="${HPkC}">!fps hit me</font><br>` },
  219. { text: `<font color="${HBlC}">firework</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps firework</font><br>` },
  220. { text: `<font color="${HBlC}">abn</font> <font color="${DBlC}">all ^ blacklist</font> <font color="${HPkC}">!fps abn blacklist</font><br>` },
  221. { text: `<font color="${HBlC}">proj</font> <font color="${DBlC}">all ^ blacklist</font> <font color="${HPkC}">!fps proj all</font><br>` },
  222. { text: `<font color="${HBlC}">guildlogo</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps guildlogo</font><br>` },
  223. { text: `<font color="${HBlC}">style</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps style</font><br>` },
  224. { text: `<font color="${HBlC}">gui npcsearch</font> <font color="${DBlC}">"target"</font> <font color="${HPkC}">!fps gui npcsearch E</font><br>` },
  225. { text: `<font color="${HBlC}">npczoom</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps npczoom</font><br>` },
  226. { text: `<font color="${HBlC}">dropitem</font> <font color="${DBlC}">N/A ^ hide</font> <font color="${HPkC}">!fps dropitem</font><br>` },
  227. { text: `<font color="${HBlC}">monsterdeathani</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps monsterdeathani</font><br>` },
  228. { text: `<font color="${HBlC}">screenabns</font> <font color="${DBlC}">N/A ^ hide</font> <font color="${HPkC}">!fps screenabns</font><br>` },
  229. { text: `<font color="${HBlC}">hpnumbers</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps hpnumbers</font><br>` },
  230. { text: `<font color="${HBlC}">mpnumbers</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps mpnumbers</font><br>` },
  231. { text: `<font color="${HBlC}">pet</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps raid</font><br>` },
  232. { text: `<font color="${HBlC}">guardian</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps guardian</font><br>` },
  233. { text: `<font color="${HBlC}">stream</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps stream</font></font><br>` },
  234. ], `<font color="${LPrC}">[FPS] HELP</font>`)
  235. break;
  236. default:
  237. gui.parse([
  238. { text: `<font color="${PrpC}" size="+15"><p align="right">REFRESH</p></font><br>`, command: "fps gui" },
  239. { text: `<font color="${YlwC}" size="+20">Modes:</font>` }, { text: "&#09;&#09;" },
  240. { 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;" },
  241. { 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;" },
  242. { 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;" },
  243. { text: `<font color="${mod.settings.Mode === 3 ? GrnC : RedC}" size="+18">[Mode 3]</font><br><br>`, command: "fps mode 3;fps gui" },
  244. { text: `<font color="${YlwC}" size="+20">Hit:</font>` }, { text: "&#09;&#09;&#09;" },
  245. { text: `<font color="${mod.settings.Hit_Other ? GrnC : RedC}" size="+18">[Players]</font>`, command: "fps hit other;fps gui" }, { text: "&nbsp;&nbsp;" },
  246. { text: `<font color="${mod.settings.Hit_Me ? GrnC : RedC}" size="+18">[Own]</font>`, command: "fps hit me;fps gui" }, { text: "&nbsp;&nbsp;" },
  247. { text: `<font color="${mod.settings.Hit_Damage ? GrnC : RedC}" size="+18">[Dmg/heal numbers]</font>`, command: "fps hit damage;fps gui" }, { text: "&nbsp;&nbsp;" },
  248. { text: `<font color="${mod.settings.Hit_All ? GrnC : RedC}" size="+18">[ALL]</font><br><br>`, command: "fps hit all;fps gui" },
  249. { text: `<font color="${YlwC}" size="+20">Hide:</font>` }, { text: "&#09;&#09;" },
  250. { text: `<font color="${LBlC}" size="+18">[Classes/Roles]</font>`, command: "fps gui role" }, { text: "&nbsp;&nbsp;&nbsp;" },
  251. { text: `<font color="${mod.settings.ShowStyle ? GrnC : RedC}" size="+18">[Style]</font>`, command: "fps style;fps gui" }, { text: "&nbsp;&nbsp;" },
  252. { text: `<font color="${mod.settings.Hideguildlogos ? GrnC : RedC}" size="+18">[Guild Logos]</font>`, command: "fps guildlogo;fps gui" }, { text: "&nbsp;&nbsp;" },
  253. { text: `<font color="${mod.settings.HideFireworks ? GrnC : RedC}" size="+18">[Fireworks]</font><br><br>`, command: "fps fireworks;fps gui" },
  254. { text: `<font color="${YlwC}" size="+20">Self(own):</font>` }, { text: "&#09;" },
  255. { text: `<font color="${mod.settings.HideHpNumbers ? GrnC : RedC}" size="+18">[HP Nums]</font>`, command: "fps hpnumbers;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  256. { text: `<font color="${mod.settings.HideMpNumbers ? GrnC : RedC}" size="+18">[MP Nums]</font>`, command: "fps mpnumbers;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  257. { text: `<font color="${mod.settings.HideMySummons ? GrnC : RedC}" size="+18">[Own summons]</font>`, command: "fps summons me;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  258. { text: `<font color="${mod.settings.HideMyServants ? GrnC : RedC}" size="+18">[Pets]</font>`, command: "fps pet me;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  259. { text: `<font color="${mod.settings.HideOwnBlacklistedAbns ? GrnC : RedC}" size="+18">[Blur/dizzy]</font><br>`, command: "fps screenabns;fps gui" },
  260. { text: `<font color="${YlwC}" size="+20">Players:</font>` }, { text: "&#09;&#09;" },
  261. { text: `<font color="${LBlC}" size="+18">[Spawned list]</font>`, command: "fps gui show" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
  262. { text: `<font color="${LBlC}" size="+18">[Hidden list]</font>`, command: "fps gui hide" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
  263. { text: `<font color="${mod.settings.HideOthersSummons ? GrnC : RedC}" size="+18">[Players summons]</font>`, command: "fps summons;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  264. { text: `<font color="${mod.settings.HideOthersServants ? GrnC : RedC}" size="+18">[Pets]</font><br>`, command: "fps pet;fps gui" },
  265. { text: `<font color="${YlwC}" size="+20">NPCs:</font>` }, { text: "&#09;&#09;" },
  266. { text: `<font color="${LBlC}" size="+18">[Menu]</font>`, command: "fps gui npcmain" }, { text: "&nbsp;&nbsp;" },
  267. { text: `<font color="${mod.settings.HideMonsterDeathAnimation ? GrnC : RedC}" size="+18">[Hide Death Ani]</font>`, command: "fps monsterdeathani;fps gui" }, { text: "&nbsp;&nbsp;" },
  268. { text: `<font color="${mod.settings.ActionScripts ? GrnC : RedC}" size="+18">[Zoom-ins]</font>`, command: "fps npczoom;fps gui" }, { text: "&nbsp;&nbsp;" },
  269. { text: `<font color="${mod.settings.HideBlacklistedNpcs ? GrnC : RedC}" size="+18">[Hide Blacklisted]</font><br><br>`, command: "fps npc;fps gui" },
  270. { text: `<font color="${YlwC}" size="+20">Skills:</font>` }, { text: "&#09;&#09;" },
  271. { text: `<font color="${LBlC}" size="+18">[Hide individually]</font>`, command: "fps gui skills" }, { text: "&nbsp;&nbsp;&nbsp;" },
  272. { text: `<font color="${mod.settings.HideBlacklistedSkills ? GrnC : RedC}" size="+18">[Hide Blacklisted]</font><br>`, command: "fps skill blacklist;fps gui" },
  273. { text: `<font color="${YlwC}" size="+20">Abnormal:</font>` }, { text: "&#09;" },
  274. { text: `<font color="${mod.settings.HideAllAbnormalities ? GrnC : RedC}" size="+18">[Hide ALL]</font>`, command: "fps abn all;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  275. { text: `<font color="${mod.settings.HideBlacklistedAbnormalities ? GrnC : RedC}" size="+18">[Hide Blacklisted]</font>`, command: "fps abn blacklist;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  276. { text: `<font color="${LBlC}" size="+18">[Black List]</font><br>`, command: "fps gui abn" },
  277. { text: `<font color="${YlwC}" size="+20">Projectile:</font>` }, { text: "&#09;" },
  278. { text: `<font color="${mod.settings.HideAllProjectiles ? GrnC : RedC}" size="+18">[Hide ALL]</font>`, command: "fps proj all;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  279. { text: `<font color="${mod.settings.HideBlacklistedProjectiles ? GrnC : RedC}" size="+18">[Hide Blacklisted]</font>`, command: "fps proj blacklist;fps gui" }, { text: "&nbsp;&nbsp;&nbsp;" },
  280. { text: `<font color="${LBlC}" size="+18">[Black List]</font><br><br>`, command: "fps gui proj" },
  281. { text: `<font color="${YlwC}" size="+20">Misc.</font>` }, { text: "&#09;&#09;" },
  282. { text: `<font color="${mod.settings.RaidAutoChange ? GrnC : RedC}" size="+18">[Raid auto state]</font>`, command: "fps raid;fps gui" }, { text: "&nbsp;&nbsp;" },
  283. { text: `<font color="${mod.settings.OnlyParty ? GrnC : RedC}" size="+18">[Only Party]</font>`, command: "fps party;fps gui" }, { text: "&nbsp;&nbsp;" },
  284. { text: `<font color="${mod.settings.HideBlacklistedDrop ? GrnC : RedC}" size="+18">[Drops BList]</font>`, command: "fps dropitem;fps gui" }, { text: "&nbsp;&nbsp;" },
  285. { text: `<font color="${mod.settings.PvpTraps ? GrnC : RedC}" size="+17">[Show Traps]</font><br>`, command: "fps pvptraps;fps gui" }, { text: "&#09;&#09;&#09;" },
  286. { text: `<font color="${mod.settings.GuardianAutoChange ? GrnC : RedC}" size="+17">[Guardian auto state]</font>`, command: "fps guardian;fps gui" }, { text: "&nbsp;&nbsp;" },
  287. { text: `<font color="${mod.settings.StreamMode ? GrnC : RedC}" size="+17">[Stream]</font><br><br>`, command: "fps stream;fps gui" },
  288. { text: `<font color="${BluC}" size="+22">Quick Links:</font><br>` },
  289. { text: `<font color="${YlwC}" size="+20">UI:</font>` }, { text: "&#09;&#09;" },
  290. { text: `<font color="${PrpC}" size="+17">[Mail]</font>`, command: "fps quicklink parcel" }, { text: "&nbsp;&nbsp;&nbsp;" },
  291. { text: `<font color="${PrpC}" size="+17">[Broker]</font>`, command: "fps quicklink broker" }, { text: "&nbsp;&nbsp;&nbsp;" },
  292. { text: `<font color="${PrpC}" size="+17">[Talent]</font>`, command: "fps quicklink talents" }, { text: "&nbsp;&nbsp;&nbsp;" },
  293. { text: `<font color="${PrpC}" size="+17">[Dress]</font>`, command: "fps quicklink dressingroom" }, { text: "&nbsp;&nbsp;&nbsp;" },
  294. { text: `<font color="${PrpC}" size="+17">[Hat Style]</font>`, command: "fps quicklink hatrestyle" }, { text: "&nbsp;&nbsp;&nbsp;" },
  295. { text: `<font color="${PrpC}" size="+17">[Search-Engine]</font><br>`, command: "fps quicklink searchengine" },
  296. { text: `<font color="${YlwC}" size="+20">Party:</font>` }, { text: "&#09;" },
  297. { text: `<font color="${CPKC}" size="+18">[Reset]</font>`, command: "fps quicklink reset" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
  298. { text: `<font color="${CPKC}" size="+18">[Leave]</font>`, command: "fps quicklink drop" }, { text: "&nbsp;&nbsp;&nbsp;&nbsp;" },
  299. { text: `<font color="${CPKC}" size="+18">[Disband]</font><br>`, command: "fps quicklink disband" },
  300. { text: `<font color="${YlwC}" size="+20">System:</font>` }, { text: "&#09;" },
  301. { text: `<font color="${CPKC}" size="+18">[Character Selection]</font>`, command: "fps quicklink lobby" }, { text: "&#09;&#09;&#09;&#09;&#09;" },
  302. { text: `<font color="${CPKC}" size="+18">[!! Instant Exit !!]</font><br>`, command: "fps quicklink instantexit" }
  303. ], `<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>`)
  304. }
  305. }
  306. // ~~~ * Gui Functions * ~~~ \\
  307. function SkillJsonSearch(value) {
  308. let keys = [],
  309. skilldata = [],
  310. skillIds = [];
  311. skilldata.push(
  312. { text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
  313. { 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" },
  314. { text: `<font color="${LBlC}" size="+19">Click skill to blacklist it.</font><br>` }
  315. )
  316. for (let key in SkillData[value]) {
  317. keys.push(key);
  318. }
  319. skillIds.push(Object.values(SkillData[value]))
  320. for (let i = 0; i < keys.length; i++) {
  321. 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>` });
  322. }
  323. return skilldata;
  324. }
  325. function NpcJsonSearch(type, arg) {
  326. const NpcDataLength = NpcData.length;
  327. TmpData = []
  328. TmpData.push({ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" })
  329. switch (type) {
  330. case 'starts':
  331. 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>` });
  332. break;
  333. case 'search':
  334. 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>` });
  335. break;
  336. }
  337. gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - NPCs</font> | <font color="${LBlC}" size="+16">Search results for '${arg}'</font>.`)
  338. TmpData = []
  339. }
  340. function ClassNameFromID(name) {
  341. for (const Class_data of Object.keys(mod.settings.ClassesData)) if (mod.settings.ClassesData[Class_data].name == name) return Class_data;
  342. }
  343. // ~~~ * Command Functions * ~~~ \\
  344. function Msg(msg) {
  345. if (mod.settings.StreamMode) return;
  346. if (NotCP) mod.command.message(`<font color="${LPrC}">[FPS] ${msg}</font>`);
  347. else mod.command.message(`<font color="${LPrC}">${msg}</font>`);
  348. }
  349. function RemoveEntity(name) {
  350. let what, A = arguments, Al = A.length, Ax;
  351. while (Al > 1 && name.length) {
  352. what = A[--Al];
  353. while ((Ax = name.indexOf(what)) !== -1) name.splice(Ax, 1);
  354. }
  355. return name;
  356. }
  357. function HideSpecificPlayer(name) {
  358. for (let i in SUsers) {
  359. if (SUsers[i].name.toString().toLowerCase() === name.toLowerCase()) {
  360. mod.toClient('S_DESPAWN_USER', 3, { gameId: SUsers[i].gameId, type: 1 });
  361. HUsers[SUsers[i].gameId] = SUsers[i];
  362. return;
  363. }
  364. }
  365. }
  366. function HideSpecificNpc(hz, ti) {
  367. for (let i in SNpcs) {
  368. if (SNpcs[i].huntingZoneId === hz && SNpcs[i].templateId === ti) {
  369. mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[i].gameId, loc: SNpcs[i].loc, type: 1, unk: 0 })
  370. HNpcs[SNpcs[i].gameId] = SNpcs[i];
  371. HNpcs[SNpcs[i].gameId].spawnType = 1;
  372. HNpcs[SNpcs[i].gameId].spawnScript = 0;
  373. }
  374. }
  375. }
  376. function ShowSpecificPlayer(name) {
  377. for (let i in HUsers) {
  378. if (HUsers[i].name.toString().toLowerCase() === name.toLowerCase()) {
  379. ModifyUserAppearance(HUsers[i]);
  380. mod.toClient('S_SPAWN_USER', NotCP ? 14 : 15, HUsers[i]);
  381. delete HUsers[i];
  382. }
  383. }
  384. }
  385. function ShowSpecificNpc(hz, ti) {
  386. for (let i in HNpcs) {
  387. if (HNpcs[i].huntingZoneId === hz && HNpcs[i].templateId === ti) {
  388. mod.toClient('S_SPAWN_NPC', 11, HNpcs[i]);
  389. delete HNpcs[i];
  390. }
  391. }
  392. }
  393. function HideAllPlayers() {
  394. if (!mod.settings.OnlyParty) {
  395. for (let i in SUsers) {
  396. mod.toClient('S_DESPAWN_USER', 3, { gameId: SUsers[i].gameId, type: 1 });
  397. HUsers[SUsers[i].gameId] = SUsers[i];
  398. HUsers[SUsers[i].gameId].spawnFx = 1;
  399. }
  400. }
  401. }
  402. function HideNpcs(type, whose) {
  403. switch (type) {
  404. case 'own':
  405. for (let k in SNpcs) {
  406. if (EqGid(SNpcs[k].owner) && UserNPCs.includes(SNpcs[k].templateId) && SNpcs[k].huntingZoneId === 1023) {
  407. mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
  408. HNpcs[SNpcs[k].gameId] = SNpcs[k];
  409. }
  410. }
  411. break;
  412. case 'others':
  413. for (let k in SNpcs) {
  414. if (!EqGid(SNpcs[k].owner) && UserNPCs.includes(SNpcs[k].templateId) && SNpcs[k].huntingZoneId === 1023) {
  415. mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
  416. HNpcs[SNpcs[k].gameId] = SNpcs[k];
  417. }
  418. }
  419. break;
  420. case 'bl':
  421. for (let k in SNpcs) {
  422. for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
  423. if (SNpcs[k].huntingZoneId == mod.settings.NpcsBlacklist[i].zone && SNpcs[k].templateId == mod.settings.NpcsBlacklist[i].templateId) {
  424. mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
  425. HNpcs[SNpcs[k].gameId] = SNpcs[k];
  426. }
  427. }
  428. }
  429. break;
  430. case 'pet':
  431. switch (whose) {
  432. case 'own':
  433. for (let p in SPets) {
  434. if (!EqGid(SPets[p].ownerId)) continue
  435. mod.toClient('S_REQUEST_DESPAWN_SERVANT', 1, { gameId: SPets[p].gameId, despawnType: 1 })
  436. HPets[SPets[p].gameId] = SPets[p]
  437. }
  438. break;
  439. case 'others':
  440. for (let p in SPets) {
  441. if (EqGid(SPets[p].ownerId)) continue
  442. mod.toClient('S_REQUEST_DESPAWN_SERVANT', 1, { gameId: SPets[p].gameId, despawnType: 1 })
  443. HPets[SPets[p].gameId] = SPets[p]
  444. }
  445. break;
  446. default: break;
  447. }
  448. break;
  449. default: break;
  450. }
  451. }
  452. function ShowNpcs(type, whose) {
  453. switch (type) {
  454. case 'own':
  455. for (let v in HNpcs) {
  456. if (EqGid(HNpcs[v].owner) && UserNPCs.includes(HNpcs[v].templateId) && HNpcs[v].huntingZoneId === 1023) {
  457. mod.toClient('S_SPAWN_NPC', 11, HNpcs[v]);
  458. delete HNpcs[v];
  459. }
  460. }
  461. break;
  462. case 'others':
  463. for (let v in HNpcs) {
  464. if (!EqGid(HNpcs[v].owner) && UserNPCs.includes(HNpcs[v].templateId) && HNpcs[v].huntingZoneId === 1023) {
  465. mod.toClient('S_SPAWN_NPC', 11, HNpcs[v]);
  466. delete HNpcs[v];
  467. }
  468. }
  469. break;
  470. case 'bl':
  471. for (let v in HNpcs) {
  472. for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
  473. if (HNpcs[v].huntingZoneId == mod.settings.NpcsBlacklist[i].zone && HNpcs[v].templateId == mod.settings.NpcsBlacklist[i].templateId) {
  474. mod.toClient('S_SPAWN_NPC', 11, HNpcs[v]);
  475. delete HNpcs[v];
  476. }
  477. }
  478. }
  479. break;
  480. case 'pet':
  481. switch (whose) {
  482. case 'own':
  483. for (let p in HPets) {
  484. if (!EqGid(HPets[p].ownerId)) continue
  485. mod.toClient('S_REQUEST_SPAWN_SERVANT', NotCP ? 1 : 2, HPets[p])
  486. delete HPets[p]
  487. }
  488. break;
  489. case 'others':
  490. for (let p in HPets) {
  491. if (EqGid(HPets[p].ownerId)) continue
  492. mod.toClient('S_REQUEST_SPAWN_SERVANT', NotCP ? 1 : 2, HPets[p])
  493. delete HPets[p]
  494. }
  495. break;
  496. default: break;
  497. }
  498. break;
  499. default: break;
  500. }
  501. }
  502. function ShowAllPlayers() {
  503. for (let i in HUsers) {
  504. ModifyUserAppearance(HUsers[i]);
  505. mod.toClient('S_SPAWN_USER', NotCP ? 14 : 15, HUsers[i]);
  506. delete HUsers[i];
  507. }
  508. }
  509. // ~~~ * Functions * ~~~ \\
  510. function ModifyUserAppearance(event) {
  511. let modified = false;
  512. if (mod.settings.ShowStyle) {
  513. event.weapon = [10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 80396, 55005, 82005, 58171, 59053][event.templateId % 100 - 1];
  514. event.body = event.hand = event.feet = event.underwear = event.head = event.face = 0;
  515. if (event.mount) event.mount = 16;
  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 = event.stackExplode = false;
  542. event.superArmor = false;
  543. event.superArmorId = event.hitCylinderId = 0;
  544. modified = true;
  545. }
  546. if (mod.settings.Hit_Other && !EqGid(event.target) && !EqGid(event.source) && !EqGid(event.owner) && (SUsers[event.owner] || SUsers[event.source])) {
  547. event.target = 0;
  548. event.id = event.type = event.noctEffect = 0;
  549. event.value = 0;
  550. event.crit = event.stackExplode = false;
  551. event.superArmor = false;
  552. event.superArmorId = event.hitCylinderId = 0;
  553. modified = true;
  554. }
  555. if (mod.settings.Hit_Damage && (EqGid(event.source) || EqGid(event.owner) || UserNPCs.includes(event.templateId) && event.skill.huntingZoneId === 1023)) {
  556. event.id = event.type = event.noctEffect = 0;
  557. event.value = 0;
  558. event.crit = event.stackExplode = false;
  559. event.superArmor = false;
  560. event.superArmorId = event.hitCylinderId = 0;
  561. modified = true;
  562. }
  563. if (mod.settings.Hit_All) {
  564. event.target = 0;
  565. event.id = event.type = event.noctEffect = 0;
  566. event.value = 0;
  567. event.crit = event.stackExplode = false;
  568. event.superArmor = false;
  569. event.superArmorId = event.hitCylinderId = 0;
  570. modified = true;
  571. }
  572. return modified ? true : undefined;
  573. }
  574. function NpcBCheck(event) {
  575. let blocked = false;
  576. if (mod.settings.HideBlacklistedNpcs) {
  577. for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
  578. if (event.huntingZoneId == mod.settings.NpcsBlacklist[i].zone && event.templateId == mod.settings.NpcsBlacklist[i].templateId) {
  579. HNpcs[event.gameId] = event;
  580. HNpcs[event.gameId].spawnType = 1;
  581. HNpcs[event.gameId].spawnScript = 0;
  582. blocked = true;
  583. break;
  584. }
  585. }
  586. }
  587. if (InvisibleNpcs[event.huntingZoneId] && InvisibleNpcs[event.huntingZoneId].includes(event.templateId)) {
  588. HNpcs[event.gameId] = event;
  589. blocked = true;
  590. }
  591. if (mod.settings.HideFireworks && event.huntingZoneId === 1023 && [60016000, 80037000].includes(event.templateId)) {
  592. HNpcs[event.gameId] = event;
  593. blocked = true;
  594. }
  595. if (UserNPCs.includes(event.templateId) && event.huntingZoneId === 1023) {
  596. if (EqGid(event.owner) && mod.settings.HideMySummons) {
  597. HNpcs[event.gameId] = event;
  598. HNpcs[event.gameId].spawnType = 1;
  599. HNpcs[event.gameId].spawnScript = 0;
  600. blocked = true;
  601. } else if (!EqGid(event.owner) && mod.settings.HideOthersSummons) {
  602. HNpcs[event.gameId] = event;
  603. HNpcs[event.gameId].spawnType = 1;
  604. HNpcs[event.gameId].spawnScript = 0;
  605. blocked = true;
  606. }
  607. }
  608. return blocked;
  609. }
  610. function EqGid(xg) {
  611. return (xg === MyGameId);
  612. }
  613. function ClassID(m) {
  614. return (m % 100);
  615. }
  616. function log(name, type, from, target, id) {
  617. 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"`);
  618. }
  619. function UpdateUserLoc(event) {
  620. mod.toClient('S_USER_LOCATION', 5, { gameId: event.gameId, loc: event.loc, w: event.w, speed: 300, dest: event.loc, type: 7 });
  621. }
  622. // ~~~ * Hook Functions * ~~~ \\
  623. function sLogin(event) {
  624. LastState = event.name === MyName ? LastState : null;
  625. LastGState = null;
  626. MyGameId = event.gameId;
  627. MyName = event.name;
  628. ProjDebug = false;
  629. AbnDebug = false;
  630. AllowedAchUps = 2;
  631. 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 its disabled.");
  632. }
  633. function sLoadTopo() {
  634. SUsers = {};
  635. SNpcs = {};
  636. HUsers = {};
  637. HNpcs = {};
  638. AllowedAchUps = 1;
  639. if (ProjDebug) {
  640. ProjDebug = false
  641. Msg(`<font color="${HPkC}">Auto Disabled</font> projectile debug, to reduce the unneeded spam.`);
  642. }
  643. if (AbnDebug) {
  644. AbnDebug = false
  645. Msg(`<font color="${HPkC}">Auto Disabled</font> abnormalities debug, to reduce the unneeded spam.`);
  646. }
  647. }
  648. function sLeaveParty() {
  649. PMembers = []
  650. if (mod.settings.RaidAutoChange) {
  651. if (LastState === null || mod.settings.Mode !== 2) {
  652. LastState = null;
  653. return;
  654. }
  655. mod.command.exec(`fps mode ${LastState}`);
  656. LastState = null;
  657. }
  658. }
  659. function sMountVehicle(event) {
  660. if (EqGid(event.gameId)) return;
  661. SUsers[event.gameId].mount = event.id;
  662. if (HUsers[event.gameId]) HUsers[event.gameId].mount = event.id;
  663. if (mod.settings.ShowStyle) {
  664. event.id = 16;
  665. return true;
  666. }
  667. }
  668. function sUnmountVehicle(event) {
  669. if (EqGid(event.gameId)) return;
  670. SUsers[event.gameId].mount = 0;
  671. if (HUsers[event.gameId]) HUsers[event.gameId].mount = 0;
  672. }
  673. function cSetVisibleRange(event) {
  674. LastVrange = event.range
  675. }
  676. function sStartCooltimeItem(event) {
  677. if (event.cooldown === 0) return false;
  678. }
  679. function sStartActionScript(event) {
  680. if ([40000, 40001, 40002].includes(event.script)) return;
  681. if (mod.settings.ActionScripts) return false;
  682. }
  683. function sLoadingScreenControlInfo() {
  684. if (mod.settings.Mode >= 2) return false;
  685. }
  686. function sUpdateAchievementProgress(event) {
  687. if (AllowedAchUps) { AllowedAchUps--; return; }
  688. for (const Achieve of event.achievements) if (SpamAchIds.indexOf(Achieve.id) > -1) return false;
  689. }
  690. function sItemCustomString(event) {
  691. if (event.customStrings.length === 0) return false;
  692. }
  693. function sSocial(event) {
  694. if (EqGid(event.target)) return;
  695. if (HUsers[event.target] || HNpcs[event.target]) return false;
  696. }
  697. function sGuildName(event) {
  698. if (mod.settings.Hideguildlogos) {
  699. event.guildEmblem = '';
  700. return true;
  701. }
  702. }
  703. function sApplyTitle(event) {
  704. if (EqGid(event.gameId)) return;
  705. if (mod.settings.ShowStyle) return false;
  706. }
  707. function sImageData() {
  708. if (mod.settings.Hideguildlogos) return false;
  709. }
  710. function sSpawnUser(event) {
  711. SUsers[event.gameId] = event;
  712. SUsers[event.gameId].spawnFx = 1;
  713. 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))) {
  714. HUsers[event.gameId] = event;
  715. HUsers[event.gameId].spawnFx = 1;
  716. return false;
  717. }
  718. if (ModifyUserAppearance(event)) return true;
  719. }
  720. function sSpawnUserfn(event) {
  721. if (ModifyUserAppearance(event)) return true;
  722. }
  723. function sDespawnUser(event) {
  724. delete HUsers[event.gameId];
  725. delete SUsers[event.gameId];
  726. }
  727. function sUserLocation(event) {
  728. if (SUsers[event.gameId]) {
  729. SUsers[event.gameId].loc = event.dest;
  730. SUsers[event.gameId].w = event.w;
  731. }
  732. if (HUsers[event.gameId]) {
  733. HUsers[event.gameId].loc = event.dest;
  734. HUsers[event.gameId].w = event.w;
  735. return false;
  736. }
  737. }
  738. function sUserStatus(event) {
  739. if (SUsers[event.gameId]) SUsers[event.gameId].status = event.status;
  740. if (HUsers[event.gameId]) {
  741. HUsers[event.gameId].status = event.status;
  742. return false;
  743. }
  744. }
  745. function sDeadLocation(event) {
  746. if (SUsers[event.gameId]) SUsers[event.gameId].loc = event.loc;
  747. if (HUsers[event.gameId]) HUsers[event.gameId].loc = event.loc;
  748. }
  749. function sUserMoveType() { return false; }
  750. function sPartyMemberList(event) {
  751. event.members.map(value => PMembers.push(value.name))
  752. if (mod.settings.RaidAutoChange) {
  753. if (event.members.length >= 18) {
  754. if (mod.settings.Mode >= 2 || (LastState === null && mod.settings.Mode === 2)) return;
  755. LastState = mod.settings.Mode;
  756. mod.command.exec("fps state 2");
  757. } else {
  758. if (LastState === null || mod.settings.Mode !== 2) {
  759. LastState = null;
  760. return;
  761. }
  762. mod.command.exec(`fps state ${LastState}`);
  763. LastState = null;
  764. }
  765. }
  766. }
  767. function sUserAppearanceChange(event) {
  768. if (EqGid(event.id)) return;
  769. if (mod.settings.ShowStyle) return false;
  770. }
  771. function sUserExternalChange(event) {
  772. if (EqGid(event.gameId)) return;
  773. if (mod.settings.ShowStyle) return false;
  774. }
  775. function sUnicastTransformData(event) {
  776. if (EqGid(event.gameId) || !event.gameId) return;
  777. if (mod.settings.ShowStyle) return false;
  778. if (mod.settings.Hideguildlogos) {
  779. event.guildLogo = '';
  780. return true;
  781. }
  782. }
  783. function sSpawnNpc(event) {
  784. SNpcs[event.gameId] = event;
  785. SNpcs[event.gameId].spawnType = 1;
  786. SNpcs[event.gameId].spawnScript = 0;
  787. if (NpcBCheck(event)) return false;
  788. }
  789. function sDespawnNpc(event) {
  790. delete HNpcs[event.gameId];
  791. delete SNpcs[event.gameId];
  792. if (!mod.settings.HideMonsterDeathAnimation || event.type !== 5) return;
  793. event.type = 1;
  794. return true;
  795. }
  796. function sNpcLocation(event) {
  797. if (SNpcs[event.gameId]) {
  798. SNpcs[event.gameId].loc = event.dest;
  799. SNpcs[event.gameId].w = event.w;
  800. }
  801. if (HNpcs[event.gameId]) {
  802. HNpcs[event.gameId].loc = event.dest;
  803. HNpcs[event.gameId].w = event.w;
  804. return false;
  805. }
  806. }
  807. function sCreatureRotate(event) {
  808. if (SNpcs[event.gameId]) SNpcs[event.gameId].w = event.w;
  809. if (HNpcs[event.gameId]) {
  810. HNpcs[event.gameId].w = event.w;
  811. return false;
  812. }
  813. }
  814. function sFearMoveStage(event) {
  815. if (typeof event.target !== "undefined" && ((!EqGid(event.target) && mod.settings.Mode === 3) || HUsers[event.target] || HNpcs[event.target])) return false;
  816. if (typeof event.gameId !== "undefined" && ((!EqGid(event.gameId) && mod.settings.Mode === 3) || HUsers[event.gameId] || HNpcs[event.gameId])) return false;
  817. }
  818. function sFearMoveEnd(event) {
  819. if (typeof event.target !== "undefined" && ((!EqGid(event.target) && mod.settings.Mode === 3) || HUsers[event.target] || HNpcs[event.target])) return false;
  820. if (typeof event.gameId !== "undefined" && ((!EqGid(event.gameId) && mod.settings.Mode === 3) || HUsers[event.gameId] || HNpcs[event.gameId])) return false;
  821. }
  822. function sRequestSpawnServant(event) {
  823. SPets[event.gameId] = event;
  824. if (EqGid(event.ownerId) && mod.settings.HideMyServants) {
  825. HPets[event.gameId] = event;
  826. return false;
  827. } else if (!EqGid(event.ownerId) && mod.settings.HideOthersServants) {
  828. HPets[event.gameId] = event;
  829. return false;
  830. }
  831. }
  832. function sRequestDespawnServant(event) {
  833. delete HPets[event.gameId];
  834. delete SPets[event.gameId];
  835. }
  836. function sAbnormalityBegin(event) {
  837. if (AbnDebug) {
  838. if (EqGid(event.target)) log('Abnormality', 'Applied', 'on', MyName, event.id);
  839. if (EqGid(event.source)) log('Abnormality', 'Started', 'from', MyName, event.id);
  840. if (SUsers[event.target]) log('Abnormality', 'Applied', 'on', SUsers[event.target].name, event.id);
  841. if (SUsers[event.source]) log('Abnormality', 'Started', 'from', SUsers[event.source].name, event.id);
  842. }
  843. if ([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
  844. if (ImportantAbns.includes(event.id)) return;
  845. if (EqGid(event.target)) {
  846. if (mod.settings.HideOwnBlacklistedAbns && mod.settings.OwnAbnormalsBlacklist.includes(event.id)) return false;
  847. return;
  848. }
  849. if (HUsers[event.target] || HNpcs[event.target]) return false;
  850. if (event.id === 9943049) return false;
  851. if (mod.settings.HideBlacklistedAbnormalities && (mod.settings.AbnormalitiesBlacklist.includes(event.id) || BlockedAbns.includes(event.id))) return false;
  852. if (mod.settings.HideAllAbnormalities && (SUsers[event.target] || SUsers[event.source] || mod.settings.AbnormalitiesBlacklist.includes(event.id) || BlockedAbns.includes(event.id))) return false;
  853. }
  854. function sAbnormalityRefresh(event) {
  855. if ([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
  856. if (ImportantAbns.includes(event.id)) return;
  857. if (HUsers[event.target] || HNpcs[event.target]) return false;
  858. 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;
  859. }
  860. function sAbnormalityEnd(event) {
  861. if ([90442103, 90442107].includes(event.id)) { event.id = 47702000; return true; }
  862. if (event.id === 9943049) return false;
  863. }
  864. function sActionStage(event) {
  865. if (EqGid(event.gameId) || !SUsers[event.gameId]) return;
  866. 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()))) {
  867. UpdateUserLoc(event);
  868. return false;
  869. }
  870. }
  871. function sStartUserProjectile(event) {
  872. if (ProjDebug) {
  873. if (EqGid(event.gameId)) log('Projectile', 'Started', 'from', MyName, event.skill.id);
  874. if (SUsers[event.gameId]) log('Projectile', 'Started', 'from', SUsers[event.gameId].name, event.skill.id);
  875. }
  876. if (mod.settings.Mode !== 3 && event.skill.id === 90120) return;
  877. if (mod.settings.PvpTraps && TrapsIds.includes(event.skill.id)) return;
  878. if ((mod.settings.HideBlacklistedProjectiles || mod.settings.HideAllProjectiles) && mod.settings.ProjectilesBlacklist.includes(event.skill.id)) return false;
  879. if (!EqGid(event.gameId) && SUsers[event.gameId] && (HUsers[event.gameId] || mod.settings.Mode >= 2 || mod.settings.HideAllProjectiles)) return false;
  880. }
  881. function sSpawnProjectile(event) {
  882. if (event.skill.npc) return;
  883. if (ProjDebug) {
  884. if (EqGid(event.gameId)) log('Projectile', 'Spawned', 'from', MyName, event.skill.id);
  885. if (SUsers[event.gameId]) log('Projectile', 'Spawned', 'from', SUsers[event.gameId].name, event.skill.id);
  886. }
  887. if (mod.settings.Mode !== 3 && event.skill.id === 90120) return;
  888. if (mod.settings.PvpTraps && TrapsIds.includes(event.skill.id)) return;
  889. if ((mod.settings.HideBlacklistedProjectiles || mod.settings.HideAllProjectiles) && mod.settings.ProjectilesBlacklist.includes(event.skill.id)) return false;
  890. if (!EqGid(event.gameId) && SUsers[event.gameId] && (HUsers[event.gameId] || mod.settings.Mode >= 2 || mod.settings.HideAllProjectiles)) return false;
  891. }
  892. function sPlayerChangeMp(event) {
  893. if (!mod.settings.HideMpNumbers || !EqGid(event.target)) return;
  894. if (event.type !== 0) {
  895. event.type = 0;
  896. return true;
  897. }
  898. }
  899. function sCreatureChangeHp(event) {
  900. if (!mod.settings.HideHpNumbers || !EqGid(event.target)) return;
  901. if (event.type !== 10) {
  902. event.type = 10;
  903. return true;
  904. }
  905. }
  906. function sEachSkillResult(event) {
  907. return ModifySkillResult(event);
  908. }
  909. function sSpawnDropItem(event) {
  910. if (EqGid(event.source)) return;
  911. if (mod.settings.HideBlacklistedDrop && mod.settings.DropBlacklist.includes(event.item)) return false;
  912. if (mod.settings.Mode >= 2) {
  913. event.explode = 0;
  914. return true;
  915. }
  916. }
  917. function sFontSwapInfo() {
  918. if (mod.settings.Hit_Damage || mod.settings.Hit_All) return false;
  919. }
  920. function sFieldEventOnEnter() {
  921. if (mod.settings.GuardianAutoChange) {
  922. if ((LastGState !== null && mod.settings.Mode === 2) || mod.settings.Mode >= 2) return;
  923. LastGState = mod.settings.Mode;
  924. mod.command.exec("fps state 2")
  925. }
  926. }
  927. function sFieldEventOnLeave() {
  928. if (mod.settings.GuardianAutoChange) {
  929. if (LastGState === null || mod.settings.Mode !== 2) {
  930. LastGState = null;
  931. return;
  932. }
  933. mod.command.exec(`fps state ${LastGState}`);
  934. LastGState = null;
  935. }
  936. }
  937. // ~~~ * Packet Hooks * ~~~ \\
  938. mod.hook('S_LOGIN', 13, sLogin)
  939. mod.hook('S_LOAD_TOPO', 'raw', sLoadTopo)
  940. mod.hook('S_LEAVE_PARTY', 'raw', sLeaveParty)
  941. mod.hook('S_MOUNT_VEHICLE', 2, Last_Hook, sMountVehicle)
  942. mod.hook('S_UNMOUNT_VEHICLE', 2, Last_Hook, sUnmountVehicle)
  943. mod.hook('C_SET_VISIBLE_RANGE', 1, cSetVisibleRange)
  944. mod.hook('S_START_COOLTIME_ITEM', 1, Last_Hook, sStartCooltimeItem)
  945. mod.hook('S_START_ACTION_SCRIPT', 3, Last_Hook, sStartActionScript)
  946. mod.hook('S_LOADING_SCREEN_CONTROL_INFO', 'raw', Last_Hook, sLoadingScreenControlInfo)
  947. mod.hook('S_UPDATE_ACHIEVEMENT_PROGRESS', 1, Last_Hookfn, sUpdateAchievementProgress)
  948. mod.hook('S_ITEM_CUSTOM_STRING', 2, Last_Hook, sItemCustomString)
  949. mod.hook('S_SOCIAL', 1, Last_Hook, sSocial)
  950. mod.hook('S_GUILD_NAME', 1, Last_Hook, sGuildName)
  951. mod.hook('S_APPLY_TITLE', 2, Last_Hook, sApplyTitle)
  952. mod.hook('S_IMAGE_DATA', 'raw', Last_Hook, sImageData)
  953. mod.hook('S_SPAWN_USER', NotCP ? 14 : 15, Last_Hook, sSpawnUser)
  954. mod.hook('S_SPAWN_USER', NotCP ? 14 : 15, Last_Hookfn, sSpawnUserfn)
  955. mod.hook('S_DESPAWN_USER', 3, sDespawnUser)
  956. mod.hook('S_USER_LOCATION', 5, Last_Hook, sUserLocation)
  957. mod.hook('S_USER_STATUS', 3, Last_Hook, sUserStatus)
  958. mod.hook('S_DEAD_LOCATION', 2, sDeadLocation)
  959. mod.hook('S_USER_MOVETYPE', 'raw', Last_Hook, sUserMoveType)
  960. mod.hook('S_PARTY_MEMBER_LIST', 7, sPartyMemberList)
  961. mod.hook('S_USER_APPEARANCE_CHANGE', 1, Last_Hook, sUserAppearanceChange)
  962. mod.hook('S_USER_EXTERNAL_CHANGE', 7, Last_Hook, sUserExternalChange)
  963. mod.hook('S_UNICAST_TRANSFORM_DATA', NotCP ? 5 : 6, Last_Hook, sUnicastTransformData)
  964. mod.hook('S_SPAWN_NPC', 11, Last_Hook, sSpawnNpc)
  965. mod.hook('S_DESPAWN_NPC', 3, Last_Hook, sDespawnNpc)
  966. mod.hook('S_NPC_LOCATION', 3, Last_Hook, sNpcLocation)
  967. mod.hook('S_CREATURE_ROTATE', 2, Last_Hook, sCreatureRotate)
  968. mod.hook('S_FEARMOVE_STAGE', NotCP ? 1 : 2, Last_Hook, sFearMoveStage)
  969. mod.hook('S_FEARMOVE_END', NotCP ? 1 : 2, Last_Hook, sFearMoveEnd)
  970. mod.hook('S_REQUEST_SPAWN_SERVANT', NotCP ? 1 : 2, Last_Hook, sRequestSpawnServant)
  971. mod.hook('S_REQUEST_DESPAWN_SERVANT', 1, sRequestDespawnServant)
  972. mod.hook('S_ABNORMALITY_BEGIN', 3, Last_Hook, sAbnormalityBegin)
  973. mod.hook('S_ABNORMALITY_REFRESH', 1, Last_Hook, sAbnormalityRefresh)
  974. mod.hook('S_ABNORMALITY_END', 1, Last_Hook, sAbnormalityEnd)
  975. mod.hook('S_ACTION_STAGE', 9, Last_Hook, sActionStage)
  976. mod.hook('S_SPAWN_PROJECTILE', 5, Last_Hook, sSpawnProjectile)
  977. mod.hook('S_START_USER_PROJECTILE', 9, Last_Hook, sStartUserProjectile)
  978. mod.hook('S_PLAYER_CHANGE_MP', 1, Last_Hook, sPlayerChangeMp)
  979. mod.hook('S_CREATURE_CHANGE_HP', 6, Last_Hook, sCreatureChangeHp)
  980. mod.hook('S_EACH_SKILL_RESULT', 13, Last_Hook, sEachSkillResult)
  981. mod.hook('S_SPAWN_DROPITEM', NotCP ? 7 : 8, Last_Hook, sSpawnDropItem)
  982. mod.hook('S_FONT_SWAP_INFO', 'raw', Last_Hookfn, sFontSwapInfo)
  983. mod.hook('S_FIELD_EVENT_ON_ENTER', 'raw', sFieldEventOnEnter)
  984. mod.hook('S_FIELD_EVENT_ON_LEAVE', 'raw', sFieldEventOnLeave)
  985. // ~~~ * Commands * ~~~ \\
  986. mod.command.add('0', () => mod.command.exec('fps mode 0'))
  987. mod.command.add('1', () => mod.command.exec('fps mode 1'))
  988. mod.command.add('2', () => mod.command.exec('fps mode 2'))
  989. mod.command.add('3', () => mod.command.exec('fps mode 3'))
  990. mod.command.add(['fps', '!fps', 'fps-utils', '!fps-utils'], (key, arg, arg2, arg3) => {
  991. switch (key) {
  992. case "g": case "gui":
  993. GuiHandler(arg, arg2);
  994. break;
  995. case "0":
  996. mod.command.exec('fps mode 0');
  997. break;
  998. case "1":
  999. mod.command.exec('fps mode 1');
  1000. break;
  1001. case "2":
  1002. mod.command.exec('fps mode 2')
  1003. break;
  1004. case "3":
  1005. mod.command.exec('fps mode 3');
  1006. break;
  1007. case "mod": case "mode": case "state":
  1008. switch (arg) {
  1009. case "0": case "off": case "zero":
  1010. if (mod.settings.Mode === 3) ShowAllPlayers();
  1011. mod.settings.Mode = 0;
  1012. mod.settings.HideAllAbnormalities = false;
  1013. mod.settings.HideAllProjectiles = false;
  1014. mod.settings.Hit_Other = false;
  1015. Msg(`<font color="${RedC}">Mode 0</font>.`);
  1016. break;
  1017. case "1": case "one":
  1018. if (mod.settings.Mode === 3) ShowAllPlayers();
  1019. mod.settings.Mode = 1;
  1020. mod.settings.HideAllAbnormalities = false;
  1021. mod.settings.HideAllProjectiles = true;
  1022. mod.settings.Hit_Other = true;
  1023. Msg(`<font color="${BnzC}">Mode 1</font>.`);
  1024. break;
  1025. case "2": case "two":
  1026. if (mod.settings.Mode === 3) ShowAllPlayers();
  1027. mod.settings.Mode = 2;
  1028. mod.settings.HideAllAbnormalities = true;
  1029. mod.settings.HideAllProjectiles = true;
  1030. mod.settings.Hit_Other = true;
  1031. Msg(`<font color="${SlvC}">Mode 2</font>.`);
  1032. break;
  1033. case "3": case "three":
  1034. HideAllPlayers();
  1035. mod.settings.Mode = 3;
  1036. mod.settings.HideAllAbnormalities = true;
  1037. mod.settings.HideAllProjectiles = true;
  1038. mod.settings.Hit_Other = true;
  1039. mod.settings.OnlyParty = false;
  1040. Msg(`<font color="${GldC}">Mode 3</font>.`);
  1041. break;
  1042. default:
  1043. Msg(`<font color="${GryC}">Invalid" ${arg}"</font>.`);
  1044. Msg(`Modes: "<font color="${PnkC}">[0, 1, 2, 3]</font>.`);
  1045. break;
  1046. }
  1047. break;
  1048. case "hide":
  1049. if (typeof arg === "string" && arg !== null) {
  1050. if (mod.settings.PlayersBlacklist.includes(arg)) return Msg(`Player '${arg}' <font color="${RedC}">Already hidden</font>.`);
  1051. else
  1052. if ((GameJobs.includes(arg) && !mod.settings.ClassesBlacklist.includes(arg)) || (GameRoles.includes(arg) && !mod.settings.RolesBlacklist.includes(arg))) {
  1053. for (let i in mod.settings.ClassesData) {
  1054. if ((mod.settings.ClassesData[i].name === arg || mod.settings.ClassesData[i].role.includes(arg)) && mod.settings.ClassesData[i].isHidden !== true) {
  1055. mod.settings.ClassesData[i].isHidden = true;
  1056. if (mod.settings.ClassesData[i].name === arg) mod.settings.ClassesBlacklist.push(arg);
  1057. if (mod.settings.ClassesData[i].role.includes(arg)) mod.settings.RolesBlacklist.push(arg);
  1058. let classtohide = mod.settings.ClassesData[i].model;
  1059. for (let i in SUsers) { if (ClassID(SUsers[i].templateId) === classtohide) HideSpecificPlayer(SUsers[i].name); }
  1060. }
  1061. }
  1062. Msg(`Class/Role ${arg} <font color="${GrnC}">Hidden</font>.`);
  1063. return;
  1064. } else if (mod.settings.ClassesBlacklist.includes(arg) || mod.settings.RolesBlacklist.includes(arg)) return Msg(`Class/Role '${arg}' <font color="${RedC}">Already hidden</font>.`);
  1065. Msg(`Player '${arg}' <font color="${GrnC}">Hidden</font>.`);
  1066. mod.settings.PlayersBlacklist.push(arg);
  1067. HideSpecificPlayer(arg);
  1068. } else Msg(`<font color="${GryC}">Invalid ${arg2}</font>.`);
  1069. break;
  1070. case "show":
  1071. if (typeof arg === "string" && arg !== null) {
  1072. if (mod.settings.PlayersBlacklist.includes(arg)) {
  1073. ShowSpecificPlayer(arg);
  1074. RemoveEntity(mod.settings.PlayersBlacklist, arg);
  1075. Msg(`Player '${arg}' <font color="${RedC}">Shown</font>.`);
  1076. return;
  1077. }
  1078. if ((GameJobs.includes(arg) && mod.settings.ClassesBlacklist.includes(arg)) || (mod.settings.RolesBlacklist.includes(arg) && GameRoles.includes(arg))) {
  1079. for (let i in mod.settings.ClassesData) {
  1080. if (mod.settings.ClassesData[i].name === arg || mod.settings.ClassesData[i].role.includes(arg)) {
  1081. if (mod.settings.ClassesData[i].name === arg) RemoveEntity(mod.settings.ClassesBlacklist, arg);
  1082. if (mod.settings.ClassesData[i].role.includes(arg)) RemoveEntity(mod.settings.RolesBlacklist, arg);
  1083. mod.settings.ClassesData[i].isHidden = false;
  1084. let classToShow = mod.settings.ClassesData[i].model;
  1085. for (let i in HUsers) {
  1086. if (ClassID(HUsers[i].templateId) === classToShow) ShowSpecificPlayer(HUsers[i].name);
  1087. }
  1088. }
  1089. }
  1090. Msg(`Class '${arg}' <font color="${RedC}">Shown</font>.`);
  1091. } else if (!mod.settings.ClassesBlacklist.includes(arg) || !mod.settings.RolesBlacklist.includes(arg)) Msg(`Class/Role '${arg}' <font color="${RedC}">Already shown</font>.`);
  1092. else if (!mod.settings.PlayersBlacklist.includes(arg)) Msg(`Player '${arg}' <font color="${RedC}">Already shown</font>.`);
  1093. else Msg(`<font color="${GryC}">Invalid ${arg2}</font>.`);
  1094. }
  1095. break;
  1096. case "party":
  1097. if (mod.settings.Mode === 3) return Msg(`<font color="${RedC}">You've to disable mode 3 first</font>.`);
  1098. mod.settings.OnlyParty = !mod.settings.OnlyParty;
  1099. if (mod.settings.OnlyParty) {
  1100. for (let i in SUsers) {
  1101. if (!PMembers.includes(SUsers[i].name)) {
  1102. mod.toClient('S_DESPAWN_USER', 3, { gameId: SUsers[i].gameId, type: 1 })
  1103. HUsers[SUsers[i].gameId] = SUsers[i];
  1104. }
  1105. }
  1106. } else ShowAllPlayers();
  1107. Msg(`Everyone but party ${mod.settings.OnlyParty ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1108. break;
  1109. case "raid":
  1110. mod.settings.RaidAutoChange = !mod.settings.RaidAutoChange;
  1111. Msg(`Raid auto-state ${mod.settings.RaidAutoChange ? `<font color="${GrnC}">Enabled</font>` : `<font color="${RedC}">Disabled</font>`}.`);
  1112. if (!mod.settings.GuardianAutoChange) LastState = null;
  1113. break;
  1114. case "guardian":
  1115. mod.settings.GuardianAutoChange = !mod.settings.GuardianAutoChange;
  1116. Msg(`Guardian auto-state ${mod.settings.GuardianAutoChange ? `<font color="${GrnC}">Enabled</font>` : `<font color="${RedC}">Disabled</font>`}.`);
  1117. if (!mod.settings.GuardianAutoChange) LastGState = null;
  1118. break;
  1119. case "pvptraps":
  1120. mod.settings.PvpTraps = !mod.settings.PvpTraps;
  1121. 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>`}.`);
  1122. break;
  1123. case "list":
  1124. Msg(`<font color="${PnkC}">Hidden players: ${mod.settings.PlayersBlacklist.length ? mod.settings.PlayersBlacklist : 0}</font>.`);
  1125. Msg(`<font color="${PnkC}">Hidden classes: ${mod.settings.ClassesBlacklist.length ? mod.settings.ClassesBlacklist : 0}</font>.`);
  1126. Msg(`<font color="${PnkC}">Hidden roles: ${mod.settings.RolesBlacklist.length ? mod.settings.RolesBlacklist : 0}</font>.`);
  1127. break;
  1128. case "summons": case "sums":
  1129. switch (arg) {
  1130. case "me":
  1131. mod.settings.HideMySummons = !mod.settings.HideMySummons;
  1132. mod.settings.HideMySummons ? HideNpcs('own') : ShowNpcs('own');
  1133. Msg(`Own summoned NPCs are ${mod.settings.HideMySummons ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1134. break;
  1135. default:
  1136. mod.settings.HideOthersSummons = !mod.settings.HideOthersSummons;
  1137. mod.settings.HideOthersSummons ? HideNpcs('others') : ShowNpcs('others');
  1138. Msg(`Others summoned NPCs are ${mod.settings.HideOthersSummons ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1139. break;
  1140. }
  1141. break;
  1142. case "skills": case "skill":
  1143. switch (arg) {
  1144. case "blacklist":
  1145. mod.settings.HideBlacklistedSkills = !mod.settings.HideBlacklistedSkills;
  1146. Msg(`Blacklisted skills ${mod.settings.HideBlacklistedSkills ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1147. break;
  1148. case "class":
  1149. if (GameJobs.includes(arg2)) {
  1150. for (let i in mod.settings.ClassesData) {
  1151. if (mod.settings.ClassesData[i].name === arg2) {
  1152. if (arg3 != null && !isNaN(arg3) && arg3 < 50) {
  1153. if (mod.settings.ClassesData[i].CD_SkillsBlacklist.includes(arg3)) {
  1154. let index = mod.settings.ClassesData[i].CD_SkillsBlacklist.indexOf(arg3);
  1155. if (index !== -1) {
  1156. mod.settings.ClassesData[i].CD_SkillsBlacklist.splice(index, 1);
  1157. Msg(`Skill ID '${arg3}' <font color="${RedC}">Shown</font> for class '${arg2}'.`);
  1158. }
  1159. return;
  1160. } else {
  1161. mod.settings.ClassesData[i].CD_SkillsBlacklist.push(arg3);
  1162. Msg(`Skill ID '${arg3}' <font color="${GrnC}">Hidden</font> for class '${arg2}'.`);
  1163. return;
  1164. }
  1165. } else {
  1166. mod.settings.ClassesData[i].CD_HideBlacklistedSkills = !mod.settings.ClassesData[i].CD_HideBlacklistedSkills;
  1167. Msg(`Skills for '${arg2}' class ${mod.settings.ClassesData[i].CD_HideBlacklistedSkills ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1168. return;
  1169. }
  1170. }
  1171. }
  1172. } else Msg(`<font color="${RedC}">Class ${arg2} not found</font>.`);
  1173. break;
  1174. }
  1175. break;
  1176. case "npcs": case "npc":
  1177. if (arg === 'hide') {
  1178. if (!arg2 || !arg3) {
  1179. mod.settings.HideBlacklistedNpcs = !mod.settings.HideBlacklistedNpcs;
  1180. Msg(`Blacklisted NPCs ${mod.settings.HideBlacklistedNpcs ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1181. break;
  1182. }
  1183. const found = mod.settings.NpcsBlacklist.some(s => s.zone === arg2 && s.templateId === arg3);
  1184. if (found) {
  1185. if (mod.settings.HideBlacklistedNpcs) ShowSpecificNpc(Number(arg2), Number(arg3));
  1186. Msg(`NPC HntZone '${arg2}', TmpId '${arg3}' <font color="${RedC}">Removed from the blacklist</font>.`);
  1187. mod.settings.NpcsBlacklist = mod.settings.NpcsBlacklist.filter(obj => obj.zone != arg2 || obj.templateId != arg3);
  1188. } else {
  1189. if (mod.settings.HideBlacklistedNpcs) HideSpecificNpc(Number(arg2), Number(arg3));
  1190. Msg(`NPC HntZone '${arg2}', TmpId '${arg3}' <font color="${GrnC}">Added to the blacklist</font>.`);
  1191. mod.settings.NpcsBlacklist.push({ zone: arg2, templateId: arg3 });
  1192. }
  1193. return;
  1194. } else {
  1195. mod.settings.HideBlacklistedNpcs = !mod.settings.HideBlacklistedNpcs;
  1196. mod.settings.HideBlacklistedNpcs ? HideNpcs('bl') : ShowNpcs('bl');
  1197. Msg(`Blacklisted NPCs ${mod.settings.HideBlacklistedNpcs ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1198. }
  1199. break;
  1200. case "hit":
  1201. switch (arg) {
  1202. case "me":
  1203. if (mod.settings.Hit_All) return Msg(`<font color="${RedC}">You've to disable hit ALL first</font>.`);
  1204. mod.settings.Hit_Me = !mod.settings.Hit_Me;
  1205. Msg(`Own hits effect ${mod.settings.Hit_Me ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1206. break;
  1207. case "other":
  1208. if (mod.settings.Hit_All) return Msg(`<font color="${RedC}">You've to disable hit ALL first</font>.`);
  1209. mod.settings.Hit_Other = !mod.settings.Hit_Other;
  1210. Msg(`Players hit effect ${mod.settings.Hit_Other ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1211. break;
  1212. case "damage":
  1213. if (mod.settings.Hit_All) return Msg(`<font color="${RedC}">You've to disable hit ALL first</font>.`);
  1214. mod.settings.Hit_Damage = !mod.settings.Hit_Damage;
  1215. Msg(`Damage numbers ${mod.settings.Hit_Damage ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1216. break;
  1217. case "all":
  1218. mod.settings.Hit_Me = mod.settings.Hit_Other = mod.settings.Hit_Damage = false;
  1219. mod.settings.Hit_All = !mod.settings.Hit_All;
  1220. Msg(`Hit all ${mod.settings.Hit_All ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1221. break;
  1222. default:
  1223. Msg(`<font color="${GryC}">Invalid &#40;hit&#41; '${arg}'</font>.`);
  1224. break;
  1225. }
  1226. break;
  1227. case "fireworks": case "firework":
  1228. mod.settings.HideFireworks = !mod.settings.HideFireworks;
  1229. Msg(`Fireworks ${mod.settings.HideFireworks ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1230. break;
  1231. case "abn": case "effects": case "abnormal": case "abnormalities":
  1232. switch (arg) {
  1233. case "all":
  1234. mod.settings.HideAllAbnormalities = !mod.settings.HideAllAbnormalities;
  1235. Msg(`All Abnormalities ${mod.settings.HideAllAbnormalities ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1236. break;
  1237. case "blacklist":
  1238. if (!arg2 || !arg3) {
  1239. mod.settings.HideBlacklistedAbnormalities = !mod.settings.HideBlacklistedAbnormalities;
  1240. Msg(`Blacklisted Abnormalities ${mod.settings.HideBlacklistedAbnormalities ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1241. break;
  1242. } else if (arg2 && arg3) {
  1243. arg3 = Number(arg3);
  1244. if (!mod.settings.AbnormalitiesBlacklist.includes(arg3)) {
  1245. if (arg2 === 'add') {
  1246. mod.settings.AbnormalitiesBlacklist.push(arg3);
  1247. Msg(`Blacklisted Abnormalities <font color="${GrnC}">added '${arg3}'</font>.`);
  1248. return;
  1249. } else if (arg2 === 'remv') return Msg(`Blacklisted Abnormalities <font color="${RedC}">can't remove '${arg3}' as it's not there</font>.`);
  1250. } else if (mod.settings.AbnormalitiesBlacklist.includes(arg3)) {
  1251. if (arg2 === 'add') return Msg(`Blacklisted Abnormalities <font color="${RedC}">can't add '${arg3}' as it's already there</font>.`);
  1252. else if (arg2 === 'remv') {
  1253. let index = mod.settings.AbnormalitiesBlacklist.indexOf(arg3);
  1254. if (index !== -1) {
  1255. mod.settings.AbnormalitiesBlacklist.splice(index, 1);
  1256. Msg(`Blacklisted Abnormalities <font color="${RedC}">removed '${arg3}'</font>.`);
  1257. return;
  1258. }
  1259. }
  1260. } else return Msg(`<font color="${GryC}">Invalid &#40;abnormalities Blacklist&#41; '${arg}'</font>.`);
  1261. }
  1262. break;
  1263. case "log":
  1264. case "debug":
  1265. AbnDebug = !AbnDebug;
  1266. if (AbnDebug) Msg(`Abnormalities debug <font color="${GrnC}">started</font>, check your proxy console for details.`)
  1267. else Msg(`Abnormalities debug <font color="${RedC}">stopped</font>.`);
  1268. break;
  1269. default:
  1270. Msg(`<font color="${GryC}">Invalid &#40;abnormalities&#41; '${arg}'</font>.`);
  1271. break;
  1272. }
  1273. break;
  1274. case "guildlogo":
  1275. if (SwitchCd) return Msg(`<font color="${PnkC}">Try again in 3 seconds</font>.`);
  1276. mod.settings.Hideguildlogos = !mod.settings.Hideguildlogos;
  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(`Guild Logos ${mod.settings.Hideguildlogos ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1282. break;
  1283. case "costume": case "style":
  1284. if (SwitchCd) return Msg(`<font color="${PnkC}">Try again in 3 seconds</font>.`);
  1285. mod.settings.ShowStyle = !mod.settings.ShowStyle;
  1286. mod.toServer('C_SET_VISIBLE_RANGE', 1, { range: 0 });
  1287. setTimeout(() => mod.toServer('C_SET_VISIBLE_RANGE', 1, { range: LastVrange }), 1500);
  1288. SwitchCd = true;
  1289. setTimeout(() => SwitchCd = false, 2800);
  1290. Msg(`Style of NPCs & others ${mod.settings.ShowStyle ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1291. break;
  1292. case "proj": case "projectile":
  1293. switch (arg) {
  1294. case "all":
  1295. mod.settings.HideAllProjectiles = !mod.settings.HideAllProjectiles;
  1296. Msg(`Projectiles ${mod.settings.HideAllProjectiles ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1297. break;
  1298. case "blacklist":
  1299. if (!arg2 || !arg3) {
  1300. mod.settings.HideBlacklistedProjectiles = !mod.settings.HideBlacklistedProjectiles;
  1301. Msg(`Blacklisted projectile ${mod.settings.HideBlacklistedProjectiles ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1302. break;
  1303. } else if (arg2 && arg3) {
  1304. arg3 = Number(arg3);
  1305. if (!mod.settings.ProjectilesBlacklist.includes(arg3)) {
  1306. if (arg2 === 'add') {
  1307. mod.settings.ProjectilesBlacklist.push(arg3);
  1308. Msg(`Blacklisted projectile <font color="${GrnC}">added '${arg3}'</font>.`);
  1309. return;
  1310. } else if (arg2 === 'remv') return Msg(`Blacklisted projectile <font color="${RedC}">can't remove '${arg3}' as it's not there</font>.`);
  1311. } else if (mod.settings.ProjectilesBlacklist.includes(arg3)) {
  1312. if (arg2 === 'add') return Msg(`Blacklisted projectile <font color="${RedC}">can't add '${arg3}' as it's already there</font>.`);
  1313. else if (arg2 === 'remv') {
  1314. let index = mod.settings.ProjectilesBlacklist.indexOf(arg3);
  1315. if (index !== -1) {
  1316. mod.settings.ProjectilesBlacklist.splice(index, 1);
  1317. Msg(`Blacklisted projectile <font color="${RedC}">removed '${arg3}'</font>.`);
  1318. return;
  1319. }
  1320. }
  1321. } else return Msg(`<font color="${GryC}">Invalid &#40;projectile Blacklist&#41; '${arg}'</font>.`);
  1322. }
  1323. break;
  1324. case "log": case "debug":
  1325. ProjDebug = !ProjDebug;
  1326. if (ProjDebug) Msg(`Projectile debug <font color="${GrnC}">started</font>, check your proxy console for details.`);
  1327. else Msg(`Projectile debug <font color="${RedC}">stopped</font>.`);
  1328. break;
  1329. default:
  1330. Msg(`<font color="${GryC}">Invalid &#40;projectile&#41; '${arg}'</font>.`);
  1331. break;
  1332. }
  1333. break;
  1334. case "quicklink":
  1335. switch (arg) {
  1336. case "mail": case "parcel":
  1337. mod.toServer('C_REQUEST_CONTRACT', 1, { type: 8 });
  1338. break;
  1339. case "talent": case "talents":
  1340. mod.toServer('C_REQUEST_CONTRACT', 1, { type: 77 });
  1341. break;
  1342. case "broker":
  1343. mod.toClient('S_NPC_MENU_SELECT', 1, { type: 28 });
  1344. break;
  1345. case "dress": case "dressingroom":
  1346. mod.toServer('C_REQUEST_CONTRACT', 1, { type: 76 });
  1347. break;
  1348. case "hat": case "hatrestyle":
  1349. mod.toServer('C_REQUEST_CONTRACT', 1, { type: 90 });
  1350. break;
  1351. case "lobby":
  1352. mod.toServer('C_RETURN_TO_LOBBY', 1, {});
  1353. break;
  1354. case "exit": case "instantexit":
  1355. mod.toClient('S_EXIT', 3, { category: 0, code: 0 });
  1356. break;
  1357. case "drop":
  1358. mod.toServer('C_LEAVE_PARTY', 1, {});
  1359. break;
  1360. case "disband":
  1361. mod.toServer('C_DISMISS_PARTY', 1, {});
  1362. break;
  1363. case "reset":
  1364. mod.toServer('C_RESET_ALL_DUNGEON', 1, {});
  1365. break;
  1366. case "searchengine":
  1367. mod.toClient('S_SHOW_AWESOMIUMWEB_SHOP', 1, { link: 'https://start.duckduckgo.com/' });
  1368. break;
  1369. default:
  1370. Msg(`<font color="${GryC}">Invalid &#40;quicklink&#41; '${arg}'</font>.`);
  1371. break;
  1372. }
  1373. break;
  1374. case "npczoom":
  1375. mod.settings.ActionScripts = !mod.settings.ActionScripts;
  1376. Msg(`Npc zoom-ins ${mod.settings.ActionScripts ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1377. break;
  1378. case "dropitem":
  1379. if (arg === 'hide') {
  1380. if (!arg2) {
  1381. mod.settings.HideBlacklistedDrop = !mod.settings.HideBlacklistedDrop;
  1382. Msg(`Blacklisted Drops ${mod.settings.HideBlacklistedDrop ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1383. break;
  1384. }
  1385. arg2 = Number(arg2);
  1386. const found1 = mod.settings.DropBlacklist.some(s => s === arg2);
  1387. if (found1) {
  1388. Msg(`Drops id '${arg2}' <font color="${RedC}">Removed from the blacklist</font>.`);
  1389. mod.settings.DropBlacklist = mod.settings.DropBlacklist.filter(obj => obj != arg2);
  1390. } else {
  1391. Msg(`Drops id '${arg2}' <font color="${GrnC}">Added to the blacklist</font>.`);
  1392. mod.settings.DropBlacklist.push(arg2);
  1393. }
  1394. return;
  1395. } else mod.settings.HideBlacklistedDrop = !mod.settings.HideBlacklistedDrop;
  1396. Msg(`Blacklisted Drops ${mod.settings.HideBlacklistedDrop ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1397. break;
  1398. case "monsterdeathani": case "monstersdeathani":
  1399. mod.settings.HideMonsterDeathAnimation = !mod.settings.HideMonsterDeathAnimation;
  1400. Msg(`Monsters Death Animation is ${mod.settings.HideMonsterDeathAnimation ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1401. break;
  1402. case "screenabns":
  1403. if (arg === 'hide') {
  1404. if (!arg2) {
  1405. mod.settings.HideOwnBlacklistedAbns = !mod.settings.HideOwnBlacklistedAbns;
  1406. Msg(`Blacklisted ScreenAbns ${mod.settings.OwnAbnormalsBlacklist ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1407. break;
  1408. }
  1409. arg2 = Number(arg2);
  1410. const found2 = mod.settings.OwnAbnormalsBlacklist.some(m => m === arg2);
  1411. if (found2) {
  1412. Msg(`Abnormal id '${arg2}' <font color="${RedC}">Removed from the blacklist</font>.`);
  1413. mod.settings.OwnAbnormalsBlacklist = mod.settings.OwnAbnormalsBlacklist.filter(obj => obj != arg2);
  1414. } else {
  1415. Msg(`Abnormal id '${arg2}' <font color="${GrnC}">Added to the blacklist</font>.`);
  1416. mod.settings.OwnAbnormalsBlacklist.push(arg2);
  1417. }
  1418. return;
  1419. } else mod.settings.HideOwnBlacklistedAbns = !mod.settings.HideOwnBlacklistedAbns;
  1420. Msg(`Blacklisted ScreenAbns ${mod.settings.HideOwnBlacklistedAbns ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1421. break;
  1422. case "pet": case "pets": case "servant": case "servants":
  1423. switch (arg) {
  1424. case "me":
  1425. mod.settings.HideMyServants = !mod.settings.HideMyServants;
  1426. mod.settings.HideMyServants ? HideNpcs('pet', 'own') : ShowNpcs('pet', 'own');
  1427. Msg(`Own Servants are ${mod.settings.HideMyServants ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1428. break;
  1429. default:
  1430. mod.settings.HideOthersServants = !mod.settings.HideOthersServants;
  1431. mod.settings.HideOthersServants ? HideNpcs('pet', 'others') : ShowNpcs('pet', 'others');
  1432. Msg(`Others summoned Servants are ${mod.settings.HideOthersServants ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1433. break;
  1434. }
  1435. break;
  1436. case "hpnumbers":
  1437. mod.settings.HideHpNumbers = !mod.settings.HideHpNumbers;
  1438. Msg(`Own Hp numbers ${mod.settings.HideHpNumbers ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1439. break;
  1440. case "mpnumbers":
  1441. mod.settings.HideMpNumbers = !mod.settings.HideMpNumbers;
  1442. Msg(`Own Mp numbers ${mod.settings.HideMpNumbers ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
  1443. break;
  1444. case "stream":
  1445. mod.settings.StreamMode = !mod.settings.StreamMode;
  1446. Msg(`Stream mode is ${mod.settings.StreamMode ? `<font color="${GrnC}">Enabled</font>` : `<font color="${RedC}">Disabled</font>`}.`); // It will only show when disabled.
  1447. 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 its disabled.");
  1448. else console.log("\x1b[94mINFO\x1b[34m [FPS-UTILS]\x1b[39m - Steam Mode has been disabled.");
  1449. break;
  1450. case "help": case "h":
  1451. mod.command.exec("fps gui help");
  1452. break;
  1453. default:
  1454. Msg(`<font color="${RedC}">Unknown command, check command list</font>.`);
  1455. mod.command.exec("fps gui help");
  1456. break;
  1457. }
  1458. if (!NotCP) mod.saveSettings();
  1459. })
  1460. }