Lottery (Magical Numbers Game)

Step up to Aberforth's bar at the Hog's Head Inn and try your luck at the Magical Numbers Game, where wizards throw their hard-earned gold at a 1-in-10,000 chance of winning the jackpot. It's mathematically inadvisable, financially irresponsible, and absolutely addictive. Just like real gambling, except with more magic and fewer lawyers.

Think of it as a daily lottery crossed with a jackpot system crossed with a gold sink that masquerades as charitable giving to Hagrid's Fund for Misunderstood Magical Creatures.

How to Play

  1. Visit the Hog's Head Inn in Hogsmeade (requires 3rd year with 2+ Voldemort Encounters)
  2. Find Aberforth's Magical Numbers Game link in the Inn menu
  3. Pay the ticket cost (typically 100 gold, but configurable by admins)
  4. Choose four numbers from 0-9 using the dropdown menus
  5. Submit your ticket and wait for tomorrow's drawing at new day
  6. Check new day messages to see if you won

Today's Numbers

Each day displays the current winning numbers in the format: `^X-X-X-X`

These are displayed after the drawing has already happened, so seeing them is like looking at yesterday's lottery results—interesting, but useless for actually winning.

Winning

How to Win

Match all four numbers that will be drawn tomorrow. The numbers are automatically sorted, so order doesn't matter:

  • If you pick: 3, 7, 1, 5
  • And tomorrow draws: 1, 3, 5, 7
  • You win! (They're the same numbers sorted)

Winning Message

At new day, if your numbers match, you'll see:

`\$The jackpot is `^^[amount]`\$ gold, which have been magically transferred to your Gringotts vault with the efficiency of a house-elf on caffeine!`

The prize is deposited directly into your bank account at Gringotts, not your gold on hand. Clever design to prevent you from immediately spending it on firewhiskey.

Split Jackpots

If multiple players pick the same winning numbers, the jackpot is split equally among all winners:

  • Jackpot: 10,000 gold
  • Winners: 4 players
  • Each gets: 2,500 gold

This means popular number combinations (like 1-2-3-4 or 6-6-6-9) are a bad strategic choice if you actually want to maximize potential winnings.

Odds and Probabilities

The Math

Let's talk cold, hard statistics:

  • Total possible 4-number combinations (0-9): 10,000 (10 × 10 × 10 × 10)
  • But since order doesn't matter: Actually 715 unique sorted combinations
  • Your odds of winning: 1 in 715 (0.14%)

Expected Value

For a 100 gold ticket with no current jackpot:

  • You pay: 100 gold
  • Half goes to "charity" (50 gold)
  • Half goes to jackpot (50 gold)
  • Your expected return: (1/715) × jackpot size
  • Minimum jackpot needed to break even: 71,500 gold

Translation: You're almost certainly going to lose money. But you knew that going in, didn't you?

Rollover Effect

The lottery's saving grace is the rollover:

  • No winner today? Jackpot grows
  • No winner tomorrow? Jackpot grows more
  • Eventually jackpot gets large enough to be +EV
  • More players buy tickets when jackpot is big
  • More likely to have multiple winners splitting it

It's a self-balancing system that ensures Aberforth stays in business while occasionally throwing players a bone.

Game Rules

As displayed on Aberforth's hand-scrawled sign:

  • One drawing per day at midnight - Happens during new day processing
  • Match all four numbers in any order to win - Order is irrelevant due to sorting
  • No winners means the pot grows like a Weasley family - Jackpot rolls over indefinitely
  • Half your money goes to Hagrid's Fund for Misunderstood Magical Creatures - The "bleed" percentage (default 50%)
  • No refunds, no whining, and absolutely NO Felix Felicis allowed - No special tricks or lucky potions

Additional Restrictions

  • One ticket per day maximum - You can't buy multiple tickets to improve your odds
  • Ticket expires if unused - Your numbers are cleared at new day whether you win or not
  • Must have sufficient gold - Can't buy tickets on credit, Aberforth doesn't trust you that much
  • Winnings go to bank - Deposited directly, can't be intercepted

Jackpot Mechanics

How the Jackpot Grows

The jackpot has two components:

  1. Base Pot - Set by admins, the minimum jackpot after a win (default varies by server)
  2. Ticket Sales - Every ticket adds (ticket cost × (100 - bleed%)) to the jackpot

Example with 100 gold tickets and 50% bleed:

  • Player buys ticket: 100 gold spent
  • 50 gold goes to "charity" (bleed)
  • 50 gold added to jackpot
  • Next ticket adds another 50 gold
  • Jackpot grows by 50 gold per ticket sold

After a Win

When someone wins:

  1. Jackpot is divided among all winners
  2. Each winner receives their share in their bank
  3. Jackpot resets to base pot amount
  4. Cycle begins again

Tracking the Jackpot

Current jackpot is displayed on Aberforth's blackboard in chalk "older than Dumbledore." You can check it anytime by visiting the Magical Numbers Game without buying a ticket.

Strategy Tips

Maximize Your (Still Terrible) Odds

  • Avoid obvious patterns - Don't pick 1-2-3-4, 0-0-0-0, or other sequences everyone else picks
  • Use truly random numbers - Roll dice, use a random number generator, ask a Divination professor
  • Only play when jackpot is large - Wait for rollovers to improve expected value
  • Check previous winners - If the last round had multiple winners, jackpot just reset (bad time to play)
  • Consider server population - More active players = more tickets = faster jackpot growth

When NOT to Play

  • Jackpot just reset after a win
  • You need that gold for something important (healing, equipment, etc.)
  • You're low level and 100 gold is significant to you
  • You have a gambling problem (this is a game within a game, get help)

When to Play

  • Jackpot is 50,000+ gold (getting close to break-even territory)
  • You have excess gold and nothing else to spend it on
  • You enjoy the thrill of gambling with fake money
  • You want to support Hagrid's creature sanctuary (the bleed is "charitable")

News Announcements

When you win, your victory is announced to the entire server:

`@[Your Name]`@ won `^[amount]`@ gold in Aberforth's Magical Numbers Game! The Ministry of Magic is investigating for possible use of Felix Felicis.`0

Everyone will know you won, which means:

  • Instant fame (or infamy)
  • Possible jealousy from other players
  • Beggars asking for gold in your mail
  • A permanent entry in the news archive
  • The satisfaction of beating 1-in-715 odds

Interface and User Experience

Buying a Ticket

The interface shows four dropdown menus with numbers 0-9. Select one number from each dropdown and click "Buy Ticket." The system automatically focuses the next dropdown as you select, making it slightly less painful than it could be.

After Purchase

Your chosen numbers are displayed in sorted format:

"You've already purchased a ticket for tomorrow's drawing. Your chosen numbers are: `^X-X-X-X`"

Aberforth will then give you a look that suggests you have "about as much chance of winning as Filch has of becoming Minister of Magic."

Winner Experience

If you win, the message appears during your new day sequence with large text emphasizing your good fortune. The gold appears in your bank immediately, and you're free to either blow it all on firewhiskey or invest it wisely in forest fighting equipment.

Admin Configuration

Server administrators can customize several lottery settings:

Setting Description Default
Base Pot Minimum jackpot after a win 0 gold (varies by server)
Ticket Cost How much a ticket costs to purchase 100 gold
Percent Bleed What % goes to "charity" instead of jackpot 50%

These settings affect game balance significantly. A higher ticket cost makes it more expensive to play but speeds up jackpot growth. A higher bleed % reduces jackpot growth but removes more gold from the economy.

Economic Impact

Gold Sink Function

The lottery serves as an important economic function in Hogwarts Live:

  • Removes gold from circulation (via the bleed %)
  • Redistributes wealth from many players to few winners
  • Provides entertainment value beyond pure economics
  • Gives high-level players something to spend excess gold on

Wealth Transfer

Over time, lottery creates winners and losers:

  • Losers - Most players, who subsidize the jackpot with their losses
  • Winners - Lucky few who hit the numbers and claim huge payouts
  • The House - Aberforth (and by extension, Hagrid's creatures) who keep the bleed percentage

Common Questions

Q: Can I buy multiple tickets?
A: No. One ticket per day maximum. This is to prevent rich players from buying out all combinations.

Q: Do my numbers carry over if I don't win?
A: No. Your ticket expires at new day whether you win or not. You must buy a new ticket each day.

Q: Can I see the numbers before they're drawn?
A: No. The drawing happens at server new day, and numbers are generated randomly then.

Q: Does order matter?
A: No! Numbers are automatically sorted, so 1-3-5-7 is the same as 7-5-3-1.

Q: What if I pick the same numbers as someone else?
A: If you both win, you split the jackpot. This is why picking unique number combinations matters.

Q: Where does the bleed percentage actually go?
A: Into the void. It's removed from the economy entirely. The "Hagrid's Fund for Misunderstood Magical Creatures" is flavor text for the gold sink.

Q: Can I increase my odds with lucky potions or spells?
A: No. Felix Felicis is explicitly banned, and no in-game mechanics affect lottery odds.

Q: Has anyone actually won this thing?
A: Yes! Check the news archives. Winners are announced publicly, so you can see the history of jackpot victories.

Q: Is this gambling?
A: It's gambling with fictional currency in a fictional wizard game. If you're worried about real gambling problems, please seek help.

Technical Details (For the Curious)

  • Module name: lottery
  • Category: Inn
  • Drawing time: newday-runonce hook (server-wide once per new day)
  • Number generation: e_rand(0,9) four times, then sorted
  • User picks stored in module prefs: pick and roundnum
  • Winner detection: SQL query counting matching picks, then dividing jackpot
  • Prize delivery: Direct bank deposit via $session['user']['goldinbank']
  • News entry: Automatically created for all winners
  • Debug log: Records ticket purchases and wins
  • No limit on jackpot size (can grow indefinitely)
  • No maximum number of winners (jackpot divides evenly)

Remember: The lottery is a tax on people who are bad at math, except in this case it's a tax on wizards who are bad at probability theory. Play responsibly, don't spend your last gold on tickets, and may the odds be ever in your favor. (Oh wait, wrong franchise. May magic be with you? No, that's not right either. Just. good luck.)