// Log Out Menu - Ryan Rae
void do_quit (CDescriptor *d, char *argument)
{
char buf [MAX_STRING_LENGTH];
CCharacter *ch;
ch = d->m_pCharacter;
d->WriteToBuffer("*** Welcome to: The Realm of Draenor ***\n\r\
\n\n\rLog Out Menu:\n\n\r\
0) Leave the Game\n\r\
1) Return to the Game\n\n\r\
2) Read the background story\n\r\
3) Read latest realm changes.\n\r\
4) Read the latest code changes.\n\n\r\
5) See the World Map.\n\r\
6) See a list of all the area's in the realm.\n\n\r\
Please select your choice: ", 0);
d->m_Connected = CON_MENU2;
break;
case CON_MENU2:
switch ( argument [0] )
{
case '0':
// d->WriteToBuffer( "Come back again.\n\r", 0 );
// d->m_pCharacter->SetDesc (NULL);
// RemoveCharacter (*d);
do_quit2 ( ch, "");
break;
case '1':
break;
case '2':
do_help( ch, "story" );
break;
case '3':
do_help( ch, "motd" );
break;
case '4':
do_help( ch, "code" );
break;
case '5':
do_help( ch, "world" );
break;
case '6':
do_help( ch, "prep" );
break;
default:
d->WriteToBuffer("\nLog Out Menu:\n\n\r\
0) Leave the Game\n\r\
1) Return to the Game\n\n\r\
2) Read the background story\n\r\
3) Read latest realm changes.\n\r\
4) Read the latest code changes.\n\n\r\
5) See the World Map.\n\r\
6) See a list of all the area's in the realm.\n\n\r\
Please select your choice: ", 0);
return;
}}
// End of New Log out Menu
do_quit (CHAR_DATA * ch, char * argument)
if no argument
send_to_char your list of options
return
if argument = 1
do this
else if argument = 2
do this
else
default
and so on…
OR
switch (argument)
case 1
do this
break
case 2
do this
break
default
if (!str_cmp (name, "do_quit")) return do_quit;
if (skill == do_quit) return "do_quit";
if (!str_cmp (name, "do_quit2")) return do_quit2;
if (skill == do_quit2) return "do_quit";
// Log Out Menu - Ryan Rae
void do_quit (CDescriptor *d, CCharacter *ch)
{
// char buf [MAX_STRING_LENGTH];
// CCharacter *ch;
ch = d->m_pCharacter;
d->WriteToBuffer("*** Welcome to: The Realm of Draenor ***\n\r\
\n\n\rLog Out Menu:\n\n\r\
0) Leave the Game\n\r\
1) Return to the Game\n\n\r\
2) Read the background story\n\r\
3) Read latest realm changes.\n\r\
4) Read the latest code changes.\n\n\r\
5) See the World Map.\n\r\
6) See a list of all the area's in the realm.\n\n\r\
Please select your choice: ", 0);
d->m_Connected = CON_MENU2;
return;
}
void do_quit2 (CCharacter *ch, char *argument)
{
int x, y;
int level;
if (ch->IsNpc () && ch->IsPolymorphed ()) {
ch->SendText ("You can't quit while polymorphed.\n\r");
return;
}
if (ch->IsNpc ())
return;
if (ch->IsFightPosition ()) {
set_char_color (AT_RED, ch);
ch->SendText ("No way! You are fighting.\n\r");
return;
}
if (ch->GetPosition () < POS_STUNNED) {
set_char_color (AT_BLOOD, ch);
ch->SendText ("You're not DEAD yet.\n\r");
return;
}
if (get_timer (ch, TIMER_RECENTFIGHT) > 0 && ch->IsMortal ()) {
set_char_color (AT_RED, ch);
ch->SendText ("Your adrenaline is pumping too hard to quit now!\n\r");
return;
}
if (auction->IsActive () && ((ch == auction->GetBuyer ())
|| (ch == auction->GetSeller ()))) {
ch->SendText ("Wait until you have bought/sold the item on auction.\n\r");
return;
}
if (ch->IsPkiller ()
&& ch->GetWimpLevel () > (int) ch->GetMaxHp () / 2.25) {
ch->SendText ("Your wimpy has been adjusted to the maximum level"
" for deadlies.\n\r");
do_wimpy (ch, "max");
}
// Get 'em dismounted until we finish mount saving – Blodkai, 4/97
if (ch->IsMounted ())
do_dismount (ch, "");
set_char_color (AT_WHITE, ch);
ch->SendText ("Your surroundings begin to fade as a mystical swirling "
"vortex of colors\n\renvelops your body… When you come to, things"
" are not as they were.\n\r\n\r");
act (AT_SAY, "A strange voice says, 'We await your return, $n…'", ch, NULL, NULL, TO_CHAR);
act (AT_BYE, "$n has left the game.", ch, NULL, NULL, TO_ROOM);
set_char_color (AT_GREY, ch);
sprintf (log_buf, "%s has quit.", ch->GetName ());
quitting_char = ch;
save_char_obj (ch);
if (ch->HasPet ()) {
act (AT_BYE, "$N follows $S master into the Void.", ch, NULL,
ch->GetPet (), TO_ROOM);
extract_char (ch->GetPet (), TRUE);
}
// Synch clandata up only when clan member quits now. –Shaddai
if (ch->GetPcData ()->GetClan ())
ch->GetPcData ()->GetClan ()->Save ();
saving_char = NULL;
level = ch->GetTrustLevel ();
// After extract_char the ch is no longer valid!
extract_char (ch, TRUE);
for (x = 0; x < MAX_WEAR; ++x)
for (y = 0; y < MAX_LAYERS; ++y)
save_equipment [x][y] = NULL;
gpDoc->LogString (log_buf, LOG_COMM, level);
}
// Temp Spot for Log Out Menu Stuff - Ryan Rae
switch ( argument [0] )
{
case CON_MENU2:
case '0':
// d->WriteToBuffer( "Come back again.\n\r", 0 );
// d->m_pCharacter->SetDesc (NULL);
// RemoveCharacter (*d);
do_quit2 ( ch, "");
break;
case '1':
break;
case '2':
do_help( ch, "story" );
break;
case '3':
do_help( ch, "motd" );
break;
case '4':
do_help( ch, "code" );
break;
case '5':
do_help( ch, "world" );
break;
case '6':
do_help( ch, "prep" );
break;
default:
d->WriteToBuffer("\nLog Out Menu:\n\n\r\
0) Leave the Game\n\r\
1) Return to the Game\n\n\r\
2) Read the background story\n\r\
3) Read latest realm changes.\n\r\
4) Read the latest code changes.\n\n\r\
5) See the World Map.\n\r\
6) See a list of all the area's in the realm.\n\n\r\
Please select your choice: ", 0);
return;
}
// End of New Log out Menu
void do_quit2 (CCharacter *ch, char *argument)
{
int x, y;
int level;
if (ch->IsNpc () && ch->IsPolymorphed ()) {
ch->SendText ("You can't quit while polymorphed.\n\r");
return;
}
if (ch->IsNpc ())
return;
if (ch->IsFightPosition ()) {
set_char_color (AT_RED, ch);
ch->SendText ("No way! You are fighting.\n\r");
return;
}
if (ch->GetPosition () < POS_STUNNED) {
set_char_color (AT_BLOOD, ch);
ch->SendText ("You're not DEAD yet.\n\r");
return;
}
if (get_timer (ch, TIMER_RECENTFIGHT) > 0 && ch->IsMortal ()) {
set_char_color (AT_RED, ch);
ch->SendText ("Your adrenaline is pumping too hard to quit now!\n\r");
return;
}
if (auction->IsActive () && ((ch == auction->GetBuyer ())
|| (ch == auction->GetSeller ()))) {
ch->SendText ("Wait until you have bought/sold the item on auction.\n\r");
return;
}
if (ch->IsPkiller ()
&& ch->GetWimpLevel () > (int) ch->GetMaxHp () / 2.25) {
ch->SendText ("Your wimpy has been adjusted to the maximum level"
" for deadlies.\n\r");
do_wimpy (ch, "max");
}
// Get 'em dismounted until we finish mount saving – Blodkai, 4/97
if (ch->IsMounted ())
do_dismount (ch, "");
do_quit2 ( ch, ""); // This was the change made to try to get to the menu for logout.
set_char_color (AT_WHITE, ch);
ch->SendText ("Your surroundings begin to fade as a mystical swirling "
"vortex of colors\n\renvelops your body… When you come to, things"
" are not as they were.\n\r\n\r");
act (AT_SAY, "A strange voice says, 'We await your return, $n…'", ch, NULL, NULL, TO_CHAR);
act (AT_BYE, "$n has left the game.", ch, NULL, NULL, TO_ROOM);
set_char_color (AT_GREY, ch);
sprintf (log_buf, "%s has quit.", ch->GetName ());
quitting_char = ch;
save_char_obj (ch);
if (ch->HasPet ()) {
act (AT_BYE, "$N follows $S master into the Void.", ch, NULL,
ch->GetPet (), TO_ROOM);
extract_char (ch->GetPet (), TRUE);
}
// Synch clandata up only when clan member quits now. –Shaddai
if (ch->GetPcData ()->GetClan ())
ch->GetPcData ()->GetClan ()->Save ();
saving_char = NULL;
level = ch->GetTrustLevel ();
// After extract_char the ch is no longer valid!
extract_char (ch, TRUE);
for (x = 0; x < MAX_WEAR; ++x)
for (y = 0; y < MAX_LAYERS; ++y)
save_equipment [x][y] = NULL;
gpDoc->LogString (log_buf, LOG_COMM, level);
}
// Temp Spot for Log Out Menu Stuff - Ryan Rae
case CON_MENU2:
switch ( argument [0] )
{
case '0':
// d->WriteToBuffer( "Come back again.\n\r", 0 );
// d->m_pCharacter->SetDesc (NULL);
// RemoveCharacter (*d);
do_quit2 ( ch, "");
break;
case '1':
break;
case '2':
do_help( ch, "story" );
break;
case '3':
do_help( ch, "motd" );
break;
case '4':
do_help( ch, "code" );
break;
case '5':
do_help( ch, "world" );
break;
case '6':
do_help( ch, "prep" );
break;
default:
d->WriteToBuffer("\nLog Out Menu:\n\n\r\
0) Leave the Game\n\r\
1) Return to the Game\n\n\r\
2) Read the background story\n\r\
3) Read latest realm changes.\n\r\
4) Read the latest code changes.\n\n\r\
5) See the World Map.\n\r\
6) See a list of all the area's in the realm.\n\n\r\
Please select your choice: ", 0);
break;
}
// End of New Log out Menu
Searching for 'do_quit'…
E:\BuiltByRustry\Current Game Code\ACT_COMM.CPP(1125):void do_quit (CDescriptor *d, CCharacter *ch)
E:\BuiltByRustry\Current Game Code\ACT_COMM.CPP(1145):void do_quit2 (char *argument, CCharacter *ch)
E:\BuiltByRustry\Current Game Code\ACT_COMM.CPP(1193): do_quit ( ch, "");
E:\BuiltByRustry\Current Game Code\ACT_WIZ.CPP(256): do_quit2 (victim, "");
E:\BuiltByRustry\Current Game Code\ACT_WIZ.CPP(424): do_quit2 (victim, "");
E:\BuiltByRustry\Current Game Code\ACT_WIZ.CPP(502): do_quit2 (victim, "");
E:\BuiltByRustry\Current Game Code\ACT_WIZ.CPP(4011): do_quit (d->m_pCharacter, "");
E:\BuiltByRustry\Current Game Code\NANNY.CPP(580):do_quit2 ( ch, "");
E:\BuiltByRustry\Current Game Code\SKILLS.CPP(7061): if (!str_cmp (name, "do_quit2")) return do_quit2;
E:\BuiltByRustry\Current Game Code\SKILLS.CPP(7536): if (skill == do_quit2) return "do_quit";
E:\BuiltByRustry\Current Game Code\SMAUG.H(1817):DECLARE_DO_FUN(do_quit);
E:\BuiltByRustry\Current Game Code\SMAUG.H(1818):DECLARE_DO_FUN(do_quit2);
E:\BuiltByRustry\Current Game Code\UPDATE.CPP(1419): do_quit2 (ch, "");
13 occurrence(s) have been found.