Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (message.content.toLowerCase() == prefix + "spawn") {
- if (message.guild.id !== "535099487010422785") return
- message.delete()
- const yesnospawn = db.fetch(`spawn${message.guild.id}_${message.channel.id}`)
- if (yesnospawn == 0) return
- var firstnum = Math.floor(Math.random() * 250) + 1
- if (firstnum < 100) {
- var firstnum = `0${firstnum}`
- }
- var shinya = Math.floor(Math.random() * 40000)
- if (shinya < 100) {
- var tirthnum = `99`
- }
- if (shinya > 99) {
- var tirthnum = `00`
- }
- var iv = Math.floor(Math.random() * 1000)
- if(iv < 1001){
- var aiv = Math.floor(Math.random() * 40)
- }
- if(iv < 900){
- var aiv = Math.floor(Math.random() * 60)
- }
- if(iv < 600){
- var aiv = Math.floor(Math.random() * 70)
- }
- if(iv < 300){
- var aiv = Math.floor(Math.random() * 80)
- }
- if(iv < 100){
- var aiv = Math.floor(Math.random() * 90)
- }
- if(iv < 50){
- var aiv = Math.floor(Math.random() * 100)
- }
- var imageNumber = `${firstnum}_${tirthnum}`
- const attachment = new discord.Attachment("./Legends/pokemon_icon_" + imageNumber + ".png", 'sample.png');
- var channela = await db.fetch(`redirect_${message.guild.id}`)
- if (!channela) {
- var channela = message.channel.id
- }
- var pembed = new discord.RichEmbed()
- .setTitle(`${prefix}catch to catch it (you have only 1h) and its for ${message.author.username}`)
- .setColor(COLOR)
- .setTimestamp(message.channel.setTimestamp)
- .attachFile(attachment)
- .setImage('attachment://sample.png');
- client.channels.get(channela).send(pembed)
- db.set(`messages_${message.guild.id}_${message.channel.id}`, 0)
- const filter = m => m.content.toLowerCase().startsWith(prefix + "catch")
- client.channels.get(channela).awaitMessages(filter, { max: 1, time: 3600000, errors: ['time'] })
- .then(collected => {
- var level = Math.floor(Math.random() * 60)
- const nostart = db.fetch(`start_${message.author.id}`)
- if (nostart == null) {
- return message.channel.send(`You haven't picked an starter do p.start`)
- }
- if (imageNumber.length !== 6) return
- var a = db.startsWith(`pokemon2_${message.author.id}`)
- if(a == null){
- var a = 0
- }
- db.set(`pokemon2_${message.author.id}_${a.length + 1}`, { number: `${a.length + 1}`, id: `${imageNumber}`, level: `${level}`, iv: `${aiv}`})
- client.channels.get(channela).send(`${message.author}, you succesfully caught the pokemon ${pokemon[imageNumber]} with level ${level} and iv ${aiv}`)
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement