Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Hp/Mana/Mv gains on level advancement

Hp/Mana/Mv gains on level advancement

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Tseris   (98 posts)  Bio
Date Sun 14 Oct 2007 08:08 PM (UTC)
Message
Was curious, has anyone tried to implement manamin/manamax, mvmin/mvmax into the setclass command the way that hpmin/hpmax is handled? I was looking through update.c at the level advancement section and the mana/mv gains are mind boggling, not to mention dependant on the character's current int/wis, which means that players who wear the right eq at the moment of leveling end up with way better stats. Id like to set this so its much more class dependant, in a similiar way that hp gains are calculated.
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #1 on Sun 14 Oct 2007 08:34 PM (UTC)
Message
I haven't, but I suspect that you could almost copy/paste from the hp stuff in setrace to make it work, of course, you'll also want to adjust any other places that it impacts too, such as the saving and loading of race files.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #2 on Sun 14 Oct 2007 10:52 PM (UTC)
Message
Yes, what Conner describes is probably the best approach. And I agree that it's insane that current con/int/etc. affect level gains: it leads to all kinds of "strategic leveling". I changed that quite quickly and made it depend on base stats, not current stats.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #3 on Sun 14 Oct 2007 11:58 PM (UTC)
Message
Ouch, David, you're just a little hard core there, arn't you? ;)

Especially given that base stats are set the same for everyone at character creation and then modified by the chosen name/race/class and can never again be modified in any other ways... or do you change that too?

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #4 on Mon 15 Oct 2007 12:01 AM (UTC)
Message
No, we don't have the name stat thing anymore. But race/class do matter (well, not class, but you get the idea).

The idea is that there is no reason whatsoever why one person should get a permanent benefit just because that one person had the right equipment and spells at the right time (leveling up).

If you think about it, it doesn't make sense for spells/eq to affect leveling gains. If a spell boosts your constitution temporarily, then when the spell goes away, all effects of that boosted constitution should go away. If that increased constitution gave you increased leveling gains, those should go away with the spell. That's hard to implement, so instead it's easier to just make the leveling gains not take the current value of stats into account.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #5 on Mon 15 Oct 2007 12:08 AM (UTC)
Message
I suppose that's fair, but after years of the stock smaug methodology, it still seems a bit HC. *shrug*

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Mon 15 Oct 2007 12:12 AM (UTC)
Message
Sometimes, the stock method has been wrong for years. ;-)

Not necessarily a fix you'd want to impose upon the main distribution, but it went over very well in our MUD. It was a little interesting to have to retroactively modify existing characters' hp/mana/mv, but it wasn't so bad.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Tseris   (98 posts)  Bio
Date Reply #7 on Mon 15 Oct 2007 01:50 AM (UTC)
Message
In update.c:


add_move = number_range( 5, ( get_curr_con( ch ) + ( get_curr_dex( ch ) ) / 4);



The only part of this string I dont understand is the number 5, how is it affecting the formula?
Top

Posted by Tseris   (98 posts)  Bio
Date Reply #8 on Mon 15 Oct 2007 01:55 AM (UTC)
Message
Ahh nevermind I get it, 5 is the minimum gain and the formula result is max gain.
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #9 on Mon 15 Oct 2007 04:28 AM (UTC)
Message
Exactly. :)

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by Tseris   (98 posts)  Bio
Date Reply #10 on Mon 15 Oct 2007 10:10 PM (UTC)
Message
So here's my quick and dirty snippet for putting mana and movement into setclass and getting rid of the gay level gains. I wanted to post this for a couple reasons:

1. *pats self on back for first successful compile after changing code*

2. Wanted to give a little back in case anyone else wants to do the same.

3. If anyone cares to look over it and let me know if theres anything Ive done that I could do better.

So without further adieu...

in tables.c

fprintf( fpout, "Mana %d\n", Class->fMana );
fprintf( fpout, "Expbase %d\n", Class->exp_base );
fprintf( fpout, "Affected %s\n", print_bitvector( &Class->affected ) );
fprintf( fpout, "Resist %d\n", Class->resist );
fprintf( fpout, "Suscept %d\n", Class->suscept );
fprintf( fpout, "Mamin %d\n", Class->ma_min ); /* Tseris */
fprintf( fpout, "Mamax %d\n", Class->ma_max );
fprintf( fpout, "Mvmin %d\n", Class->mv_min );
fprintf( fpout, "Mvmax %d\n", Class->mv_max );


case 'H':
KEY( "HpMax", Class->hp_max, fread_number( fp ) );
KEY( "HpMin", Class->hp_min, fread_number( fp ) );
break;

case 'M':
KEY( "Mana", Class->fMana, fread_number( fp ) );
KEY( "MaMax", Class->ma_max, fread_number( fp ) ); /* Tseris */
KEY( "MaMin", Class->ma_min, fread_number( fp ) );
KEY( "MvMax", Class->mv_max, fread_number( fp ) );
KEY( "MvMin", Class->mv_min, fread_number( fp ) );
break;


