Просмотр исходного кода

2.1.0 Added "dungeonOnly" option and "dungeon" command

TeraProxy лет назад: 8
Родитель
Сommit
1ba1ff0b43
5 измененных файлов с 29 добавлено и 12 удалено
  1. 5 1
      README.md
  2. 18 6
      index.js
  3. 4 4
      manifest.json
  4. 1 1
      module.json
  5. 1 0
      settings_migrator.js

+ 5 - 1
README.md

@@ -14,10 +14,11 @@ If you enjoy my work and wish to support future development, feel free to drop m
 A tera-proxy module that automatically uses "Nostrum"/"Battle Solution" and "Complete Crystalbind" items whenever needed.
 A tera-proxy module that automatically uses "Nostrum"/"Battle Solution" and "Complete Crystalbind" items whenever needed.
 
 
 ## Usage
 ## Usage
-There are several options you can change in the "\tera-proxy\settings\Essentials.json" file:  
+There are several options you can change in the config.json file (Pinkie's proxy: "\settings\Essentials.json"):  
   
   
 * "useNostrum" - Change this to "false" if you do not want the module to use any Nostrums
 * "useNostrum" - Change this to "false" if you do not want the module to use any Nostrums
 * "useCCB" - Change this to "false" if you do not want the module to use any CCBs
 * "useCCB" - Change this to "false" if you do not want the module to use any CCBs
+* "dungeonOnly" - Change this to "true" if you want the items to be only used in dungeons
 * "log" - If you need to find a specific item ID, change this to "true" and it will log the ID of any item you use in the proxy chat
 * "log" - If you need to find a specific item ID, change this to "true" and it will log the ID of any item you use in the proxy chat
 * "nostrum" - This is the ID of the Nostrum item the module will use.
 * "nostrum" - This is the ID of the Nostrum item the module will use.
 * "ccb" - This is the ID of the Nostrum item the module will use
 * "ccb" - This is the ID of the Nostrum item the module will use
@@ -27,6 +28,7 @@ This serves as the script's command interface.
 The following commands are supported:  
 The following commands are supported:  
   
   
 * essentials - enable/disable Essentials
 * essentials - enable/disable Essentials
+* essentials dungeon - switch between using items everywhere or only in dungeons
 
 
 ## Safety
 ## Safety
 Whatever you send to the proxy chat in game is intercepted client-side. The chat is NOT sent to the server.  
 Whatever you send to the proxy chat in game is intercepted client-side. The chat is NOT sent to the server.  
@@ -39,6 +41,8 @@ Based on true-everful-nostrum by Caali https://github.com/caali-hackerman
 ## Changelog
 ## Changelog
 <details>
 <details>
 
 
+### 2.1.0
+* [+] Added "dungeonOnly" option and "dungeon" command
 ### 2.0.5
 ### 2.0.5
 * [~] Look and feel will now be the same on Caali's and Pinkie's proxy
 * [~] Look and feel will now be the same on Caali's and Pinkie's proxy
 ### 2.0.4
 ### 2.0.4

+ 18 - 6
index.js

@@ -1,4 +1,4 @@
-// Version 2.0.5
+// Version 2.1.0
 // Based on true-everful-nostrum by Pinkie Pie https://github.com/pinkipi
 // Based on true-everful-nostrum by Pinkie Pie https://github.com/pinkipi
 // Based on true-everful-nostrum by Caali https://github.com/caali-hackerman
 // Based on true-everful-nostrum by Caali https://github.com/caali-hackerman
 
 
@@ -96,6 +96,7 @@ module.exports = function Essentials(mod) {
 			if(abnormalityDuration(buff) > 300000 || !mod.settings.useNostrum) return
 			if(abnormalityDuration(buff) > 300000 || !mod.settings.useNostrum) return
 
 
 		if(!mod.game.isIngame || mod.game.isInLoadingScreen || !mod.game.me.alive || mod.game.me.mounted || mod.game.me.inBattleground || mod.game.contract.active) return
 		if(!mod.game.isIngame || mod.game.isInLoadingScreen || !mod.game.me.alive || mod.game.me.mounted || mod.game.me.inBattleground || mod.game.contract.active) return
+		if(mod.game.me.zone < 9000 && mod.settings.dungeonOnly) return
 
 
 		if(enabled) {
 		if(enabled) {
 			if(slot) mod.toServer('C_PCBANGINVENTORY_USE_SLOT', 1, {slot})
 			if(slot) mod.toServer('C_PCBANGINVENTORY_USE_SLOT', 1, {slot})
@@ -108,7 +109,8 @@ module.exports = function Essentials(mod) {
 			if(abnormalityDuration(buff) > 600000 || !mod.settings.useCCB) return
 			if(abnormalityDuration(buff) > 600000 || !mod.settings.useCCB) return
 
 
 		if(!mod.game.isIngame || mod.game.isInLoadingScreen || !mod.game.me.alive || mod.game.me.mounted || mod.game.me.inBattleground || mod.game.contract.active) return
 		if(!mod.game.isIngame || mod.game.isInLoadingScreen || !mod.game.me.alive || mod.game.me.mounted || mod.game.me.inBattleground || mod.game.contract.active) return
-
+		if(mod.game.me.zone < 9000 && mod.settings.dungeonOnly) return
+		
 		if(enabled) useItem(mod.settings.ccb)
 		if(enabled) useItem(mod.settings.ccb)
 	}
 	}
 
 
@@ -154,9 +156,19 @@ module.exports = function Essentials(mod) {
 	// ### Commands ### //
 	// ### Commands ### //
 	// ################ //
 	// ################ //
 
 
-	mod.command.add('essentials', () => {
-		enabled = !enabled
-		mod.command.message(niceName + 'Essentials ' + (enabled ? '<font color="#56B4E9">enabled</font>' : '<font color="#E69F00">disabled</font>'))
-		console.log('Essentials ' + (enabled ? 'enabled' : 'disabled'))
+	mod.command.add('essentials', (param) => {
+		if(param == null) {
+			enabled = !enabled
+			mod.command.message(niceName + 'Essentials ' + (enabled ? '<font color="#56B4E9">enabled</font>' : '<font color="#E69F00">disabled</font>'))
+			console.log('Essentials ' + (enabled ? 'enabled' : 'disabled'))
+		}
+		else if(param == "dungeons" || param == "dungeons" || param == "dung") {
+			mod.settings.dungeonOnly = !mod.settings.dungeonOnly
+			mod.command.message(niceName + 'Items will be used ' + (enabled ? 'everywhere' : 'in dungeons only'))
+		}
+		else mod.command.message('Commands:\n'
+								+ ' "essentials" (enable/disable Essentials),\n'
+								+ ' "essentials dungeon" (switch between using items everywhere or only in dungeons)'
+		)
 	})
 	})
 }
 }

+ 4 - 4
manifest.json

@@ -1,10 +1,10 @@
 {
 {
 	"files": {
 	"files": {
 		"LICENSE": "589ed823e9a84c56feb95ac58e7cf384626b9cbf4fda2a907bc36e103de1bad2",
 		"LICENSE": "589ed823e9a84c56feb95ac58e7cf384626b9cbf4fda2a907bc36e103de1bad2",
-		"README.md": "5536df20503ef5e3c25b9f8ecb5ff2602a02b38950f837354338c62b81c07e2f",
-		"index.js": "f795a649eebbe4a0c7bd1c6bfc8f68be6749b2e2b2255078e4785b0b60f1306d",
-		"module.json": "ff65da8b58525c2468a904b0c5cda7490b98d395dd352dcc12bf58ca67faf3cb",
-		"settings_migrator.js": "d06d1adc3c700cb22392e8921a6e3b99302ae536f46bc3da200311eee1e8141d"
+		"README.md": "0578f04bc98cab2fe7a7a4bf6714f8dbcf546825907d0b9df67e685ea0a1f2fc",
+		"index.js": "0ff66205d0c0a3a55456541ca2c244846c872733bb3906457f24eabf045f3330",
+		"module.json": "3b8cad84f702ec215160fa9c5aee35b8cd6bc30b56e65d8010f95c3cbe3652f6",
+		"settings_migrator.js": "b6cd4c0b82a975d56663951b7bb9a839201ab90fef123e41902871057831ee95"
 	},
 	},
 	"defs": {
 	"defs": {
 		"C_PCBANGINVENTORY_USE_SLOT": 1,
 		"C_PCBANGINVENTORY_USE_SLOT": 1,

+ 1 - 1
module.json

@@ -2,7 +2,7 @@
     "disableAutoUpdate": false,
     "disableAutoUpdate": false,
     "options": {
     "options": {
         "niceName": "Essentials",
         "niceName": "Essentials",
-        "settingsVersion": 3,
+        "settingsVersion": 4,
         "settingsFile": "config.json",
         "settingsFile": "config.json",
         "settingsMigrator": "settings_migrator.js"
         "settingsMigrator": "settings_migrator.js"
     },
     },

+ 1 - 0
settings_migrator.js

@@ -3,6 +3,7 @@
 const DefaultSettings = {
 const DefaultSettings = {
 	"useNostrum": true,
 	"useNostrum": true,
 	"useCCB": true,
 	"useCCB": true,
+	"dungeonOnly": false,
 	"log": false,
 	"log": false,
 	"nostrum": 200999,
 	"nostrum": 200999,
 	"ccb": 70000
 	"ccb": 70000