Skip to content

Commit

Permalink
Merge pull request #2 from MAYKELL07/rpg-beta
Browse files Browse the repository at this point in the history
Rpg fix
  • Loading branch information
MAYKELL07 authored Dec 20, 2021
2 parents 638a148 + edf7db2 commit 61f509c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 23 deletions.
6 changes: 2 additions & 4 deletions handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -70,11 +69,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: {},
Expand Down Expand Up @@ -103,6 +100,7 @@ module.exports = {
pasangan: '',
lasthunt: 0,
lastfishing: 0,
lastadventure: 0,
}

let chat = global.db.data.chats[m.chat]
Expand Down
2 changes: 1 addition & 1 deletion plugins/adventure.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/hunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 1 addition & 17 deletions plugins/inv.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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' : ''}*
Expand Down
1 change: 1 addition & 0 deletions plugins/shop copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ let handler = async (m, { conn, command, args, usedPrefix, DevMode }) => {

handler.help = ['buy <args>', 'sell <args>']
handler.tags = ['rpg']
handler.owner = true

handler.command = /^(buy|beli|sell|jual)$/i
module.exports = handler
1 change: 1 addition & 0 deletions plugins/shop.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ Sampah: ${Ssampah}\n\n

handler.help = ['shop <sell|buy> <args>', 'toko <sell|buy> <args>']
handler.tags = ['rpg']
handler.owner = true

handler.command = /^(shop|toko|buy|beli|sell|jual)$/i
module.exports = handler

0 comments on commit 61f509c

Please sign in to comment.