SmaugWiz_Restore.txt
Zanthoris Snippets/SmaugWiz_Restore.txt · 1.8 KB
From the archive Zanthoris Snippets.zip
Download the archive « Back to the archive contents
Restore Snippet
Original author: Sadiq (sadiq@a-znet.com)
Ported to SmaugWiz by Zanthoris
Installation Instructions
-------------------------
1. In smaug.h search for the following line (in the update.cpp section):
void remove_portal (CObjData *portal);
and add the following line:
void restore_char (CCharacter *ch);
2. In update.cpp, near the bottom of the gain_exp() function, you will see this code:
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->level );
advance_level( ch );
IMMEDIATELY after the line 'advance_level( ch );', add this line of code:
restore_char(ch);
Also in update.cpp, add this code at the end of the file:
void restore_char (CCharacter *ch)
{
ch->SetHp(ch->GetMaxHp());
ch->SetMana(ch->GetMaxMana());
ch->SetMove(ch->GetMaxMove());
if(ch->GetPcData())
{
ch->GetPcData ()->condition [COND_BLOODTHIRST] = 10 + ch->GetLevel();
ch->GetPcData ()->condition [COND_FULL] = 40;
ch->GetPcData ()->condition [COND_THIRST] = 40;
}
update_pos( ch );
ch->SendColor("&YThe gods are pleased with your progress, and have restored you!\n\r");
return;
}
3. Make clean, then recompile.
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
This snippet was written for and tested on SmaugWiz version 2.01, I cannot guarantee that
it will work in previous versions without some modification (though I expect it will). If
you have problems with this snippet let me know!
-=Zanthoris=-
zanthoris@hotmail.com
telnet:\\zanthoris.dhs.org:4000
http:\\zanthoris.home.dhs.org