index.js 76 KB

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