Random Character Draw

I want to implement a feature that, for a certain amount of currency:
  • Randomly selects one of several characters from a list, some being rarer than others (80% R, 15% SR, 4% SSR, 1% UR, or some such percentage lineup)
  • Plays an animation based on which character was selected (each one will have it's own animation consisting of an envelope opening and the character coming out, so no need to separately select the envelope animation)
  • Adds that character to the list of characters you can put in your party, (from a certain area of the hub world,) but does not add the character directly to your party itself until you do it (basically, it's unlocking characters)
  • Can do this either one character at a time (costing 5) or eleven characters at a time (costing 50)
Does anyone have any ideas on how to make this happen?
Eventing. Run a common event and use conditional branches. Just think it through. I almost have it all planned in my head right now.

You do your text conversation, pay money, then generate a random number (this is the only part that might be hard as you want the higher numbers to be not as easy to get) 0-80,81-95,96-99,100, then conditional branch check numbers, play animation, text unlocked character, turn switch on.
Character event - page 1 blank, page 2 switch on character shown. You talk to character and they join you. self-switch on.
Eventing. Run a common event and use conditional branches. Just think it through. I almost have it all planned in my head right now.

You do your text conversation, pay money, then generate a random number (this is the only part that might be hard as you want the higher numbers to be not as easy to get) 0-80,81-95,96-99,100, then conditional branch check numbers, play animation, text unlocked character, turn switch on.
Character event - page 1 blank, page 2 switch on character shown. You talk to character and they join you. self-switch on.
Thank you! I'm really not used to how the non-visual side of this engine runs- straight out of Ren'Py, haha- and I thought something like that might work? But it's great to have reassurance of what order to make things run in.

Original thread: https://forums.rpgmakerweb.com/threads/random-character-draw.86401/