index.js 75 KB

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