in act_wiz.c

class_table[rcindex]->skill_adept = 0;
class_table[rcindex]->thac0_00 = 0;
class_table[rcindex]->thac0_32 = 0;
class_table[rcindex]->hp_min = 0;
class_table[rcindex]->hp_max = 0;
class_table[rcindex]->fMana = FALSE;
class_table[rcindex]->exp_base = 1000;
class_table[rcindex]->ma_min = 0; /* Tseris */
class_table[rcindex]->ma_max = 0;
class_table[rcindex]->mv_min = 0;
class_table[rcindex]->mv_max = 0;



class_table[rcindex]->thac0_32 = 0;
class_table[rcindex]->hp_min = 0;
class_table[rcindex]->hp_max = 0;
class_table[rcindex]->fMana = FALSE;
class_table[rcindex]->exp_base = 1000;
class_table[rcindex]->ma_min = 0; /* Tseris */
class_table[rcindex]->ma_max = 0;
class_table[rcindex]->mv_min = 0;
class_table[rcindex]->mv_max = 0;


f( !str_cmp( arg2, "hpmax" ) )
{
Class->hp_max = atoi( argument );
send_to_char( "Max HP gain set.\r\n", ch );
write_class_file( cl );
return;
}
if( !str_cmp( arg2, "mamin" ) ) /* Min and Max Mana and Movement by Tseris */
{
Class->ma_min = atoi( argument );
send_to_char( "Min Mana gain set.\r\n", ch );
write_class_file( cl );
return;
}
if( !str_cmp( arg2, "mamax" ) )
{
Class->ma_max = atoi( argument );
send_to_char( "Max Mana gain set.\r\n", ch );
write_class_file( cl );
return;
}
if( !str_cmp( arg2, "mvmin" ) )
{
Class->mv_min = atoi( argument );
send_to_char( "Min Move gain set.\r\n", ch );
write_class_file( cl );
return;
}
if( !str_cmp( arg2, "mvmax" ) )
{
Class->mv_max = atoi( argument );
send_to_char( "Max Move gain set.\r\n", ch );
write_class_file( cl );
return;
}


pager_printf_color( ch, "&wAffected by: &W%s\r\n", affect_bit_name( &Class->affected ) );
pager_printf_color( ch, "&wResistant to: &W%s\r\n", flag_string( Class->resist, ris_flags ) );
pager_printf_color( ch, "&wSusceptible to: &W%s\r\n", flag_string( Class->suscept, ris_flags ) );
pager_printf_color( ch, "&wMa Min/Ma Max : &W%-2d/%-2d ", Class->ma_min, Class->ma_max ); /* Tseris */
pager_printf_color( ch, "&wMv Min/Mv Max : &W%-2d/%-2d", Class->mv_min, Class->mv_max );



if( arg1[0] == '\0' )
{
send_to_char( "Syntax: setclass <class> <field> <value>\r\n", ch );
send_to_char( "Syntax: setclass <class> create\r\n", ch );
send_to_char( "\r\nField being one of:\r\n", ch );
send_to_char( " name prime weapon guild thac0 thac32\r\n", ch );
send_to_char( " hpmin hpmax mamin mamax mana expbase mtitle ftitle\r\n", ch ); /* Tseris */
send_to_char( " mvmin mvmax second, deficient affected resist suscept skill\r\n", ch );
return;
}



in mud.h

int guild; /* Vnum of guild room */
short skill_adept; /* Maximum skill level */
short thac0_00; /* Thac0 for level 0 */
short thac0_32; /* Thac0 for level 32 */
short hp_min; /* Min hp gained on leveling */
short hp_max; /* Max hp gained on leveling */
bool fMana; /* Class gains mana on level */
short exp_base; /* Class base exp */
short ma_min; /* Min Mana gained on leveling. Tseris 10/07 */
short ma_max; /* Max Mana gained on leveling. */
short mv_min; /* Min Move gained on leveling */
short mv_max; /* Max Move gained on leveling */
};


and finally in update.c


add_hp = number_range( class_table[ch->Class]->hp_min, class_table[ch->Class]->hp_max );
add_mana = class_table[ch->Class]->fMana ? number_range( class_table[ch->Class]->ma_min, /* Mana and Move */
class_table[ch->Class]->ma_max ) : 0; /* gains by Tseris */
add_move = number_range( class_table[ch->Class]->mv_min, class_table[ch->Class]->mv_max );
add_prac = wis_app[get_curr_wis( ch )].practice;




Hope this helps somebody, and thank you to all who are helping me.


Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #11 on Tue 16 Oct 2007 02:55 AM (UTC)
Message
Gratz! :)
I may look it over for you when I get a chance, but I expect others will have the time before I do, it's been a busy day, and not in all good ways. *sigh*

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #12 on Tue 16 Oct 2007 03:00 AM (UTC)
Message
Yeah, it's great that you got it worked out. :)

One suggestion is to use the [code]...[/code] tags, so that your code appears nicely formatted:


like
{
   this
}

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


38,805 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.