 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
101 double att_mult, prot_mult, spec_mult;
106 att_mult = prot_mult = spec_mult = 1.0;
138 exp *= att_mult*prot_mult*spec_mult;
170 int64_t lastexp = -1, tmpexp;
174 if ((fp = fopen(
buf,
"r")) == NULL) {
175 LOG(
llevError,
"Fatal error: could not open experience table (%s)\n",
buf);
183 if ((cp = strrchr(
buf,
'\n')) != NULL)
188 while (isspace(*cp) && *cp != 0)
190 if ( *cp == 0 )
continue;
193 if (!strncasecmp(cp,
"max_level", 9)) {
195 LOG(
llevDebug,
"Got more than one max_level value from exp_table file?\n");
198 int ml = atoi(cp + 9);
199 if (ml <= 0 || ml > 10000) {
200 LOG(
llevError,
"max_level must be between 1 and 10000\n");
206 while (isdigit(*cp) && *cp != 0) {
208 LOG(
llevError,
"max_level is not set in exp_table file. Did you remember to update it?\n");
216 if (tmpexp <= lastexp) {
217 LOG(
llevError,
"Experience for level %d is lower than previous level (%" FMT64 " <= %" FMT64 ")\n", lastlevel+1, tmpexp, lastexp);
225 levels[lastlevel] = tmpexp;
230 while (isdigit(*cp) && *cp != 0)
232 while (!isdigit(*cp) && *cp != 0)
#define FLAG_USE_BOW
(Monster) can apply and fire bows
struct Settings settings
Server settings.
int16_t maxhp
Max hit points.
int16_t max_level
This is read out of exp_table.
#define FLAG_STAND_STILL
NPC will not (ever) move.
@ llevError
Error, serious thing.
#define FABS(x)
Decstations have trouble with fabs()...
int64_t new_exp(const object *ob)
Alternative way to calculate experience based on the ability of a monster.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define QUERY_FLAG(xyz, p)
#define FLAG_REFL_MISSILE
Arrows will reflect from object.
float speed
Frequency of object 'moves' relative to server tick rate.
#define FLAG_SEE_INVISIBLE
Will see invisible player.
#define FLAG_NO_MAGIC
Spells (some) can't pass this object.
int16_t resist[NROFATTACKS]
Resistance adjustments for attacks.
void dump_experience(void)
Dump the experience table, then calls exit() - useful in terms of debugging to make sure the format o...
#define FLAG_USE_RANGE
(Monster) can apply and use range items
int64_t * levels
Number of levels for which we have experience.
int16_t dam
How much damage this object does when hitting.
static const float exp_prot_mult[NROFATTACKS]
const char * confdir
Configuration files.
FILE * logfile
Used by server/daemon.c.
#define FLAG_SPLITTING
Object splits into stats.food other objs.
void fatal(enum fatal_error err)
fatal() is meant to be called whenever a fatal signal is intercepted.
#define FLAG_HITBACK
Object will hit back when hit.
#define MAX_BUF
Used for all kinds of things.
static const float exp_att_mult[NROFATTACKS]
int8_t wc
Weapon Class, lower WC increases probability of hitting.
#define FLAG_REFL_SPELL
Spells (some) will reflect from object.
#define FREE_AND_CLEAR(xyz)
Free the pointer and then set it to NULL.
object * object_find_by_type(const object *who, int type)
Find object in inventory.
#define FLAG_CAST_SPELL
(Monster) can learn and cast spells
int16_t maxsp
Max spell points.
void free_experience(void)
Frees experience-related memory.
void init_experience(void)
This loads the experience table from the exp_table file.
int8_t ac
Armor Class, lower AC increases probability of not getting hit.
int has_ability(const object *ob)
Checks whether object has innate abilities (spell/spellbook in inventory).
living stats
Str, Con, Dex, etc.
uint32_t attacktype
Bitmask of attacks this object does.
#define FLAG_USE_SCROLL
(Monster) can read scroll
@ llevDebug
Only for debugging purposes.