#1 Apr 28, 2013 7:19 pm
Last edited Apr 28, 2013 7:24 pm by Remcon
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
Blah made it to annoying to look at lol when I just want ideas, so removed the posted code for this.
#2 Apr 28, 2013 7:23 pm
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
Few of the views for immortals so far
later
still lots to do to it but seems to be working fair so far lol.
lottery set testing Name: testing DrawTime Sun Apr 28 8:08:05PM 2013 Numbers: 6 Jackpot: 750 BaseJackpot: 500 Price: 100 HighNum: 50 LowNum: 1 HighLastNum: 30 LowLastNum: 1 PrizeForMatches: 50 JPercent: 20 MatchesToWin: 3 ReuseNumbers: false DrawDiffLast: true MatchOrder: false AutoRedraw: false Drawn: No, Winning Numbers: . Winner: Remcon, Winnings: 0, Claimed: no, Numbers: 7 15 16 26 38 46. Winner: Remcon, Winnings: 0, Claimed: no, Numbers: 5 7 9 12 48 44. Winner: Remcon, Winnings: 0, Claimed: no, Numbers: 3 4 5 16 28 6.
later
lottery set testing Name: testing DrawTime Numbers: 6 Jackpot: 750 BaseJackpot: 500 Price: 100 HighNum: 50 LowNum: 1 HighLastNum: 30 LowLastNum: 1 PrizeForMatches: 50 JPercent: 20 MatchesToWin: 3 ReuseNumbers: false DrawDiffLast: true MatchOrder: false AutoRedraw: false Drawn: Yes, Winning Numbers: 7 18 22 27 49 19. Winner: Remcon, Winnings: 0, Claimed: yes, Numbers: 7 15 16 26 38 46. Winner: Remcon, Winnings: 0, Claimed: yes, Numbers: 5 7 9 12 48 44. Winner: Remcon, Winnings: 0, Claimed: yes, Numbers: 3 4 5 16 28 6.
still lots to do to it but seems to be working fair so far lol.
#3 Apr 29, 2013 7:26 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
I sent you a pm a long time ago with ideas for this kind of system
#4 Apr 29, 2013 8:31 pm
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
Well i guess id deleted it at some point, if you find it resend or just give me some thoughts on it
#5 Apr 30, 2013 6:20 am
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005
You might also want to provide a raffle system.
A lottery draw just starts with some base jackpot (funded somehow) and adds a fraction of each ticket purchase price to that jackpot. If any ticket matches all the numbers, they get a payout, usually a large percentage of the jackpot. Partial matches may get smaller fixed prizes. If nobody matches all numbers, the jackpot is usually rolled over into the next drawing.
A raffle ticket system handles the jackpot the same way, but there is always a guarenteed winner. In a raffle, you pay for any number of tickets, and one of those numbers is drawn. That person wins (most of) the jackpot. You may also draw for runner up prizes.
Since the mechanics are pretty similar, you might want to support both.
A lottery draw just starts with some base jackpot (funded somehow) and adds a fraction of each ticket purchase price to that jackpot. If any ticket matches all the numbers, they get a payout, usually a large percentage of the jackpot. Partial matches may get smaller fixed prizes. If nobody matches all numbers, the jackpot is usually rolled over into the next drawing.
A raffle ticket system handles the jackpot the same way, but there is always a guarenteed winner. In a raffle, you pay for any number of tickets, and one of those numbers is drawn. That person wins (most of) the jackpot. You may also draw for runner up prizes.
Since the mechanics are pretty similar, you might want to support both.
#6 Apr 30, 2013 10:56 am
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
good points, was trying to make sure I covered most the bases on the lotterys, lol while allowing it to be simple to use overall. yea the raffle idea is simple to add. id likely just do a bool raffle, if thats true when it draws have it draw a bought ticket lol. have considered scratch offs also haha. I even joked to someone I might have to add in the typical gambling help line info lol.
#7 May 2, 2013 5:55 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
Drawn every 3 days, One winner. Ticket system, Mobs used to buy tickets and get winnings, Taxed winnings.
#8 May 3, 2013 1:08 am
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005
*chuckle*
So, I'm picturing various NPC's wandering into town to buy lottery tickets. An orc buys a ticket and wins. After collecting his winnings and wandering back out into the forest, a WANTED poster suddenly goes up with his picture and a bounty. *grin*
So, I'm picturing various NPC's wandering into town to buy lottery tickets. An orc buys a ticket and wins. After collecting his winnings and wandering back out into the forest, a WANTED poster suddenly goes up with his picture and a bounty. *grin*
#9 May 3, 2013 11:08 am
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
no I meant, you need a npc to buy a ticket like a shopkeeper.
#10 Aug 30, 2013 8:45 pm
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
Never tossed in for an npc being needed to buy a ticket, shouldn't be to hard to add that though.
It is in the 1.44 release as well as I just updated the release fixing some issues in parse_description as well as using it for showing help files.
It is in the 1.44 release as well as I just updated the release fixing some issues in parse_description as well as using it for showing help files.
#11 Sep 2, 2013 9:40 am
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
rawTime Fri Aug 30 9:35:15AM 2013
TimeBetweenDraws 86400(In Seconds)
Numbers: 0
Jackpot: 100
BaseJackpot: 100
Price: 5
HighNum: 0
LowNum: 0
MatchesToWin: 0
ReuseNumbers: FALSE
DrawDiffLast: FALSE
MatchOrder: FALSE
JPercent: 95
AutoRedraw: TRUE
Raffle: FALSE
Drawn: No
It doesn't seem to have drawn.
TimeBetweenDraws 86400(In Seconds)
Numbers: 0
Jackpot: 100
BaseJackpot: 100
Price: 5
HighNum: 0
LowNum: 0
MatchesToWin: 0
ReuseNumbers: FALSE
DrawDiffLast: FALSE
MatchOrder: FALSE
JPercent: 95
AutoRedraw: TRUE
Raffle: FALSE
Drawn: No
It doesn't seem to have drawn.
#12 Sep 2, 2013 10:40 am
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
No numbers set, No highnum or lownum set for the ranges of numbers and no one has bought a ticket. If you set all that stuff and buy a ticket the next update it should draw
#13 Sep 2, 2013 12:00 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
suggestion: an announcement over the infochan for when the numbers have been selected ?
#14 Sep 2, 2013 12:08 pm
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
actually considering a new lottery channel for it.
#15 Sep 2, 2013 12:10 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
Also found a bug.
should be
while( quickbuys > 0 ) { if( !ch->gold < lottery->price ) {
should be
while( quickbuys > 0 ) { if( ch->gold < lottery->price ) {
#16 Sep 2, 2013 12:12 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
Well if you would be so find to show me where I would add the message and what I would do for it to display a certain lotteries timer on who I would appreciate it.
#17 Sep 2, 2013 12:15 pm
Last edited Sep 2, 2013 12:17 pm by dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
Also there is no way for players to see the winning numbers and what their ticket numbers are if they use quickpick. Also are quick picks suppose to save like this, The winner Hokai are actually the tickets I just bought
Lottery.dat:
Lottery.dat:
#LOTTERY Name Daily~ Jackpot 104000 BaseJackpot 100000 TimeToDraw 1378144422 TimeBetweenDraws 50 Price 1000 Tickets 4 Numbers 5 HighNum 10000 LowNum 1 Prize4Match 500 Match2Win 4 AutoRedraw History ~ FALSE Winner Hokai~ 1~ 0 Winner Hokai~ 2~ 0 Winner Hokai~ 3~ 0 Winner Hokai~ 4~ 0 End
#18 Sep 2, 2013 12:21 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
Also the Jprecent doesn't actually work. I have mine set at 75 and it still increase the jackpot by 100% of the ticket cost.
#19 Sep 2, 2013 2:22 pm
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
ok find
change the rafflepicks to = false;
Thats my fault for not testing normal after adding raffle haha.
that bug must come from your change of !has_gold to ch->gold < lottery->price
Use to have that in but then since the code does all the handling of if they win or not is it needed?
Ok, I'll take a look at this in a few.
My advise would be to do a next lottery display counter on who (just cycle through the lotterys looking for the next one that will draw, and display what lottery that is and when it will draw (or a countdown till it draws). For the message on when it is drawn I would suggest in lottery_update when it does the drawing. if you want it to announce the winners go with handle_winnings
if( !str_cmp( arg, "buy" ) ) { int quickbuys = 1, bought = 0; bool quickpicks = false, rafflepicks = true;
change the rafflepicks to = false;
Thats my fault for not testing normal after adding raffle haha.
while( quickbuys > 0 ) { if( !has_gold( ch, lottery->price ) ) {
that bug must come from your change of !has_gold to ch->gold < lottery->price
Also there is no way for players to see the winning numbers and what their ticket numbers are if they use quickpick. Also are quick picks suppose to save like this, The winner Hokai are actually the tickets I just bought
Use to have that in but then since the code does all the handling of if they win or not is it needed?
Also the Jprecent doesn't actually work. I have mine set at 75 and it still increase the jackpot by 100% of the ticket cost.
Ok, I'll take a look at this in a few.
Well if you would be so find to show me where I would add the message and what I would do for it to display a certain lotteries timer on who I would appreciate it.
My advise would be to do a next lottery display counter on who (just cycle through the lotterys looking for the next one that will draw, and display what lottery that is and when it will draw (or a countdown till it draws). For the message on when it is drawn I would suggest in lottery_update when it does the drawing. if you want it to announce the winners go with handle_winnings
#20 Sep 2, 2013 2:46 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
I mean there is no point in having the players see their numbers but it would make it more realistic you know?