Browse Source

new features

SaltyMonkey 6 years ago
parent
commit
dd2846c5e8
3 changed files with 61 additions and 22 deletions
  1. 6 0
      data/protoData.json
  2. 49 22
      lib/unitFps.js
  3. 6 0
      settings/presets/common.json

+ 6 - 0
data/protoData.json

@@ -163,5 +163,11 @@
 	},
 	"S_DEFEND_SUCCESS": {
 		"default": 3
+	},
+	"S_INSTANT_MOVE": {
+		"default": 3
+	},
+	"S_NOCTAN_VARIATION_INFO": {
+		"default": 1
 	}
 }

+ 49 - 22
lib/unitFps.js

@@ -150,15 +150,34 @@ class unitFps {
 			return false;
 		};
 
+		const isNoctsBlockable = () => {
+			if (data.activeMode.blockNoctsEffect) return true;
+			return false;
+		};
+
 		const isAbnormalBlockable = (event) => {
 			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.effects && data.onScreenEffectsBuffs.has(event.id)) return true;
 			}
 			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
 		//-------------------------------------
@@ -340,13 +359,13 @@ class unitFps {
 			}
 		};
 
-		const blockAdditionalSkillEffectsHandler = (event) => {
+		const instanceArrowHandler = (event) => {
 			if (isEntityBlocked(event.gameId)) return false;
 			if (isEffectBlockable(event)) return false;
 		};
 
 		const smtHandler = (event) => {
-			if (data.activeMode.blockAnnoyingScreenMessages && data.smtData.has(mod.parseSystemMessage(event.message).id)) return false;
+			if (isSmtBlockable(event)) return false;
 		};
 
 		const inventoryHandler = () => {
@@ -365,6 +384,7 @@ class unitFps {
 		};
 
 		const abnormalsHandler = (event) => {
+			if (isEntityBlocked(event.target)) return false;
 			if (isAbnormalBlockable(event)) return false;
 		};
 
@@ -438,13 +458,12 @@ class unitFps {
 			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 (isSkillBlockable(event)) {
+				mod.send(...proto.getData("S_INSTANT_MOVE"), {"gameId": event.gameId, "w": event.w, "loc": event.loc});
+				return false;
+			}
 		};
 
 		/*const itemsExplosionHandler = (event) => {
@@ -453,7 +472,8 @@ class unitFps {
 		};*/
 
 		const appearanceChangeHandler = (event) => {
-			if (isEntityBlocked(event.gameId) || data.activeMode.blockCustomAppearanceChanges) return false;
+			if (isEntityBlocked(event.gameId)) return false;
+			if (isCustomAppBlockable()) return false;
 		};
 
 		const achievementHandler = () => {
@@ -462,7 +482,11 @@ class unitFps {
 
 		const baloonsHandler = (event) => {
 			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) => {
@@ -501,16 +525,20 @@ class unitFps {
 
 		//-------------------------------------
 		// 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.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("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_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_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_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_END"), 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_LIFE"), 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_END"), 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_PLAYER_CHANGE_MP"), HOOK_SETTINGS.LAST, creatureChangeMpHandler);
 		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_ABNORMALITY_BEGIN"), HOOK_SETTINGS.LAST, abnormalsHandler);

+ 6 - 0
settings/presets/common.json

@@ -15,6 +15,8 @@
 			"blockCustomAppearanceChanges": false,
 			"blockUselessPackets": false,
 			"blockAnnoyingScreenMessages": false,
+			"blockNoctsEffect": false,
+			"blockActionScripts": false,
 			"blockNpcsDeathAnimations": false,
 			"blockAchievementsInCombat": false,
 			"blockInventoryInCombat": false,
@@ -77,6 +79,8 @@
 			"blockCustomAppearanceChanges": true,
 			"blockUselessPackets": true,
 			"blockAnnoyingScreenMessages": true,
+			"blockNoctsEffect": true,
+			"blockActionScripts": true,
 			"blockNpcsDeathAnimations": true,
 			"blockAchievementsInCombat": false,
 			"blockInventoryInCombat": false,
@@ -139,6 +143,8 @@
 			"blockCustomAppearanceChanges": true,
 			"blockUselessPackets": true,
 			"blockAnnoyingScreenMessages": true,
+			"blockNoctsEffect": true,
+			"blockActionScripts": true,
 			"blockNpcsDeathAnimations": true,
 			"blockAchievementsInCombat": true,
 			"blockInventoryInCombat": true,