Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. if (message.content.toLowerCase() == prefix + "spawn") {
  2. if (message.guild.id !== "535099487010422785") return
  3. message.delete()
  4. const yesnospawn = db.fetch(`spawn${message.guild.id}_${message.channel.id}`)
  5. if (yesnospawn == 0) return
  6. var firstnum = Math.floor(Math.random() * 250) + 1
  7. if (firstnum < 100) {
  8. var firstnum = `0${firstnum}`
  9. }
  10. var shinya = Math.floor(Math.random() * 40000)
  11. if (shinya < 100) {
  12. var tirthnum = `99`
  13. }
  14. if (shinya > 99) {
  15. var tirthnum = `00`
  16. }
  17. var iv = Math.floor(Math.random() * 1000)
  18. if(iv < 1001){
  19. var aiv = Math.floor(Math.random() * 40)
  20. }
  21. if(iv < 900){
  22. var aiv = Math.floor(Math.random() * 60)
  23. }
  24. if(iv < 600){
  25. var aiv = Math.floor(Math.random() * 70)
  26. }
  27. if(iv < 300){
  28. var aiv = Math.floor(Math.random() * 80)
  29. }
  30. if(iv < 100){
  31. var aiv = Math.floor(Math.random() * 90)
  32. }
  33. if(iv < 50){
  34. var aiv = Math.floor(Math.random() * 100)
  35. }
  36. var imageNumber = `${firstnum}_${tirthnum}`
  37. const attachment = new discord.Attachment("./Legends/pokemon_icon_" + imageNumber + ".png", 'sample.png');
  38. var channela = await db.fetch(`redirect_${message.guild.id}`)
  39. if (!channela) {
  40. var channela = message.channel.id
  41. }
  42. var pembed = new discord.RichEmbed()
  43. .setTitle(`${prefix}catch to catch it (you have only 1h) and its for ${message.author.username}`)
  44. .setColor(COLOR)
  45. .setTimestamp(message.channel.setTimestamp)
  46. .attachFile(attachment)
  47. .setImage('attachment://sample.png');
  48.  
  49. client.channels.get(channela).send(pembed)
  50. db.set(`messages_${message.guild.id}_${message.channel.id}`, 0)
  51. const filter = m => m.content.toLowerCase().startsWith(prefix + "catch")
  52. client.channels.get(channela).awaitMessages(filter, { max: 1, time: 3600000, errors: ['time'] })
  53. .then(collected => {
  54. var level = Math.floor(Math.random() * 60)
  55. const nostart = db.fetch(`start_${message.author.id}`)
  56. if (nostart == null) {
  57. return message.channel.send(`You haven't picked an starter do p.start`)
  58. }
  59. if (imageNumber.length !== 6) return
  60. var a = db.startsWith(`pokemon2_${message.author.id}`)
  61. if(a == null){
  62. var a = 0
  63. }
  64. db.set(`pokemon2_${message.author.id}_${a.length + 1}`, { number: `${a.length + 1}`, id: `${imageNumber}`, level: `${level}`, iv: `${aiv}`})
  65. client.channels.get(channela).send(`${message.author}, you succesfully caught the pokemon ${pokemon[imageNumber]} with level ${level} and iv ${aiv}`)
  66. })
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement