Past Gen RNG Research

Kaphotics

Remodeling Kitchens
is a Researcher Alumnusis a Contributor Alumnus
Goldenrod Department Store RNG (HGSS)

Raffle
Code:
Rand % 100

0-3   (1st Prize)  4% for TMs
4-39  (2nd Prize) 36% for Balls
40-99 (3rd Prize) 60% for Berries (-> Rand%70 for 7 berries)
Code:
Message 0xb        ' All right. Please draw one!/r.../n.../r/0 '
017C 0x800c 0x64                     Rand%100
If 0x800c 0x28                       >= 40    (60%)
COMPARELASTRESULT 0x4 func_16        goto 3rd: Berry
If 0x800c 0x4                        >= 4    (36%)
COMPARELASTRESULT 0x4 func_17        goto 2nd: Ball
If 0x800c 0x0                        >= 0    (4%)
COMPARELASTRESULT 0x4 func_18        goto 1st: TM
End
Berry Branch:
Code:
Fanfare 0x913
SetvarNum 0x0 0x3    ' Wow!/nYou've got yourself the no. [VAR NUM: 2 .0 ] .0  prize!/rPlease take it./r/0 '
Message 0xc
017C 0x800c 0x46                     Rand%70
If 0x800c 0x3c                       >= 60
COMPARELASTRESULT 0x4 func_44        gives 0x009B = Oran
If 0x800c 0x32                       >= 50
COMPARELASTRESULT 0x4 func_45        gives 0x0096 = Chesto
If 0x800c 0x28                       >= 40
COMPARELASTRESULT 0x4 func_46        gives 0x0097 = Pecha
If 0x800c 0x1e                       >= 30
COMPARELASTRESULT 0x4 func_47        gives 0x0098 = Rawst
If 0x800c 0x14                       >= 20
COMPARELASTRESULT 0x4 func_48        gives 0x0099 = Aspear
If 0x800c 0xa                        >= 10
COMPARELASTRESULT 0x4 func_49        gives 0x009A = Leppa
If 0x800c 0x0                        >= 0
COMPARELASTRESULT 0x4 func_50        gives 0x0095 = Cheri
End
Vending Machine to verify blastoise_x
Code:
Rand % 64

0    - Give Extra Drink
1-63 - Don't Give Extra Drink
Code:
017C 0x800c 0x40                   varC rand%0x40
If 0x800c 0x0                      cmp(varC,0)
COMPARELASTRESULT 0x5 func_36      if != goto start
Fanfare 0x616                      play clang
SetvarItem 0x0 0x8001              textvar = itemname
Message 0x7                        "Clang!\rBonus! Another can of [item]\ndropped down.\r"
They gr/eq for their statements when checking high->low; in gen V they check low->high but with le/eq's. (script cmp values for reference)
 
Last edited:

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top