 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
82 LOG(
llevError,
"init_skills: too many skills, increase MAX_SKILLS and rebuild server!");
121 assert(
"invalid skill!");
148 if (!
skill && !skill_tool)
213 int num_names, highest_level_skill=0, i;
219 if (!strchr(
name,
',')) {
221 skill_tools[0] = NULL;
227 ourname = strdup(
name);
229 if ((
skill_names[0] = strtok_r(ourname,
",", &lasts)) == NULL) {
231 LOG(
llevError,
"find_skill_by_name: strtok_r returned null, but strchr did not?\n");
235 skill_tools[0] = NULL;
239 while ((
skill_names[num_names] = strtok_r(NULL,
",", &lasts)) != NULL) {
246 skill_tools[num_names] = NULL;
261 for (i = 0; i<num_names; i++) {
264 if (tmp->type ==
SKILL) {
268 highest_level_skill=i;
277 skill_tools[i] = tmp;
313 object *
skill = NULL, *skill_tool = NULL;
320 if (tmp->type ==
SKILL && tmp->subtype == skillno)
326 else if (tmp->type ==
SKILL_TOOL && tmp->subtype == skillno) {
444 int success = 0, exp = 0;
461 LOG(
llevError,
"do_skill: asked for skill %s but couldn't find matching SKILL archetype.\n",
skill->skill);
468 if (
skill->anim_suffix)
471 switch (
skill->subtype) {
481 "You come to earth.");
485 "You rise into the air!.");
580 "This skill is not currently implemented.");
586 "There is no special attack for this skill.");
613 "This skill is already in effect.");
694 float base, value, lvl_mult;
728 return ((int64_t)(op_exp*0.1)+1);
737 base +=
skill->arch->clone.stats.exp;
739 if (
skill->arch->clone.level)
740 lvl_mult = (float)
skill->arch->clone.level/100.0;
745 lvl_mult = ((float)
skill->arch->clone.level*(
float)op_lvl)/((
float)
skill->level*100.0);
751 lvl_mult = (float)op_lvl/(
float)(
skill->level ?
skill->level : 1);
756 value = base*lvl_mult;
760 #ifdef SKILL_UTIL_DEBUG
763 return ((int64_t)value);
786 if (!scroll->
skill) {
787 LOG(
llevError,
"skill scroll %s does not have skill pointer set.\n", scroll->
name);
797 if (inv->type ==
SKILL && !strncasecmp(scroll->
skill, inv->skill, strlen(scroll->
skill))) {
818 LOG(
llevError,
"skill scroll %s does not have valid skill name (%s).\n", scroll->
name, scroll->
skill);
844 rv = (int)((100.0f*((
float)
a)/((
float)b))+0.5f);
865 return num == 0 ? 1 :
floor( log10( labs(num) ) ) + 1;
886 int i, num_skills_found = 0;
889 const char *search = parms;
890 bool long_format =
false;
892 if ( parms && strncmp(parms,
"-l",2) == 0 ) {
895 while ( *search && *search !=
' ' ) ++search;
896 while ( *search ==
' ' ) ++search;
899 if (tmp->type ==
SKILL) {
900 if (search && strstr(tmp->name, search) == NULL)
907 tmp->name, tmp->level,
917 tmp->name, tmp->level,
924 tmp->name, tmp->level,
936 "Your character has too many skills.\n"
937 "Something isn't right - contact the server admin");
943 if ( search && *search ) {
945 "Player skills%s: (matching '%s')", long_format ?
" (long format)":
"",search);
948 "Player skills%s:", long_format ?
" (long format)":
"");
951 if (num_skills_found > 1)
952 qsort(
skills, num_skills_found,
MAX_BUF, (
int (*)(
const void *,
const void *))strcmp);
954 for (i = 0; i < num_skills_found; i++) {
960 if (strcmp(cp,
"none") == 0)
964 "You can handle %d weapon improvements.\n"
966 "Your equipped item power is %d out of %d\n",
968 cp ? cp :
"no god at current time",
997 if (tmp->type ==
SKILL
999 && !strncasecmp(
string, tmp->skill,
MIN(strlen(
string), strlen(tmp->skill)))) {
1004 && !strncasecmp(
string, tmp->skill,
MIN(strlen(
string), strlen(tmp->skill)))) {
1011 "Unable to find skill %s",
1016 len = strlen(skop->
skill);
1023 if (len >= strlen(
string)) {
1027 while (*
string == 0x20)
1029 if (strlen(
string) == 0)
1033 #ifdef SKILL_UTIL_DEBUG
1067 object *best_skill = NULL;
1086 "Unable to find skill %s - using default unarmed skill",
1118 if (tmp->type ==
SKILL) {
1129 for (i = 0; i < last_skill; i++) {
1188 "You have no unarmed combat skills!");
1198 "Couldn't change to skill %s",
1211 LOG(
llevError,
"Player %s does not have current weapon set but flag_ready_weapon is set\n",
op->
name);
1253 }
else if (
string != NULL) {
1339 "There is nothing to attack!");
1369 if (weapon != NULL) {
1376 "You are unable to unwield %s in order to attack with %s.",
1377 weaponname,
skill->name);
1381 "You unwield your weapon in order to attack.");
1412 "You have no ready weapon to attack with!");
New face structure - this enforces the notion that data is face by face only - you can not change the...
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various what they and how they effect the player s actions Also in this section are the stat modifiers that specific classes professions bring Player and sps the current and maximum the Current and Maximum The Current Sp can go somewhat negative When Sp is negative not all spells can be and a more negative Sp makes spell casting less likey to succeed can affect Damage and how the characters as well as how often the character can attack this affects the prices when buying and selling items if this drops the player will start losing hit points wd Cleric or Dwarf sm Elf wd Fireborn ft Human ra Mage C Monk se Ninja hi Priest C Quetzalcoatl mw Swashbuckler si Thief st Viking ba Warrior or Wizard C Wraith C Class Prof Str Dex Con Wis Cha Int Pow Net Skills Enclosed are codes used for the skills above The ones in and fighting should all be pretty self explanatory For the other skills
struct Settings settings
Global settings.
uint8_t simple_exp
If true, use the simple experience system.
#define FOR_MAP_FINISH()
Finishes FOR_MAP_PREPARE().
@ SK_FIRE_MAGIC
Fire magic, unused.
object * object_find_by_type_applied(const object *who, int type)
Find applied object in inventory.
#define MSG_TYPE_ATTACK_MISS
attack didn't hit
const char * unarmed_skill
Prefered skill to use in unarmed combat.
@ llevError
Error, serious thing.
int learn_skill(object *pl, object *scroll)
Player is trying to learn a skill.
uint16_t difficulty
What level the player should be to play here.
@ SK_INSCRIPTION
Inscription.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
int use_alchemy(object *op)
Handle use_skill for alchemy-like items.
static void do_skill_attack(object *tmp, object *op, const char *string, object *skill)
We have got an appropriate opponent from either move_player_attack() or skill_attack().
#define MSG_TYPE_SKILL
Messages related to skill use.
#define QUERY_FLAG(xyz, p)
void archetypes_for_each(arch_op op)
#define AP_APPLY
Item is to be applied.
uint8_t permanent_exp_ratio
How much exp should be 'permenant' and unable to be lost.
#define MSG_TYPE_ATTACK_DID_HIT
Player hit something else.
@ SK_DET_MAGIC
Detect magic.
int16_t invisible
How much longer the object will be invis.
@ SK_DISARM_TRAPS
Disarm traps.
float speed_left
How much speed is left to spend this round.
struct mapstruct * map
Pointer to the map in which this object is present.
object * give_skill_by_name(object *op, const char *skill_name)
Given the skill name skill_name, we find the skill archetype/object, set appropriate values,...
#define AP_UNAPPLY
Item is to be remvoed.
double expmul
needed experience = (calc_exp*expmul) - means some races/classes can need less/more exp to gain level...
int write_on_item(object *pl, const char *params, object *skill)
Implement the 'inscription' skill, which checks for the required skills and marked items before runni...
uint8_t unarmed_skills[UNARMED_SKILLS_COUNT]
Table of unarmed attack skills.
@ range_none
No range selected.
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
int use_oratory(object *pl, int dir, object *skill)
Oratory skill handling.
@ SKILL
Also see SKILL_TOOL (74) below.
int singing(object *pl, int dir, object *skill)
Singing skill handling.
int skill_ident(object *pl, object *skill)
Main identification skill handling.
void fix_object(object *op)
Updates all abilities given by applied objects in the inventory of the given object.
object * object_find_by_type_and_skill(const object *who, int type, const char *skill)
Find object in inventory by type and skill.
int find_traps(object *pl, object *skill)
Checks for traps on the spaces around the player or in certain objects.
@ SK_MEDITATION
Meditation.
@ SK_SET_TRAP
Set traps, unused.
uint8_t hide
The object is hidden, not invisible.
object * find_skill_by_number(object *who, int skillno)
This returns the first skill pointer of the given subtype (the one that accumulates exp,...
sstring skill_messages[MAX_SKILLS]
Will contain the message for the skills, initialized by init_skill().
#define FLAG_CAN_ROLL
Object can be rolled.
int16_t level
Level of creature or object.
static int digits_in_long(int64_t num)
Gives the number of digits that ld will print for a long int.
#define MSG_TYPE_VICTIM
Something bad is happening to the player.
static int free_skill_index()
Plugin animator file specs[Config] name
@ SK_EARTH_MAGIC
Earth magic, unused.
#define FLAG_ALIVE
Object can fight (or be fought)
int16_t y
Position in the map for this object.
static event_registration m
const char * skill_names[MAX_SKILLS]
Will contain a number-name mapping for skills, initialized by init_skills().
#define FLAG_FREED
Object is in the list of free objects.
void object_update(object *op, int action)
object_update() updates the array which represents the map.
struct player * contr
Pointer to the player which control this object.
#define FLAG_READY_SKILL
(Monster or Player) has a skill readied
object * chosen_skill
The skill chosen to use.
int pick_lock(object *pl, int dir, object *skill)
Lock pick handling.
uint8_t subtype
Subtype of object.
@ SK_HARVESTING
Harvesting.
int change_skill(object *who, object *new_skill, int flag)
This changes the object's skill to new_skill.
sstring add_refcount(sstring str)
Like add_string(), but the string is already a shared string.
@ SK_TWO_HANDED_WEAPON
Two handed weapons.
const char * determine_god(object *op)
Determines if op worships a god.
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
#define FLAG_UNPAID
Object hasn't been paid for yet.
static void attack_hth(object *pl, int dir, const char *string, object *skill)
This handles all hand-to-hand attacks.
static int clipped_percent(int64_t a, int64_t b)
Gives a percentage clipped to 0% -> 100% of a/b.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
int shop_describe(const object *op)
Give the player a description of the shop on their current map.
object * ranges[range_size]
Object for each range.
int remove_trap(object *op, object *skill)
This skill will disarm any previously discovered trap.
@ SK_DET_CURSE
Detect curse.
object clone
An object from which to do object_copy()
sstring add_string(const char *str)
Share a string.
void apply_anim_suffix(object *who, const char *suffix)
Applies a compound animation to an object.
#define FLAG_CAN_USE_SKILL
The monster can use skills.
int do_skill(object *op, object *part, object *skill, int dir, const char *string)
Main skills use function-similar in scope to cast_spell().
const Face * skill_faces[MAX_SKILLS]
Will contain the face numbers for the skills, initialized by init_skill().
const Face * face
Face with colors.
int exp_level(int64_t exp)
Returns the level for a given exp.
#define MSG_TYPE_ATTACK
Attack related messages.
uint32_t tmp_invis
Will invis go away when we attack?
uint8_t type
PLAYER, BULLET, etc.
int8_t magic
Any magical bonuses to this item.
#define GET_MAP_MOVE_BLOCK(M, X, Y)
Gets the blocking state of a square.
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
int16_t item_power
Total item power of objects equipped.
#define MSG_TYPE_SKILL_MISSING
Don't have the skill.
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Changes experience to a player/monster.
rangetype
What range is currently selected by the player.
@ SK_BARGAINING
Bargaining.
int64_t level_exp(int level, double expmul)
Returns how much experience is needed for a player to become the given level.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
rangetype shoottype
Which range-attack is being used by player.
int pray(object *pl, object *skill)
Praying skill handling.
#define P_OUT_OF_MAP
This space is outside the map.
@ SK_AIR_MAGIC
Air magic, unused.
void skill_attack(object *tmp, object *pl, int dir, const char *string, object *skill)
Core routine for use when we attack using a skills system.
static void do_each_skill(archetype *at)
#define MAX_SKILLS
This is the maximum number of skills the game may handle.
#define MSG_TYPE_VICTIM_WAS_HIT
Player was hit by something.
int skill_throw(object *op, object *part, int dir, object *skill)
Throwing skill handling.
int get_skill_client_code(const char *skill_name)
Return the code of the skill for a client, the index in the skill_names array.
void clear_skill(object *who)
This function just clears the chosen_skill and range_skill values in the player.
int random_roll(int min, int max, const object *op, int goodbad)
Roll a random number between min and max.
int8_t facing
Object is oriented/facing that way.
static void attack_melee_weapon(object *op, int dir, const char *string, object *skill)
This handles melee weapon attacks -b.t.
void fatal(enum fatal_error err)
fatal() is meant to be called whenever a fatal signal is intercepted.
#define MAX_BUF
Used for all kinds of things.
static object * find_best_player_hth_skill(object *op)
Finds the best unarmed skill the player has, and returns it.
static object * adjust_skill_tool(object *who, object *skill, object *skill_tool)
This returns specified skill if it can be used, potentially using tool to help.
object * current_weapon
Pointer to the weapon currently used.
@ SK_FLAME_TOUCH
Flame-touch.
@ SK_LEVITATION
Levitation.
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
Constructs a loop iterating over all objects of a map tile.
#define PERM_EXP(exptotal)
Convert saved total experience into permanent experience.
@ SK_LOCKPICKING
Lockpicking.
#define P_IS_ALIVE
Something alive is on this space.
#define MSG_TYPE_SKILL_ERROR
Doing something wrong.
#define NDI_UNIQUE
Print immediately, don't buffer.
#define FLAG_READY_WEAPON
(Monster or Player) has a weapon readied
sstring name
The name of the object, obviously...
#define MSG_TYPE_SKILL_FAILURE
Failure in using skill.
bool do_skill_cb(player *pl, void *data)
int use_skill(object *op, const char *string)
Similar to invoke command, it executes the skill in the direction that the user is facing.
int is_dragon_pl(const object *op)
Checks if player is a dragon.
int get_learn_spell(int stat)
#define MSG_TYPE_SKILL_LIST
List of skills.
@ SK_WRAITH_FEED
Wraith feed.
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
This rolls up wall, blocks_magic, blocks_view, etc, all into one function that just returns a P_.
#define AP_NOPRINT
Don't print messages - caller will do that may be some that still print.
const typedef char * sstring
Magical Runes Runes are magical inscriptions on the dungeon floor
sstring skill
Name of the skill this object uses/grants.
#define FLAG_APPLIED
Object is ready for use by living.
sstring msg
If this is a book/sign/magic mouth/etc.
@ SKILL_TOOL
Allows the use of a skill.
@ SK_MISSILE_WEAPON
Missile weapon.
#define CLEAR_FLAG(xyz, p)
void do_harvest(object *pl, int dir, object *skill)
Player is trying to harvest something.
#define SK_SUBTRACT_SKILL_EXP
Used when removing exp.
int apply_special(object *who, object *op, int aflags)
Apply an object.
@ SK_ONE_HANDED_WEAPON
One handed weapon.
void show_skills(object *op, const char *parms)
Displays a player's skill list, and some other non skill related info (god, max weapon improvements,...
#define UP_OBJ_FACE
Only thing that changed was the face.
partylist * party
Party this player is part of.
void meditate(object *pl, object *skill)
Meditation skill handling.
int steal(object *op, int dir, object *skill)
Main stealing function.
====Textual A command containing textual data has data fields separated by one ASCII space character. word::A sequence of ASCII characters that does not contain the space or nul character. This is to distinguish it from the _string_, which may contain space characters. Not to be confused with a machine word. int::A _word_ containing the textual representation of an integer. Not to be confused with any of the binary integers in the following section. Otherwise known as the "string value of integer data". Must be parsed, e.g. using `atoi()` to get the actual integer value. string::A sequence of ASCII characters. This must only appear at the end of a command, since spaces are used to separate fields of a textual message.=====Binary All multi-byte integers are transmitted in network byte order(MSB first). int8::1-byte(8-bit) integer int16::2-byte(16-bit) integer int32::4-byte(32-bit) integer lstring::A length-prefixed string, which consists of an `int8` followed by that many bytes of the actual string. This is used to transmit a string(that may contain spaces) in the middle of binary data. l2string::Like _lstring_, but is prefixed with an `int16` to support longer strings Implementation Notes ~~~~~~~~~~~~~~~~~~~~ - Typical implementations read two bytes to determine the length of the subsequent read for the actual message, then read and parse the data from each message according to the commands described below. To send a message, the sender builds the message in a buffer, counts the length of the message, sends the length, and finally sends the actual message. TIP:Incorrectly transmitting or receiving the `length` field can lead to apparent "no response" issues as the client or server blocks to read the entire length of the message. - Since the protocol is highly interactive, it may be useful to set `TCP_NODELAY` on both the client and server. - If you are using a language with a buffered output stream, remember to flush the stream after a complete message. - If the connection is lost(which will also happen if the output buffer overflowing), the player is saved and the server cleans up. This does open up some abuses, but there is no perfect solution here. - The server only reads data from the socket if the player has an action. This isn 't really good, since many of the commands below might not be actual commands for the player. The alternative is to look at the data, and if it is a player command and there isn 't time, store it away to be processed later. But this increases complexity, in that the server must start buffering the commands. Fortunately, for now, there are few such client commands. Commands -------- In the documentation below, `S->C` represents a message to the client from the server, and `C->S` represents a message to the server from the client. Commands are documented in a brief format like:C->S:version< csval >[scval[vinfo]] Fields are enclosed like `< this >`. Optional fields are denoted like `[this]`. Spaces that appear in the command are literal, i.e. the<< _version > > command above uses spaces to separate its fields, but the command below does not:C->S:accountlogin< name >< password > As described in<< _messages > >, if a command contains data, then the command is separated from the data by a literal space. Many of the commands below refer to 'object tags'. Whenever the server creates an object, it creates a unique tag for that object(starting at 1 when the server is first run, and ever increasing.) Tags are unique, but are not consistent between runs. Thus, the client can not store tags when it exits and hope to re-use them when it joins the server at a later time - tags are only valid for the current connection. The protocol commands are broken into various sections which based somewhat on what the commands are for(ie, item related commands, map commands, image commands, etc.) In this way, all the commands related to similar functionality is in the same place. Initialization ~~~~~~~~~~~~~~ version ^^^^^^^ C->S:version< csval >[scval[vinfo]] S->C:version< csval >[scval[vinfo]] Used by the client and server to exchange which version of the Crossfire protocol they understand. Neither send this in response to the other - they should both send this shortly after a connection is established. csval::int, version level of C->S communications scval::int, version level of S->C communications vinfo::string, that is purely for informative that general client/server info(ie, javaclient, x11client, winclient, sinix server, etc). It is purely of interest of server admins who can see what type of clients people are using.=====Version ID If a new command is added to the protocol in the C->S direction, then the version number in csval will get increased. Likewise, the same is true for the scval. The version are currently integers, in the form ABCD. A=1, and will likely for quite a while. This will only really change if needed from rollover of B. B represents major protocol changes - if B mismatches, the clients will be totally unusable. Such an example would be change of map or item sending commands(either new commands or new format.) C represents more minor but still significant changes - clients might still work together, but some features that used to work may now fail due to the mismatch. An example may be a change in the meaning of some field in some command - providing the field is the same size, it still should be decoded properly, but the meaning won 't be processed properly. D represents very minor changes or new commands. Things should work no worse if D does not match, however if they do match, some new features might be included. An example of the would be the C->S mark command to mark items. Server not understanding this just means that the server can not process it, and will ignore it.=====Handling As far as the client is concerned, its _scval_ must be at least equal to the server, and its _csval_ should not be newer than the server. The server does not care about the version command it receives right now - all it currently does is log mismatches. In theory, the server should keep track of what the client has, and adjust the commands it sends respectively in the S->C direction. The server is resilant enough that it won 't crash with a version mismatch(however, client may end up sending commands that the server just ignores). It is really up to the client to enforce versioning and quit if the versions don 't match. NOTE:Since all packets have the length as the first 2 bytes, all that either the client or server needs to be able to do is look at the first string and see if it understands it. If not, it knows how many bytes it can skip. As such, exact version matches should not be necessary for proper operation - however, both the client and server needs to be coded to handle such cases.=====History _scval_ and _vinfo_ were added in version 1020. Before then, there was only one version sent in the version command. NOTE:For the most part, this has been obsoleted by the setup command which always return status and whether it understood the command or not. However there are still some cases where using this versioning is useful - an example it the addition of the requestinfo/replyinfo commands - the client wants to wait for acknowledge of all the replyinfo commands it has issued before sending the addme command. However, if the server doesn 't understand these options, the client will never get a response. With the versioning, the client can look at the version and know if it should wait for a response or if the server will never send back. setup ^^^^^ C->S, S->C:setup< option1 >< value1 >< option2 >< value2 > ... Sent by the client to request protocol option changes. This can be at any point during the life of a connection, but usually sent at least once right after the<< _version > > command. The server responds with a message in the same format confirming what configuration options were set. The server only sends a setup command in response to one from the client. The sc_version should be updated in the server if commands have been obsoleted such that old clients may not be able to play. option::word, name of configuration option value::word, value of configuration option. May need further parsing according to the setup options below=====Setup Options There are really 2 set of setup commands here:. Those that control preferences of the client(how big is the map, what faceset to use, etc). . Those that describe capabilities of the client(client supports this protocol command or that) .Setup Options[options="autowidth,header"]|===========================|Command|Description|beat|Ask the server to enable heartbeat support. When heartbeat is enabled, the client must send the server a command every three seconds. If no commands need to be sent, use the `beat` no-op command. Clients that do not contact the server within the interval are assumed to have a temporary connection failure.|bot(0/1 value)|If set to 1, the client will not be considered a player when updating information to the metaserver. This is to avoid having a server with many bots appear more crowded than others.|darkness(0/1 value)|If set to 1(default), the server will send darkness information in the map protocol commands. If 0, the server will not include darkness, thus saving a minor amount of bandwidth. Since the client is free to ignore the darkness information, this does not allow the client to cheat. In the case of the old 'map' protocol command, turning darkness off will result in the masking faces not getting sent to the client.|extended_stats(0/1 value)|If set to 1, the server will send the CS_STAT_RACE_xxx and CS_STAT_BASE_xxx values too, so the client can display various status related to statistics. Default is 0.|facecache(0/1)|Determines if the client is caching images(1) or wants the images sent to it without caching them(0). Default is 0. This replaces the setfacemode command.|faceset(8 bit)|Faceset the client wishes to use. If the faceset is not valid, the server returns the faceset the client will be using(default 0).|loginmethod(8 bit)|Client sends this to server to note login support. This is basically used as a subset of the csversion/scversion to find out what level of login support the server and client support. Current defined values:0:no advanced support - only legacy login method 1:account based login(described more below) 2:new character creation support This list may grow - for example, advanced character creation could become a feature.|map2cmd:(1)|This indicates client support for the map2 protocol command. See the map2 protocol details above for the main differences. Obsolete:This is the only supported mode now, but many clients use it as a sanity check for protocol versions, so the server still replies. It doesn 't do anything with the data|mapsize(int x) X(int y)|Sets the map size to x X y. Note the spaces here are only for clarity - there should be no spaces when actually sent(it should be 11x11 or 25x25). The default map size unless changed is 11x11. The minimum map size the server will allow is 9x9(no technical reason this could be smaller, but I don 't think the game would be smaller). The maximum map size supported in the current protocol is 63x63. However, each server can have its maximum map size sent to most any value. If the client sends an invalid mapsize command or a mapsize of 0x0, the server will respond with a mapsize that is the maximum size the server supports. Thus, if the client wants to know the maximum map size, it can just do a 'mapsize 0x0' or 'mapsize' and it will get the maximum size back. The server will constrain the provided mapsize x &y to the configured minumum and maximums. For example, if the maximum map size is 25x25, the minimum map size is 9x9, and the client sends a 31x7 mapsize request, the mapsize will be set to 25x9 and the server will send back a mapsize 25x9 setup command. When the values are valid, the server will send back a mapsize XxY setup command. Note that this is from its parsed values, so it may not match stringwise with what the client sent, but will match 0 wise. For example, the client may send a 'mapsize 025X025' command, in which case the server will respond with a 'mapsize 25x25' command - the data is functionally the same. The server will send an updated map view when this command is sent.|notifications(int value)|Value indicating what notifications the client accepts. It is incremental, a value means "all notifications till this level". The following levels are supported:1:quest-related notifications("addquest" and "updquest") 2:knowledge-related notifications("addknowledge") 3:character status flags(overloaded, blind,...)|num_look_objects(int value)|The maximum number of objects shown in the ground view. If more objects are present, fake objects are created for selecting the previous/next group of items. Defaults to 50 if not set. The server may adjust the given value to a suitable one data
void * repeat_func_data
Arguments to pass into repeat_func.
int64_t calc_skill_exp(const object *who, const object *op, const object *skill)
Calculates amount of experience can be gained for successful use of a skill.
void init_skills(void)
This just sets up the skill_names table above.
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
@ SK_THAUMATURGY
Thaumaturgy.
#define OB_TYPE_MOVE_BLOCK(ob1, type)
Basic macro to see if if ob1 can not move onto a space based on the 'type' move_block parameter Add c...
living stats
Str, Con, Dex, etc.
#define MSG_TYPE_SKILL_SUCCESS
Successfully used skill.
int attack_ob(object *op, object *hitter)
Simple wrapper for attack_ob_simple(), will use hitter's values.
@ SK_FIND_TRAPS
Find traps.
void player_start_repeat(player *pl, const char *action, repeat_cb cb)
Start repeating an action.
@ SK_USE_MAGIC_ITEM
Use magic item.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
void link_player_skills(object *op)
This function goes through the player inventory and sets up the last_skills[] array in the player obj...
object * find_skill_by_name(object *who, const char *name)
This returns the skill pointer of the given name (the one that accumulates exp, has the level,...
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
@ SK_WATER_MAGIC
Water magic, unused.
@ llevDebug
Only for debugging purposes.
int jump(object *pl, int dir, object *skill)
Jump skill handling.