I use this:
in dg_variables.c
inside void find_replacement()
at around line 950ish - mine is a bit edited now but just find the other Quest related things and add this:
Code:
case 'q':
if (!IS_NPC(c) && (!str_cmp(field, "questpoints") ||
!str_cmp(field, "qp") || !str_cmp(field, "qpnts")))
{
if (subfield && *subfield) {
int addition = atoi(subfield);
GET_QUESTPOINTS(c) += addition;
}
snprintf(str, slen, "%d", GET_QUESTPOINTS(c));
}
else if (!str_cmp(field, "quest"))
{
if (!IS_NPC(c) && (GET_QUEST(c) != NOTHING) && (real_quest(GET_QUEST(c)) != NOTHING))
snprintf(str, slen, "%d", GET_QUEST(c));
else
strcpy(str, "0");
}
+ else if (!str_cmp(field, "queston"))
+ {
+ if (!IS_NPC(c) && subfield && *subfield) {
+ int q_num = atoi(subfield);
+ if (GET_QUEST(c) == q_num)
+ strcpy(str, "1");
+ else
+ strcpy(str, "0");
+ }
+ else
+ strcpy(str, "0");
+ }
+ else if (!str_cmp(field, "questdone"))
+ {
+ if (!IS_NPC(c) && subfield && *subfield) {
+ int q_num = atoi(subfield);
+ if (is_complete(c, q_num))
+ strcpy(str, "1");
+ else
+ strcpy(str, "0");
+ }
+ else
+ strcpy(str, "0");
+ }
break;
case 'r':
Then in your triggers use it like this:
if %actor.queston(100)%
This will return 1 if they are on quest 100, returns 0 if not
AND
if %actor.questdone(100)%
This will return 1 if they have completed quest 100, returns 0 if not.