Advertisement
fox1759

Untitled

Mar 26th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. local chance_shiny = 6 -- 6% de chance
  2. local chance_raro = 1 -- 1 % de chance
  3.  
  4. local shinys = {
  5. "Caterpie", "Venusaur", "Charizard", "Blastoise", "Metapod", "Butterfree", "Weedle", "Kakuna", "Beedrill", "Pidgey", "Pidgeotto", "Pidgeot", "Rattata",
  6. "Raticate", "Spearow", "Fearow", "Ekans", "Arbok", "Pikachu", "Raichu", "Sandshrew", "Sandslash", "Nidoran Female",
  7. "Nidorina", "Nidoqueen", "Nidoran Male", "Nidorino", "Nidoking", "Clefairy", "Clefable", "Vulpix", "Ninetales",
  8. "Jigglypuff", "Wigglytuff", "Zubat", "Golbat", "Oddish", "Gloom", "Vileplume", "Paras", "Parasect", "Venonat", "Venomoth",
  9. "Diglett", "Dugtrio", "Meowth", "Persian", "Psyduck", "Golduck", "Mankey", "Primeape", "Growlithe", "Arcanine",
  10. "Poliwhirl", "Poliwrath", "Machop", "Machoke", "Machamp", "Bellsprout", "Weepinbell", "Victreebel",
  11. "Tentacruel", "Geodude", "Graveler", "Golem", "Ponyta", "Rapidash", "Slowpoke", "Slowbro", "Magnemite", "Magneton",
  12. "Farfetch'd", "Doduo", "Dodrio", "Seel", "Dewgong", "Grimer", "Muk", "Shellder", "Cloyster", "Onix", "Drowzee", "Hypno",
  13. "Krabby", "Kingler", "Voltorb", "Electrode", "Exeggcute", "Exeggutor", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan",
  14. "Lickitung", "Koffing", "Weezing", "Rhyhorn", "Rhydon", "Tangela", "Horsea", "Seadra", "Goldeen",
  15. "Seaking", "Staryu", "Starmie", "Mr. Mime", "Pinsir", "Tauros", "Gyarados", "Lapras", "Ditto", "Vaporeon", "Jolteon",
  16. "Flareon", "Porygon", "Kadabra", "Omanyte", "Magikarp", "Jynx", "Poliwag", "Tentacool", "Haunter", "Chansey", "Ivysaur",
  17. "Charmeleon", "Dragonair", "Wartortle", "Snorlax", "Omastar", "Dragonite", "Gengar", "Alakazam", "Electabuzz", "Magmar", "Kabuto", "Kabutops"
  18. }
  19. local raros = {"Bulbasaur", "Charmander", "Squirtle",
  20. "Dratini", "Eevee", "Scyther", "Gastly", "Kangaskhan",
  21. "Abra", "Articuno", "Zapdos", "Moltres", "Mew", "Mewtwo", "Aerodactyl"}
  22.  
  23. local function doPokemonRegisterLevel(cid)
  24. if not isCreature(cid) then return true end
  25. if getWildPokemonLevel(cid) == -1 then
  26. setWildPokemonLevel(cid)
  27. end
  28. end
  29.  
  30. local function doSetRandomGender(cid)
  31. if not isCreature(cid) then return true end
  32. local gender = 0
  33. local name = getCreatureName(cid)
  34. if not newpokedex[name] then return true end
  35. local rate = newpokedex[name].gender
  36. if rate == 0 then
  37. gender = 3
  38. elseif rate == 1000 then
  39. gender = 4
  40. elseif rate == -1 then
  41. gender = 0
  42. elseif math.random(1, 1000) <= rate then
  43. gender = 4
  44. else
  45. gender = 3
  46. end
  47. doCreatureSetSkullType(cid, gender)
  48. end
  49.  
  50. local function doShiny(cid)
  51. if isCreature(cid) then
  52. if isSummon(cid) then return true end
  53. if getPlayerStorageValue(cid, 74469) >= 1 then return true end
  54. if isNpcSummon(cid) then return true end
  55. if isInArray(shinys, getCreatureName(cid)) then
  56. transform = math.random(chance_shiny, 100) --6% chance
  57. elseif isInArray(raros, getCreatureName(cid)) then
  58. transform = math.random(chance_raro, 100) --1% chance
  59. elseif not isInArray(raros, getCreatureName(cid)) and not isInArray(shinys, getCreatureName(cid)) then
  60. return true
  61. end
  62. if transform == 10 then
  63. doSendMagicEffect(getThingPos(cid), 18)
  64. local shi = doCreateMonster("Shiny ".. getCreatureName(cid) .."", getThingPos(cid))
  65. setPlayerStorageValue(shi, 74469, 1)
  66. setPlayerStorageValue(cid, 74469, 1)
  67. doRemoveCreature(cid)
  68. else
  69. setPlayerStorageValue(cid, 74469, 1)
  70. end
  71. else
  72. return true
  73. end
  74. end
  75.  
  76. function onSpawn(cid)
  77.  
  78. registerCreatureEvent(cid, "GeneralConfiguration")
  79. registerCreatureEvent(cid, "DirectionSystem")
  80. registerCreatureEvent(cid, "CastSystem")
  81.  
  82. if isSummon(cid) then
  83. registerCreatureEvent(cid, "SummonDeath")
  84. return true
  85. end
  86.  
  87. registerCreatureEvent(cid, "Experience")
  88.  
  89. addEvent(doPokemonRegisterLevel, 5, cid)
  90. addEvent(doSetRandomGender, 5, cid)
  91. addEvent(doShiny, 10, cid)
  92.  
  93. return true
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement