index.js 74 KB

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