Register forum user name Search FAQ

Gammon Forum

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 ➜ Whisper Channel Issue

Whisper Channel Issue

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Dralnu   USA  (277 posts)  Bio
Date Sat 11 Jun 2005 10:01 PM (UTC)
Message
This is a rather simple-sounding problem, but I cann't figure how to fix it.

void do_whisper( CHAR_DATA * ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
int position;
int speaking = -1, lang;
#ifndef SCRAMBLE

for( lang = 0; lang_array[lang] != LANG_UNKNOWN; lang++ )
if( ch->speaking & lang_array[lang] )
{
speaking = lang;
break;
}
#endif

REMOVE_BIT( ch->deaf, CHANNEL_WHISPER );

argument = one_argument( argument, arg );

if( arg[0] == '\0' || argument[0] == '\0' )
{
send_to_char( "Whisper to whom what?\n\r", ch );
return;
}


if( ( victim = get_char_room( ch, arg ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}

if( ch == victim )
{
send_to_char( "You have a nice little chat with yourself.\n\r", ch );
return;
}

if( !IS_NPC( victim ) && ( victim->switched ) && !IS_AFFECTED( victim->switched, AFF_POSSESS ) )
{
send_to_char( "That player is switched.\n\r", ch );
return;
}
else if( !IS_NPC( victim ) && ( !victim->desc ) )
{
send_to_char( "That player is link-dead.\n\r", ch );
return;
}
if( !IS_NPC( victim ) && xIS_SET( victim->act, PLR_AFK ) )
{
send_to_char( "That player is afk.\n\r", ch );
return;
}
if( IS_SET( victim->deaf, CHANNEL_WHISPER ) && ( !IS_IMMORTAL( ch ) || ( get_trust( ch ) < get_trust( victim ) ) ) )
{
act( AT_PLAIN, "$E has $S whispers turned off.", ch, NULL, victim, TO_CHAR );
return;
}
if( !IS_NPC( victim ) && xIS_SET( victim->act, PLR_SILENCE ) )
send_to_char( "That player is silenced. They will receive your message but can not respond.\n\r", ch );

if( victim->desc /* make sure desc exists first -Thoric */
&& victim->desc->connected == CON_EDITING && get_trust( ch ) < LEVEL_GOD )
{
act( AT_PLAIN, "$E is currently in a writing buffer. Please try again in a few minutes.", ch, 0, victim, TO_CHAR );
return;
}

/*
* Check to see if target of tell is ignoring the sender
*/
if( is_ignoring( victim, ch ) )
{
/*
* If the sender is an imm then they cannot be ignored
*/
if( !IS_IMMORTAL( ch ) || get_trust( victim ) > get_trust( ch ) )
{
set_char_color( AT_IGNORE, ch );
ch_printf( ch, "%s is ignoring you.\n\r", victim->name );
return;
}
else
{
set_char_color( AT_IGNORE, victim );
ch_printf( victim, "You attempt to ignore %s, but " "are unable to do so.\n\r", ch->name );
}
}

act( AT_WHISPER, "You whisper to $N '$t'", ch, argument, victim, TO_CHAR );
position = victim->position;
victim->position = POS_STANDING;
#ifndef SCRAMBLE
if( speaking != -1 && ( !IS_NPC( ch ) || ch->speaking ) )
{
int speakswell = UMIN( knows_language( victim, ch->speaking, ch ),
knows_language( ch, ch->speaking, victim ) );
if( speakswell < 85 )
act( AT_WHISPER, "$n whispers to you '$t'", ch, translate( speakswell, argument, lang_names[speaking] ), victim, TO_VICT );
}
else
act( AT_WHISPER, "$n whispers to you '$t'", ch, argument, victim, TO_VICT );
#else
if( !knows_language( vch, ch->speaking, ch ) && ( !IS_NPC( ch ) || ch->speaking != 0 ) )
act( AT_WHISPER, "$n whispers to you '$t'", ch, translate( speakswell, argument, lang_names[speaking] ), victim, TO_VICT );
else
act( AT_WHISPER, "$n whispers to you '$t'", ch, argument, victim, TO_VICT );
#endif
if( !IS_SET( ch->in_room->room_flags, ROOM_SILENCE ) )
act( AT_WHISPER, "$n whispers something to $N.", ch, argument, victim, TO_NOTVICT );

victim->position = position;
if( IS_SET( ch->in_room->room_flags, ROOM_LOGSPEECH ) )
{
sprintf( buf, "%s: %s (whisper to) %s.",
IS_NPC( ch ) ? ch->short_descr : ch->name, argument, IS_NPC( victim ) ? victim->short_descr : victim->name );
append_to_file( LOG_FILE, buf );
}

mprog_speech_trigger( argument, ch );
return;
}


Something in there is broke. You can send a whisper, but the target never gets it. I dunno what is wrong...
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Sat 11 Jun 2005 10:24 PM (UTC)
Message
Is the victim up and standing? Act doesn't show to players who are stunned etc.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #2 on Sun 12 Jun 2005 12:02 AM (UTC)
Message
They are both awake, in the same room, ect. I just don't see the issue...
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.


12,508 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.