22 Nov, 2008, Igabod wrote in the 1st comment:
Votes: 0
i'm trying to make it possible to train your hr/dr up in a keggermud (quickmud deriv) i've got the necessary parts added to do_train and during testing i have no problems, it increases the hr/dr as it is supposed to, however whenever the character logs out and then back in again it has the previous hr/dr they had before. my guess is it's because of the void reset_char function in handler.c but i could be wrong. is there some way of making the changes to hr/dr through training permanent? also i wouldn't mind some suggestions for other things i can add to the train function cause i've made it to where you can buy trains from the questmaster and would like to give my non-existant players plenty of options for uses of their trains.
22 Nov, 2008, Kline wrote in the 2nd comment:
Votes: 0
If you're just increasing ch->hitroll and ch->damroll respectively, these values are usually bonus values that get lumped together with gear and other things via a get_hitroll() function or macro. They aren't written or loaded to the pfile. You could add a bonus_hr/bonus_dr values to your char_data struct, increase these, add it to pfile save/loading, and into your func or macro that calculates total hr/dr.
24 Nov, 2008, Igabod wrote in the 3rd comment:
Votes: 0
actually, yes they are saved to the pfile. i fixed my problem by removing the reset_char call from the nanny function though. i was kinda hoping someone could provide me with an alternative to this though cause the reset_char function has uses which are quite necessary.
24 Nov, 2008, tphegley wrote in the 4th comment:
Votes: 0
Do what Kline said. Add another hit dam modifier in the pfile that will be added when the player hit/dam is added. We'll call it trainhit/traindam.

So in the pfile it'd look like:

hitroll 10
damroll 10
trainhit 2
traindam 2

So when it is recalculated it'll become 12 hit 12 dam on the characters score sheet.

I'm not familiar with Keggermud, but you will probably get some really wierd results if you keep reset_char from the nanny function. You better leave that in. :cool:
25 Nov, 2008, Igabod wrote in the 5th comment:
Votes: 0
i'll do that then. it's a simple matter of adding that to save.c then changing my do_train function to point to those rather than ch->hitroll right?
25 Nov, 2008, Kline wrote in the 6th comment:
Votes: 0
Igabod: Yes, and also updating your hr/dr calculation functions to account for it. A lot of Diku* MUDs have GET_HITROLL or similar macros that will take (ch->hitroll + dex + other stuff) = final value. Just make certain your new field gets added there, too. You'll also need to add trainhit/traindam to your merc.h/mud.h char_data struct just like you see the regular hitroll/damroll in it.
26 Nov, 2008, Igabod wrote in the 7th comment:
Votes: 0
yeah i went and started working on that earlier and realized after i added it to save.c that there were a lot more things i needed to do so i just decided to procrastinate a little cause i am slightly lazy. added two new spells for mages instead. thanks for informing me about merc.h i hadn't even thought about adding it there, although i probably would have figured it out after i did everything else. i'll probably get to work on this project tomorrow morning. i'll let everybody know how it goes.