- 220
- Posts
- 14
- Years
- Seen Nov 29, 2021
So I keep getting a syntax error pointing to the last line of this code (the "}"), and I can't figure out why:
Code:
Events.onStepTakenTransferPossible+=proc {|sender,e|
handled=e[0]
next if handled[0]
if $PokemonGlobal.stepcount % 4 == 0
for i in $Trainer.party
if isConst?(pokemon.ability,PBAbilities,:PICKUP) &&
!pokemon.isEgg? && pokemon.item==0 && rand(10)==0
pickupList=pbDynamicItemList(
:POTION,
:ANTIDOTE,
:SUPERPOTION,
:GREATBALL,
:REPEL,
:ESCAPEROPE,
:FULLHEAL,
:HYPERPOTION,
:ULTRABALL,
:REVIVE,
:RARECANDY,
:SUNSTONE,
:MOONSTONE,
:HEARTSCALE,
:FULLRESTORE,
:MAXREVIVE,
:PPUP,
:MAXELIXIR
)
pickupListRare=pbDynamicItemList(
:HYPERPOTION,
:NUGGET,
:KINGSROCK,
:FULLRESTORE,
:ETHER,
:IRONBALL,
:DESTINYKNOT,
:ELIXIR,
:DESTINYKNOT,
:LEFTOVERS,
:DESTINYKNOT
)
return if pickupList.length!=18
return if pickupListRare.length!=11
randlist=[30,10,10,10,10,10,10,4,4,1,1]
items=[]
plevel=[100,pokemon.level].min
itemstart=(plevel-1)/10
itemstart=0 if itemstart<0
for i in 0...9
items.push(pickupList[itemstart+i])
end
items.push(pickupListRare[itemstart])
items.push(pickupListRare[itemstart+1])
rnd=rand(100)
cumnumber=0
for i in 0...11
cumnumber+=randlist[i]
if rnd<cumnumber
pokemon.setItem(items[i])
break
end
end
end
end
}