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
➜ Hospitals & Player stats
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Dark_Trunks
Australia (27 posts) Bio
|
Date
| Mon 10 Jun 2002 03:29 PM (UTC) |
Message
| I know, its a strange combination but these are the things I need to know right now!
So anyway, I want to add a hospital room to my mud, my question is this: How do I change the rate of healing depending on the room the player is in? And while we're on the subject of healing, how do I change the rate of healing for a perticular race?
My next question is about player stats. C programming definately isnt my strong point (seeing as I saw C for the first time when I downloaded the source for smaug!), so please bare with me. I know how to access the stats, xp, mana etc by using the statement 'ch->' but I want to make a couple of new variables in the same place. Which .c file can I find these in and how do add them?
Thanks in advance for any help anyone can provide. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Mon 10 Jun 2002 09:29 PM (UTC) |
Message
| You want the declaration of the character, which is in mud.h. Somewhere in the middle you will find all the characteristics that a player has. Here is part of it ...
/*
* One character (PC or NPC).
* (Shouldn't most of that build interface stuff use substate, dest_buf,
* spare_ptr and tempnum? Seems a little redundant)
*/
struct char_data
{
CHAR_DATA * next;
CHAR_DATA * prev;
CHAR_DATA * next_in_room;
...
sh_int num_fighting;
sh_int substate;
sh_int sex;
sh_int class;
sh_int race;
sh_int level;
sh_int trust;
int played;
time_t logon;
time_t save_time;
sh_int timer;
sh_int wait;
sh_int hit;
sh_int max_hit;
sh_int mana;
sh_int max_mana;
sh_int move;
sh_int max_move;
sh_int practice;
sh_int numattacks;
int gold;
int exp;
...
sh_int mod_con;
sh_int mod_cha;
sh_int mod_lck;
sh_int mental_state; /* simplified */
sh_int emotional_state; /* simplified */
int pagelen; /* BUILD INTERFACE */
sh_int inter_page; /* BUILD INTERFACE */
sh_int inter_type; /* BUILD INTERFACE */
char *inter_editing; /* BUILD INTERFACE */
int inter_editing_vnum; /* BUILD INTERFACE */
sh_int inter_substate; /* BUILD INTERFACE */
int retran;
int regoto;
sh_int mobinvis; /* Mobinvis level SB */
};
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Chris L
USA (57 posts) Bio
|
Date
| Reply #2 on Mon 10 Jun 2002 10:27 PM (UTC) |
Message
| most of what u asking does not require coding, for the hospital room it seems you are making it to complicated. for 1 room just make a prog
example:
if rand(30)
if position($r) == ? -i dont know these without looking
mprestore $r 30
else
if position($r) == ?
mprestore $r 50
else
etc.
can also include it to restore races etc differently but will take lil longer but still most likely less time if not used to coding
and for setting regen rates for races
setrace ?? hp_regen ??
i have never used this but should work | Top |
|
Posted by
| Dark_Trunks
Australia (27 posts) Bio
|
Date
| Reply #3 on Tue 11 Jun 2002 03:16 PM (UTC) Amended on Tue 11 Jun 2002 03:21 PM (UTC) by Dark_Trunks
|
Message
| Great thanks alot people. I actually found the player stats myself not long after posting. Funny how that happens hey? And also, earlier today, while writing some other code, I found a little section about hp regen, I think in update.c, so I figure a few 'if' statements to check races should do the job. | 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.
14,026 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top