summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rwxr-xr-xtmw-info3
2 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index b59a868..b9f2be3 100644
--- a/README.md
+++ b/README.md
@@ -66,4 +66,5 @@ If you get an error while searching, it may contain special characters and needs
2020-08-15 - fixed gm-show (wasn't showing GUI) and removed trailing comma in mob drops
+2020-08-16 - added ratio for dropped items to represent chances in a more human readable way
diff --git a/tmw-info b/tmw-info
index 628ee9c..c6277d2 100755
--- a/tmw-info
+++ b/tmw-info
@@ -323,9 +323,10 @@ elif [ "$1" == "mob-search" ]; then
DROP_NAME=$(echo "$DROP_NAMES" | awk "{print $"$DROP_COUNT"}")
DROP_PERC=$(echo "$DROP_PERCS" | awk "{print $"$DROP_COUNT"}")
DROP_PERCENT=$(echo "scale=2; $DROP_PERC / 100" | bc)
+ DROP_RATIO=$(echo "100 / $DROP_PERCENT" | bc)
#echo "DROP_NAME: $DROP_NAME"
#echo "DROP_PERC: $DROP_PERC"
- echo "$DROP_NAME($DROP_PERCENT%)," >> "$TMW_INFO/mob-drops-$MOB_ID.tmp"
+ echo "$DROP_NAME($DROP_PERCENT% | $DROP_RATIO:1)," >> "$TMW_INFO/mob-drops-$MOB_ID.tmp"
cat < "$TMW_INFO/mob-drops-$MOB_ID.tmp" | tr '\n' ' ' > "$TMW_INFO/mob-drops-$MOB_ID.tmp.tmp"
mv "$TMW_INFO/mob-drops-$MOB_ID.tmp.tmp" "$TMW_INFO/mob-drops-$MOB_ID.tmp"
DROP_COUNT=$(( DROP_COUNT + 1 ))