if (IS_SET(ch->act, PLR_QUESTOR))
{
if (ch->questmob == -1 && ch->countdown > 0)
{
int reward, pointreward, pracreward;
reward = number_range(2500,45000);
pointreward = number_range(25,75);
sprintf(buf, "Congratulations on completing your quest!");
do_say(questman,buf);
sprintf(buf,"As a reward, I am giving you %d quest points, and%d gold.",pointreward,reward);
do_say(questman,buf);
if (chance(15))
{
pracreward = number_range(1,6);
sprintf(buf, "You gain %d practices!\n\r",pracreward);
send_to_char(buf, ch);
ch->practice += pracreward;
}
REMOVE_BIT(ch->act, PLR_QUESTOR);
ch->questgiver = NULL;
ch->countdown = 0;
ch->questmob = 0;
ch->questobj = 0;
ch->questbox = 0;
ch->nextquest = 1;
ch->gold += reward;
return;
}
else if (ch->questbox > 0 && ch->countdown > 0)
{
for (victim = char_list; victim != NULL; victim = victim->next)
if (IS_NPC(victim))
{
bool obj_found = FALSE;
for (obj = victim->carrying; obj != NULL; obj = obj_next)
{
obj_next = obj->next_content;
if (obj->pIndexData->vnum == ch->questbox)
{
obj_found = TRUE;
break;
}
}
if (obj_found == TRUE)
{
int reward, pointreward, pracreward;
reward = number_range(2500,45000);
pointreward = number_range(25,75);
sprintf(buf, "Congratulations on completing your quest!");
do_say(questman,buf);
sprintf(buf,"As a reward, I am giving you %d quest points, and %d gold.",pointreward,reward);
do_say(questman,buf);
if (chance(15))
{
pracreward = number_range(1,6);
sprintf(buf, "You gain %d practices!\n\r",pracreward);
send_to_char(buf, ch);
ch->practice += pracreward;
}
REMOVE_BIT(ch->act, PLR_QUESTOR);
ch->questgiver = NULL;
ch->countdown = 0;
ch->questmob = 0;
ch->questobj = 0;
ch->questbox = 0;
ch->nextquest = 1;
ch->gold += reward;
ch->questpoints += pointreward;
extract_obj(obj);
return;
}
} }
else if (ch->questobj > 0 && ch->countdown > 0)
{
bool obj_found = FALSE;
for (obj = ch->carrying; obj != NULL; obj= obj_next)
{
obj_next = obj->next_content;
if (obj != NULL && obj->pIndexData->vnum == ch->questobj)
{
obj_found = TRUE;
break;
}
}
if (obj_found == TRUE)
{
int reward, pointreward, pracreward;
reward = number_range(2500,45000);
pointreward = number_range(25,75);
act("You hand $p to $N.",ch, obj, questman, TO_CHAR);
act("$n hands $p to $N.",ch, obj, questman, TO_ROOM);
sprintf(buf, "Congratulations on completing your quest!");
do_say(questman,buf);
sprintf(buf,"As a reward, I am giving you %d quest points,and %d gold.",pointreward,reward);
do_say(questman,buf);
if (chance(15))
{
pracreward = number_range(1,6);
sprintf(buf, "You gain %d practices!\n\r",pracreward);
send_to_char(buf, ch);
ch->practice += pracreward;
}
REMOVE_BIT(ch->act, PLR_QUESTOR);
ch->questgiver = NULL;
ch->countdown = 0;
ch->questmob = 0;
ch->questobj = 0;
ch->nextquest = 1;
ch->gold += reward;
ch->questpoints += pointreward;
extract_obj(obj);
return;
}
else
{
sprintf(buf, "You haven't completed the quest yet, but there is still time!");
do_say(questman, buf);
return;
}
return;
}
else if ((ch->questmob > 0 || ch->questobj > 0 || ch->questbox > 0) && ch->countdown > 0)
{
sprintf(buf, "You haven't completed the quest yet, but there is still time!");
do_say(questman, buf);
return;
}
if (ch->nextquest > 0)
sprintf(buf,"But you didn't complete your quest in time!");
else sprintf(buf, "You have to REQUEST a quest first, %s.",ch->name);
do_say(questman, buf);
return;
}
send_to_char("QUEST commands: POINTS INFO TIME REQUEST COMPLETE LIST BUY.\n\r",ch);
send_to_char("For more information, type 'HELP QUEST'.\n\r",ch);
return;
}
bool quest_complete( CHAR_DATA *ch )
{
int type;
type = quest_table[ch->quest].type;
switch (type)
{
default: return FALSE; break;
case MOB_KILL:
if (ch->multiples >= quest_table[ch->quest].multiples)
{
return TRUE;
break;
}
break;
case ITEM_RETRIEVE:
if (ch->multiples >= quest_table[ch->quest].multiples)
{
return TRUE;
break;
}
break;
case MOB_HELP_COMBO:
if (ch->multiples >= quest_table[ch->quest].multiples)
{
if (!strcmp ("", quest_table[ch->quest].help1 ) || ch->qread1 == TRUE)
{
if ( !strcmp ("", quest_table[ch->quest].help2 ) || ch->qread2 == TRUE )
{
if ( !strcmp ("", quest_table[ch->quest].help3 ) || ch->qread3 == TRUE )
{
return TRUE;
break;
}
}
}
}
break;
case HELP_READ:
if (ch->qread1 == TRUE)
{
if ( !strcmp ("", quest_table[ch->quest].help2 ) || ch->qread2 == TRUE )
{
if ( !strcmp ("", quest_table[ch->quest].help3 ) || ch->qread3 == TRUE )
{
return TRUE;
break;
}
}
}
break;
}
return FALSE;
}
Then comes the rewards and I do have the brackets closed lower. weird thing is, this worked once and hasnt worked since.