Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Yesterday, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Google, Yahoo!, DotBot, Bing

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » LoP Codebase » Lottery
Forum Rules | Mark all | Recent Posts

Lottery
< Newer Topic :: Older Topic > Thoughts and ideas on the lottery?

Pages:<< prev 1, 2, 3, 4 next >>
Post is unread #41 Sep 4, 2013, 7:39 pm
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

eh I wouldn't even know how to make it for objs too.
       
Post is unread #42 Sep 4, 2013, 7:48 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
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

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 <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 :)
       
Post is unread #43 Sep 8, 2013, 2:24 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

can you post the thing you did for the logon check?
       
Post is unread #44 Sep 8, 2013, 7:54 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
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 );
}

       
Post is unread #45 Sep 8, 2013, 11:53 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

Winnings does not take into account if the pwipe is gone or renamed.
       
Post is unread #46 Sep 8, 2013, 3:11 pm   Last edited Sep 8, 2013, 4:50 pm by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

nope but both might be good things to consider lol

Edit: ok, next release should handle renaming and deleting/destroying/etc...
       
Post is unread #47 Sep 9, 2013, 3:31 pm
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 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
       
Post is unread #48 Sep 9, 2013, 3:34 pm
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 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.
       
Post is unread #49 Sep 9, 2013, 3:51 pm   Last edited Sep 9, 2013, 4:26 pm by dbna2
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

Also in the new update

around 1175 you will find a repeat ifcheck which causes the jackpot to show twice.
       
Post is unread #50 Sep 9, 2013, 4:28 pm   Last edited Sep 9, 2013, 5:08 pm by dbna2
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 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....


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;
}
       
Post is unread #51 Sep 9, 2013, 7:44 pm   Last edited Sep 9, 2013, 7:48 pm by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
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.
       
Post is unread #52 Sep 10, 2013, 8:29 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 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.
       
Post is unread #53 Sep 10, 2013, 9:08 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

K bug with Objs type

Log: [*****] BUG: do_lottery: lottery->jackpot 8143898, object doesn't exist.

But it does exist.
       
Post is unread #54 Sep 10, 2013, 9:26 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

I see why its because if the type is obj buying tickets still add to the jackpott
       
Post is unread #55 Sep 10, 2013, 12:15 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

ah kk thanks probably good idea to fix that lol i hadn't tested objects just tossed them in haha
       
Post is unread #56 Sep 10, 2013, 12:16 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
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 ) );

       
Post is unread #57 Sep 12, 2013, 11:04 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

Had a raffle set up with autoredraw turned off, but by the time it went through autoredraw was turned to TRUE again.
       
Post is unread #58 Sep 12, 2013, 1:40 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

ok ill look at it when I have time :) ty
       
Post is unread #59 Sep 12, 2013, 7:24 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

in the new_lottery find
   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
       
Post is unread #60 Sep 13, 2013, 9:32 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

Well with that I am sure the lottery system is bug free now. I have tested every kind there is.
       
Pages:<< prev 1, 2, 3, 4 next >>