|
@@ -150,15 +150,34 @@ class unitFps {
|
|
|
return false;
|
|
return false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const isNoctsBlockable = () => {
|
|
|
|
|
+ if (data.activeMode.blockNoctsEffect) return true;
|
|
|
|
|
+ return false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const isAbnormalBlockable = (event) => {
|
|
const isAbnormalBlockable = (event) => {
|
|
|
if (data.activeMode.blockBuffs) {
|
|
if (data.activeMode.blockBuffs) {
|
|
|
- if (isEntityBlocked(event.target) || (data.activeMode.blockBuffs.area && !isMe(event.target) && tracker.spawnedPlayers.has(event.target))) return true;
|
|
|
|
|
|
|
+ if (data.activeMode.blockBuffs.area && !isMe(event.target) && tracker.spawnedPlayers.has(event.target)) return true;
|
|
|
if (data.activeMode.blockBuffs.shapeChange && data.shapeChangersBuffs.has(event.id)) return true;
|
|
if (data.activeMode.blockBuffs.shapeChange && data.shapeChangersBuffs.has(event.id)) return true;
|
|
|
if (data.activeMode.blockBuffs.effects && data.onScreenEffectsBuffs.has(event.id)) return true;
|
|
if (data.activeMode.blockBuffs.effects && data.onScreenEffectsBuffs.has(event.id)) return true;
|
|
|
}
|
|
}
|
|
|
return false;
|
|
return false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const isBaloonBlockable = (event) => {
|
|
|
|
|
+ if (data.activeMode.blockPetBaloons && tracker.spawnedServants.has(event.source)) return true;
|
|
|
|
|
+ return false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const isCustomAppBlockable = () => {
|
|
|
|
|
+ if (data.activeMode.blockCustomAppearanceChanges) return true;
|
|
|
|
|
+ return false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const isSmtBlockable = (event) => {
|
|
|
|
|
+ if (data.activeMode.blockAnnoyingScreenMessages && data.smtData.has(mod.parseSystemMessage(event.message).id)) return true;
|
|
|
|
|
+ return false;
|
|
|
|
|
+ };
|
|
|
//-------------------------------------
|
|
//-------------------------------------
|
|
|
// Reconfigure area handlers
|
|
// Reconfigure area handlers
|
|
|
//-------------------------------------
|
|
//-------------------------------------
|
|
@@ -340,13 +359,13 @@ class unitFps {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const blockAdditionalSkillEffectsHandler = (event) => {
|
|
|
|
|
|
|
+ const instanceArrowHandler = (event) => {
|
|
|
if (isEntityBlocked(event.gameId)) return false;
|
|
if (isEntityBlocked(event.gameId)) return false;
|
|
|
if (isEffectBlockable(event)) return false;
|
|
if (isEffectBlockable(event)) return false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const smtHandler = (event) => {
|
|
const smtHandler = (event) => {
|
|
|
- if (data.activeMode.blockAnnoyingScreenMessages && data.smtData.has(mod.parseSystemMessage(event.message).id)) return false;
|
|
|
|
|
|
|
+ if (isSmtBlockable(event)) return false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const inventoryHandler = () => {
|
|
const inventoryHandler = () => {
|
|
@@ -365,6 +384,7 @@ class unitFps {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const abnormalsHandler = (event) => {
|
|
const abnormalsHandler = (event) => {
|
|
|
|
|
+ if (isEntityBlocked(event.target)) return false;
|
|
|
if (isAbnormalBlockable(event)) return false;
|
|
if (isAbnormalBlockable(event)) return false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -438,13 +458,12 @@ class unitFps {
|
|
|
if (isEntityBlocked(id)) return false;
|
|
if (isEntityBlocked(id)) return false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const actionStageHandler = (event) => {
|
|
|
|
|
- if (isEntityBlocked(event.gameId)) return false;
|
|
|
|
|
- if (isSkillBlockable(event)) return false;
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const actionEndHandler = (event) => {
|
|
|
|
|
|
|
+ const actionHandler = (event) => {
|
|
|
if (isEntityBlocked(event.gameId)) return false;
|
|
if (isEntityBlocked(event.gameId)) return false;
|
|
|
|
|
+ if (isSkillBlockable(event)) {
|
|
|
|
|
+ mod.send(...proto.getData("S_INSTANT_MOVE"), {"gameId": event.gameId, "w": event.w, "loc": event.loc});
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/*const itemsExplosionHandler = (event) => {
|
|
/*const itemsExplosionHandler = (event) => {
|
|
@@ -453,7 +472,8 @@ class unitFps {
|
|
|
};*/
|
|
};*/
|
|
|
|
|
|
|
|
const appearanceChangeHandler = (event) => {
|
|
const appearanceChangeHandler = (event) => {
|
|
|
- if (isEntityBlocked(event.gameId) || data.activeMode.blockCustomAppearanceChanges) return false;
|
|
|
|
|
|
|
+ if (isEntityBlocked(event.gameId)) return false;
|
|
|
|
|
+ if (isCustomAppBlockable()) return false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const achievementHandler = () => {
|
|
const achievementHandler = () => {
|
|
@@ -462,7 +482,11 @@ class unitFps {
|
|
|
|
|
|
|
|
const baloonsHandler = (event) => {
|
|
const baloonsHandler = (event) => {
|
|
|
if (isEntityBlocked(event.source)) return false;
|
|
if (isEntityBlocked(event.source)) return false;
|
|
|
- if (data.activeMode.blockPetBaloons && tracker.spawnedServants.has(event.source)) return false;
|
|
|
|
|
|
|
+ if (isBaloonBlockable(event)) return false;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const noctanHandler = () => {
|
|
|
|
|
+ if(isNoctsBlockable()) return false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const partyMemberListHandler = (event) => {
|
|
const partyMemberListHandler = (event) => {
|
|
@@ -501,16 +525,20 @@ class unitFps {
|
|
|
|
|
|
|
|
//-------------------------------------
|
|
//-------------------------------------
|
|
|
// Hooks
|
|
// Hooks
|
|
|
- //-------------------------------------
|
|
|
|
|
|
|
+ //-------------------------------------
|
|
|
|
|
+ mod.hook("S_LOAD_TOPO", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.FIRST, cleanup);
|
|
|
|
|
+
|
|
|
data.throttlePacketsData.forEach(packet => { mod.hook(packet, RAW_HOOK_MODE.PAYLOAD, HOOK_SETTINGS.LAST, throttlePacketsHandler.bind(null, packet)); });
|
|
data.throttlePacketsData.forEach(packet => { mod.hook(packet, RAW_HOOK_MODE.PAYLOAD, HOOK_SETTINGS.LAST, throttlePacketsHandler.bind(null, packet)); });
|
|
|
data.lockedPacketsData.forEach(packet => { mod.hook(packet, RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, blockUselessPacketsHandler); });
|
|
data.lockedPacketsData.forEach(packet => { mod.hook(packet, RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, blockUselessPacketsHandler); });
|
|
|
- mod.hook(...proto.getData("S_SYSTEM_MESSAGE"), HOOK_SETTINGS.LAST, smtHandler);
|
|
|
|
|
mod.hook("C_SHOW_ITEMLIST", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, inventoryHandler);
|
|
mod.hook("C_SHOW_ITEMLIST", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, inventoryHandler);
|
|
|
mod.hook("S_INVEN_USERDATA", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, inventoryHandler);
|
|
mod.hook("S_INVEN_USERDATA", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, inventoryHandler);
|
|
|
mod.hook("S_ITEMLIST", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, inventoryHandler);
|
|
mod.hook("S_ITEMLIST", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, inventoryHandler);
|
|
|
mod.hook("S_UPDATE_ACHIEVEMENT_PROGRESS", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, achievementHandler);
|
|
mod.hook("S_UPDATE_ACHIEVEMENT_PROGRESS", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, achievementHandler);
|
|
|
- mod.hook("S_LOAD_TOPO", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.FIRST, cleanup);
|
|
|
|
|
|
|
+ mod.hook("S_NOCTAN_VARIATION_INFO", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, noctanHandler);
|
|
|
|
|
+ mod.hook("S_FONT_SWAP_INFO", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, fontSwapHandler);
|
|
|
|
|
+
|
|
|
mod.hook(...proto.getData("S_QUEST_BALLOON"), HOOK_SETTINGS.LAST, baloonsHandler);
|
|
mod.hook(...proto.getData("S_QUEST_BALLOON"), HOOK_SETTINGS.LAST, baloonsHandler);
|
|
|
|
|
+ mod.hook(...proto.getData("S_SYSTEM_MESSAGE"), HOOK_SETTINGS.LAST, smtHandler);
|
|
|
|
|
|
|
|
mod.hook(...proto.getData("S_DESPAWN_COLLECTION"), HOOK_SETTINGS.LAST, collectionHandler.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
|
|
mod.hook(...proto.getData("S_DESPAWN_COLLECTION"), HOOK_SETTINGS.LAST, collectionHandler.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
|
|
|
mod.hook(...proto.getData("S_SPAWN_COLLECTION"), HOOK_SETTINGS.LAST, collectionHandler.bind(null, ENTITY_HOOK_TYPE.SPAWN));
|
|
mod.hook(...proto.getData("S_SPAWN_COLLECTION"), HOOK_SETTINGS.LAST, collectionHandler.bind(null, ENTITY_HOOK_TYPE.SPAWN));
|
|
@@ -529,6 +557,7 @@ class unitFps {
|
|
|
mod.hook(...proto.getData("S_FEARMOVE_STAGE"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
mod.hook(...proto.getData("S_FEARMOVE_STAGE"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
|
mod.hook(...proto.getData("S_FEARMOVE_END"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
mod.hook(...proto.getData("S_FEARMOVE_END"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
|
mod.hook(...proto.getData("S_USER_LOCATION"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
mod.hook(...proto.getData("S_USER_LOCATION"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
|
|
|
+ mod.hook(...proto.getData("S_USER_LOCATION_IN_ACTION"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
|
mod.hook(...proto.getData("S_CREATURE_ROTATE"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
mod.hook(...proto.getData("S_CREATURE_ROTATE"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
|
mod.hook(...proto.getData("S_CREATURE_LIFE"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
mod.hook(...proto.getData("S_CREATURE_LIFE"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
|
mod.hook(...proto.getData("S_NPC_LOCATION"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
mod.hook(...proto.getData("S_NPC_LOCATION"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
@@ -537,17 +566,15 @@ class unitFps {
|
|
|
mod.hook(...proto.getData("S_STICK_TO_USER_START"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
mod.hook(...proto.getData("S_STICK_TO_USER_START"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
|
mod.hook(...proto.getData("S_STICK_TO_USER_END"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
mod.hook(...proto.getData("S_STICK_TO_USER_END"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
|
mod.hook(...proto.getData("S_DEFEND_SUCCESS"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
mod.hook(...proto.getData("S_DEFEND_SUCCESS"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
|
|
|
-
|
|
|
|
|
- mod.hook(...proto.getData("S_INSTANCE_ARROW"), HOOK_SETTINGS.LAST, blockAdditionalSkillEffectsHandler);
|
|
|
|
|
- mod.hook(...proto.getData("S_INSTANCE_ARROW"), HOOK_SETTINGS.LASTFAKE, blockAdditionalSkillEffectsHandler);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ mod.hook(...proto.getData("S_INSTANCE_ARROW"), HOOK_SETTINGS.LAST, instanceArrowHandler);
|
|
|
|
|
+ mod.hook(...proto.getData("S_INSTANCE_ARROW"), HOOK_SETTINGS.LASTFAKE, instanceArrowHandler);
|
|
|
mod.hook(...proto.getData("S_CREATURE_CHANGE_HP"), HOOK_SETTINGS.LAST, creatureChangeHpHandler);
|
|
mod.hook(...proto.getData("S_CREATURE_CHANGE_HP"), HOOK_SETTINGS.LAST, creatureChangeHpHandler);
|
|
|
mod.hook(...proto.getData("S_PLAYER_CHANGE_MP"), HOOK_SETTINGS.LAST, creatureChangeMpHandler);
|
|
mod.hook(...proto.getData("S_PLAYER_CHANGE_MP"), HOOK_SETTINGS.LAST, creatureChangeMpHandler);
|
|
|
mod.hook(...proto.getData("S_EACH_SKILL_RESULT"), HOOK_SETTINGS.LAST, eachSkillResultHandler);
|
|
mod.hook(...proto.getData("S_EACH_SKILL_RESULT"), HOOK_SETTINGS.LAST, eachSkillResultHandler);
|
|
|
- mod.hook("S_FONT_SWAP_INFO", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, fontSwapHandler);
|
|
|
|
|
-
|
|
|
|
|
- mod.hook(...proto.getData("S_ACTION_STAGE"), HOOK_SETTINGS.LAST, actionStageHandler);
|
|
|
|
|
- mod.hook(...proto.getData("S_ACTION_END"), HOOK_SETTINGS.LAST, actionEndHandler);
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ mod.hook(...proto.getData("S_ACTION_STAGE"), HOOK_SETTINGS.LAST, actionHandler);
|
|
|
|
|
+ mod.hook(...proto.getData("S_ACTION_END"), HOOK_SETTINGS.LAST, actionHandler);
|
|
|
//mod.hook(...proto.getData("S_ITEM_EXPLOSION_RESULT"), HOOK_SETTINGS.LAST, itemsExplosionHandler); //TODO: NEED MAP
|
|
//mod.hook(...proto.getData("S_ITEM_EXPLOSION_RESULT"), HOOK_SETTINGS.LAST, itemsExplosionHandler); //TODO: NEED MAP
|
|
|
|
|
|
|
|
mod.hook(...proto.getData("S_ABNORMALITY_BEGIN"), HOOK_SETTINGS.LAST, abnormalsHandler);
|
|
mod.hook(...proto.getData("S_ABNORMALITY_BEGIN"), HOOK_SETTINGS.LAST, abnormalsHandler);
|