 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
102 {
"alive",
"FLAG_ALIVE" },
103 {
"wiz",
"FLAG_WIZ" },
104 {
"was_wiz",
"FLAG_WAS_WIZ" },
105 {
"applied",
"FLAG_APPLIED" },
106 {
"unpaid",
"FLAG_UNPAID" },
107 {
"can_use_shield",
"FLAG_USE_SHIELD" },
108 {
"no_pick",
"FLAG_NO_PICK" },
109 {
"client_anim_sync",
"FLAG_CLIENT_ANIM_SYNC" },
110 {
"client_anim_random",
"FLAG_CLIENT_ANIM_RANDOM" },
111 {
"is_animated",
"FLAG_ANIMATE" },
112 {
"monster",
"FLAG_MONSTER" },
113 {
"friendly",
"FLAG_FRIENDLY" },
114 {
"generator",
"FLAG_GENERATOR" },
115 {
"is_thrown",
"FLAG_IS_THROWN" },
116 {
"auto_apply",
"FLAG_AUTO_APPLY" },
117 {
"treasure",
"FLAG_TREASURE" },
118 {
"player sold",
"FLAG_PLAYER_SOLD" },
119 {
"see_invisible",
"FLAG_SEE_INVISIBLE" },
120 {
"can_roll",
"FLAG_CAN_ROLL" },
121 {
"overlay_floor",
"FLAG_OVERLAY_FLOOR" },
122 {
"is_turnable",
"FLAG_IS_TURNABLE" },
123 {
"is_used_up",
"FLAG_IS_USED_UP" },
124 {
"identified",
"FLAG_IDENTIFIED" },
125 {
"reflecting",
"FLAG_REFLECTING" },
126 {
"changing",
"FLAG_CHANGING" },
127 {
"splitting",
"FLAG_SPLITTING" },
128 {
"hitback",
"FLAG_HITBACK" },
129 {
"startequip",
"FLAG_STARTEQUIP" },
130 {
"blocksview",
"FLAG_BLOCKSVIEW" },
131 {
"undead",
"FLAG_UNDEAD" },
132 {
"scared",
"FLAG_SCARED" },
133 {
"unaggressive",
"FLAG_UNAGGRESSIVE" },
134 {
"reflect_missile",
"FLAG_REFL_MISSILE" },
135 {
"reflect_spell",
"FLAG_REFL_SPELL" },
136 {
"no_magic",
"FLAG_NO_MAGIC" },
137 {
"no_fix_player",
"FLAG_NO_FIX_PLAYER" },
138 {
"is_lightable",
"FLAG_IS_LIGHTABLE" },
139 {
"tear_down",
"FLAG_TEAR_DOWN" },
140 {
"run_away",
"FLAG_RUN_AWAY" },
141 {
"unique",
"FLAG_UNIQUE" },
142 {
"no_drop",
"FLAG_NO_DROP" },
143 {
"can_cast_spell",
"FLAG_CAST_SPELL" },
144 {
"can_use_scroll",
"FLAG_USE_SCROLL" },
145 {
"can_use_range",
"FLAG_USE_RANGE" },
146 {
"can_use_bow",
"FLAG_USE_BOW" },
147 {
"can_use_armour",
"FLAG_USE_ARMOUR" },
148 {
"can_use_weapon",
"FLAG_USE_WEAPON" },
149 {
"can_use_ring",
"FLAG_USE_RING" },
150 {
"has_ready_range",
"FLAG_READY_RANGE" },
151 {
"has_ready_bow",
"FLAG_READY_BOW" },
152 {
"xrays",
"FLAG_XRAYS" },
153 {
"is_floor",
"FLAG_IS_FLOOR" },
154 {
"lifesave",
"FLAG_LIFESAVE" },
155 {
"no_strength",
"FLAG_NO_STRENGTH" },
156 {
"sleep",
"FLAG_SLEEP" },
157 {
"stand_still",
"FLAG_STAND_STILL" },
158 {
"random_movement",
"FLAG_RANDOM_MOVE" },
159 {
"only_attack",
"FLAG_ONLY_ATTACK" },
160 {
"confused",
"FLAG_CONFUSED" },
161 {
"stealth",
"FLAG_STEALTH" },
162 {
"cursed",
"FLAG_CURSED" },
163 {
"damned",
"FLAG_DAMNED" },
164 {
"see_anywhere",
"FLAG_SEE_ANYWHERE" },
165 {
"known_magical",
"FLAG_KNOWN_MAGICAL" },
166 {
"known_cursed",
"FLAG_KNOWN_CURSED" },
167 {
"can_use_skill",
"FLAG_CAN_USE_SKILL" },
168 {
"been_applied",
"FLAG_BEEN_APPLIED" },
169 {
"has_ready_scroll",
"FLAG_READY_SCROLL" },
170 {
"make_invisible",
"FLAG_MAKE_INVIS" },
171 {
"inv_locked",
"FLAG_INV_LOCKED" },
172 {
"is_wooded",
"FLAG_IS_WOODED" },
173 {
"is_hilly",
"FLAG_IS_HILLY" },
174 {
"has_ready_skill",
"FLAG_READY_SKILL" },
175 {
"has_ready_weapon",
"FLAG_READY_WEAPON" },
176 {
"no_skill_ident",
"FLAG_NO_SKILL_IDENT" },
177 {
"is_blind",
"FLAG_BLIND" },
178 {
"can_see_in_dark",
"FLAG_SEE_IN_DARK" },
179 {
"is_cauldron",
"FLAG_IS_CAULDRON" },
180 {
"no_steal",
"FLAG_NO_STEAL" },
181 {
"one_hit",
"FLAG_ONE_HIT" },
182 {
"berserk",
"FLAG_BERSERK" },
183 {
"neutral",
"FLAG_NEUTRAL" },
184 {
"no_attack",
"FLAG_NO_ATTACK" },
185 {
"no_damage",
"FLAG_NO_DAMAGE" },
186 {
"activate_on_push",
"FLAG_ACTIVATE_ON_PUSH" },
187 {
"activate_on_release",
"FLAG_ACTIVATE_ON_RELEASE" },
188 {
"is_water",
"FLAG_IS_WATER" },
189 {
"use_content_on_gen",
"FLAG_CONTENT_ON_GEN" },
190 {
"is_buildable",
"FLAG_IS_BUILDABLE" },
191 {
"blessed",
"FLAG_BLESSED" },
192 {
"known_blessed",
"FLAG_KNOWN_BLESSED" },
347 for (test = 0; test <
type->attribute_count; test++) {
348 if (!strcmp(
type->attributes[test]->field, attribute)) {
349 ret =
type->attributes[test];
360 ret->
field = strdup(attribute);
362 type->attribute_count++;
364 type->attributes[
type->attribute_count-1] = ret;
417 printf(
"type not found: %s\n",
name);
426 return strcmp((*la)->name, (*lb)->name);
443 return fgets(
buffer, 200, file);
450 for (find = 0; find <
type->attribute_count; find++) {
451 if (!strcmp(attribute,
type->attributes[find]->field)) {
455 type->attributes[find] =
type->attributes[
type->attribute_count-1];
456 type->attribute_count--;
467 printf(
"empty ignore list?\n");
471 for (attr = 0; attr <
list->count; attr++) {
478 char *sn, *en, *sv, *ev;
479 char value[200],
name[200], temp[200];
486 sn = strstr(
const_cast<char *
>(
buf),
"arch");
489 sn = strchr(sn,
'"');
490 en = strchr(sn+1,
'"');
491 sv = strstr(
const_cast<char *
>(
buf),
"value");
492 sv = strchr(sv,
'"');
493 ev = strchr(sv+1,
'"');
495 name[en-sn-1] =
'\0';
496 strncpy(
name, sn+1, en-sn-1);
497 value[ev-sv-1] =
'\0';
498 strncpy(value, sv+1, ev-sv-1);
500 type->require_count++;
501 type->required =
static_cast<char **
>(realloc(
type->required,
type->require_count*
sizeof(
char *)));
505 snprintf(temp, 200,
"@ref %s %s", flag->
code_name, strcmp(value,
"0") ?
"set" :
"unset");
507 snprintf(temp, 200,
"@ref object::%s = %s",
name, value);
508 type->required[
type->require_count-1] = strdup(temp);
513 char buf[200], tmp[200];
518 if (strstr(
buf, block_end) != NULL) {
519 if (
type->attribute_count)
523 if (strstr(
buf,
"<description>") != NULL) {
525 if (strstr(
buf,
"</description>") != NULL)
528 if (
type->description) {
529 type->description =
static_cast<char *
>(realloc(
type->description, strlen(
type->description)+strlen(
buf)+1));
530 strcat(
type->description,
buf);
533 type->description = strdup(
buf);
535 find = strstr(
type->description,
"]]>");
537 type->description[find-
type->description] =
'\0';
538 while (
type->description[strlen(
type->description)-1] ==
'\n')
539 type->description[strlen(
type->description)-1] =
'\0';
543 if (strstr(
buf,
"<ignore_list") != NULL) {
544 find = strstr(
buf,
"name=");
547 find = strchr(find+1,
'"');
550 end = strchr(find+1,
'"');
553 tmp[end-find-1] =
'\0';
554 strncpy(tmp, find+1, end-find-1);
558 if (strstr(
buf,
"<ignore>") != NULL) {
560 if (strstr(
buf,
"</ignore>") != NULL)
562 find = strstr(
buf,
"arch=");
565 find = strchr(find+1,
'"');
568 end = strchr(find+1,
'"');
571 tmp[end-find-1] =
'\0';
572 strncpy(tmp, find+1, end-find-1);
577 if (strstr(
buf,
"<required>") != NULL) {
579 if (strstr(
buf,
"</required>") != NULL)
585 if (strstr(
buf,
"<import_type") != NULL) {
588 find = strstr(
buf,
"name=");
591 find = strchr(find+1,
'"');
594 end = strchr(find+1,
'"');
597 tmp[end-find-1] =
'\0';
598 strncpy(tmp, find+1, end-find-1);
605 printf(
"%s: import %s not found\n",
type->name, tmp);
608 if (strstr(
buf,
"<attribute") != NULL) {
609 find = strstr(
buf,
"arch");
612 find = strchr(find,
'"');
613 end = strchr(find+1,
'"');
618 tmp[end-find-1] =
'\0';
619 strncpy(tmp, find+1, end-find-1);
622 find = strstr(
buf,
"editor");
627 find = strchr(find,
'"');
628 end = strchr(find+1,
'"');
629 tmp[end-find-1] =
'\0';
630 strncpy(tmp, find+1, end-find-1);
631 attr->
name = strdup(tmp);
634 if (strstr(
buf,
"</attribute>") == NULL && strstr(
buf,
"/>") == NULL) {
636 if (strstr(
buf,
"<![CDATA[<html>") != NULL)
639 if (strstr(
buf,
"]]>") != NULL)
642 if (strstr(
buf,
"</attribute>") != NULL)
663 printf(
"type: %s [%d]\n",
type->name,
type->number);
664 printf(
" attributes:\n");
665 for (attr = 0; attr <
type->attribute_count; attr++) {
666 printf(
" %30s: %s\n",
type->attributes[attr]->field,
type->attributes[attr]->name);
667 printf(
" %s\n",
type->attributes[attr]->description);
706 for (desc = 0; desc < attribute->
type_count; desc++) {
708 return attribute->
types[desc];
710 return attribute->
types[desc];
729 att->
type =
static_cast<char **
>(realloc(att->
type, att->
count*
sizeof(
const char *)));
737 char buf[200], tmp[200];
749 if (strstr(
buf,
"</ignore_list>") != NULL) {
753 start = strstr(
buf,
"arch=");
756 start = strchr(start+1,
'"');
759 end = strchr(start+1,
'"');
763 tmp[end-start-1] =
'\0';
764 strncpy(tmp, start+1, end-start-1);
768 list->fields =
static_cast<char **
>(realloc(
list->fields,
list->count*
sizeof(
char *)));
769 list->fields[
list->count-1] = strdup(tmp);
776 printf(
"ignore lists:\n");
812 "weight_speed_ratio",
830 "price_adjustment_buy",
831 "price_adjustment_sell",
832 "casting_requirements",
834 "identified_name_pl",
836 "identified_animation",
837 "identified_anim_speed",
838 "identified_anim_random",
865 for (val = 0;
in_living[val] != NULL; val++) {
866 if (!strcmp(
in_living[val], attribute)) {
867 fprintf(file,
"living::%s", attribute);
872 fprintf(file,
"page_custom_attribute_%s \"%s\"", attribute, attribute);
875 if (strstr(attribute,
"resist_")) {
876 fprintf(file,
"object::resist");
879 if (!strcmp(attribute,
"connected")) {
880 fprintf(file,
"page_connected \"connection value\"");
883 fprintf(file,
"object::%s", attribute);
893 file = fopen(
buf,
"w+");
895 fprintf(file,
"/**\n");
898 if (
type->number > 0) {
901 fprintf(file,
"@var %s\nSee @ref page_type_%d\n*/\n\n/**\n",
type_names[req].code_name,
type->number);
907 fprintf(file,
"@page page_type_%d %s\n\n",
type->number,
type->name);
908 fprintf(file,
"%s\n\n",
type->description);
910 fprintf(file,
"\n\nType defined by:\n");
912 fprintf(file,
"- @ref object::type = %d\n",
type->number);
913 for (req = 0; req <
type->require_count; req++)
914 fprintf(file,
"- %s\n",
type->required[req]);
917 fprintf(file,
"\n\n# Attributes\n\n");
918 fprintf(file,
"<table>\n\t<tr>\n\t\t<th>Attribute</th>\n\t\t<th>Field</th>\n\t\t<th>Description</th>\n\t</tr>\n");
919 for (attr = 0; attr <
type->attribute_count; attr++) {
920 fprintf(file,
"\t<tr>\n\t\t<td>%s</td>\n\t\t<td>@ref ",
type->attributes[attr]->name);
922 fprintf(file,
"</td>\n\t\t<td>%s\n\t\t</td>\n\t</tr>\n",
type->attributes[attr]->description ?
type->attributes[attr]->description :
"(no description)");
925 fprintf(file,
"</table>\n*/\n");
937 index = fopen(
buf,
"w+");
938 fprintf(index,
"/**\n@page type_index Type index\n");
940 fprintf(index,
"Types not listed here have the attributes defined in @subpage page_type_0 \"this page\".\n\n");
946 fprintf(index,
"*/\n");
958 index = fopen(
buf,
"w+");
959 fprintf(index,
"/**\n@page field_index Field index\n");
961 fprintf(index,
"This page lists all attributes.\n\n");
964 fprintf(index,
"- @subpage ");
966 fprintf(index,
"\n");
969 fprintf(index,
"*/\n");
982 file = fopen(
buf,
"w+");
985 fprintf(file,
"/**\n@page page_custom_attribute_%s %s", attribute->
field, attribute->
field);
986 fprintf(file,
"\nThis is a @ref page_custom_attributes \"custom attribute\".\n");
988 if (strcmp(attribute->
field,
"connected") == 0)
989 fprintf(file,
"/**\n@page ");
991 fprintf(file,
"/**\n@fn ");
996 if (strstr(attribute->
field,
"resist_"))
997 fprintf(file,
"\n@section %s %s resistance\n", attribute->
field, attribute->
field+7);
999 fprintf(file,
"\n# Use\n");
1001 fprintf(file,
"<table>\n\t<tr>\n\t\t<th>Type(s)</th>\n\t\t<th>Description</th>\n\t</tr>");
1003 for (desc = 0; desc < attribute->
type_count; desc++) {
1006 fprintf(file,
"\t<tr>\n\t\t<td>\n");
1009 if (type < attribute->
types[desc]->count-1)
1013 fprintf(file,
"@ref page_type_%d%s", attribute->
types[desc]->
number[
type], end);
1018 fprintf(file,
"\n*/\n");
1025 int number, attr, dummy;
1026 char buf[200], tmp[200];
1031 printf(
"Syntax: %s /path/to/Gridarta/types.xml\n", argv[0]);
1038 xml = fopen(argv[1],
"r");
1041 printf(
"Could not find file %s\n", argv[1]);
1048 if (strstr(
buf,
"<default_type>")) {
1055 if (strstr(
buf,
"<ignore_list") != NULL) {
1056 start = strstr(
buf,
"name=");
1057 start = strchr(start+1,
'"');
1058 end = strchr(start+1,
'"');
1059 tmp[end-start-1] =
'\0';
1060 strncpy(tmp, start+1, end-start-1);
1065 start = strstr(
buf,
"<type number");
1067 start = strchr(start,
'"');
1070 end = strchr(start+1,
'"');
1073 tmp[end-start-1] =
'\0';
1074 strncpy(tmp, start+1, end-start-1);
1078 start = strstr(end,
"name=");
1079 start = strchr(start,
'"');
1080 end = strchr(start+1,
'"');
1081 tmp[end-start-1] =
'\0';
1082 strncpy(tmp, start+1, end-start-1);
1084 if (!strcmp(tmp,
"Misc")) {
1100 while (
read_line(
buf, 200, xml) != NULL && strstr(
buf,
"</type>") == NULL)
1107 type->number = number;
1110 type->name = strdup(tmp);
1119 for (number = 0; number <
type_count; number++) {
1129 for (number = 0; number <
type_count; number++)
@ CLASS
Object for applying character class modifications to someone.
void add_required_parameter(type_definition *type, const char *buf)
Add a required parameter to the specified type.
@ MONSTER
A real, living creature.
int main(int argc, char **argv)
@ CLOSE_CON
Eneq((at)csd.uu.se): Id for close_container archetype.
@ EVENT_CONNECTOR
Lauwenmark: an invisible object holding a plugin event hook.
static const char * custom_attributes[]
Custom attributes we know about, to point to the right page.
type_attribute * duplicate_attribute(type_attribute *attr)
@ FLESH
animal 'body parts' -b.t.
attribute_definition ** attributes
type_definition ** types
Defined types.
int is_custom_attribute(const char *attribute)
non standard information is not specified or uptime fields
char * read_line(char *buffer, int size, FILE *file)
@ SKILL
Also see SKILL_TOOL (74) below.
static const flag_definition flags[]
Flag mapping.
@ TRANSPORT
see doc/Developers/objects
@ POTION_RESIST_EFFECT
A force, holding the effect of a resistance potion.
@ FLOOR
Floor tile -> native layer 0.
One type for an attribute.
type_attribute * get_attribute_for_type(type_definition *type, const char *attribute, int clean)
Gets the attribute for the specified type.
Plugin animator file specs[Config] name
void write_attribute_index(void)
Write the index of all attributes.
@ TRIGGER_MARKER
inserts an invisible, weightless force into a player with a specified string WHEN TRIGGERED.
void free_attribute(type_attribute *attr)
int sort_type_attribute(const void *a, const void *b)
To sort attributes.
void read_ignore_list(const char *name, FILE *file)
Read the contents of a <ignore_list> tag.
ignore_list * find_ignore_list(const char *name)
@ MARKER
inserts an invisible, weightless force into a player with a specified string.
@ BUILDER
Generic item builder, see subtypes below.
type_attribute ** attributes
One list of fields to ignore.
@ INORGANIC
metals, minerals, dragon scales
void dump_ignore_lists(void)
type_definition * find_type_definition(const char *name)
Used for type import.
spell prayer lvl t sp speed range duration short description
@ PEACEMAKER
Object owned by a player which can convert a monster into a peaceful being incapable of attack.
@ SKILLSCROLL
can add a skill to player's inventory -bt.
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn t
void ignore_attributes(type_definition *type, ignore_list *list)
Remove all attributes in the specified list from the type.
attribute_definition * get_attribute(const char *name)
Get an attribute, create it if it doesn't exist yet.
void add_type_to_attribute(attribute_definition *attribute, type_definition *type, int attr)
void write_type_index(void)
Write index of all types.
void copy_attributes(const type_definition *source, type_definition *type)
attribute_type * get_description_for_attribute(attribute_definition *attribute, const char *description)
Gets a type description for specified attribute, create it if doesn't exist.
void ignore_attribute(type_definition *type, const char *attribute)
Remove an attribute from the type.
void write_type_file(type_definition *type)
Write a type definition file.
static type_name type_names[]
type_definition * get_type_definition(void)
Returns a new type_definition having the default attributes.
const char * type_dir
Where the files about types will be stored.
@ BATTLEGROUND
battleground, by Andreas Vogl
@ OBJECT_TYPE_MAX
Try to find a fire/heat source to light this when applied.
@ DUPLICATOR
Duplicator/multiplier object.
void copy_default_attributes(type_definition *type)
@ MATERIAL
Material for building.
@ SKILL_TOOL
Allows the use of a skill.
if you malloc the data for the buffer
@ SHOP_INVENTORY
Mark Wedel (mark@pyramid.com) Shop inventories.
void write_attribute_file(attribute_definition *attribute)
Write the description of a field.
const char * field_dir
Where the files about the fields will be stored.
void read_type(type_definition *type, FILE *file, const char *block_end)
Read all lines related to a type, stop when "block_end" is found on a line.
Magical Runes Runes are magical inscriptions on the dungeon which cast a spell or detonate when something steps on them Flying objects don t detonate runes Beware ! Runes are invisible most of the time They are only visible occasionally ! There are several runes which are there are some special runes which may only be called with the invoke and people may apply it to read it Maybe useful for mazes ! This rune will not nor is it ordinarily invisible Partial Visibility of they ll be visible only part of the time They have a(your level/2) chance of being visible in any given round
static const char * in_living[]
Fields part of the living structure.
void write_attribute_reference(const char *attribute, FILE *file)
Write the part to the right of a @ref for the specified attribute.
const char * destination_dir
Root destination dir.
How to Install a Crossfire Server on you must install a python script engine on your computer Python is the default script engine of Crossfire You can find the python engine you have only to install them The VisualC Crossfire settings are for but you habe then to change the pathes in the VC settings Go in Settings C and Settings Link and change the optional include and libs path to the new python installation path o except the maps ! You must download a map package and install them the share folder Its must look like doubleclick on crossfire32 dsw There are projects in your libcross lib and plugin_python You need to compile all Easiest way is to select the plugin_python ReleaseLog as active this will compile all others too Then in Visual C press< F7 > to compile If you don t have an appropriate compiler you can try to get the the VC copies the crossfire32 exe in the crossfire folder and the plugin_python dll in the crossfire share plugins folder we will remove it when we get time for it o Last showing lots of weird write to the Crossfire mailing list
const flag_definition * find_flag(const char *name)
Return flag if exists, NULL else.
type_definition * default_type
Definitions all types have by default.
type_definition * fallback_type
Dummy object type that non defined objects use.
void dump_type(type_definition *type)
@ DETECTOR
peterm: detector is an object which notices the presense of another object and is triggered like butt...