From ebc7b68f6590034deddbf683c72786ab717f2e9f Mon Sep 17 00:00:00 2001 From: MIKELL Date: Mon, 20 Dec 2021 13:07:38 +0700 Subject: [PATCH] fix adventure --- handler.js | 6 ++---- plugins/adventure.js | 2 +- plugins/hunt.js | 2 +- plugins/inv.js | 18 +----------------- plugins/shop copy.js | 1 + plugins/shop.js | 1 + 6 files changed, 7 insertions(+), 23 deletions(-) diff --git a/handler.js b/handler.js index 9823ab5a..df4d3a59 100644 --- a/handler.js +++ b/handler.js @@ -32,7 +32,6 @@ module.exports = { if (user) { if (!('rpg' in user)) user.rpg = {} - if (!('cooldown' in user)) user.cooldown = {} if (!isNumber(user.exp)) user.exp = 0 if (!isNumber(user.limit)) user.limit = 10 if (!isNumber(user.healt)) user.healt = 100 @@ -67,11 +66,9 @@ module.exports = { if (!('afkReason' in user)) user.afkReason = '' if (!isNumber(user.lasthunt)) user.lasthunt = 0 if (!isNumber(user.lastfishing)) user.lastfishing = 0 + if (!isNumber(user.lastadventure)) user.lastadventure = 0 } else global.db.data.users[m.sender] = { - cooldown: { - - }, rpg: { fish: {}, items: {}, @@ -100,6 +97,7 @@ module.exports = { pasangan: '', lasthunt: 0, lastfishing: 0, + lastadventure: 0, } let chat = global.db.data.chats[m.chat] diff --git a/plugins/adventure.js b/plugins/adventure.js index b569162c..0a0edd72 100644 --- a/plugins/adventure.js +++ b/plugins/adventure.js @@ -84,7 +84,7 @@ handler.help = ['adventure'] handler.tags = ['rpg'] handler.command = /^adventure/i -handler.owner = true +handler.owner = false handler.disabled = false handler.fail = null diff --git a/plugins/hunt.js b/plugins/hunt.js index 105d77b5..f7e3ec44 100644 --- a/plugins/hunt.js +++ b/plugins/hunt.js @@ -73,7 +73,7 @@ handler.help = ['hunt'] handler.tags = ['rpg'] handler.command = /^hunt/i -handler.owner = true +handler.owner = false handler.disabled = false handler.fail = null diff --git a/plugins/inv.js b/plugins/inv.js index 37a94dab..ab10e48c 100644 --- a/plugins/inv.js +++ b/plugins/inv.js @@ -1,32 +1,21 @@ let levelling = require('../lib/levelling') let handler = async (m, { conn, usedPrefix }) => { let inventoryy = global.db.data.users[m.sender].rpg - let kayu = global.db.data.users[m.sender].kayu let healt = global.db.data.users[m.sender].healt let armor = global.db.data.users[m.sender].armor let warn = global.db.data.users[m.sender].warn let banklimit = global.db.data.users[m.sender].banklimit - let banknote = global.db.data.users[m.sender].banknote let pet = global.db.data.users[m.sender].pet - let fishingrod = global.db.data.users[m.sender].fishingrod let kucing = global.db.data.users[m.sender].kucing let _kucing = global.db.data.users[m.sender].anakkucing let rubah = global.db.data.users[m.sender].rubah let _rubah = global.db.data.users[m.sender].anakrubah let kuda = global.db.data.users[m.sender].kuda let _kuda = global.db.data.users[m.sender].anakkuda - let diamond = global.db.data.users[m.sender].diamond - let potion = global.db.data.users[m.sender].potion - let common = global.db.data.users[m.sender].common - let makananpet = global.db.data.users[m.sender].makananpet - let uncommon = global.db.data.users[m.sender].uncommon - let mythic = global.db.data.users[m.sender].mythic - let legendary = global.db.data.users[m.sender].legendary let level = global.db.data.users[m.sender].level let money = global.db.data.users[m.sender].money let bank = global.db.data.users[m.sender].bank let exp = global.db.data.users[m.sender].exp - let sampah = global.db.data.users[m.sender].sampah let { max } = levelling.xpRange(level, exp, global.multiplier) let name = m.fromMe ? conn.user : conn.contacts[m.sender] let sortedmoney = Object.entries(global.db.data.users).sort((a, b) => b[1].money - a[1].money) @@ -63,12 +52,7 @@ Exp: *${exp}*\n Warn: *${warn}* Banned: *No* \n${readMore}\n -${finalstring} -*Crate* -Common: *${common}* -Uncommon: *${uncommon}* -Mythic: *${mythic}* -Legendary: *${legendary}* +${finalstring}\n Pet: *${pet}*\n *Pet* Kuda: *${kuda == 0 ? 'Tidak Punya' : '' || kuda == 1 ? 'Level 1' : '' || kuda == 2 ? 'Level 2' : '' || kuda == 3 ? 'Level 3' : '' || kuda == 4 ? 'Level 4' : '' || kuda == 5 ? 'Level MAX' : ''}* diff --git a/plugins/shop copy.js b/plugins/shop copy.js index 055a73a9..e77765f4 100644 --- a/plugins/shop copy.js +++ b/plugins/shop copy.js @@ -32,6 +32,7 @@ let handler = async (m, { conn, command, args, usedPrefix, DevMode }) => { handler.help = ['buy ', 'sell '] handler.tags = ['rpg'] +handler.owner = true handler.command = /^(buy|beli|sell|jual)$/i module.exports = handler \ No newline at end of file diff --git a/plugins/shop.js b/plugins/shop.js index 69062378..b0db6df2 100644 --- a/plugins/shop.js +++ b/plugins/shop.js @@ -371,6 +371,7 @@ Sampah: ${Ssampah}\n\n handler.help = ['shop ', 'toko '] handler.tags = ['rpg'] +handler.owner = true handler.command = /^(shop|toko|buy|beli|sell|jual)$/i module.exports = handler \ No newline at end of file