Skip to content

Commit

Permalink
Merge pull request #1 from MAYKELL07/rpg-beta
Browse files Browse the repository at this point in the history
Rpg update 2.0.0
  • Loading branch information
MAYKELL07 authored Dec 20, 2021
2 parents b779434 + 6709c0e commit 638a148
Show file tree
Hide file tree
Showing 17 changed files with 417 additions and 279 deletions.
1 change: 1 addition & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
let fs = require('fs')
global.DevMode = false
global.owner = JSON.parse(fs.readFileSync('./data/owner.json')) // Letakan nomor kamu di file /data/owner.json
global.mods = JSON.parse(fs.readFileSync('./data/moderator.json')) // Moderator?
global.prems = JSON.parse(fs.readFileSync('./data/premium.json')) // Pengguna premium tidak memerlukan limit
Expand Down
10 changes: 0 additions & 10 deletions data/Items

This file was deleted.

43 changes: 43 additions & 0 deletions data/rpg/fish.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"fishes":[
{ "area": 1, "name": "Pufferfish", "url": "https://stardewvalleywiki.com/mediawiki/images/b/ba/Pufferfish.png"},
{ "area": 1, "name": "Anchovy", "url": "https://stardewvalleywiki.com/mediawiki/images/7/79/Anchovy.png"},
{ "area": 1, "name": "Tuna", "url": "https://stardewvalleywiki.com/mediawiki/images/c/c5/Tuna.png"},
{ "area": 2, "name": "Sardine", "url": "https://stardewvalleywiki.com/mediawiki/images/0/04/Sardine.png"},
{ "area": 2, "name": "Bream", "url": "https://stardewvalleywiki.com/mediawiki/images/8/82/Bream.png"},
{ "area": 2, "name": "Largemouth Bass", "url": "https://stardewvalleywiki.com/mediawiki/images/1/11/Largemouth_Bass.png"},
{ "area": 3, "name": "Smallmouth Bass", "url": "https://stardewvalleywiki.com/mediawiki/images/a/a5/Smallmouth_Bass.png"},
{ "area": 3, "name": "Rainbow Trout", "url": "https://stardewvalleywiki.com/mediawiki/images/1/14/Rainbow_Trout.png"},
{ "area": 3, "name": "Salmon", "url": "https://stardewvalleywiki.com/mediawiki/images/e/e0/Salmon.png"},
{ "area": 4, "name": "Walleye", "url": "https://stardewvalleywiki.com/mediawiki/images/0/05/Walleye.png"},
{ "area": 4, "name": "Perch", "url": "https://stardewvalleywiki.com/mediawiki/images/4/43/Perch.png"},
{ "area": 4, "name": "Carp", "url": "https://stardewvalleywiki.com/mediawiki/images/a/a8/Carp.png"},
{ "area": 5, "name": "Catfish", "url": "https://stardewvalleywiki.com/mediawiki/images/9/99/Catfish.png"},
{ "area": 5, "name": "Pike", "url": "https://stardewvalleywiki.com/mediawiki/images/3/31/Pike.png"},
{ "area": 5, "name": "Sunfish", "url": "https://stardewvalleywiki.com/mediawiki/images/5/56/Sunfish.png"},
{ "area": 6, "name": "Red Mullet", "url": "https://stardewvalleywiki.com/mediawiki/images/f/f2/Red_Mullet.png"},
{ "area": 6, "name": "Herring", "url": "https://stardewvalleywiki.com/mediawiki/images/f/f1/Herring.png"},
{ "area": 6, "name": "Eel", "url": "https://stardewvalleywiki.com/mediawiki/images/9/91/Eel.png"},
{ "area": 7, "name": "Octopus", "url": "https://stardewvalleywiki.com/mediawiki/images/5/5a/Octopus.png"},
{ "area": 7, "name": "Red Snapper", "url": "https://stardewvalleywiki.com/mediawiki/images/d/d3/Red_Snapper.png"},
{ "area": 7, "name": "Squid", "url": "https://stardewvalleywiki.com/mediawiki/images/8/81/Squid.png"},
{ "area": 8, "name": "Sea Cucumber", "url": "https://stardewvalleywiki.com/mediawiki/images/a/a9/Sea_Cucumber.png"},
{ "area": 8, "name": "Super Cucumber", "url": "https://stardewvalleywiki.com/mediawiki/images/d/d5/Super_Cucumber.png"},
{ "area": 8, "name": "Ghostfish", "url": "https://stardewvalleywiki.com/mediawiki/images/7/72/Ghostfish.png"},
{ "area": 9, "name": "Stonefish", "url": "https://stardewvalleywiki.com/mediawiki/images/0/03/Stonefish.png"},
{ "area": 9, "name": "Ice Pip", "url": "https://stardewvalleywiki.com/mediawiki/images/6/63/Ice_Pip.png"},
{ "area": 9, "name": "Lava Eel", "url": "https://stardewvalleywiki.com/mediawiki/images/1/12/Lava_Eel.png"},
{ "area": 10, "name": "Sandfish", "url": "https://stardewvalleywiki.com/mediawiki/images/b/bb/Sandfish.png"},
{ "area": 10, "name": "Scorpion Carp", "url": "https://stardewvalleywiki.com/mediawiki/images/7/76/Scorpion_Carp.png"},
{ "area": 10, "name": "Flounder", "url": "https://stardewvalleywiki.com/mediawiki/images/8/85/Flounder.png"},
{ "area": 11, "name": "Midnight Carp", "url": "https://stardewvalleywiki.com/mediawiki/images/3/33/Midnight_Carp.png"},
{ "area": 11, "name": "Sturgeon", "url": "https://stardewvalleywiki.com/mediawiki/images/4/42/Sturgeon.png"},
{ "area": 11, "name": "Tiger Trout", "url": "https://stardewvalleywiki.com/mediawiki/images/0/01/Tiger_Trout.png"},
{ "area": 12, "name": "Bullhead", "url": "https://stardewvalleywiki.com/mediawiki/images/d/db/Bullhead.png"},
{ "area": 12, "name": "Tilapia", "url": "https://stardewvalleywiki.com/mediawiki/images/7/73/Tilapia.png"},
{ "area": 12, "name": "Chub", "url": "https://stardewvalleywiki.com/mediawiki/images/b/bd/Chub.png"},
{ "area": 13, "name": "Slimejack", "url": "https://stardewvalleywiki.com/mediawiki/images/3/34/Slimejack.png"},
{ "area": 13, "name": "Void Salmon", "url": "https://stardewvalleywiki.com/mediawiki/images/a/ad/Void_Salmon.png"},
{ "area": 13, "name": "Blue Discus", "url": "https://stardewvalleywiki.com/mediawiki/images/e/ee/Blue_Discus.png"}
]
}
9 changes: 9 additions & 0 deletions data/rpg/items.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"items":[
{"rarity":"common", "name":"potion", "chance": 50, "price": 1000},
{"rarity":"common", "name":"bone", "chance": 50, "price": 50},
{"rarity":"uncommon", "name":"rock", "chance": 50, "price": 50},
{"rarity":"rare", "name":"mythic chest", "chance": 15, "price": 0},
{"rarity":"epic", "name":"legendary chest", "chance": 5, "price": 0}
]
}
19 changes: 19 additions & 0 deletions data/rpg/monster.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"monsters":[
{ "area": 1, "name": "Angry Bones", "drop": "Bone", "droprate": 98, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/f/f6/Angry_Bones_1.png/revision/latest/scale-to-width-down/30?cb=20200530060826&format=original" },
{ "area": 1, "name": "Anomura Fungus", "drop": "", "droprate": 0, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/f/f0/Anomura_Fungus.png/revision/latest/scale-to-width-down/50?cb=20200521181927&format=original" },
{ "area": 1, "name": "Antlion", "drop": "Antlion Mandible", "droprate": 33, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/f/ff/Antlion.png/revision/latest/scale-to-width-down/36?cb=20191128180152&format=original" },
{ "area": 2, "name": "Antlion Charger", "drop": "Antlion Mandible", "droprate": 33, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/6/6c/Antlion_Charger.png/revision/latest/scale-to-width-down/62?cb=20200517034253&format=original" },
{ "area": 2, "name": "Antlion Larva", "drop": "Antlion Mandible", "droprate": 33, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/c/c8/Antlion_Larva.png/revision/latest/scale-to-width-down/30?cb=20200517034039&format=original" },
{ "area": 2, "name": "Baby Slime", "drop": "Gel", "droprate": 100, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/6/6d/Baby_Slime.png/revision/latest/scale-to-width-down/32?cb=20170121233645&format=original" },
{ "area": 3, "name": "Black Slime", "drop": "Gel", "droprate": 100, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/5/5c/Black_Slime.png/revision/latest/scale-to-width-down/32?cb=20110828163020&format=original" },
{ "area": 3, "name": "Cochineal Beetle", "drop": "Red Husk", "droprate": 100, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/9/9b/Cochineal_Beetle.png/revision/latest/scale-to-width-down/32?cb=20200523235211&format=original" },
{ "area": 3, "name": "Blood Crawler", "drop": "Vertebra", "droprate": 33, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/7/7e/Blood_Crawler.png/revision/latest/scale-to-width-down/60?cb=20200804000419&format=original" },
{ "area": 4, "name": "Ghost", "drop": "", "droprate": 0, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/7/70/Ghost_%28enemy%29.png/revision/latest/scale-to-width-down/32?cb=20131025175525&format=original" },
{ "area": 4, "name": "Green Slime", "drop": "Gel", "droprate": 100, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/7/7b/Green_Slime.png/revision/latest/scale-to-width-down/32?cb=20141106201737&format=original" },
{ "area": 4, "name": "Frozen Zombie", "drop": "Wizard Hat", "droprate": 100, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/c/cf/Frozen_Zombie.png/revision/latest/scale-to-width-down/34?cb=20170422010132&format=original" },
{ "area": 5, "name": "Zombie", "drop": "Zombie Arm", "droprate": 4, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/c/c3/Zombie.png/revision/latest/scale-to-width-down/34?cb=20171102011214&format=original" },
{ "area": 5, "name": "Undead Viking", "drop": "Hook", "droprate": 4, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/8/83/Undead_Viking.png/revision/latest/scale-to-width-down/30?cb=20170421015630&format=original" },
{ "area": 5, "name": "Tim", "drop": "Wizard Hat", "droprate": 100, "url": "https://static.wikia.nocookie.net/terraria_gamepedia/images/e/ea/Tim.png/revision/latest/scale-to-width-down/34?cb=20171104013044&format=original" }
]
}
116 changes: 17 additions & 99 deletions handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ module.exports = {
if (typeof user !== 'object') global.db.data.users[m.sender] = {}

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 All @@ -40,7 +42,7 @@ module.exports = {
if (!isNumber(user.premiumDate)) user.premiumDate = 0
if (!'premium' in user) user.premium = false
if (!isNumber(user.banklimit)) user.banklimit = 10000
if (!isNumber(user.banklimit)) user.banknote = 0
if (!isNumber(user.banknote)) user.banknote = 0
if (!isNumber(user.lastclaim)) user.lastclaim = 0
if (!('registered' in user)) user.registered = false
if (!user.registered) {
Expand All @@ -59,122 +61,33 @@ module.exports = {
if (!isNumber(user.pc)) user.pc = 0
if (!isNumber(user.warning)) user.warning = 0
if (!('pasangan' in user)) user.pasangan = ''
//Misc
if (!isNumber(user.lastclaim)) user.lastclaimm = 0
if (!isNumber(user.lastowner)) user.lastowner = 0
if (!isNumber(user.lastrob)) user.lastrob = 0
if (!isNumber(user.diamond)) user.diamond = 0
if (!isNumber(user.iron)) user.iron = 0
if (!isNumber(user.common)) user.common = 0
if (!isNumber(user.uncommon)) user.uncommon = 0
if (!isNumber(user.mythic)) user.mythic = 0
if (!isNumber(user.legendary)) user.legendary = 0
if (!isNumber(user.pet)) user.pet = 0
if (!isNumber(user.potion)) user.potion = 0
if (!isNumber(user.sampah)) user.sampah = 0
if (!isNumber(user.armor)) user.armor = 0
if (!isNumber(user.kucing)) user.kucing = 0
if (!isNumber(user.kucinglastclaim)) user.kucinglastclaim = 0
if (!isNumber(user.kuda)) user.kuda = 0
if (!isNumber(user.kudalastclaim)) user.kudalastclaim = 0
if (!isNumber(user.rubah)) user.rubah = 0
if (!isNumber(user.rubahlastclaim)) user.rubahlastclaim = 0
if (!isNumber(user.anjing)) user.anjing = 0
if (!isNumber(user.anjinglastclaim)) user.anjinglastclaim = 0

if (!('banned' in user)) user.banned = false
if (!isNumber(user.warn)) user.warn = 0
if (!isNumber(user.warning)) user.warning = 0
if (!isNumber(user.call)) user.call = 0

if (!isNumber(user.afk)) user.afk = -1
if (!('afkReason' in user)) user.afkReason = ''

// RPG
if (!isNumber(user.anakkucing)) user.anakkucing = 0
if (!isNumber(user.anakkuda)) user.anakkuda = 0
if (!isNumber(user.anakrubah)) user.anakrubah = 0
if (!isNumber(user.anakanjing)) user.anakanjing = 0
if (!isNumber(user.makananpet)) user.makananpet = 0
if (!isNumber(user.antispam)) user.antispam = 0
if (!isNumber(user.kayu)) user.kayu = 0
if (!isNumber(user.batu)) user.batu = 0
if (!isNumber(user.string)) user.string = 0
if (!isNumber(user.sword)) user.sword = 0
if (!isNumber(user.sworddurability)) user.sworddurability = 0
if (!isNumber(user.pickaxe)) user.pickaxe = 0
if (!isNumber(user.pickaxedurability)) user.pickaxedurability = 0
if (!isNumber(user.fishingrod)) user.fishingrod = 0
if (!isNumber(user.fishingroddurability)) user.fishingroddurability = 0
if (!isNumber(user.lastadventure)) user.lastadventure = 0
if (!isNumber(user.lastfishing)) user.lastfishing = 0
if (!isNumber(user.lastdungeon)) user.lastdungeon = 0
if (!isNumber(user.lastduel)) user.lastduel = 0
if (!isNumber(user.lastmining)) user.lastmining = 0
if (!isNumber(user.lasthunt)) user.lasthunt = 0
if (!isNumber(user.lastweekly)) user.lastweekly = 0
if (!isNumber(user.lastmonthly)) user.lastmontly = 0
if (!isNumber(user.lastfishing)) user.lastfishing = 0

} else global.db.data.users[m.sender] = {
rpg: {
cooldown: {

},
rpg: {
fish: {},
items: {},
},
healt: 100,
level: 1,
exp: 0,
limit: 10,
lastowner: 0,
money: 0,
bank: 0,
banklimit: 10000,
banknote: 0,
lastrob: 0,
lastseen: 0,
premium: false,
premiumDate: 0,
diamond: 0,
iron: 0,
common: 0,
uncommon: 0,
mythic: 0,
legendary: 0,
pet: 0,
potion: 0,
sampah: 0,
armor: 0,
kucing: 0,
kucinglastclaim: 0,
kuda: 0,
kudalastclaim: 0,
rubah: 0,
rubahlastclaim: 0,
anjing: 0,
anjinglastclaim: 0,
anakkucing: 0,
anakkuda: 0,
anakrubah: 0,
anakanjing: 0,
makananpet: 0,
antispam: 0,
antispamlastclaim: 0,
kayu: 0,
batu: 0,
string: 0,
sword: 0,
sworddurability: 0,
pickaxe: 0,
pickaxedurability: 0,
fishingrod: 0,
fishingroddurability: 0,
lastadventure: 0,
lastfishing: 0,
lastdungeon: 0,
lastduel: 0,
lastmining: 0,
lasthunt: 0,
lastweekly: 0,
lastmonthly: 0,
lastclaim: 0,
registered: false,
name: this.getName(m.sender),
age: -1,
Expand All @@ -188,6 +101,8 @@ module.exports = {
pc: 0,
warning: 0,
pasangan: '',
lasthunt: 0,
lastfishing: 0,
}

let chat = global.db.data.chats[m.chat]
Expand Down Expand Up @@ -440,10 +355,13 @@ module.exports = {
m.error = e
console.error(e)
if (e) {
let text = util.format(e.message ? e.message : e)
let text = util.format(e)
for (let key of Object.values(global.APIKeys))
text = text.replace(new RegExp(key, 'g'), 'apikey')
m.reply(text)
text = text.replace(new RegExp(key, 'g'), '#HIDDEN#')
if (DevMode && text.length > 100) {
for (let jid of Object.entries(global.Owner).filter(v => v[1].isDev).map(v => v[0].replace(/[^0-9]/g, '') + '@s.whatsapp.net').filter(v => v != conn.user.jid)) m.reply(`*file:* ${m.plugin}\n*Nomor:* ${m.sender}\n*Text:* ${m.text}\n\n\`\`\`${text}\`\`\``, jid)
}
m.reply(text)
}
} finally {
// m.reply(util.format(_user))
Expand Down
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ global.loadDatabase = async function loadDatabase() {
stats: {},
msgs: {},
sticker: {},
settings: {},
...(global.db.data || {})
}
global.db.chain = _.chain(global.db.data)
Expand Down
1 change: 1 addition & 0 deletions plugins/Test-Plugin/open.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
let { MessageType } = require('@adiwajshing/baileys')
let handler = async (m, { conn, command, args, text, usedPrefix, DevMode }) => {
let items = JSON.parse(fs.readFileSync('./data/rpg/items.json')).items
let massage = `${usedPrefix}open <crate name>`
let type = (args[0] || '').toLowerCase()
let amount = (args[1] || '').toLowerCase()
Expand Down
Loading

0 comments on commit 638a148

Please sign in to comment.