[RunUO 1.0 & RunUO 2.0 RC1 Rev156] Lottery System
Description
*** The NEW WORKING version of the lottery system ***
It's an automated lottery system which allows players to purchase lottery tickets from the lottery stone.
The new version has been re-worked due to some errors in code which i made in the original version, sorry for any inconvienience it might have caused. The main cause of the problems were the lottery rules, which at the time i didn't totally get right which was why there were a few errors.
The Rules to this system are...
Players can purchase a lottery ticket with 5 numbers on it.
The numbers are from 0-9 for each selection, each of the 5 selections must be different numbers, the new system removes each selection button from the selection gump to ensure the player cannot pick the same number twice.
Players must also pick 5 numbers or use the lucky dip feature in order to get to the 'continue to ticket' option, this was to remove the ability to pick duplicated ticket selection numbers.
The draw takes place...
The system now generates 5 random numbers, each generated number cannot be duplicated... the system now does this correctly.
The system then checks tickets for matching draw numbers and each ticket is checked and changed according to how many of the draw numbers are on the ticket, this is also colour coded now on the tickets.
Players now have until the next lottery draw to claim their share of the jackpot amount from their winning tickets.
Tickets...
The lottery tickets are now colour coded to make things easier for players to identifiy winning tickets, rather than having to view each ticket there are colours to spot potential winners.
The ticket colours are changed at the time of a draw.
Newly purchased tickets are bright orange (blaze).
Tickets with any of the draw numbers on them are shaded from light green through to a darker green, the more matched draw numbers means the lighter the green is.
Tickets which did not match any lottery draw numbers are red.
Tickets which had a lottery draw number match (green tickets) become light blue to show the ticket has paid out it's winning amount of gold, this is given to players in the form of a bankcheck into there backpacks.
Any tickets which are green (had a match to some of the lottery draw numbers) that are not claimed by the time of the next lottery become red and void. The winnings from this ticket cannot be claimed because the next lottery has taken place.
Payout...
The lottery jackpot is divided up into 5 amounts, because theres 5 types of win avaliable... 5, 4, 3, 2 & 1 lottery draw numbers matched. In addition to this theres a Rollover too. The Rollover is increased each time theres a lottery draw IF no players get all 5 lottery draw numbers.
The split amounts are calculated like this...
50% of the jackpot amount for a 5 lottery number match, plus any gold held on the rollover from previous lottery draws.
20% of the jackpot amount for a 4 lottery number match.
15% of the jackpot amount for a 3 lottery number match.
10% of the jackpot amount for a 2 lottery number match.
5% of the jackpot amount for a 1 lottery number match.
The split amounts can be altered from the lottery stones [props, if you do decide to alter this just make sure all 5 split %'s total back up to 100%, these figures can also be viewed on the next lottery details gump from the lottery stone.
The results for the last draw can also be viewed from the lottery stone via the previous draw results gump, this shows the last draws winning numbers and details about how many tickets for that draw actually won.
Installing
Installing this system will require 2 server re-starts.
Unzip the attached file into the directory of your shards scripts folders and re-start the shard.
At first startup the lottery timer is running but will be disabled due to the shard not having a lottery stone, just log in and place the lottery stone where you want it. The [add lotter comand should bring the stone up in the menu, place the stone and re-start the shard again.
At the second re-start the timers are running, and should find the lottery stone and continue to run.
DO NOT CREATE MORE THAN ONE LOTTERY STONE, if you do the timer will pick up on this and shut the timer down.
All lottery information is stored on the stone and tickets even after a shard restart, so there should be no need to re-create another stone once you have one placed.
The time for the next lottery draw will be set for 3 days from the stones creation in the game world.
Commands
[lotteryticketdelete
This removes ALL lottery tickets from the shard, if you used the old version run this first to ensure theres nothing left from the previous lottery system.
If you don't run it the system should still work ok, just added this to clean up the mess the last system created.
Reserved For Updates
Update : 25th Feb 2007
Added an instruction stone for it, further down in this thread.
Update : 3rd March 2007
It's now Repaired.
Theres also 2 extra gumps with this version, Next lottery draw details & Previous lottery draw details.
I've set some of the variables access levels to admin or GM, this was to avoid GM's messing things up, a safeguard. Shard GM's can change the split %'s and the price of tickets via the [props commands, only admin has access to [lotteryticketdelete command.
The instruction stone requires an update, on my to do list. The old version is included in the zip files tho.
There is one minor issue i'm aware of.
If a player is in the middle of selecting ticket numbers at the time of a lottery draw taking place the ticket will have the incorrect draw date on it. The system will clean up after the next draw but the player will loose his/her gold for that ticket. Possiably on a future repair list.
Last edited by FingersMcSteal; 03-02-2007 at 07:16 PM.
|