#41 Sep 4, 2013 9:39 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
eh I wouldn't even know how to make it for objs too.
#42 Sep 4, 2013 9:48 pm
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
obj would be fairly simple, just add in a vnum and then if someone wins the jackpot, when they claim have it create the object and give it to them
btw
wow when I was looking over the post I said this earlier this morning and looking back i see that it could easily come off as rude. I meant you should have looked at the winnings using lottery instead of claiming the winnings because they are cleared when you do. It should double well because I tested that quite a few times
btw
Instead of claiming should have looked, It doubles well. There isn't a history claiming clears off you as a winner and if no more winners it clears that drawing info.
wow when I was looking over the post I said this earlier this morning and looking back i see that it could easily come off as rude. I meant you should have looked at the winnings using lottery
#43 Sep 8, 2013 4:24 am
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
can you post the thing you did for the logon check?
#44 Sep 8, 2013 9:54 am
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
void has_winnings( CHAR_DATA *ch ) { LOTTERY_DATA *lottery; LHISTORY_DATA *lhistory; LWINNER_DATA *lwinner; int cntwins = 0; if( !ch ) return; for( lottery = first_lottery; lottery; lottery = lottery->next ) { for( lhistory = lottery->first_lhistory; lhistory; lhistory = lhistory->next ) { if( !lhistory->drawn ) continue; for( lwinner = lhistory->first_lwinner; lwinner; lwinner = lwinner->next ) { if( !str_cmp( lwinner->winner, ch->name ) ) cntwins++; } } } if( cntwins > 0 ) ch_printf( ch, "&[plain]You have %d wins in the lottery waiting for you to claim them.\r\n", cntwins ); }
#45 Sep 8, 2013 1:53 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
Winnings does not take into account if the pwipe is gone or renamed.
#46 Sep 8, 2013 5:11 pm
Last edited Sep 8, 2013 6:50 pm by Remcon
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
nope but both might be good things to consider lol
Edit: ok, next release should handle renaming and deleting/destroying/etc...
Edit: ok, next release should handle renaming and deleting/destroying/etc...
#47 Sep 9, 2013 5:31 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
[Info] ::The Raffle lottery numbers have been drawn.::
[Info] ::A winner was not drawn for this lotto, so the jackpot will continue over::
Maybe I have this set up wrong?
#LOTTERY
Name Raffle~
Jackpot 290
TimeToDraw 1378852195
Price 100
Tickets 2
AutoRedraw
Raffle
History 2~ TRUE
History ~ FALSE
Winner Isshin~ 1~ 0
Winner Hokai~ 2~ 0
[Info] ::A winner was not drawn for this lotto, so the jackpot will continue over::
Maybe I have this set up wrong?
#LOTTERY
Name Raffle~
Jackpot 290
TimeToDraw 1378852195
Price 100
Tickets 2
AutoRedraw
Raffle
History 2~ TRUE
History ~ FALSE
Winner Isshin~ 1~ 0
Winner Hokai~ 2~ 0
#48 Sep 9, 2013 5:34 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
Also I have a question about your account system is that the way you plan on having people log in now? and how player files will be stored, because I have some ideas for that kind of system.
#49 Sep 9, 2013 5:51 pm
Last edited Sep 9, 2013 6:26 pm by dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
Also in the new update
around 1175 you will find a repeat ifcheck which causes the jackpot to show twice.
around 1175 you will find a repeat ifcheck which causes the jackpot to show twice.
#50 Sep 9, 2013 6:28 pm
Last edited Sep 9, 2013 7:08 pm by dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
Also not sure if you meant to not add it or not, but the function you made to have it show the next drawing on who isn't in the update.
And I have changed this one to read obj names, but for some reason it crashes and gdb isn't giving me any info on why....
And I have changed this one to read obj names, but for some reason it crashes and gdb isn't giving me any info on why....
char *display_nextdrawing( void ) { LOTTERY_DATA *lottery, *lotdraw = NULL; int jack = 0; time_t nextdraw = 0; static char buf[MIL]; bool foundfirst =FALSE; OBJ_INDEX_DATA *oindex; for( lottery = first_lottery; lottery; lottery = lottery->next ) { /* There is some reason it hasn't been drawn so skip it */ if( lottery->timetodraw < current_time ) continue; if( !foundfirst || lottery->timetodraw < nextdraw ) { lotdraw = lottery; nextdraw = lottery->timetodraw; jack = lottery->jackpot; } foundfirst = TRUE; } if( !lotdraw ) snprintf( buf, sizeof( buf ), "%s", "&WThere is currently no lottery set to be drawn." ); else { if( lottery->lwtype == LW_GOLD ) snprintf( buf, sizeof( buf ), "&Y%s&W will be drawn at &Y%s&W. Current Jackpot: &Y%s&D", lotdraw->name, distime( nextdraw ), format_pl(jack) ); else if( lottery->lwtype == LW_GLORY ) snprintf( buf, sizeof( buf ), "&Y%s&W will be drawn at &Y%s&W. Current Jackpot: &Y%s&D", lotdraw->name, distime( nextdraw ), format_pl(jack) ); else if( lottery->lwtype == LW_OBJ ) { if( !( oindex = get_obj_index(lottery->jackpot ) ) ) snprintf( buf, sizeof( buf ), "&Y%s&W will be drawn at &Y%s&W. Current Jackpot: &Y*BUG* Item Not Found&D", lotdraw->name, distime( nextdraw ) ); else snprintf( buf, sizeof( buf ), "&Y%s&W will be drawn at &Y%s&W. Current Jackpot: &Y%s&D", lotdraw->name, distime( nextdraw ), oindex->short_descr ); } else snprintf( buf, sizeof( buf ), "&Y%s&W will be drawn at &Y%s&W. Current Jackpot: &Y%s&D", lotdraw->name, distime( nextdraw ), format_pl(jack) ); } return buf; }
#51 Sep 9, 2013 9:44 pm
Last edited Sep 9, 2013 9:48 pm by Remcon
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
[Info] ::The Raffle lottery numbers have been drawn.:: [Info] ::A winner was not drawn for this lotto, so the jackpot will continue over:: Maybe I have this set up wrong? #LOTTERY Name Raffle~ Jackpot 290 TimeToDraw 1378852195 Price 100 Tickets 2 AutoRedraw Raffle History 2~ TRUE History ~ FALSE Winner Isshin~ 1~ 0 Winner Hokai~ 2~ 0
around line 274 find
if( matchednums == lottery->numbers )
change it to
if( ( matchednums == lottery->numbers ) || ( lottery->raffle && matchednums == 1 ) )
My fault looks like i missed updating it lol.
Also I have a question about your account system is that the way you plan on having people log in now? and how player files will be stored, because I have some ideas for that kind of system.
That was just to make it easier for people to set up the system for a basic guide, I plan to change it a whole lot, I welcome all ideas on it, but please put it in another topic
Also in the new update around 1175 you will find a repeat ifcheck which causes the jackpot to show twice.
if( lottery->lwtype == LW_OBJ ) { if( !( oindex = get_obj_index( lottery->jackpot ) ) ) ch_printf( ch, "Jackpot: %d, object doesn't exist.", lottery->jackpot ); else ch_printf( ch, "Jackpot: %s", oindex->short_descr ); } else ch_printf( ch, "Jackpot: %d\r\n", lottery->jackpot ); if( lottery->lwtype == LW_OBJ ) { if( !( oindex = get_obj_index( lottery->basejackpot ) ) ) ch_printf( ch, "BaseJackpot: %d, object doesn't exist.", lottery->basejackpot ); else ch_printf( ch, "BaseJackpot: %s", oindex->short_descr ); } else ch_printf( ch, "BaseJackpot: %d\r\n", lottery->basejackpot );
These? it shouldn't if it is an object it should show the info if not it shows it doesn't exist, if not an object it will show the jackpot. Notice the second is basejackpot.
char *display_nextdrawing( void ) { LOTTERY_DATA *lottery, *lotdraw = NULL; int jack = 0; time_t nextdraw = 0; static char buf[MIL]; bool foundfirst =FALSE; OBJ_INDEX_DATA *oindex; for( lottery = first_lottery; lottery; lottery = lottery->next ) { /* There is some reason it hasn't been drawn so skip it */ if( lottery->timetodraw < current_time ) continue; if( !foundfirst || lottery->timetodraw < nextdraw ) { lotdraw = lottery; nextdraw = lottery->timetodraw; jack = lottery->jackpot; } foundfirst = TRUE; } if( !lotdraw ) snprintf( buf, sizeof( buf ), "%s", "&WThere is currently no lottery set to be drawn." ); else { if( lottery->lwtype == LW_GOLD ) snprintf( buf, sizeof( buf ), "&Y%s&W will be drawn at &Y%s&W. Current Jackpot: &Y%s&D", lotdraw->name, distime( nextdraw ), format_pl(jack) ); else if( lottery->lwtype == LW_GLORY ) snprintf( buf, sizeof( buf ), "&Y%s&W will be drawn at &Y%s&W. Current Jackpot: &Y%s&D", lotdraw->name, distime( nextdraw ), format_pl(jack) ); else if( lottery->lwtype == LW_OBJ ) { if( !( oindex = get_obj_index(lottery->jackpot ) ) ) snprintf( buf, sizeof( buf ), "&Y%s&W will be drawn at &Y%s&W. Current Jackpot: &Y*BUG* Item Not Found&D", lotdraw->name, distime( nextdraw ) ); else snprintf( buf, sizeof( buf ), "&Y%s&W will be drawn at &Y%s&W. Current Jackpot: &Y%s&D", lotdraw->name, distime( nextdraw ), oindex->short_descr ); } else snprintf( buf, sizeof( buf ), "&Y%s&W will be drawn at &Y%s&W. Current Jackpot: &Y%s&D", lotdraw->name, distime( nextdraw ), format_pl(jack) ); } return buf; }
The reason it is crashing is the lottery->lwtype ==, change them to lotdraw->lwtype == and the oindex = get_obj_index( lottery->jackpot ) change lottery to lotdraw
Also it will be added in the next update.
#52 Sep 10, 2013 10:29 am
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
A sorry misread the ifcheck for the jackpot thanks so far I haven't had too many issues with it. Other then the ones posted here it seems to be working perfect.
#53 Sep 10, 2013 11:08 am
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
K bug with Objs type
Log: [*****] BUG: do_lottery: lottery->jackpot 8143898, object doesn't exist.
But it does exist.
Log: [*****] BUG: do_lottery: lottery->jackpot 8143898, object doesn't exist.
But it does exist.
#54 Sep 10, 2013 11:26 am
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
I see why its because if the type is obj buying tickets still add to the jackpott
#55 Sep 10, 2013 2:15 pm
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
ah kk thanks probably good idea to fix that lol i hadn't tested objects just tossed them in haha
#56 Sep 10, 2013 2:16 pm
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
actually in mine and the release it already has
/* Only increase for gold */ if( lottery->lwtype == LW_GOLD ) lottery->jackpot += (int)( (double)( ( lottery->price * lottery->jpercent ) / 100 ) );
#57 Sep 12, 2013 1:04 pm
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
Had a raffle set up with autoredraw turned off, but by the time it went through autoredraw was turned to TRUE again.
#58 Sep 12, 2013 3:40 pm
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
ok ill look at it when I have time ty
#59 Sep 12, 2013 9:24 pm
Geomancer
GroupAdministrators
Posts1,933
JoinedJul 26, 2005
in the new_lottery find
just change autoredraw = true to = false since when it loads them it setting it to true by default is what is causing the issue lol
lottery->drawdifflast = false; lottery->matchorder = false; lottery->autoredraw = true; lottery->raffle = false;
just change autoredraw = true to = false since when it loads them it setting it to true by default is what is causing the issue lol
#60 Sep 13, 2013 11:32 am
Sorcerer
GroupMembers
Posts600
JoinedDec 3, 2008
Well with that I am sure the lottery system is bug free now. I have tested every kind there is.