Fukki 8 years ago
parent
commit
64cf2c3940
2 changed files with 5 additions and 3 deletions
  1. 4 2
      index.js
  2. 1 1
      manifest.json

+ 4 - 2
index.js

@@ -99,7 +99,8 @@ module.exports = function AutoPOT(mod) {
 	
     mod.hook('S_PLAYER_STAT_UPDATE', 10, e => {
 		if (config.enabled && config.hp) {
-			nowHP = Math.round(e.hp / e.maxHp * 100);
+			//nowHP = Math.round(e.hp / e.maxHp * 100));
+			nowHP = Math.round(parseInt(e.hp) / parseInt(e.maxHp) * 100));
 			for (let hp = 0; hp < hpPot.length; hp++) {
 				if (!hpPot[hp][1].inCd && ((!isSlaying && nowHP <= hpPot[hp][1].use_at) || (isSlaying && nowHP <= hpPot[hp][1].slaying)) && hpPot[hp][1].amount > 0 && isCombat && isAlive && !isBG) {
 					useItem(hpPot[hp]); hpPot[hp][1].inCd = true; hpPot[hp][1].amount--; setTimeout(function () {hpPot[hp][1].inCd = false;}, hpPot[hp][1].cd * 1000);
@@ -108,7 +109,8 @@ module.exports = function AutoPOT(mod) {
 			}
 		}
 		if (config.enabled && config.mp) {
-			nowMP = Math.round(e.mp / e.maxMp * 100);
+			//nowMP = Math.round(e.mp / e.maxMp * 100));
+			nowMP = Math.round(parseInt(e.mp) / parseInt(e.maxMp) * 100));
 			for (let mp = 0; mp < mpPot.length; mp++) {
 				if (!mpPot[mp][1].inCd && nowMP <= mpPot[mp][1].use_at && mpPot[mp][1].amount > 0 && isAlive && !isBG && !isCon && !isMount) {
 					useItem(mpPot[mp]); mpPot[mp][1].inCd = true; mpPot[mp][1].amount--; setTimeout(function () {mpPot[mp][1].inCd = false;}, mpPot[mp][1].cd * 1000);

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
 	"files": {
-		"index.js": "97f8394494a800ea5994cd1279a184c571a02213a92654a9213f88178afca6d2"
+		"index.js": "8da2d1a955062db386055777186ef202cb2e5c0a6e6a3bd4dd9dc03246204e2d"
 	},
 	"defs": {
 		"C_BIND_ITEM_EXECUTE": "raw",