 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
52 nextrep = currep->
next;
63 nextrep = currep->
next;
82 char *pipe, *save = NULL, *msg;
90 pipe = strtok_r(msg,
"|", &save);
96 pipe = strtok_r(NULL,
"|", &save);
107 return msg[0] ==
'{';
130 char *current, *save = NULL, *msg, *cp;
147 msg = strdup(op->
msg);
148 current = strtok_r(msg,
"\n", &save);
151 if (strncmp(current,
"@match ", 7) == 0) {
165 message->match = strdup(current+7);
166 }
else if ((strncmp(current,
"@reply ", 7) == 0 && (len = 7)) || (strncmp(current,
"@question ", 10) == 0 && (len = 10))) {
170 cp = strchr(current+len,
' ');
173 reply->
reply = strdup(current+len);
176 reply->
reply = strdup(current+len);
178 LOG(
llevDebug,
"Warning: @reply/@question without message for %s!\n", op->
name);
191 }
else if ((strncmp(current,
"@identify", 9) == 0 && (len = 9))) {
198 tmplen += strlen(current)+2;
201 tmp =
static_cast<char *
>(realloc(tmp, tmplen*
sizeof(
char)));
206 strncat(tmp, current, tmplen-strlen(tmp)-1);
207 strncat(tmp,
"\n", tmplen-strlen(tmp)-1);
209 current = strtok_r(NULL,
"\n", &save);
246 if (strcmp((*reply)->reply,
text) == 0)
player * next
Pointer to next player, NULL if this is last.
struct struct_dialog_reply * next
Next reply, NULL for last.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define QUERY_FLAG(xyz, p)
char * match
What the player should say, can be a regexp.
struct struct_dialog_reply * replies
Replies this message has.
static bool is_cfdialog(const char *msg)
Return true if the given message is detected as CFDialog JSON.
char * message
What the NPC will say.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
#define FLAG_DIALOG_PARSED
Was the object::msg field parsed? Temporary flag not saved.
char * message
What the player will actually say for this reply.
void dialog_preparse(object *op)
uint64_t event_bitmask
Bitmask of events this object has a handler for, see events.h.
One reply a NPC can expect.
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your message
@ rt_reply
Reply to something.
void fatal(enum fatal_error err)
fatal() is meant to be called whenever a fatal signal is intercepted.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
const char * re_cmp(const char *, const char *)
re-cmp - get regular expression match.
#define BITMASK_VALID
Bit indicating if the event bitmask is valid or not.
char * reply
Reply expected from the player.
One message a NPC can react to.
sstring name
The name of the object, obviously...
int get_dialog_message(object *op, const char *text, struct_dialog_message **message, struct_dialog_reply **reply)
Tries to find a message matching the said text.
object * object_find_by_arch_name(const object *who, const char *name)
Find object in inventory by archetype name.
@ rt_question
Asking a question.
sstring msg
If this is a book/sign/magic mouth/etc.
#define CLEAR_FLAG(xyz, p)
struct struct_dialog_message * next
Next message, NULL if last.
struct_dialog_information * dialog_information
Parsed dialog information for this object.
void free_dialog_information(object *op)
Frees obj::dialog_information.
static int matches(const char *exp, const char *text)
Does the text match the expression?
const char * NPC_DIALOG_ARCH
reply_type type
Type of message.
@ llevDebug
Only for debugging purposes.
static void parse_dialog_information(object *op)
Parse the dialog information for op, and fills in obj::dialog_information.