Well i'd let you into my shell but i'm running in cygwin of my comp... so here goes some info on it.I had the problem when i married them it would add to pfile. I fixed that. now they get married and loose the fiance status in the pfile. but when i do a divorce and make them loose the married status it will not allow the character to propose to any one else. Here is the code:void do_divorce( CHAR_DATA *ch, char *argument )
{
CHAR_DATA *vic1;
CHAR_DATA *vic2;
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
char buf[MAX_INPUT_LENGTH];
argument = one_argument(argument, arg1);
argument = one_argument(argument, arg2);
if (arg1[0] == '\0' && arg2[0] == '\0')
{
send_to_char("Syntax: Divorce <victim1> <victim2>\n\r", ch);
return;
}
if ((vic1 = get_char_room(ch, arg1)) == NULL)
{
sprintf(buf, "%s doesn't appear to be here. You should wait for them.\n\r", arg1);
send_to_char(buf, ch);
return;
}
if ((vic2 = get_char_room(ch, arg2)) == NULL)
{
sprintf(buf, "%s doesn't appear to be here. You should wait for then.\n\r", arg2);
send_to_char(buf, ch);
return;
}
if (vic1->pcdata->spouse == NULL)
{
sprintf(buf, "%s doesn't appear to be married.\n\r", vic1->name);
send_to_char(buf, ch);
return;
}
if (vic2->pcdata->spouse == NULL)
{
sprintf(buf, "%s doesn't appear to be married.\n\r", vic2->name);
send_to_char(buf, ch);
return;
}
if (vic1->pcdata->spouse != vic2->name)
{
sprintf(buf, "%s is not married to %s\n\r", vic1->name, vic2->name);
send_to_char(buf, ch);
return;
}
vic1->pcdata->spouse = NULL;
vic2->pcdata->spouse = NULL;
do_say(ch, "500 credits each please.");
do_say(ch, "Thank you.");
ch->gold += 1000;
vic1->gold -= 500;
vic2->gold -= 500;
sprintf(buf, "&R(&WMarriage&R} &W%s: It is my sad duty to anounce that %s and %s are now divorced.", ch->name, vic1->name, vic2->name);
}
void do_propose( CHAR_DATA *ch, char *argument )
{
CHAR_DATA *victim;
char arg[MAX_INPUT_LENGTH];
char buf[MAX_INPUT_LENGTH];
argument = one_argument(argument, arg);
if (arg[0] == '\0'){
send_to_char("Syntax: Propose <victim>\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("Why would you want to propose to yourself?\n\r", ch);
if (ch->sex == SEX_MALE)
sprintf(buf, "What a moron. %s proposed to himself.", ch->name);
else if (ch->sex == SEX_FEMALE)
sprintf(buf, "What a moron. %s proposed to herself.", ch->name);
else
sprintf(buf, "What a moron. %s proposed to itself.", ch->name);
echo_to_all( AT_WHITE, buf, ECHOTAR_ALL );
return;
}
if ( IS_NPC(victim) ){
send_to_char("Why would you propose to a mob?\n\r", ch);
return;
}
if ( IS_NPC(ch) ){
send_to_char("Why would a mob propose to someone?\n\r", ch);
return;
}
if (victim->pcdata->fiance && victim->pcdata->fiance != NULL){
send_to_char("They are already engaged.\n\r", ch);
return;
}
if (victim->pcdata->spouse && victim->pcdata->spouse != NULL){
send_to_char("They are already married.\n\r", ch);
}
if (victim->pcdata->proposed && victim->pcdata->proposed != NULL){
sprintf(buf, "They have already been proposed to by %s.\n\r", victim->pcdata->proposed);
return;
}
if (victim->pcdata->propose && victim->pcdata->propose != NULL){
sprintf(buf, "They have already been proposed to %s.\n\r", victim->pcdata->propose);
return;
}
ch->pcdata->propose = victim->name;
victim->pcdata->proposed = ch->name;
act(AT_WHITE, "$n gets down on one knee and asks your hand in marriage.", ch, NULL, victim, TO_VICT);
act(AT_WHITE, "You get down on one knee and ask $N's hand in marriage.", ch, NULL, victim, TO_CHAR);
act(AT_WHITE, "$n gets down on one knee and asks for $N's hand in marriage.", ch, NULL, victim, TO_NOTVICT);
return;
}
Hope this helps.
|