I have added the bandage code from http://ftp.kyndig.com/diku/merc/smaug/snippets/bandage.txt
It works just fine what I need help with is how to allow me to bandage other players and I need to run a check to see if the Actor and the Victim are both sitting or laying down.
Thanks before hand
Would a if check on position work?
For the character who applies the bandage, when you add the skill in the skilltable, you can set the minpos. If you don't want to do that, you can do what you said--run position checks.
cool I still have the problem that I am not able to direct this towards a victim.
Thanks with the answers so far they are helping me!!
Aren't you passing in the victim as part of the argument? I mean take the name of the victim, convert it to CHAR_DATA, then use the position check on that.
no I mean I am trying to change the code. As it sets now you cannot bandage someone other than yourself. I am still learning how to program so I am not totally understanding how to set it up so that it looks at the victim to apply the bandage to and stop the bleeding.
Thanks beforehand!
find another peice of code in your code that uses the ability to do something to another player. just copy and paste and then change a few things here and there.
I would love to thank all who helped me.... here is the altered code that works just like it I wanted. Thanks again!!!!
void do_bandage( CHAR_DATA *ch, char *argument )
{
char arg1 [MAX_INPUT_LENGTH];
CHAR_DATA *victim;
/* OBJ_DATA *obj; This is commented out in case I want make them carry bandages later */
argument = one_argument( argument, arg1 );
if ( ch->mount )
{
send_to_char( "You can't do that while mounted.\n\r", ch );
return;
}
if ( arg1[0] == '\0')
{
send_to_char( "Bandage whom?\n\r", ch );
return;
}
if ( ( victim = get_char_room( ch, arg1 ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if ( victim->pcdata->condition[COND_BLEEDING] <= 0)
{
send_to_char( "How can you bandage that which is not bleeding? \n\r", ch );
return;
}
if ( victim->position == POS_SITTING || victim->position == POS_RESTING )
{
if(can_use_skill(ch, number_percent(), gsn_bleeding))
{
gain_condition(victim, COND_BLEEDING, -1);
act( AT_SKILL, "You place a bandage over $N's wound trying to help the bleeding!", ch, NULL, victim, TO_CHAR );
act( AT_SKILL, "$n places a bandage over your wound to help stop the bleeding!", ch, NULL, victim, TO_VICT );
act( AT_SKILL, "$n places a bandage over $N's wound to help stop the bleeding!", ch, NULL, victim, TO_NOTVICT );
learn_from_success( ch, gsn_bleeding );
return;
}
}
else
{
if ( victim == ch )
{
send_to_char( "You need to sit still to bandage yourself.\n\r", ch );
return;
}
else
{
send_to_char( "How can you bandage anyone if they won't sit still. /n/r", ch );
return;
}
return;
}
}