# check if not run as plugin
if [ "$TMWW_PLUGINS" != "yes" ] ; then
echo >&2 "This script is tmww plugin and rely heavily on it's facilities."
exit 1
fi
# when called as plugin - abort if no SERVERPATH was given
if [ -z "${TMWW_SERVERPATH}" ]; then
error "No serverpath given. Aborting."
return 1
fi
help_db() {
cat << EOF
db.plugin - item/mob db lookup (using tmwa-server-data)
Options:
c -- no fields captions
n -- suppress append id/name to fields query
r -- output raw tab-separated fields without pretty-printing
f EXPR -- custom "cut -f" expression for db filter
subcommand: item [ OPTS ]
get { NAME | [ id | name | db | FIELD+ ] by { id ID | name NAME } }
show { names | ids | db | FIELD+ } by { ids ID+ | names NAME+ | re REGEXP | itemset ITEMSET }
mobs by { ids ID+ | names NAME+ | re REGEXP } -- show mobs dropping item/items
subcommand: mob [ OPTS ]
get { NAME | [ id | name | db | FIELD+ ] by { id ID | name NAME } }
show [ names | ids | db | FIELD+ ] by { ids ID+ | names NAME+ | re REGEXP }
drops { NAME | by { id ID | name NAME } } -- show mob drops
EOF
}