Couple of questions

Posted by USER007 on Sun 13 Jun 2004 09:42 PM — 13 posts, 38,551 views.

#0
1) Say that I were to make my mud go public without any changes to the code in smaugFUSS and let the players gain exp points from killing mobs, now my question is this, if the player got around level 49 and he trained some more would he gain another level to 50 and them from 50 to 51 and so on?
2) On the who list, how would I go about to adding like another section just for mortals? Heres an example:

Currently:

2 Warrior Obed the Recruit.

-----------------------------------[ IMMORTALS ]------------------------------

Owner/Coder Anavel is known as "The Nightmare of Solomon".
There are 2 players on.


Now heres what I want to change it to:

-----------------------------------[ MORTALS ]------------------------------

2 Warrior Obed the Recruit.

-----------------------------------[ IMMORTALS ]------------------------------

Owner/Coder Anavel is known as "The Nightmare of Solomon".
There are 2 players on.


Any suggestions?
Amended on Sun 13 Jun 2004 09:44 PM by USER007
USA #1
Its pretty simple. Find this section of code:


   for ( cur_who = first_mortal; cur_who; cur_who = next_who )
    {
      if ( !ch )
        fprintf( whoout, cur_who->text );
      else
        send_to_pager( cur_who->text, ch );
      next_who = cur_who->next;
      DISPOSE( cur_who->text );
      DISPOSE( cur_who ); 
    } 

DIRECTLY above it, add


   if ( first_mortal )
    {
      if ( !ch )
        fprintf( whoout, "\n\r-------------------------------[ MORTALS ]-------------------------\n\r\n\r" );
      else
       send_to_pager( "\n\r-------------------------------[ MORTALS ]--------------------------\n\r\n\r", ch );
    }


I think that should fix ya up.
USA #2
Sry, forgot to give my two cents on question 1.

I do belive that the code prevents them from leveling past the maximum level of their class, and I'm pretty sure it definitely prevents them from gaining immortal levels.
#3
Yeah it worked thanks. Now heres another newbie question, how do I extend the hp when players create new chars? For example I want them to start at 100 hp instead of 25 hp.
USA #4
I think its in clear_char (db.c). Change

    ch->hit			= 20;
    ch->max_hit			= 20;

to...

    ch->hit			= 100;
    ch->max_hit			= 100;

Also, if you want everyone to start with exactly 100 hp you will need to delete the line in nanny (which is in comm.c). So yeah, I -THINK- thats it. If its not let me know.
#5
Yep it worked and it also helped me figure out another problem thanks. :D Now I'm going to search for the nanny.

=EDIT= Hmmm... this is what I found in comm.c:

ch->level = 1;
ch->exp = 0;
ch->max_hit += race_table[ch->race]->hit;
ch->max_mana += race_table[ch->race]->mana;
ch->hit = UMAX(1,ch->max_hit);
ch->mana = UMAX(1,ch->max_mana);

then further down :

case 'h':
stat = ch->hit;
break;
case 'H':
stat = ch->max_hit;
break;
case 'm':

Now I don't know which one to remove so yeah... little help here. :P
Amended on Mon 14 Jun 2004 09:34 PM by USER007
USA #6
I think a better question is what are you trying to accomplish. I think you want everyone to start at 100 without racial modifiers, in which you would remove the following line:

ch->max_hit += race_table[ch->race]->hit;

If thats not what you were trying to do, please specify :)
#7
Ok heres what I'm trying to do. I want the max HP for all the races to be 100, so that means their HP won't go above 100 no matter what, unless they get injured during a fight. :D And right now I'm going to try what you said. And while I'm at it whats the name of the file where you can remove the save requirement? Like this: "You must be at least level second to save." or something like that, so that way a newly created char can save when their at level one. I tried grep but it didn't give me anything. :/
Amended on Tue 15 Jun 2004 01:19 AM by USER007
USA #8
In update.c, in the advance_level function, remove the add_hp var and all refrences to it to stop HP gains.
#9
Yes! It worked even though I got 2 warnings during the compiling phase. Thanks. :D
USA #10
And yes, its okay to remove those level checks. Such as in do_save, etc.
USA #11
What were your compiling warnings? Unused variable? We can prolly help you remove those as well since warnings can be bothersome.
#12
Yeah thanks. Hmmm... I compiled update.c again and this time I didn't get any warnings. :o So I don't know...

=EDIT= Ok nvm, seems the file was back to its orignal version so I did the changes again. Heres what I got:

Owner@Unit 03 ~/smaugfuss/src
$ make
make -s smaug
Compiling o/update.o....
update.c: In function `advance_level':
update.c:133: warning: too few arguments for format
update.c:140: warning: too few arguments for format
Done compiling mud.
chmod: changing permissions of `smaug': No such file or directory
make[1]: *** [smaug] Error 1
make: *** [all] Error 2

=EDIT= Ok nvm I just removed "%d/%d hp," on lines 133 and 140 which was "Your gain is: %d/%d hp, %d/%d bp, %d/%d mv %d/%d prac.\n\r". Then I compiled it again and I didn't get any warnings. Thanks for helping. :D