|
|
@@ -6,7 +6,7 @@
|
|
|
const NpcData = require("./data/npcData.json"), SkillData = require("./data/skillString.json");
|
|
|
const Last_Hook = { order: 100010 }, Last_Hookfn = { order: 100010, filter: { fake: null, silenced: false, modified: null } };
|
|
|
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';
|
|
|
-const InvisibleNpcs = { 8: [6011], 12: [1], 23: [201, 202], 34: [8000], 61: [9901], 62: [9001, 9002, 9003, 9004, 9901], 83: [9901], 207: [9901], 223: [9901], 230: [9901] };
|
|
|
+const InvisibleNpcs = { 8: [6011], 12: [1], 23: [201, 202], 34: [8000], 61: [9901], 62: [9001, 9002, 9003, 9004, 9901], 83: [9901], 207: [9901], 223: [9901], 230: [9901], 2010: [9901], 2011: [9901], 2012: [9901], 2013: [9901], 2014: [9901], 2015: [9901] };
|
|
|
const TrapsIds = [30120, 30220, 30320, 90220, 90320, 90420, 90520, 90620, 90720, 90820, 90920, 100120, 100220, 100320, 100420, 100520, 120220, 120320, 120420, 120520, 120620, 120720, 120820, 120920, 150120, 150220, 150320, 150420, 150520, 150620, 150720, 170120, 170220, 170320, 170420, 170520, 170620, 170720, 170820, 170920, 230120, 230220, 230320, 250120, 250220, 250320, 250420, 250520, 250620, 250720, 250820, 250920, 251020];
|
|
|
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];
|
|
|
const SpamAchIds = [6, 14, 15, 17, 18, 51, 377, 391, 466, 467, 468, 469, 470, 471, 472, 473, 476, 611, 1002, 1003, 1004, 1005, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1408, 1420, 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, 20605, 20607, 20608, 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];
|
|
|
@@ -49,29 +49,27 @@ module.exports = function FpsUtils(mod) {
|
|
|
mod.hook('C_CONFIRM_UPDATE_NOTIFICATION', 'raw', Last_Hook, () => false)
|
|
|
|
|
|
mod.hook('C_ADMIN', 1, Last_Hookfn, (event) => {
|
|
|
- const Xd = event.command.split(";")
|
|
|
- Xd.forEach(cmd => mod.command.exec(cmd))
|
|
|
+ const commands = event.command.split(";")
|
|
|
+ for (const cmd of commands)
|
|
|
+ try { mod.command.exec(cmd) }
|
|
|
+ catch (err) { continue } //In-case it errors out, to prevent the C_ADMIN packet from being sent to server.
|
|
|
return false
|
|
|
})
|
|
|
}
|
|
|
|
|
|
const gui = {
|
|
|
- parse(Xarray, Xtitle) {
|
|
|
- let Xdata = '';
|
|
|
- for (let i = 0; i < Xarray.length; i++) {
|
|
|
- if (Xdata.length >= 16000) {
|
|
|
- Xdata += `Gui data limit exceeded, some values may be missing.`;
|
|
|
+ parse(Xarray, title) {
|
|
|
+ let body = '';
|
|
|
+ for (const data of Xarray) {
|
|
|
+ if (body.length >= 16000) {
|
|
|
+ body += 'Gui data limit exceeded, some values may be missing.';
|
|
|
break;
|
|
|
}
|
|
|
- if (Xarray[i].command) Xdata += `<a href="admincommand:/@${Xarray[i].command}">${Xarray[i].text}</a>`;
|
|
|
- else if (!Xarray[i].command) Xdata += `${Xarray[i].text}`;
|
|
|
+ if (data.command) body += `<a href="admincommand:/@${data.command}">${data.text}</a>`;
|
|
|
+ else if (!data.command) body += `${data.text}`;
|
|
|
else continue;
|
|
|
}
|
|
|
- mod.toClient('S_ANNOUNCE_UPDATE_NOTIFICATION', 1, {
|
|
|
- id: 0,
|
|
|
- title: Xtitle,
|
|
|
- body: Xdata
|
|
|
- })
|
|
|
+ mod.toClient('S_ANNOUNCE_UPDATE_NOTIFICATION', 1, { id: 0, title, body })
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -86,20 +84,15 @@ module.exports = function FpsUtils(mod) {
|
|
|
NpcJsonSearch("starts", arg);
|
|
|
break;
|
|
|
case "npclist":
|
|
|
- TmpData = []
|
|
|
TmpData.push(
|
|
|
{ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
|
|
|
{ text: `<font color="${YlwC}" size="+20"><p align="right">[Main NPC page]</p></font><br>`, command: "fps gui npcmain" },
|
|
|
{ text: `<font color="${LBlC}" size="+19">Click a NPC ID to remove it from the blacklist:</font><br>` }
|
|
|
)
|
|
|
- for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
|
|
|
- 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` })
|
|
|
- }
|
|
|
+ for (const blNpc of mod.settings.NpcsBlacklist) TmpData.push({ text: `<font color="${BnzC}" size="+17">${blNpc.zone}, ${blNpc.templateId}</font><br>`, command: `fps npc hide ${blNpc.zone} ${blNpc.templateId};fps gui npclist` })
|
|
|
gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - NPCs </font><font color="${GrnC}">(Blacklist)</font>`)
|
|
|
- TmpData = []
|
|
|
break;
|
|
|
case "npcmain":
|
|
|
- TmpData = []
|
|
|
TmpData.push(
|
|
|
{ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
|
|
|
{ text: `<font color="${YlwC}" size="+20"><p align="right">[Blacklisted NPCs list]</p></font><br>`, command: "fps gui npclist" },
|
|
|
@@ -114,31 +107,24 @@ module.exports = function FpsUtils(mod) {
|
|
|
{ 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>` }
|
|
|
)
|
|
|
gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - NPCs </font><font color="${YlwC}">(Main)</font>`)
|
|
|
- TmpData = []
|
|
|
break;
|
|
|
case "show":
|
|
|
- TmpData = []
|
|
|
TmpData.push(
|
|
|
{ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
|
|
|
{ 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>` },
|
|
|
{ text: `<font color="${PnkC}" size="+16">(Command </font><font color="${HPkC}" size="+16">"fps hide <name>"</font><font color="${PnkC}" size="+16"> to hide someone that does not appear here)</font><br><br>` },
|
|
|
{ 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>` }
|
|
|
)
|
|
|
- for (let i in SUsers) {
|
|
|
- TmpData.push({ text: `<font color="${mod.settings.PlayersBlacklist.indexOf(SUsers[i].name.toLowerCase()) !== -1 ? GrnC : RedC}" size="+17">${SUsers[i].name}</font><br>`, command: mod.settings.PlayersBlacklist.indexOf(SUsers[i].name.toLowerCase()) !== -1 ? `fps show ${SUsers[i].name};fps gui show` : `fps hide ${SUsers[i].name};fps gui show` })
|
|
|
- }
|
|
|
+ for (const sUser in SUsers) TmpData.push({ text: `<font color="${mod.settings.PlayersBlacklist.indexOf(SUsers[sUser].name.toLowerCase()) !== -1 ? GrnC : RedC}" size="+17">${SUsers[sUser].name}</font><br>`, command: mod.settings.PlayersBlacklist.indexOf(SUsers[sUser].name.toLowerCase()) !== -1 ? `fps show ${SUsers[sUser].name};fps gui show` : `fps hide ${SUsers[sUser].name};fps gui show` })
|
|
|
gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Players </font><font color="${RedC}">(In-distance)</font>`)
|
|
|
- TmpData = []
|
|
|
break;
|
|
|
case "hide":
|
|
|
- TmpData = []
|
|
|
TmpData.push(
|
|
|
{ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" },
|
|
|
{ text: `<font color="${LBlC}" size="+19">Click to show & remove from blacklist.</font><br>` }
|
|
|
)
|
|
|
mod.settings.PlayersBlacklist.forEach(mem => TmpData.push({ text: `<font color="${BnzC}" size="+17">${mem}</font><br>`, command: `fps show ${mem};fps gui hide` }))
|
|
|
gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Players </font><font color="${GrnC}">(Hidden)</font>`)
|
|
|
- TmpData = []
|
|
|
break;
|
|
|
case "skills":
|
|
|
gui.parse([
|
|
|
@@ -194,7 +180,6 @@ module.exports = function FpsUtils(mod) {
|
|
|
], `<font color="${LPrC}">[FPS] Options - Roles/Classes</font>`)
|
|
|
break;
|
|
|
case "abn":
|
|
|
- TmpData = []
|
|
|
TmpData.push(
|
|
|
{ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
|
|
|
{ text: `<font color="${AbnDebug ? GrnC : RedC}" size="+19"><p align="right">Debug</p></font><br>`, command: "fps abn log;fps gui abn" },
|
|
|
@@ -202,10 +187,8 @@ module.exports = function FpsUtils(mod) {
|
|
|
)
|
|
|
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` }))
|
|
|
gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Abnormalities</font>`)
|
|
|
- TmpData = []
|
|
|
break;
|
|
|
case "proj":
|
|
|
- TmpData = []
|
|
|
TmpData.push(
|
|
|
{ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
|
|
|
{ text: `<font color="${ProjDebug ? GrnC : RedC}" size="+19"><p align="right">Debug</p></font><br>`, command: "fps proj log;fps gui proj" },
|
|
|
@@ -213,7 +196,6 @@ module.exports = function FpsUtils(mod) {
|
|
|
)
|
|
|
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` }))
|
|
|
gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - Projectiles</font>`)
|
|
|
- TmpData = []
|
|
|
break;
|
|
|
case "help":
|
|
|
gui.parse([
|
|
|
@@ -316,10 +298,11 @@ module.exports = function FpsUtils(mod) {
|
|
|
{ text: `<font color="${CPKC}" size="+18">[Disband]</font><br>`, command: "fps quicklink disband" },
|
|
|
{ text: `<font color="${YlwC}" size="+20">System:</font>` }, { text: "	" },
|
|
|
{ text: `<font color="${CPKC}" size="+18">[Character Selection]</font>`, command: "fps quicklink lobby" }, { text: "					" },
|
|
|
- { text: `<font color="${CPKC}" size="+18">[!! Instant Exit !!]</font><br>`, command: "fps quicklink instantexit" }
|
|
|
+ { text: `<font color="${CPKC}" size="+18">[! Instant Exit !]</font><br>`, command: "fps quicklink instantexit" }
|
|
|
], `<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>`)
|
|
|
break;
|
|
|
}
|
|
|
+ TmpData = [];
|
|
|
}
|
|
|
|
|
|
// ~~~ * Gui Functions * ~~~ \\
|
|
|
@@ -330,12 +313,10 @@ module.exports = function FpsUtils(mod) {
|
|
|
skillIds = [];
|
|
|
skilldata.push(
|
|
|
{ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br>`, command: "fps gui" },
|
|
|
- { 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" },
|
|
|
+ { 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 class ${value}` },
|
|
|
{ text: `<font color="${LBlC}" size="+19">Click skill to blacklist it.</font><br>` }
|
|
|
)
|
|
|
- for (let key in SkillData[value]) {
|
|
|
- keys.push(key);
|
|
|
- }
|
|
|
+ for (const key in SkillData[value]) keys.push(key);
|
|
|
skillIds.push(Object.values(SkillData[value]))
|
|
|
for (let i = 0; i < keys.length; i++) {
|
|
|
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>` });
|
|
|
@@ -344,23 +325,16 @@ module.exports = function FpsUtils(mod) {
|
|
|
}
|
|
|
|
|
|
function NpcJsonSearch(type, arg) {
|
|
|
- const NpcDataLength = NpcData.length;
|
|
|
- TmpData = []
|
|
|
TmpData.push({ text: `<font color="${PrpC}" size="+24"><p align="right">MAIN MENU</p></font><br><br>`, command: "fps gui" })
|
|
|
- switch (type) {
|
|
|
- case 'starts':
|
|
|
- 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>` });
|
|
|
- break;
|
|
|
- case 'search':
|
|
|
- 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>` });
|
|
|
- break;
|
|
|
- }
|
|
|
+ for (const data of NpcData)
|
|
|
+ if (type === 'starts' && data.Nm.startsWith(arg) || type === 'search' && data.Nm.includes(arg))
|
|
|
+ TmpData.push({ command: `fps npc hide ${data.Hz} ${data.Ti};fps gui ${type === 'starts' ? 'npc' : 'npcsearch'} ${arg}`, text: `<font color="${mod.settings.NpcsBlacklist.some(arrVal => data.Hz === arrVal.zone && data.Ti === arrVal.templateId) ? GrnC : RedC}" size="+17">${data.Nm}</font><br>` })
|
|
|
gui.parse(TmpData, `<font color="${LPrC}">[FPS] Options - NPCs</font> | <font color="${LBlC}" size="+16">Search results for '${arg}'</font>.`)
|
|
|
TmpData = []
|
|
|
}
|
|
|
|
|
|
function ClassNameFromID(name) {
|
|
|
- for (const Class_data of Object.keys(mod.settings.ClassesData)) if (mod.settings.ClassesData[Class_data].name == name) return Class_data;
|
|
|
+ for (const Class_data of Object.keys(mod.settings.ClassesData)) if (mod.settings.ClassesData[Class_data].name === name) return Class_data;
|
|
|
}
|
|
|
|
|
|
// ~~~ * Command Functions * ~~~ \\
|
|
|
@@ -380,172 +354,127 @@ module.exports = function FpsUtils(mod) {
|
|
|
}
|
|
|
|
|
|
function HideSpecificPlayerByName(name) {
|
|
|
- for (let i in SUsers) {
|
|
|
- if (SUsers[i].name.toString().toLowerCase() === name.toLowerCase()) {
|
|
|
- mod.toClient('S_DESPAWN_USER', 3, { gameId: SUsers[i].gameId, type: 1 });
|
|
|
- HUsers[SUsers[i].gameId] = SUsers[i];
|
|
|
+ for (const sUser in SUsers) {
|
|
|
+ if (SUsers[sUser].name.toString().toLowerCase() === name.toLowerCase()) {
|
|
|
+ mod.toClient('S_DESPAWN_USER', 3, { gameId: SUsers[sUser].gameId, type: 1 });
|
|
|
+ HUsers[SUsers[sUser].gameId] = SUsers[sUser];
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function HideSpecificNpc(hz, ti) {
|
|
|
- for (let i in SNpcs) {
|
|
|
- if (SNpcs[i].huntingZoneId === hz && SNpcs[i].templateId === ti) {
|
|
|
- mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[i].gameId, loc: SNpcs[i].loc, type: 1, unk: 0 })
|
|
|
- HNpcs[SNpcs[i].gameId] = SNpcs[i];
|
|
|
- HNpcs[SNpcs[i].gameId].spawnType = 1;
|
|
|
- HNpcs[SNpcs[i].gameId].spawnScript = 0;
|
|
|
+ function HideSpecificNpcByHzTi(hz, ti) {
|
|
|
+ for (const sNpc in SNpcs) {
|
|
|
+ if (SNpcs[sNpc].huntingZoneId === hz && SNpcs[sNpc].templateId === ti) {
|
|
|
+ mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[sNpc].gameId, loc: SNpcs[sNpc].loc, type: 1, unk: 0 })
|
|
|
+ HNpcs[SNpcs[sNpc].gameId] = SNpcs[sNpc];
|
|
|
+ HNpcs[SNpcs[sNpc].gameId].spawnType = 1;
|
|
|
+ HNpcs[SNpcs[sNpc].gameId].spawnScript = 0;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function ShowSpecificPlayerByName(name) {
|
|
|
- for (let i in HUsers) {
|
|
|
- if (HUsers[i].name.toString().toLowerCase() === name.toLowerCase()) {
|
|
|
- ModifyUserAppearance(HUsers[i]);
|
|
|
- mod.toClient('S_SPAWN_USER', 15, HUsers[i]);
|
|
|
- delete HUsers[i];
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function ShowSpecificNpc(hz, ti) {
|
|
|
- for (let i in HNpcs) {
|
|
|
- if (HNpcs[i].huntingZoneId === hz && HNpcs[i].templateId === ti) {
|
|
|
- mod.toClient('S_SPAWN_NPC', 11, HNpcs[i]);
|
|
|
- delete HNpcs[i];
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function HideAllPlayers() {
|
|
|
- if (!mod.settings.OnlyParty) {
|
|
|
- for (let i in SUsers) {
|
|
|
- mod.toClient('S_DESPAWN_USER', 3, { gameId: SUsers[i].gameId, type: 1 });
|
|
|
- HUsers[SUsers[i].gameId] = SUsers[i];
|
|
|
- HUsers[SUsers[i].gameId].spawnFx = 1;
|
|
|
- }
|
|
|
- }
|
|
|
+ function HideSpecificNpcByGid(gameId) {
|
|
|
+ mod.toClient('S_DESPAWN_NPC', 3, { gameId, loc: SNpcs[gameId].loc, type: 1, unk: 0 })
|
|
|
+ HNpcs[gameId] = SNpcs[gameId]
|
|
|
+ HNpcs[gameId].spawnType = 1
|
|
|
+ HNpcs[gameId].spawnScript = 0
|
|
|
}
|
|
|
|
|
|
function HideNpcs(type, whose) {
|
|
|
switch (type) {
|
|
|
case 'own':
|
|
|
- for (let k in SNpcs) {
|
|
|
- if (EqGid(SNpcs[k].owner) && UserNPCs.includes(SNpcs[k].templateId) && SNpcs[k].huntingZoneId === 1023) {
|
|
|
- mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
|
|
|
- HNpcs[SNpcs[k].gameId] = SNpcs[k];
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
case 'others':
|
|
|
- for (let k in SNpcs) {
|
|
|
- if (!EqGid(SNpcs[k].owner) && UserNPCs.includes(SNpcs[k].templateId) && SNpcs[k].huntingZoneId === 1023) {
|
|
|
- mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
|
|
|
- HNpcs[SNpcs[k].gameId] = SNpcs[k];
|
|
|
- }
|
|
|
- }
|
|
|
+ for (const sNpc in SNpcs)
|
|
|
+ if ((type === 'own' && EqGid(SNpcs[sNpc].owner) || type === 'others' && !EqGid(SNpcs[sNpc].owner)) && UserNPCs.includes(SNpcs[sNpc].templateId) && SNpcs[sNpc].huntingZoneId === 1023) HideSpecificNpcByGid(SNpcs[sNpc].gameId)
|
|
|
break;
|
|
|
case 'bl':
|
|
|
- for (let k in SNpcs) {
|
|
|
- for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
|
|
|
- if (SNpcs[k].huntingZoneId == mod.settings.NpcsBlacklist[i].zone && SNpcs[k].templateId == mod.settings.NpcsBlacklist[i].templateId) {
|
|
|
- mod.toClient('S_DESPAWN_NPC', 3, { gameId: SNpcs[k].gameId, loc: SNpcs[k].loc, type: 1, unk: 0 });
|
|
|
- HNpcs[SNpcs[k].gameId] = SNpcs[k];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ for (const sNpc in SNpcs)
|
|
|
+ for (const blNpc of mod.settings.NpcsBlacklist)
|
|
|
+ if (SNpcs[sNpc].huntingZoneId === Number(blNpc.zone) && SNpcs[sNpc].templateId === Number(blNpc.templateId)) HideSpecificNpcByGid(SNpcs[sNpc].gameId)
|
|
|
break;
|
|
|
case 'pet':
|
|
|
- switch (whose) {
|
|
|
- case 'own':
|
|
|
- for (let p in SPets) {
|
|
|
- if (!EqGid(SPets[p].ownerId)) continue
|
|
|
- mod.toClient('S_REQUEST_DESPAWN_SERVANT', 1, { gameId: SPets[p].gameId, despawnType: 1 })
|
|
|
- HPets[SPets[p].gameId] = SPets[p]
|
|
|
- }
|
|
|
- break;
|
|
|
- case 'others':
|
|
|
- for (let p in SPets) {
|
|
|
- if (EqGid(SPets[p].ownerId)) continue
|
|
|
- mod.toClient('S_REQUEST_DESPAWN_SERVANT', 1, { gameId: SPets[p].gameId, despawnType: 1 })
|
|
|
- HPets[SPets[p].gameId] = SPets[p]
|
|
|
- }
|
|
|
- break;
|
|
|
- default: break;
|
|
|
- }
|
|
|
+ for (const sPet in SPets)
|
|
|
+ if (whose === 'own' && EqGid(SPets[sPet].ownerId) || whose === 'others' && !EqGid(SPets[sPet].ownerId)) {
|
|
|
+ mod.toClient('S_REQUEST_DESPAWN_SERVANT', 1, { gameId: SPets[sPet].gameId, despawnType: 1 })
|
|
|
+ HPets[SPets[sPet].gameId] = SPets[sPet]
|
|
|
+ }
|
|
|
break;
|
|
|
default: break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ function HideAllPlayers() {
|
|
|
+ if (mod.settings.OnlyParty) return undefined;
|
|
|
+ for (const sUser in SUsers) {
|
|
|
+ mod.toClient('S_DESPAWN_USER', 3, { gameId: SUsers[sUser].gameId, type: 1 });
|
|
|
+ HUsers[SUsers[sUser].gameId] = SUsers[sUser];
|
|
|
+ HUsers[SUsers[sUser].gameId].spawnFx = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function ShowSpecificPlayerByName(name) {
|
|
|
+ for (const hUser in HUsers) {
|
|
|
+ if (HUsers[hUser].name.toString().toLowerCase() === name.toLowerCase()) {
|
|
|
+ ModifyUserAppearance(HUsers[hUser]);
|
|
|
+ mod.toClient('S_SPAWN_USER', 15, HUsers[hUser]);
|
|
|
+ delete HUsers[hUser];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function ShowSpecificNpcByHzTi(hz, ti) {
|
|
|
+ for (const hNpc in HNpcs) {
|
|
|
+ if (HNpcs[hNpc].huntingZoneId === hz && HNpcs[hNpc].templateId === ti) {
|
|
|
+ mod.toClient('S_SPAWN_NPC', 11, HNpcs[hNpc]);
|
|
|
+ delete HNpcs[hNpc];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function ShowSpecificNpcByGid(gameId) {
|
|
|
+ mod.toClient('S_SPAWN_NPC', 11, HNpcs[gameId])
|
|
|
+ delete HNpcs[gameId]
|
|
|
+ }
|
|
|
+
|
|
|
function ShowNpcs(type, whose) {
|
|
|
switch (type) {
|
|
|
case 'own':
|
|
|
- for (let v in HNpcs) {
|
|
|
- if (EqGid(HNpcs[v].owner) && UserNPCs.includes(HNpcs[v].templateId) && HNpcs[v].huntingZoneId === 1023) {
|
|
|
- mod.toClient('S_SPAWN_NPC', 11, HNpcs[v]);
|
|
|
- delete HNpcs[v];
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
case 'others':
|
|
|
- for (let v in HNpcs) {
|
|
|
- if (!EqGid(HNpcs[v].owner) && UserNPCs.includes(HNpcs[v].templateId) && HNpcs[v].huntingZoneId === 1023) {
|
|
|
- mod.toClient('S_SPAWN_NPC', 11, HNpcs[v]);
|
|
|
- delete HNpcs[v];
|
|
|
- }
|
|
|
- }
|
|
|
+ for (const hNpc in HNpcs)
|
|
|
+ if (type === 'own' && EqGid(HNpcs[hNpc].owner || type === 'others' && !EqGid(HNpcs[hNpc].owner)) && UserNPCs.includes(HNpcs[hNpc].templateId) && HNpcs[hNpc].huntingZoneId === 1023) ShowSpecificNpcByGid(HNpcs[hNpc].gameId)
|
|
|
break;
|
|
|
case 'bl':
|
|
|
- for (let v in HNpcs) {
|
|
|
- for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
|
|
|
- if (HNpcs[v].huntingZoneId == mod.settings.NpcsBlacklist[i].zone && HNpcs[v].templateId == mod.settings.NpcsBlacklist[i].templateId) {
|
|
|
- mod.toClient('S_SPAWN_NPC', 11, HNpcs[v]);
|
|
|
- delete HNpcs[v];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ for (const hNpc in HNpcs)
|
|
|
+ for (const blNpc of mod.settings.NpcsBlacklist)
|
|
|
+ if (HNpcs[hNpc].huntingZoneId === Number(blNpc.zone) && HNpcs[hNpc].templateId === Number(blNpc.templateId)) ShowSpecificNpcByGid(HNpcs[hNpc].gameId)
|
|
|
break;
|
|
|
case 'pet':
|
|
|
- switch (whose) {
|
|
|
- case 'own':
|
|
|
- for (let p in HPets) {
|
|
|
- if (!EqGid(HPets[p].ownerId)) continue
|
|
|
- mod.toClient('S_REQUEST_SPAWN_SERVANT', 4, HPets[p])
|
|
|
- delete HPets[p]
|
|
|
- }
|
|
|
- break;
|
|
|
- case 'others':
|
|
|
- for (let p in HPets) {
|
|
|
- if (EqGid(HPets[p].ownerId)) continue
|
|
|
- mod.toClient('S_REQUEST_SPAWN_SERVANT', 4, HPets[p])
|
|
|
- delete HPets[p]
|
|
|
- }
|
|
|
- break;
|
|
|
- default: break;
|
|
|
- }
|
|
|
+ for (const hPet in HPets)
|
|
|
+ if (whose === 'own' && EqGid(HPets[hPet].ownerId) || whose === 'others' && !EqGid(HPets[hPet].ownerId)) {
|
|
|
+ mod.toClient('S_REQUEST_SPAWN_SERVANT', 4, HPets[hPet])
|
|
|
+ delete HPets[hPet]
|
|
|
+ }
|
|
|
break;
|
|
|
default: break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function ShowAllPlayers() {
|
|
|
- for (let i in HUsers) {
|
|
|
- ModifyUserAppearance(HUsers[i]);
|
|
|
- mod.toClient('S_SPAWN_USER', 15, HUsers[i]);
|
|
|
- delete HUsers[i];
|
|
|
+ for (const hUser in HUsers) {
|
|
|
+ ModifyUserAppearance(HUsers[hUser]);
|
|
|
+ mod.toClient('S_SPAWN_USER', 15, HUsers[hUser]);
|
|
|
+ delete HUsers[hUser];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// ~~~ * Functions * ~~~ \\
|
|
|
|
|
|
function ModifyUserAppearance(event) {
|
|
|
- let modified = false;
|
|
|
+ let modified = undefined;
|
|
|
|
|
|
if (mod.settings.ShowStyle) {
|
|
|
event.weapon = [10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 80396, 55005, 82005, 58171, 59053][event.templateId % 100 - 1];
|
|
|
@@ -578,7 +507,7 @@ module.exports = function FpsUtils(mod) {
|
|
|
modified = true;
|
|
|
}
|
|
|
|
|
|
- return modified ? true : undefined;
|
|
|
+ return modified;
|
|
|
}
|
|
|
|
|
|
function ModifyAbnormalities(event, end) {
|
|
|
@@ -634,7 +563,7 @@ module.exports = function FpsUtils(mod) {
|
|
|
}
|
|
|
|
|
|
function ModifySkillResult(event) {
|
|
|
- let modified = false;
|
|
|
+ let modified = undefined;
|
|
|
|
|
|
if (mod.settings.Hit_Me && (EqGid(event.source) || EqGid(event.owner))) {
|
|
|
event.templateId = 0;
|
|
|
@@ -673,17 +602,17 @@ module.exports = function FpsUtils(mod) {
|
|
|
modified = true;
|
|
|
}
|
|
|
|
|
|
- return modified ? true : undefined;
|
|
|
+ return modified;
|
|
|
}
|
|
|
|
|
|
- const UserBCheck = user => { for (const player of mod.settings.PlayersBlacklist) if (player.toLowerCase() === user.toLowerCase()) return true }
|
|
|
+ const UserBCheck = user => { for (const plBlist of mod.settings.PlayersBlacklist) if (plBlist.toLowerCase() === user.toLowerCase()) return true }
|
|
|
|
|
|
function NpcBCheck(event) {
|
|
|
let blocked = false;
|
|
|
|
|
|
if (mod.settings.HideBlacklistedNpcs) {
|
|
|
- for (let i = 0; i < mod.settings.NpcsBlacklist.length; i++) {
|
|
|
- if (event.huntingZoneId == mod.settings.NpcsBlacklist[i].zone && event.templateId == mod.settings.NpcsBlacklist[i].templateId) {
|
|
|
+ for (const blNpc of mod.settings.NpcsBlacklist) {
|
|
|
+ if (event.huntingZoneId === Number(blNpc.zone) && event.templateId === Number(blNpc.templateId)) {
|
|
|
HNpcs[event.gameId] = event;
|
|
|
HNpcs[event.gameId].spawnType = 1;
|
|
|
HNpcs[event.gameId].spawnScript = 0;
|
|
|
@@ -721,8 +650,8 @@ module.exports = function FpsUtils(mod) {
|
|
|
return blocked ? false : undefined;
|
|
|
}
|
|
|
|
|
|
- function EqGid(xg) {
|
|
|
- return (xg === MyGameId);
|
|
|
+ function EqGid(xG) {
|
|
|
+ return (xG === MyGameId);
|
|
|
}
|
|
|
|
|
|
function ClassID(m) {
|
|
|
@@ -795,7 +724,7 @@ module.exports = function FpsUtils(mod) {
|
|
|
}
|
|
|
|
|
|
function cSetVisibleRange(event) {
|
|
|
- LastVrange = event.range
|
|
|
+ LastVrange = event.range;
|
|
|
}
|
|
|
|
|
|
function sStartCooltimeItem(event) {
|
|
|
@@ -816,7 +745,7 @@ module.exports = function FpsUtils(mod) {
|
|
|
AllowedAchUps--;
|
|
|
return;
|
|
|
}
|
|
|
- for (const Achieve of event.achievements) if (SpamAchIds.indexOf(Achieve.id) > -1 || !Achieve.requirements.length) return false;
|
|
|
+ for (const Achieve of event.achievements) if (SpamAchIds.indexOf(Achieve.id) !== -1 || !Achieve.requirements.length) return false;
|
|
|
}
|
|
|
|
|
|
function sItemCustomString(event) {
|
|
|
@@ -920,6 +849,15 @@ module.exports = function FpsUtils(mod) {
|
|
|
if (mod.settings.ShowStyle) return false;
|
|
|
}
|
|
|
|
|
|
+ function sUserChangeFaceCustom(event) {
|
|
|
+ if (EqGid(event.gameId)) return;
|
|
|
+
|
|
|
+ if (mod.settings.MuteOthersVoice) {
|
|
|
+ event.appearance.voice = 249;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
function sUserExternalChange(event) {
|
|
|
if (EqGid(event.gameId)) return;
|
|
|
if (mod.settings.ShowStyle) return false;
|
|
|
@@ -928,10 +866,22 @@ module.exports = function FpsUtils(mod) {
|
|
|
function sUnicastTransformData(event) {
|
|
|
if (EqGid(event.gameId) || !event.gameId) return;
|
|
|
if (mod.settings.ShowStyle) return false;
|
|
|
+
|
|
|
+ let modified = undefined;
|
|
|
+
|
|
|
if (mod.settings.Hideguildlogos) {
|
|
|
event.guildLogo = '';
|
|
|
- return true;
|
|
|
+
|
|
|
+ modified = true;
|
|
|
}
|
|
|
+
|
|
|
+ if (mod.settings.MuteOthersVoice) {
|
|
|
+ event.appearance.voice = 249;
|
|
|
+
|
|
|
+ modified = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return modified;
|
|
|
}
|
|
|
|
|
|
function sSpawnNpc(event) {
|
|
|
@@ -1165,6 +1115,7 @@ module.exports = function FpsUtils(mod) {
|
|
|
mod.hook('S_USER_MOVETYPE', 1, Last_Hook, sUserMovetype)
|
|
|
mod.hook('S_PARTY_MEMBER_LIST', 7, sPartyMemberList)
|
|
|
mod.hook('S_USER_APPEARANCE_CHANGE', 1, Last_Hook, sUserAppearanceChange)
|
|
|
+ mod.hook('S_USER_CHANGE_FACE_CUSTOM', 2, Last_Hook, sUserChangeFaceCustom)
|
|
|
mod.hook('S_USER_EXTERNAL_CHANGE', 7, Last_Hook, sUserExternalChange)
|
|
|
mod.hook('S_UNICAST_TRANSFORM_DATA', 6, Last_Hook, sUnicastTransformData)
|
|
|
|
|
|
@@ -1269,13 +1220,13 @@ module.exports = function FpsUtils(mod) {
|
|
|
if (mod.settings.PlayersBlacklist.includes(arg)) return Msg(`Player '${arg}' <font color="${RedC}">Already hidden</font>.`);
|
|
|
else
|
|
|
if ((GameJobs.includes(arg) && !mod.settings.ClassesBlacklist.includes(arg)) || (GameRoles.includes(arg) && !mod.settings.RolesBlacklist.includes(arg))) {
|
|
|
- for (let i in mod.settings.ClassesData) {
|
|
|
- if ((mod.settings.ClassesData[i].name === arg || mod.settings.ClassesData[i].role.includes(arg)) && mod.settings.ClassesData[i].isHidden !== true) {
|
|
|
- mod.settings.ClassesData[i].isHidden = true;
|
|
|
- if (mod.settings.ClassesData[i].name === arg) mod.settings.ClassesBlacklist.push(arg);
|
|
|
- if (mod.settings.ClassesData[i].role.includes(arg)) mod.settings.RolesBlacklist.push(arg);
|
|
|
- let classtohide = mod.settings.ClassesData[i].model;
|
|
|
- for (let i in SUsers) { if (ClassID(SUsers[i].templateId) === classtohide) HideSpecificPlayerByName(SUsers[i].name); }
|
|
|
+ for (const cD in mod.settings.ClassesData) {
|
|
|
+ if ((mod.settings.ClassesData[cD].name === arg || mod.settings.ClassesData[cD].role.includes(arg)) && cD.isHidden !== true) {
|
|
|
+ mod.settings.ClassesData[cD].isHidden = true;
|
|
|
+ if (mod.settings.ClassesData[cD].name === arg) mod.settings.ClassesBlacklist.push(arg);
|
|
|
+ if (mod.settings.ClassesData[cD].role.includes(arg)) mod.settings.RolesBlacklist.push(arg);
|
|
|
+ let classtohide = mod.settings.ClassesData[cD].model;
|
|
|
+ for (const sUser in SUsers) if (ClassID(SUsers[sUser].templateId) === classtohide) HideSpecificPlayerByName(SUsers[sUser].name);
|
|
|
}
|
|
|
}
|
|
|
Msg(`Class/Role ${arg} <font color="${GrnC}">Hidden</font>.`);
|
|
|
@@ -1295,15 +1246,13 @@ module.exports = function FpsUtils(mod) {
|
|
|
return;
|
|
|
}
|
|
|
if ((GameJobs.includes(arg) && mod.settings.ClassesBlacklist.includes(arg)) || (mod.settings.RolesBlacklist.includes(arg) && GameRoles.includes(arg))) {
|
|
|
- for (let i in mod.settings.ClassesData) {
|
|
|
- if (mod.settings.ClassesData[i].name === arg || mod.settings.ClassesData[i].role.includes(arg)) {
|
|
|
- if (mod.settings.ClassesData[i].name === arg) RemoveEntity(mod.settings.ClassesBlacklist, arg);
|
|
|
- if (mod.settings.ClassesData[i].role.includes(arg)) RemoveEntity(mod.settings.RolesBlacklist, arg);
|
|
|
- mod.settings.ClassesData[i].isHidden = false;
|
|
|
- let classToShow = mod.settings.ClassesData[i].model;
|
|
|
- for (let i in HUsers) {
|
|
|
- if (ClassID(HUsers[i].templateId) === classToShow) ShowSpecificPlayerByName(HUsers[i].name);
|
|
|
- }
|
|
|
+ for (const cD in mod.settings.ClassesData) {
|
|
|
+ if (mod.settings.ClassesData[cD].name === arg || mod.settings.ClassesData[cD].role.includes(arg)) {
|
|
|
+ if (mod.settings.ClassesData[cD].name === arg) RemoveEntity(mod.settings.ClassesBlacklist, arg);
|
|
|
+ if (mod.settings.ClassesData[cD].role.includes(arg)) RemoveEntity(mod.settings.RolesBlacklist, arg);
|
|
|
+ mod.settings.ClassesData[cD].isHidden = false;
|
|
|
+ let classToShow = mod.settings.ClassesData[cD].model;
|
|
|
+ for (const hUser in HUsers) if (ClassID(HUsers[hUser].templateId) === classToShow) ShowSpecificPlayerByName(HUsers[hUser].name);
|
|
|
}
|
|
|
}
|
|
|
Msg(`Class '${arg}' <font color="${RedC}">Shown</font>.`);
|
|
|
@@ -1317,11 +1266,9 @@ module.exports = function FpsUtils(mod) {
|
|
|
//if(!PMembers.length) return Msg(`<font color="${GryC}">You must be in party in-order to enable this</font>.`)
|
|
|
mod.settings.OnlyParty = !mod.settings.OnlyParty;
|
|
|
if (mod.settings.OnlyParty) {
|
|
|
- for (let i in SUsers) {
|
|
|
- if (!PMembers.includes(SUsers[i].name)) {
|
|
|
- mod.toClient('S_DESPAWN_USER', 3, { gameId: SUsers[i].gameId, type: 1 })
|
|
|
- HUsers[SUsers[i].gameId] = SUsers[i];
|
|
|
- }
|
|
|
+ for (const sUser in SUsers) {
|
|
|
+ if (!PMembers.includes(SUsers[sUser].name)) HideSpecificPlayerByName(SUsers[sUser].name)
|
|
|
+ else if (HUsers.includes(SUsers[sUser].name)) ShowSpecificPlayerByName(SUsers[sUser].name)
|
|
|
}
|
|
|
} else ShowAllPlayers();
|
|
|
Msg(`Everyone but party ${mod.settings.OnlyParty ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
|
|
|
@@ -1367,24 +1314,24 @@ module.exports = function FpsUtils(mod) {
|
|
|
break;
|
|
|
case "class":
|
|
|
if (GameJobs.includes(arg2)) {
|
|
|
- for (let i in mod.settings.ClassesData) {
|
|
|
- if (mod.settings.ClassesData[i].name === arg2) {
|
|
|
- if (arg3 != null && !isNaN(arg3) && arg3 < 50) {
|
|
|
- if (mod.settings.ClassesData[i].CD_SkillsBlacklist.includes(arg3)) {
|
|
|
- let index = mod.settings.ClassesData[i].CD_SkillsBlacklist.indexOf(arg3);
|
|
|
+ for (const cD in mod.settings.ClassesData) {
|
|
|
+ if (mod.settings.ClassesData[cD].name === arg2) {
|
|
|
+ if (arg3 && !isNaN(arg3) && arg3 < 50) {
|
|
|
+ if (mod.settings.ClassesData[cD].CD_SkillsBlacklist.includes(arg3)) {
|
|
|
+ let index = mod.settings.ClassesData[cD].CD_SkillsBlacklist.indexOf(arg3);
|
|
|
if (index !== -1) {
|
|
|
- mod.settings.ClassesData[i].CD_SkillsBlacklist.splice(index, 1);
|
|
|
+ mod.settings.ClassesData[cD].CD_SkillsBlacklist.splice(index, 1);
|
|
|
Msg(`Skill ID '${arg3}' <font color="${RedC}">Shown</font> for class '${arg2}'.`);
|
|
|
}
|
|
|
return;
|
|
|
} else {
|
|
|
- mod.settings.ClassesData[i].CD_SkillsBlacklist.push(arg3);
|
|
|
+ mod.settings.ClassesData[cD].CD_SkillsBlacklist.push(arg3);
|
|
|
Msg(`Skill ID '${arg3}' <font color="${GrnC}">Hidden</font> for class '${arg2}'.`);
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
- mod.settings.ClassesData[i].CD_HideBlacklistedSkills = !mod.settings.ClassesData[i].CD_HideBlacklistedSkills;
|
|
|
- Msg(`Skills for '${arg2}' class ${mod.settings.ClassesData[i].CD_HideBlacklistedSkills ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
|
|
|
+ mod.settings.ClassesData[cD].CD_HideBlacklistedSkills = !cD.CD_HideBlacklistedSkills;
|
|
|
+ Msg(`Skills for '${arg2}' class ${mod.settings.ClassesData[cD].CD_HideBlacklistedSkills ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -1402,11 +1349,11 @@ module.exports = function FpsUtils(mod) {
|
|
|
}
|
|
|
const found = mod.settings.NpcsBlacklist.some(s => s.zone === arg2 && s.templateId === arg3);
|
|
|
if (found) {
|
|
|
- if (mod.settings.HideBlacklistedNpcs) ShowSpecificNpc(Number(arg2), Number(arg3));
|
|
|
+ if (mod.settings.HideBlacklistedNpcs) ShowSpecificNpcByHzTi(Number(arg2), Number(arg3));
|
|
|
Msg(`NPC HntZone '${arg2}', TmpId '${arg3}' <font color="${RedC}">Removed from the blacklist</font>.`);
|
|
|
- mod.settings.NpcsBlacklist = mod.settings.NpcsBlacklist.filter(obj => obj.zone != arg2 || obj.templateId != arg3);
|
|
|
+ mod.settings.NpcsBlacklist = mod.settings.NpcsBlacklist.filter(obj => obj.zone !== arg2 || obj.templateId !== arg3);
|
|
|
} else {
|
|
|
- if (mod.settings.HideBlacklistedNpcs) HideSpecificNpc(Number(arg2), Number(arg3));
|
|
|
+ if (mod.settings.HideBlacklistedNpcs) HideSpecificNpcByHzTi(Number(arg2), Number(arg3));
|
|
|
Msg(`NPC HntZone '${arg2}', TmpId '${arg3}' <font color="${GrnC}">Added to the blacklist</font>.`);
|
|
|
mod.settings.NpcsBlacklist.push({ zone: arg2, templateId: arg3 });
|
|
|
}
|
|
|
@@ -1604,7 +1551,7 @@ module.exports = function FpsUtils(mod) {
|
|
|
const found1 = mod.settings.DropBlacklist.some(s => s === arg2);
|
|
|
if (found1) {
|
|
|
Msg(`Drops id '${arg2}' <font color="${RedC}">Removed from the blacklist</font>.`);
|
|
|
- mod.settings.DropBlacklist = mod.settings.DropBlacklist.filter(obj => obj != arg2);
|
|
|
+ mod.settings.DropBlacklist = mod.settings.DropBlacklist.filter(obj => obj !== Number(arg2));
|
|
|
} else {
|
|
|
Msg(`Drops id '${arg2}' <font color="${GrnC}">Added to the blacklist</font>.`);
|
|
|
mod.settings.DropBlacklist.push(arg2);
|
|
|
@@ -1628,7 +1575,7 @@ module.exports = function FpsUtils(mod) {
|
|
|
const found2 = mod.settings.OwnAbnormalsBlacklist.some(m => m === arg2);
|
|
|
if (found2) {
|
|
|
Msg(`Abnormal id '${arg2}' <font color="${RedC}">Removed from the blacklist</font>.`);
|
|
|
- mod.settings.OwnAbnormalsBlacklist = mod.settings.OwnAbnormalsBlacklist.filter(obj => obj != arg2);
|
|
|
+ mod.settings.OwnAbnormalsBlacklist = mod.settings.OwnAbnormalsBlacklist.filter(obj => obj !== Number(arg2));
|
|
|
} else {
|
|
|
Msg(`Abnormal id '${arg2}' <font color="${GrnC}">Added to the blacklist</font>.`);
|
|
|
mod.settings.OwnAbnormalsBlacklist.push(arg2);
|
|
|
@@ -1677,8 +1624,9 @@ module.exports = function FpsUtils(mod) {
|
|
|
mod.command.exec("fps gui help");
|
|
|
break;
|
|
|
default:
|
|
|
- Msg(`<font color="${RedC}">Unknown command, check command list</font>.`);
|
|
|
- mod.command.exec("fps gui help");
|
|
|
+ //Msg(`<font color="${RedC}">Unknown command, check command list</font>.`);
|
|
|
+ //mod.command.exec("fps gui help");
|
|
|
+ mod.command.exec("fps gui");
|
|
|
break;
|
|
|
}
|
|
|
if (!NotCP && typeof mod.settings.ClassesData["12"] === 'undefined') mod.saveSettings();
|