|
|
@@ -23,6 +23,7 @@ module.exports = function FpsUtils(mod) {
|
|
|
SwitchCd,
|
|
|
AllowedAchUps,
|
|
|
LastState,
|
|
|
+ LastGState,
|
|
|
LastVrange,
|
|
|
ProjDebug,
|
|
|
AbnDebug,
|
|
|
@@ -238,7 +239,10 @@ module.exports = function FpsUtils(mod) {
|
|
|
{ text: `<font color="${HBlC}">monsterdeathani</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps monsterdeathani</font><br>` },
|
|
|
{ text: `<font color="${HBlC}">screenabns</font> <font color="${DBlC}">N/A ^ hide</font> <font color="${HPkC}">!fps screenabns</font><br>` },
|
|
|
{ text: `<font color="${HBlC}">hpnumbers</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps hpnumbers</font><br>` },
|
|
|
- { text: `<font color="${HBlC}">mpnumbers</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps mpnumbers</font></font>` }
|
|
|
+ { text: `<font color="${HBlC}">mpnumbers</font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps mpnumbers</font></font><br>` },
|
|
|
+ { text: `<font color="${HBlC}">pet </font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps raid</font></font><br>` },
|
|
|
+ { text: `<font color="${HBlC}">guardian </font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps guardian</font></font><br>` },
|
|
|
+ { text: `<font color="${HBlC}">stream </font> <font color="${DBlC}">N/A</font> <font color="${HPkC}">!fps stream</font></font><br>` }
|
|
|
], `<font color="${LPrC}">[FPS] HELP</font>`)
|
|
|
break;
|
|
|
default:
|
|
|
@@ -290,7 +294,9 @@ module.exports = function FpsUtils(mod) {
|
|
|
{ text: `<font color="${mod.settings.RaidAutoChange ? GrnC : RedC}" size="+18">[Raid auto state]</font>`, command: "fps raid;fps gui" }, { text: " " },
|
|
|
{ text: `<font color="${mod.settings.OnlyParty ? GrnC : RedC}" size="+18">[Only Party]</font>`, command: "fps party;fps gui" }, { text: " " },
|
|
|
{ text: `<font color="${mod.settings.HideBlacklistedDrop ? GrnC : RedC}" size="+18">[Drops BList]</font>`, command: "fps dropitem;fps gui" }, { text: " " },
|
|
|
- { text: `<font color="${mod.settings.PvpTraps ? GrnC : RedC}" size="+17">[Show Traps]</font><br><br><br>`, command: "fps pvptraps;fps gui" },
|
|
|
+ { text: `<font color="${mod.settings.PvpTraps ? GrnC : RedC}" size="+17">[Show Traps]</font><br>`, command: "fps pvptraps;fps gui" }, { text: "			" },
|
|
|
+ { text: `<font color="${mod.settings.GuardianAutoChange ? GrnC : RedC}" size="+17">[Guardian auto state]</font>`, command: "fps guardian;fps gui" }, { text: " " },
|
|
|
+ { text: `<font color="${mod.settings.StreamMode ? GrnC : RedC}" size="+17">[Stream]</font><br><br>`, command: "fps stream;fps gui" },
|
|
|
{ text: `<font color="${BluC}" size="+22">Quick Links:</font><br>` },
|
|
|
{ text: `<font color="${YlwC}" size="+20">UI:</font>` }, { text: "		" },
|
|
|
{ text: `<font color="${PrpC}" size="+17">[Mail]</font>`, command: "fps quicklink parcel" }, { text: " " },
|
|
|
@@ -304,7 +310,7 @@ module.exports = function FpsUtils(mod) {
|
|
|
{ text: `<font color="${CPKC}" size="+18">[Leave]</font>`, command: "fps quicklink drop" }, { text: " " },
|
|
|
{ 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">[Character Selection]</font>`, command: "fps quicklink lobby" }, { text: "					" },
|
|
|
{ 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>`)
|
|
|
}
|
|
|
@@ -354,6 +360,7 @@ module.exports = function FpsUtils(mod) {
|
|
|
// ~~~ * Command Functions * ~~~ \\
|
|
|
|
|
|
function Msg(msg) {
|
|
|
+ if (mod.settings.StreamMode) return;
|
|
|
if (NotCP) mod.command.message(`<font color="${LPrC}">[FPS] ${msg}</font>`);
|
|
|
else mod.command.message(`<font color="${LPrC}">${msg}</font>`);
|
|
|
}
|
|
|
@@ -666,11 +673,13 @@ module.exports = function FpsUtils(mod) {
|
|
|
|
|
|
function sLogin(event) {
|
|
|
LastState = event.name === MyName ? LastState : null;
|
|
|
+ LastGState = null;
|
|
|
MyGameId = event.gameId;
|
|
|
MyName = event.name;
|
|
|
ProjDebug = false;
|
|
|
AbnDebug = false;
|
|
|
AllowedAchUps = 2;
|
|
|
+ if (mod.settings.StreamMode) console.log("\x1b[94mINFO\x1b[34m [FPS-UTILS]\x1b[39m - Steam Mode is enabled, No messages will be sent in-game messages until it's disabled.");
|
|
|
}
|
|
|
|
|
|
function sLoadTopo() {
|
|
|
@@ -692,7 +701,7 @@ module.exports = function FpsUtils(mod) {
|
|
|
function sLeaveParty() {
|
|
|
PMembers = []
|
|
|
if (mod.settings.RaidAutoChange) {
|
|
|
- if (!LastState || mod.settings.Mode !== 2) return;
|
|
|
+ if (LastState !== null || mod.settings.Mode !== 2) return;
|
|
|
mod.command.exec(`fps mode ${LastState}`);
|
|
|
LastState = null;
|
|
|
}
|
|
|
@@ -812,11 +821,11 @@ module.exports = function FpsUtils(mod) {
|
|
|
event.members.map(value => PMembers.push(value.name))
|
|
|
if (mod.settings.RaidAutoChange) {
|
|
|
if (event.members.length >= 18) {
|
|
|
- if (mod.settings.Mode === 3 || (LastState && mod.settings.Mode === 2)) return;
|
|
|
+ if (mod.settings.Mode === 3 || (LastState !== null && mod.settings.Mode === 2)) return;
|
|
|
LastState = mod.settings.Mode;
|
|
|
mod.command.exec("fps mode 2");
|
|
|
} else {
|
|
|
- if (!LastState || mod.settings.Mode !== 2) {
|
|
|
+ if (!LastState !== null || mod.settings.Mode !== 2) {
|
|
|
LastState = null;
|
|
|
return;
|
|
|
}
|
|
|
@@ -999,6 +1008,22 @@ module.exports = function FpsUtils(mod) {
|
|
|
if (mod.settings.Hit_Damage || mod.settings.Hit_All) return false;
|
|
|
}
|
|
|
|
|
|
+ function sFieldEventOnEnter() {
|
|
|
+ if (mod.settings.GuardianAutoChange) {
|
|
|
+ if (mod.settings.Mode >= 2) return;
|
|
|
+ LastGState = mod.settings.Mode;
|
|
|
+ mod.command.exec('2')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function sFieldEventOnLeave() {
|
|
|
+ if (mod.settings.GuardianAutoChange) {
|
|
|
+ if (!LastGState !== null || mod.settings.Mode !== 2) return;
|
|
|
+ mod.command.exec(`fps mode ${LastGState}`);
|
|
|
+ LastGState = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// ~~~ * Packet Hooks * ~~~ \\
|
|
|
|
|
|
const Last_Hook = { order: 100010 }, Last_Hookfn = { order: 100010, filter: { fake: null } }
|
|
|
@@ -1056,6 +1081,10 @@ module.exports = function FpsUtils(mod) {
|
|
|
mod.hook('S_SPAWN_DROPITEM', NotCP ? 7 : 8, sSpawnDropItem)
|
|
|
mod.hook('S_FONT_SWAP_INFO', 'raw', sFontSwapInfo)
|
|
|
|
|
|
+ mod.hook('S_FIELD_EVENT_ON_ENTER', 'raw', sFieldEventOnEnter)
|
|
|
+ mod.hook('S_FIELD_EVENT_ON_LEAVE', 'raw', sFieldEventOnLeave)
|
|
|
+
|
|
|
+
|
|
|
// ~~~ * Commands * ~~~ \\
|
|
|
|
|
|
mod.command.add('0', () => mod.command.exec('fps mode 0'))
|
|
|
@@ -1186,6 +1215,10 @@ module.exports = function FpsUtils(mod) {
|
|
|
mod.settings.RaidAutoChange = !mod.settings.RaidAutoChange;
|
|
|
Msg(`Raid auto-state ${mod.settings.RaidAutoChange ? `<font color="${GrnC}">Enabled</font>` : `<font color="${RedC}">Disabled</font>`}.`);
|
|
|
break;
|
|
|
+ case "guardian":
|
|
|
+ mod.settings.GuardianAutoChange = !mod.settings.GuardianAutoChange;
|
|
|
+ Msg(`Guardian auto-state ${mod.settings.GuardianAutoChange ? `<font color="${GrnC}">Enabled</font>` : `<font color="${RedC}">Disabled</font>`}.`);
|
|
|
+ break;
|
|
|
case "pvptraps":
|
|
|
mod.settings.PvpTraps = !mod.settings.PvpTraps;
|
|
|
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>`}.`);
|
|
|
@@ -1512,6 +1545,12 @@ module.exports = function FpsUtils(mod) {
|
|
|
mod.settings.HideMpNumbers = !mod.settings.HideMpNumbers;
|
|
|
Msg(`Own Mp numbers ${mod.settings.HideMpNumbers ? `<font color="${GrnC}">Hidden</font>` : `<font color="${RedC}">Shown</font>`}.`);
|
|
|
break;
|
|
|
+ case "stream":
|
|
|
+ mod.settings.StreamMode = !mod.settings.StreamMode;
|
|
|
+ Msg(`Stream mode is ${mod.settings.StreamMode ? `<font color="${GrnC}">Enabled</font>` : `<font color="${RedC}">Disabled</font>`}.`); // It will only show when disabled.
|
|
|
+ if (mod.settings.StreamMode) console.log("\x1b[94mINFO\x1b[34m [FPS-UTILS]\x1b[39m - Steam Mode has been enabled, No messages will be sent in-game messages until it's disabled.");
|
|
|
+ else console.log("\x1b[94mINFO\x1b[34m [FPS-UTILS]\x1b[39m - Steam Mode has been disabled.");
|
|
|
+ break;
|
|
|
case "help":
|
|
|
mod.command.exec("fps gui help");
|
|
|
break;
|