index.js 90 KB

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