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
➜ Restore When Leveling Snippet
Restore When Leveling Snippet
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Yourdrunkendad
(35 posts) Bio
|
Date
| Mon 04 Aug 2003 05:14 AM (UTC) |
Message
| I tried using a snippet to restore char's when they level, here it is..
This is a very basic Auto-Restore code to be put in void gain_exp in update.c under the line that reads advance_level(ch,FALSE );
put this line:
affect_strip(ch,gsn_plague);
affect_strip(ch,gsn_poison);
affect_strip(ch,gsn_blindness);
affect_strip(ch,gsn_sleep);
affect_strip(ch,gsn_curse);
ch->hit = ch->max_hit;
ch->mana = ch->max_mana;
ch->move = ch->max_move;
update_pos( ch);
send_to_char( "<name of god> has give you the power to continue ", ch );
the problem is that my update.c doesn't have the line
advance_level(ch,FALSE );
Does anyone know what to do with this? Or know of another way that works?
Thanks for taking to time to read this |
Shampoo is for sissies real men use poo*
[werd]thewerd.com "Smacking Your Mom Then Running Away" | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #1 on Mon 04 Aug 2003 08:11 AM (UTC) |
Message
| In my update.c I see this stuff:
while ( ch->level < LEVEL_AVATAR && ch->exp >= exp_level(ch, ch->level+1))
{
set_char_color( AT_WHITE + AT_BLINK, ch );
ch_printf( ch, "You have now obtained experience level %d!\n\r", ++ch->l
evel );
advance_level( ch );
}
It isn't exactly the same but should be close enough.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Yourdrunkendad
(35 posts) Bio
|
Date
| Reply #2 on Mon 04 Aug 2003 10:18 AM (UTC) |
Message
| Ok I tried putting it there, however when compiling got these errors:
update.c: In function 'gain_exp' :
update.c:232: 'gsn_plague' undeclared <first use in this function.
update.c:232: <each undeclared idientifer is reported only once
update.c:232: for each function it appears in.>
make[1]: *** [o/update.o] Error 1
make: *** [all] Error 2
Any ideas? |
Shampoo is for sissies real men use poo*
[werd]thewerd.com "Smacking Your Mom Then Running Away" | Top |
|
Posted by
| Nick Cash
USA (626 posts) Bio
|
Date
| Reply #3 on Mon 04 Aug 2003 06:42 PM (UTC) |
Message
| Take out the line affect_strip(ch,gsn_plague); would be my guess. |
~Nick Cash
http://www.nick-cash.com | Top |
|
Posted by
| Yourdrunkendad
(35 posts) Bio
|
Date
| Reply #4 on Mon 04 Aug 2003 07:17 PM (UTC) |
Message
| Ahh yes, I removed the plague part of it that god rid of the errors but it still didn't work.
So I tried moving it into the advance_level fuction instead, now it works.
~Cheers~ |
Shampoo is for sissies real men use poo*
[werd]thewerd.com "Smacking Your Mom Then Running Away" | 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,070 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top