Go to the documentation of this file.
42 if (!
op->dialog_information)
45 current =
op->dialog_information->all_messages;
52 nextrep = currep->
next;
61 currep =
op->dialog_information->all_replies;
63 nextrep = currep->
next;
70 free(
op->dialog_information);
71 op->dialog_information = NULL;
82 char *pipe, *save = NULL, *
msg;
90 pipe = strtok_r(
msg,
"|", &save);
96 pipe = strtok_r(NULL,
"|", &save);
107 return msg[0] ==
'{';
141 if (
op->dialog_information == NULL)
147 msg = strdup(
op->msg);
151 if (strncmp(
current,
"@match ", 7) == 0) {
162 op->dialog_information->all_messages =
message;
166 }
else if ((strncmp(
current,
"@reply ", 7) == 0 && (len = 7)) || (strncmp(
current,
"@question ", 10) == 0 && (len = 10))) {
174 reply->message = strdup(cp+1);
178 LOG(
llevDebug,
"Warning: @reply/@question without message for %s!\n",
op->name);
187 reply->next =
op->dialog_information->all_replies;
188 op->dialog_information->all_replies =
reply;
190 LOG(
llevDebug,
"Warning: @reply not in @match block for %s!\n",
op->name);
191 }
else if ((strncmp(
current,
"@identify", 9) == 0 && (len = 9))) {
201 tmp =
static_cast<char *
>(realloc(
tmp, tmplen*
sizeof(
char)));
207 strncat(
tmp,
"\n", tmplen-strlen(
tmp)-1);
209 current = strtok_r(NULL,
"\n", &save);
245 for (*
reply =
op->dialog_information->all_replies; *
reply; *
reply = (*reply)->next) {
246 if (strcmp((*reply)->reply,
text) == 0)
struct struct_dialog_reply * next
void LOG(LogLevel logLevel, const char *format,...)
#define QUERY_FLAG(xyz, p)
static bool is_cfdialog(const char *msg)
object * object_insert_in_ob(object *op, object *where)
#define FLAG_DIALOG_PARSED
void dialog_preparse(object *op)
void fatal(enum fatal_error err)
object * create_archetype(const char *name)
int get_dialog_message(object *op, const char *text, struct_dialog_message **message, struct_dialog_reply **reply)
object * object_find_by_arch_name(const object *who, const char *name)
#define CLEAR_FLAG(xyz, p)
const char * re_cmp(const char *, const char *)
void free_dialog_information(object *op)
static int matches(const char *exp, const char *text)
const char * NPC_DIALOG_ARCH
static void parse_dialog_information(object *op)