 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
68 if (op->
race != NULL) {
70 if (godname != NULL) {
97 return tmp->
title != NULL ? tmp->
title :
"none";
115 return s2 != NULL && strcmp(s1, s2) == 0;
134 const char *given_by;
139 if (given_by == god->
name) {
146 "The %s crumble to dust!",
150 "The %s crumbles to dust!",
171 if (tmp->type == item->
type
174 && tmp->msg == item->
msg
218 "%s lets %s appear in your hands.",
233 const uint64_t loss = angry * (
skill->stats.exp / 10);
315 "Foul Priest! %s punishes you!",
321 "Foolish heretic! %s is livid!",
325 "Heretic! %s is angered!",
333 "A divine force pushes you off the altar.");
355 LOG(
llevError,
"BUG: remove_special_prayers(): god %s without randomitems\n", god->
name);
373 if (tr->
item == NULL)
389 "You lose knowledge of %s.",
422 && (item->type !=
SKILL)
423 && (item->type !=
FORCE)
424 && (item->type !=
SPELL)) {
448 "Fool! %s detests your kind!",
460 && tr->item->clone.invisible
462 && tr->item->clone.type !=
BOOK
463 && tr->item->clone.type !=
SPELL)
468 "You become a follower of %s!",
496 "%s's blessing is withdrawn from you.",
500 if (sk_applied || undeadified) {
542 "You are bathed in %s's aura.",
597 "You may use %s again.",
601 "You are forbidden to use %s.",
682 LOG(
llevError,
"BUG: determine_holy_arch(): no god or god without randomitems\n");
698 count =
rndm(1, count);
744 "You feel like someone is helping you.");
758 if (difficulty < 1) {
759 LOG(
llevError,
"follower_level_to_enchantments(): difficulty %d is invalid\n", difficulty);
764 return level/difficulty;
766 return (20+(
level-20)/2)/difficulty;
767 return (30+(
level-40)/4)/difficulty;
791 if (weapon->
magic < tmp) {
793 "A phosphorescent glow envelops your weapon!");
834 "%s considers your %s is not worthy to be enchanted any more.",
848 const char *divine_owner =
object_get_value(weapon,
"divine_blessing_name");
850 object *skillop = NULL;
852 if (divine_owner != NULL && strcmp(divine_owner, god->
name) != 0) {
855 "Your %s already belongs to %s !",
856 weapon->
name, divine_owner);
860 if ((owner != NULL) && (strcmp(owner, op->
name) != 0)) {
863 "The %s is not yours, and is magically protected against such changes !",
868 if (skillop == NULL) {
869 LOG(
llevError,
"god_enchants_weapon: no praying skill object found ?!\n");
870 snprintf(
buf,
sizeof(
buf),
"%d", 1);
879 if (!weapon->
title) {
880 snprintf(
buf,
sizeof(
buf),
"of %s", god->
name);
885 "Your weapon quivers as if struck!");
892 "Your %s now hungers to slay enemies of your god!",
902 "Your weapon suddenly glows!");
931 LOG(
llevError,
"BUG: god_intervention(): no god or god without randomitems\n");
940 "You feel a holy presence!");
958 "Something appears before your eyes. You catch it before it falls to the ground.");
972 && strcmp(item->
name,
"grace limit") == 0) {
990 && strcmp(item->
name,
"restore grace") == 0) {
995 "You are returned to a state of grace.");
1001 && strcmp(item->
name,
"restore hitpoints") == 0) {
1005 "A white light surrounds and heals you!");
1013 && strcmp(item->
name,
"restore spellpoints") == 0) {
1020 "A blue lightning strikes your head but doesn't hurt you!");
1026 && strcmp(item->
name,
"heal spell") == 0) {
1042 && strcmp(item->
name,
"remove curse") == 0) {
1051 && strcmp(item->
name,
"remove damnation") == 0) {
1060 && strcmp(item->
name,
"heal depletion") == 0) {
1063 "Shimmering light surrounds and restores you!");
1069 && strcmp(item->
name,
"voice_behind") == 0) {
1071 "You hear a voice from behind you, but you don't dare to "
1080 && strcmp(item->
name,
"message") == 0) {
1088 && strcmp(item->
name,
"enchant weapon") == 0) {
1103 "%s grants you use of a special prayer!",
1120 "You feel rapture.");
1147 int loss = 10000000;
1148 int angry = abs(reaction);
1152 loss = 0.05*(float)skop->
stats.
exp;
1160 "%s becomes angry and punishes you!",
1191 snprintf(
buf,
sizeof(
buf),
"of %s", god->
name);
1203 "Heretic! You are using %s!",
1225 int caster_is_spell = 0;
1228 caster_is_spell = 1;
1238 if (!caster_is_spell)
1240 "This prayer is useless unless you worship an appropriate god");
1253 if (!caster_is_spell)
1268 if (spellop->
title) {
1271 snprintf(
buf,
sizeof(
buf),
"%s of %s", spellop->
name, spellop->
title);
sstring name_pl
The plural name of the object.
object * object_get_owner(object *op)
Returns the object which this object marks as being the owner.
object * object_find_by_type_subtype(const object *who, int type, int subtype)
Find object in inventory.
struct Settings settings
Server settings.
#define MSG_TYPE_SKILL_PRAY
Praying related messages.
int16_t maxhp
Max hit points.
object * object_find_by_type_applied(const object *who, int type)
Find applied object in inventory.
uint8_t chance
Percent chance for this item.
@ llevError
Error, serious thing.
static int follower_level_to_enchantments(int level, int difficulty)
Converts a level and difficulty to a magic/enchantment value for eg weapons.
object * find_skill_by_number(object *who, int skillno)
This returns the first skill pointer of the given subtype (the one that accumulates exp,...
uint32_t path_attuned
Paths the object is attuned to.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define FLAG_UNDEAD
Monster is undead.
object * inv
Pointer to the first object in the inventory.
#define FLAG_STARTEQUIP
Object was given to player at start.
#define MSG_TYPE_SKILL
Messages related to skill use.
#define QUERY_FLAG(xyz, p)
#define FLAG_REFL_MISSILE
Arrows will reflect from object.
treasure * items
Items in this list, linked.
void do_learn_spell(object *op, object *spell, int special_prayer)
Actually makes op learn spell.
#define FLAG_SEE_IN_DARK
if set ob not effected by darkness
const char * determine_god(object *op)
Determines if op worships a god.
int8_t item_power
Power rating of the object.
struct archetype * arch
Pointer to archetype.
int absdir(int d)
Computes an absolute direction.
int16_t invisible
How much longer the object will be invis.
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,...
sstring anim_suffix
Used to determine combined animations.
treasurelist * find_treasurelist(const char *name)
Search for the given treasurelist by name.
static int worship_forbids_use(object *op, object *exp_obj, uint32_t flag, const char *string)
Forbids or let player use something item type.
#define MSG_TYPE_ATTRIBUTE
Changes to attributes (stats, resistances, etc)
@ GT_ONLY_GOOD
Don't generate bad/cursed items.
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 fix_generated_item(object *op, object *creator, int difficulty, int max_magic, int flags)
fix_generated_item(): This is called after an item is generated, in order to set it up right.
int move_player(object *op, int dir)
Move player in the given direction.
@ SKILL
Also see SKILL_TOOL (74) below.
int16_t last_grace
As last_sp, except for grace.
static void remove_special_prayers(object *op, const object *god)
Removes special prayers given by a god.
int rndm(int min, int max)
Returns a number between min and max.
sstring title
Of foo, etc.
const char * object_get_value(const object *op, const char *const key)
Get an extra value by key.
#define FLAG_APPLIED
Object is ready for use by living.
int16_t level
Level of creature or object.
#define FLAG_STEALTH
Will wake monsters with less range.
int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
Execute an event on the specified object.
@ GT_STARTEQUIP
Generated items have the FLAG_STARTEQUIP.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
#define HUGE_BUF
Used for messages - some can be quite long.
int16_t resist[NROFATTACKS]
Resistance adjustments for attacks.
const object * find_god(const char *name)
Returns a god's object from its name.
Plugin animator file specs[Config] name
void cast_magic_storm(object *op, object *tmp, int lvl)
This is really used mostly for spell fumbles and the like.
#define FLAG_ALIVE
Object can fight (or be fought)
uint32_t path_denied
Paths the object is denied access to.
uint32_t path_repelled
Paths the object is repelled from.
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
struct player * contr
Pointer to the player which control this object.
void pray_at_altar(object *pl, object *altar, object *skill)
Player prays at altar.
void esrv_remove_spell(player *pl, object *spell)
int cast_heal(object *op, object *caster, object *spell, int dir)
Heals something.
static int improve_weapon_magic(object *op, object *tr, object *weapon, object *skill)
Utility function for improving the magic on a weapon.
const object * get_rand_god(void)
Returns a random god.
int32_t last_heal
Last healed.
sstring name
If non null, name of list to use instead.
object * object_present_in_ob_by_name(int type, const char *str, const object *op)
Searches for any objects with a matching type & name variable in the inventory of the given object.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
#define FLAG_KNOWN_CURSED
The object is known to be cursed.
treasurelist represents one logical group of items to be generated together.
object clone
An object from which to do object_copy()
sstring add_string(const char *str)
This will add 'str' to the hash table.
void apply_anim_suffix(object *who, const char *suffix)
Applies a compound animation to an object.
int64_t random_roll64(int64_t min, int64_t max, const object *op, int goodbad)
This is a 64 bit version of random_roll() above.
void query_short_name(const object *op, char *buf, size_t size)
query_short_name(object) is similar to query_name(), but doesn't contain any information about object...
#define FLAG_BLIND
If set, object cannot see (visually)
#define MSG_TYPE_ITEM
Item related information.
#define AP_IGNORE_CURSE
Apply/unapply regardless of cursed/damned status.
#define FLAG_MAKE_INVIS
(Item) gives invisibility when applied
int32_t last_eat
How long since we last ate.
int become_follower(object *op, const object *new_god)
This function is called whenever a player has switched to a new god.
#define FREE_AND_COPY(sv, nv)
Release the shared string if not NULL, and make it a reference to nv.
uint8_t type
PLAYER, BULLET, etc.
#define FLAG_DAMNED
The object is very cursed.
int8_t magic
Any magical bonuses to this item.
struct archetype * item
Which item this link can be.
static int follower_has_similar_item(object *op, object *item)
Checks for any occurrence of the given 'item' in the inventory of 'op' (recursively).
#define FLAG_USE_SHIELD
Can this creature use a shield?
void object_free(object *ob, int flags)
Frees everything allocated by an object, removes it from the list of used objects,...
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
int32_t food
How much food in stomach.
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Changes experience to a player/monster.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
const char * get_god_for_race(const char *race)
Returns a string that is the name of the god that should be natively worshipped by a creature of who ...
#define FLAG_USE_WEAPON
(Monster) can wield weapons
static void follower_remove_given_items(object *pl, object *op, const object *god)
Removes from a player's inventory all items bestowed by a particular god.
int random_roll(int min, int max, const object *op, int goodbad)
Roll a random number between min and max.
sstring race
Human, goblin, dragon, etc.
int8_t facing
Object is oriented/facing that way.
static bool try_leave_cult(object *pl, object *skill, int angry)
Try to leave a cult.
struct archetype * other_arch
Pointer used for various things - mostly used for what this objects turns into or what this object cr...
treasure * next
Next treasure-item in a linked list.
#define MAX_BUF
Used for all kinds of things.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
int tailor_god_spell(object *spellop, object *caster)
Changes the attributes of cone, smite, and ball spells as needed by the code.
int16_t maxgrace
Maximum grace.
#define MSG_TYPE_ITEM_ADD
Item added to inventory.
int change_abil(object *op, object *tmp)
Permanently alters an object's stats/flags based on another object.
#define FLAG_REFL_SPELL
Spells (some) will reflect from object.
#define NDI_UNIQUE
Print immediately, don't buffer.
sstring slaying
Which race to do double damage to.
sstring name
The name of the object, obviously...
#define FLAG_USE_ARMOUR
(Monster) can wear armour/shield/helmet
#define MSG_TYPE_ITEM_REMOVE
Item removed from inv.
int16_t maxsp
Max spell points.
object * create_archetype_by_object_name(const char *name)
Creates an object given the name that appears during the game (for example, "writing pen" instead of ...
object * env
Pointer to the object which is the environment.
object * check_spell_known(object *op, const char *name)
Checks to see if player knows the spell.
int32_t last_sp
As last_heal, but for spell points.
uint8_t personalized_blessings
If 1, blessed weapons get an owner and a willpower value.
sstring skill
Name of the skill this object uses/grants.
#define MSG_TYPE_ATTRIBUTE_GOD
changing god info
static int god_enchants_weapon(object *op, const object *god, object *tr, object *skill)
God wants to enchant weapon.
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
sstring msg
If this is a book/sign/magic mouth/etc.
#define CLEAR_FLAG(xyz, p)
static int god_examines_priest(object *op, const object *god)
Checks and maybe punishes someone praying.
#define SK_SUBTRACT_SKILL_EXP
Used when removing exp.
static void god_intervention(object *op, const object *god, object *skill, object *altar)
Every once in a while the god will intervene to help the worshiper.
int apply_special(object *who, object *op, int aflags)
Apply an object.
static int god_removes_curse(object *op, int remove_damnation)
God helps player by removing curse and/or damnation.
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
static void update_priest_flag(const object *god, object *exp_ob, uint32_t flag)
If the god does/doesnt have this flag, we give/remove it from the experience object if it doesnt/does...
struct treasurelist * randomitems
Items to be generated.
archetype * get_archetype_by_type_subtype(int type, int subtype)
Retrieves an archetype by type and subtype.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
int cast_change_ability(object *op, object *caster, object *spell_ob, int dir, int silent)
Cast some stat-improving spell.
int remove_depletion(object *op, int level)
Remove depletion from op, if present, and warn player of such restorations.
#define MSG_TYPE_ITEM_CHANGE
Item has changed in some way.
archetype * determine_holy_arch(const object *god, const char *type)
Determines the archetype for holy servant and god avatar.
sstring name
More definite name, like "generate_kobold".
#define FLAG_XRAYS
X-ray vision.
living stats
Str, Con, Dex, etc.
treasure is one element in a linked list, which together consist of a complete treasure-list.
@ GT_UPDATE_INV
When object has been generated, send its information to player.
int object_set_value(object *op, const char *key, const char *value, int add_key)
Updates the key in op to value.
static int same_string(const char *s1, const char *s2)
Compares 2 strings.
#define AP_UNAPPLY
Item is to be remvoed.
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 a brief description is for a more detailed look at the skills doc file Skill remove use magic items phys no fire cold Fireborns are supposed to be fire spirits They re closely in tune with magic and are powerful and learn magic easily Being fire they are immune to fire and and vulnerable to cold They are vulnerable to ghosthit and drain because being mostly non anything which strikes directly at the spirit hits them harder race attacktype restrictions immunities prot vuln Quetzalcoatl physical no armour fire cold Quetzalcoatl s are now born knowing the spell of burning but because of their negative wisdom bonus
#define MAX_WEAPON_ITEM_POWER
Maximum item power an item can have.
void link_player_skills(object *op)
This function goes through the player inventory and sets up the last_skills[] array in the player obj...
static int god_gives_present(object *op, const object *god, treasure *tr)
God gives an item to the player.
void player_unready_range_ob(player *pl, object *ob)
Unready an object for a player.
uint32_t attacktype
Bitmask of attacks this object does.
#define FLAG_CURSED
The object is cursed.
#define MSG_TYPE_ITEM_INFO
Information related to items.
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
This calls the appropriate treasure creation function.
int8_t luck
Affects thaco and ac from time to time.
static int god_examines_item(const object *god, object *item)
God checks item the player is using.
static void stop_using_item(object *op, int type, int number)
Unapplies up to number worth of items of type type, ignoring curse status.
#define EVENT_APPLY
Object applied-unapplied.