Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Créditos a Polectron, The Doctor y la base Wonderful World of Pokémon
- #Otras partes de este script: mapview, map factory y game event
- def pbSetBattles
- for event in $game_map.events
- if(event[1].name == "Battle Event")
- $game_self_switches[[$game_map.map_id, event[1].id, "A"]] = true
- $game_map.refresh
- eventid = event[1].id
- pokemon = pbRandBattle()
- $game_map.events[eventid].character_name = pokemon[0].to_s.rjust(3, "0")
- $game_map.events[eventid].name = $game_map.events[eventid].name+","+pokemon[0].to_s+","+pokemon[1].to_s
- $game_map.refresh
- end
- end
- end
- def pbResetLocalSwitches()
- if $game_map
- for event in $game_map.events
- if ((event[1].name.include? "Battle Event") || (event[1].name == "Item Event"))
- #p "evento " + event[1].id.to_s + " - " + event[1].name
- $game_self_switches[[$game_map.map_id, event[1].id, "A"]] = false
- $game_self_switches[[$game_map.map_id, event[1].id, "B"]] = false
- end
- if $game_switches[318] && $game_map.map_id==183 || $game_map.map_id==182 ||$game_map.map_id==174 || $game_map.map_id==186 || $game_map.map_id==20 || $game_map.map_id==21 || $game_map.map_id==173 || $game_map.map_id==178
- #p "evento " + event[1].id.to_s + " - " + event[1].name
- $game_self_switches[[$game_map.map_id, event[1].id, "A"]] = false
- $game_self_switches[[$game_map.map_id, event[1].id, "B"]] = false
- end
- end
- $game_map.refresh
- end
- end
- def pbRandBattle()
- mapinfos = pbLoadRxData("Data/MapInfos")
- prueba = [[PBSpecies::NAGANADEL,20],[PBSpecies::NIDOQUEEN,20],
- [PBSpecies::NIDOKING,20],[PBSpecies::VIKAVOLT,30],[PBSpecies::POIPOLE,20],
- [PBSpecies::EXEGGUTORA,20],[PBSpecies::LICKILICKY,30],[PBSpecies::BEARTIC,20],
- [PBSpecies::HOUNDOOM,20],[PBSpecies::CLAYDOL,20]]
- pokemon = {
- 02=>[[PBSpecies::RATTATA,25]],
- 03=>prueba,
- }
- #fin lista
- pokemon = pokemon[$game_map.map_id].shuffle
- return pokemon[0]
- end
- def pbStartBattle(eventid)
- pokemon = $game_map.events[eventid].name.split(",")[1].to_i
- level = $game_map.events[eventid].name.split(",")[2].to_i
- variation = (-3..3).to_a
- level += variation.shuffle[0]
- pokemon_rnd = pbRandBattle() #batalla doble
- pokemon2 = pokemon_rnd[0]
- level2 = pokemon_rnd[1]
- variation2 = (-3..3).to_a
- level2 += variation2.shuffle[0]
- if $game_switches[60]
- if(!$game_switches[63] || $Trainer.ablePokemonCount==1) #si solo le queda un Pokémon, no error. Caeles
- pbWildBattle(pokemon,level,26,false,false) #escapar o no / true, false / Perder o no
- else
- pbDoubleWildBattle(pokemon,level,pokemon2,level2,26,false,false) #escapar o no / true, false / Perder o no
- end
- else
- if(!$game_switches[63] || $Trainer.ablePokemonCount==1) #si solo le queda un Pokémon, no error. Caeles
- pbWildBattle(pokemon,level,26,true,false) #escapar o no / true, false / Perder o no
- else
- pbDoubleWildBattle(pokemon,level,pokemon2,level2,26,true,false) #escapar o no / true, false / Perder o no
- end
- end
- end
- #######ITEM LOOT########
- def pbShowItem
- return pbRandPercentage(50)
- end
- def pbLootItem #para hierbas y otros objetos
- items = [PBItems::POTION,PBItems::SUPERPOTION,PBItems::HYPERPOTION,PBItems::POWERHERB,PBItems::WHITEHERB,PBItems::REVIVE,PBItems::ENERGYROOT,PBItems::ENERGYPOWDER,PBItems::REVIVALHERB,PBItems::HEALPOWDER,PBItems::ETHER,PBItems::MAXETHER,PBItems::ELIXIR,PBItems::MAXELIXIR,PBItems::STICKYBARB,PBItems::FLOATSTONE,PBItems::TINYMUSHROOM,PBItems::BIGMUSHROOM,PBItems::BIGROOT]
- Kernel.pbItemBall(items.shuffle[0])
- end
Advertisement
Add Comment
Please, Sign In to add comment