Go to the documentation of this file.
36 #define MAXITEMLEN 300
50 unsigned int flags = 0;
123 int flags, len, anim_speed;
150 len = strlen(item_n);
155 len = strlen(item_n);
158 strncpy(item_n+len+1, item_p, 127);
160 item_n[len+1+127] = 0;
161 len += strlen(item_n+1+len)+1;
177 if (anim_speed > 255)
195 int got_one = 0, start_look = 0, end_look = 0, objects_sent = 0;
199 if (!
pl->contr->socket->update_look) {
200 LOG(
llevDebug,
"esrv_draw_look called when update_look was not set\n");
203 pl->contr->socket->update_look = 0;
212 if (
pl->contr->transport)
230 if (
pl->contr->socket->look_position) {
231 int overhead = 1+(
pl->contr->transport != NULL);
232 int prev_len =
pl->contr->socket->num_look_objects-overhead-(
pl->contr->socket->look_position >
pl->contr->socket->num_look_objects-overhead);
237 snprintf(
buf,
sizeof(
buf),
"Click here to see previous group of items");
247 if (
pl->contr->transport) {
270 if (start_look++ <
pl->contr->socket->look_position)
274 if (objects_sent >=
pl->contr->socket->num_look_objects) {
283 snprintf(
buf,
sizeof(
buf),
"Click here to see next group of items");
317 int got_one = 0, start_look = 0, end_look = 0, objects_sent = 0;
320 int prev_len =
pl->contr->socket->num_look_objects - 2 - (((
pl->contr->socket->container_position >
pl->contr->socket->num_look_objects - 1)) ? 1 : 0);
331 if (
pl !=
op &&
pl->contr->socket->container_position) {
336 snprintf(
buf,
sizeof(
buf),
"Click here to see previous group of items");
351 if (start_look++ <
pl->contr->socket->container_position &&
pl !=
op)
355 if (
pl !=
op && objects_sent >=
pl->contr->socket->num_look_objects) {
360 SockList_AddInt(&sl, 0x80000000|(
pl->contr->socket->container_position + end_look - 1));
364 snprintf(
buf,
sizeof(
buf),
"Click here to see next group of items");
392 if (
pl !=
op &&
pl->contr->socket->container_position) {
397 pl->contr->socket->container_position =
MAX(0,
pl->contr->socket->container_position - prev_len);
481 strlcpy(item_n, custom_name,
sizeof(item_n)-1);
482 strlcpy(item_p, custom_name,
sizeof(item_p));
485 len = strlen(item_n)+1;
486 snprintf(item_n+len,
sizeof(item_n)-len,
"%s", item_p);
487 len += strlen(item_n+len);
498 anim_speed =
op->anim_speed;
500 if (
FABS(
op->speed) < 0.001)
502 else if (
FABS(
op->speed) >= 1.0)
507 if (anim_speed > 255)
534 pl->contr->socket->update_look = 1;
553 if (
pl->contr != NULL &&
pl->container != NULL &&
op->env ==
pl->container)
554 pl->contr->socket->update_inventory = 1;
572 if (
pl->ob->container != NULL &&
ob->env ==
pl->ob->container)
573 pl->socket->update_inventory = 1;
633 if (
pl->contr->transport) {
647 if (len <= 0 || !
buf) {
648 LOG(
llevDebug,
"Player '%s' sent bogus examine_cmd information\n",
pl->ob->name);
655 LOG(
llevDebug,
"Player '%s' tried to examine the unknown object (%ld)\n",
pl->ob->name,
tag);
669 if (!
buf || len <= 0) {
670 LOG(
llevDebug,
"Player '%s' sent bogus apply_cmd information\n",
pl->ob->name);
685 if (
tag&0x80000000) {
686 if (
pl->ob->container != NULL) {
687 pl->socket->container_position =
tag&0x7fffffff;
689 pl->socket->update_inventory = 0;
691 pl->socket->look_position =
tag&0x7fffffff;
692 pl->socket->update_look = 1;
698 LOG(
llevDebug,
"Player '%s' tried to apply the unknown object (%d)\n",
pl->ob->name,
tag);
712 LOG(
llevDebug,
"Player '%s' sent bogus lock_item_cmd information\n",
pl->ob->name);
721 "Could not find object to lock/unlock");
727 "Can't lock/unlock an item on the ground");
730 if (
op->env !=
pl->ob) {
732 "Can't lock/unlock an item not directly in your inventory");
740 "Unlocked %s.",
name);
770 LOG(
llevDebug,
"Player '%s' sent bogus mark_item_cmd information\n",
pl->ob->name);
778 "Could not find object to mark");
782 pl->mark_count =
op->count;
852 "You see nothing there.");
864 if (len <= 0 || !
buf) {
865 LOG(
llevDebug,
"Player '%s' sent bogus look_at_cmd information\n",
pl->ob->name);
870 if (!(cp = strchr(
buf,
' '))) {
877 "You can't see there from where you're standing.");
881 if (
pl->blocked_los[dx+(
pl->socket->mapx/2)][dy+(
pl->socket->mapy/2)]) {
883 "You can't see there from where you're standing.");
895 LOG(
llevDebug,
"Player '%s' tried to move an unknown object (%lu)\n",
pl->name, (
unsigned long)
tag);
902 if (!
to && !
pl->contr->transport) {
905 if (
op->map && !
op->env) {
921 }
else if (
to ==
pl->count) {
926 pl->contr->count = nrof;
931 if (
pl->contr->transport) {
939 LOG(
llevDebug,
"Player '%s' tried to move object to the unknown location (%d)\n",
pl->name,
to);
956 object *scroll, *
spell, *
marked, *inscription, *currentspell;
957 tag_t tscroll, tspell, tmarked;
961 LOG(
llevDebug,
"Player %s sent an invalid inscribe command.\n",
pl->ob->name);
975 LOG(
llevDebug,
"Player %s sent an invalid inscribe command.\n",
pl->ob->name);
983 LOG(
llevDebug,
"Player %s sent an invalid scroll for inscribe command.\n",
pl->ob->name);
989 LOG(
llevDebug,
"Player %s sent an invalid spell for inscribe command.\n",
pl->ob->name);
993 tmarked =
pl->mark_count;
997 pl->mark_count = tscroll;
1003 pl->mark_count = tmarked;
#define GET_MAP_OB(M, X, Y)
void SockList_AddInt(SockList *sl, uint32_t data)
void esrv_move_object(object *pl, tag_t to, tag_t tag, long nrof)
#define MSG_TYPE_COMMAND_SUCCESS
void LOG(LogLevel logLevel, const char *format,...)
void mark_item_cmd(uint8_t *data, int len, player *pl)
#define QUERY_FLAG(xyz, p)
object * object_merge(object *op, object *top)
void SockList_AddString(SockList *sl, const char *data)
void do_dump(object *who, object *what)
int write_on_item(object *pl, const char *params, object *skill)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
void examine_cmd(char *buf, int len, player *pl)
static const flag_definition flags[]
#define MSG_TYPE_COMMAND_EXAMINE
void esrv_update_item(int flags, object *pl, object *op)
#define MSG_TYPE_COMMAND_ERROR
void SockList_Reset(SockList *sl)
const char * object_get_value(const object *op, const char *const key)
Plugin animator file specs[Config] name
size_t SockList_Avail(const SockList *sl)
static event_registration m
void lock_item_cmd(uint8_t *data, int len, player *pl)
static void add_object_to_socklist(socket_struct *ns, SockList *sl, object *head)
void esrv_send_face(socket_struct *ns, const Face *face, int nocache)
void query_name(const object *op, char *buf, size_t size)
#define FLAG_KNOWN_BLESSED
#define FLAG_KNOWN_CURSED
#define FOR_OB_AND_BELOW_FINISH()
void SockList_AddShort(SockList *sl, uint16_t data)
int transport_can_hold(const object *transport, const object *op, int nrof)
void query_short_name(const object *op, char *buf, size_t size)
void SockList_AddChar(SockList *sl, unsigned char c)
int out_of_map(mapstruct *m, int x, int y)
int is_identified(const object *op)
void esrv_send_inventory(object *pl, object *op)
with a maximum of six This is not so if you are wearing plate you receive no benefit Armour is additive with all the supplementry forms of which means that it lasts until the next semi permanent spell effect is cast upon the character spell
static object * esrv_get_ob_from_count(object *pl, tag_t count)
mapstruct * get_map_from_coord(mapstruct *m, int16_t *x, int16_t *y)
#define FOR_OB_AND_BELOW_PREPARE(op_)
const Animations * animation
void SockList_Init(SockList *sl)
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 and press< Return > You can also use say if you feel like typing a little extra Other NPCs may not speak to but display intelligence with their movement Some monsters can be and may attack the nearest of your enemies Others can be in that they follow you around and help you in your quest to kill enemies and find treasure SPECIAL ITEMS There are many special items which can be found in of these the most important may be the signs all a player must do is apply the handle In the case of the player must move items over the button to hold it down Some of the larger buttons may need very large items to be moved onto before they can be activated Gates and locked but be for you could fall down into a pit full of ghosts or dragons and not be able to get back out Break away sometimes it may be worth a player s time to test the walls of a map for secret doors Fire such as missile weapons and spells you will notice them going up in smoke ! So be careful not to destroy valuable items Spellbooks sometimes a player can learn the other times they cannot There are many different types of books and scrolls out there Improve item have lower weight
bool player_can_find(object *op, object *ob)
object * find_skill_by_name(object *who, const char *name)
static std::shared_ptr< inja::Environment > env
object * drop_object(object *op, object *tmp, uint32_t nrof)
size_t strlcpy(char *dst, const char *src, size_t size)
void SockList_Term(SockList *sl)
#define MSG_TYPE_COMMAND_FAILURE
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
#define FLAG_KNOWN_MAGICAL
void esrv_send_animation(socket_struct *ns, const Animations *anim)
#define MSG_TYPE_SKILL_FAILURE
void esrv_send_item(object *pl, object *op)
void esrv_del_item(player *pl, object *ob)
int object_can_pick(const object *who, const object *item)
void esrv_draw_look(object *pl)
const typedef char * sstring
static object * ob_if_can_find(object *op, object *ob)
void SockList_AddLen8Data(SockList *sl, const void *data, size_t len)
int apply_by_living(object *pl, object *op, int aflag, int quiet)
void look_at(object *op, int dx, int dy)
#define CLEAR_FLAG(xyz, p)
uint8_t anims_sent[MAXANIMNUM]
void apply_cmd(char *buf, int len, player *pl)
int GetInt_String(const unsigned char *data)
void look_at_cmd(char *buf, int len, player *pl)
void inscribe_scroll_cmd(char *buf, int len, player *pl)
void inventory(object *op, object *inv)
void query_base_name(const object *op, int plural, char *buf, size_t size)
static unsigned int query_flags(const object *op)
#define FLAG_NO_SKILL_IDENT
void pick_up(object *op, object *alt)
void examine(object *op, object *tmp)
int sack_can_hold(const object *pl, const object *sack, const object *op, uint32_t nrof)
void Send_With_Handling(socket_struct *ns, SockList *sl)
#define CUSTOM_NAME_FIELD
#define FOR_INV_PREPARE(op_, it_)
void SockList_AddPrintf(SockList *sl, const char *format,...)
void put_object_in_sack(object *op, object *sack, object *tmp, uint32_t nrof)