/
lib/banish/
lib/d/
lib/doc/
lib/doc/domains/
lib/doc/efun/
lib/doc/examples/
lib/doc/examples/armour/
lib/doc/examples/contain/
lib/doc/examples/food/
lib/doc/examples/magic/
lib/doc/examples/monster/
lib/doc/examples/room/
lib/doc/examples/weapons/
lib/function/
lib/include/
lib/include/fn_specs/
lib/include/skills/
lib/info/
lib/inherit/base/
lib/log/
lib/manuals/312/
lib/news/
lib/obj/party/
lib/objects/components/
lib/open/
lib/open/library/
lib/open/party/
lib/players/
lib/players/zilanthius/
lib/room/
lib/room/city/arena/
lib/room/city/creator/
lib/room/city/garden/monst/
lib/room/city/obj/
lib/room/city/shop/
lib/room/death/
lib/room/registry/
lib/secure/
lib/secure/UDP_CMD_DIR/
lib/skills/
lib/skills/fighter/
lib/skills/thief/
lib/usr/
lib/usr/creators/
lib/usr/players/
This doc is shows the functions that are available objects that inherit
"inherit/base/living". These objects include /inherit/monster,
/inherit/undead, /obj/player, and /obj/wizard.  The function specification is
given.  The term 'player', can also indicate a monster.


/* log */

void log(string file,mixed old, mixed new);
Comment: This function is used mainly internally, it automatically logs who does
the call, on who was called, time.  Not much use eccept to arches and admin who
want to log certain functions.

/* sets & queries. */

int set_level(int i);

string set_msgin(string s);
string set_msgout(string s);
Comment: msgin and msgout are the messages given when move_player() is used.
They have the format: <name> msgout <direction>; <name> msgin.

string set_mmsgin(string s);
string set_mmsgout(string s);
Comment: mmsgin and mmsgout are alternative messages when the player undergoes a
'magical' transportation. They have the format: <name> msgout; <name> msgin. It
is flagged when the direction given to move_player() is "X".


string *set_languages_known(string *arr);
Comment: This sets the languages known list in a player.
 

status set_speak_language(string str);
Comment: This sets the language currently spoken by a player.


string *set_weapon_prof(string *arr);
Comment: This sets the list that a player is proficient. Note that this has no
effect on monsters, only players.

string *set_classes(string *arr);
Comment: There are four main classes. Thief, Fighter, Mage, and Cleric. There is
also a fifth. The psionicist. It has temporarily been disabled, until a nice
system is made for it.

status set_ghost(status i);
Comment: flags that the player is a ghost.

status set_dead(status i);
Comment: flags that the player has just died.

status set_no_wimpy(status i);
Comment: Overrides wimpy and prevents monster running away.

int set_wimpy(int i);
Comment: under i hit points the player will run from a fight. Note that the exp
gained from battle is proportioned according to wimpy.


string set_custom(string s);
Comment: Run in direction 's' if wimpy. Not that if set, and that is an invalid
direction the player will fail to run away.
  

int set_hp(int i);
Comment: will set a players hit points to 'i', even if it is greater then
max_hp. (Logged)

int set_max_hp(int i);
Comment: sets the maximum hit points a player should have. (Logged)

int set_exp(int i);
Comment: sets the exp of a player. (Logged)

int set_money(int i);
Comment: sets the money of a player. (Logged)

int set_age(int i);
Comment: sets the age of a player (i == 1 per 2 seconds).

int set_alignment(int i);
Comment: sets the alignment. i > 10 is good, else tending to evil. The align
updating fn works by subtracting of the monster's alignment from 9/10 of players
alignment. (Thus to get angelic you must kill really evil monsters, but killing
a slightly evil monster could in fact make the alignment go down).

int set_gender(int i);
Comment: There are accepted values, 0 - neuter (default), 1 - male, 2 - female.

string *set_spell_immune(string *arr);


mixed *set_loaded_spell(mixed *arr);
Comment: The attributes of a spell are loaded into the player using the fn,
load_spell(). Do not use this function Unless you know what you are doing. See
spell2.doc, and spell.h for further info.


int set_magic_resist(int i);
Comment: i can be anything from 0 to 100(%). This indicates the monsters ability
to resist magical spells.


status set_npc(status i);
Comment: Used by monster.c to indicate it is not an interactive player.

int set_invis(int i);
Comment: i is the value that is compared to a players intelligence to see them.
Normally invisibility value, is equal to the players level. But it could be
based on the players spell school|sphere if it is by a spell.


int set_ac(int i);
int set_armour_class(int i);
Comment: sets the monsters armour class.  Note that recalc_ac will use this
value instead of armour values when calculating for npcs.


int set_ac_bonus(int i);
Comment: Don't use this for players. It has been put in for guild use at a later
stage.

object *set_armour_worn(object *arr);
Comment: This is a fixer fn, not in current use. Sets an array of objects that
are currently worn.

int set_right_wc(int i);
object set_right_weapon(object ob);
string set_right_weapon_type(string s);
int set_right_weapon_bonus(int i);

int set_left_wc(int i);
object set_left_weapon(object ob);
string set_left_weapon_type(string s);
int set_left_weapon_bonus(int i);
Comment: Note that the players have the potential to wield two weapons.
set_%%_wc() sets the weapon class. set_%%_weapon() sets the wielded object.
set_%%_type() sets the wielded type to use the appropriate hit messages. There
are 5 weapon types "slash", "thrust", "pierce", "crush", "cleave".  There are
two other attack message types not appropriate to weapons; "spell", and
"unarmed". The set_%%_bonus() has been put in for future guild use.


 
object set_primary_attack(object ob);
Comment: The primary attack is the main monster the player is attacking. Not for
general use. Unless you are changing the focus of an atttack, use
add_secondary_attacker(ob).

object *set_secondary_attacks(object *arr);
Comment: Not for general use. Use add_secondary_attacker(ob).


  
/*** Primary skills ***/ 
 
int set_combat(int i);
int set_dexterity(int i);
int set_intelligence(int i);
int set_wisdom(int i);
int set_charisma(int i);
int set_constitution(int i);
int set_strength(int i);

Comment: Sets the stats a a player.

/**************************************************************************/
/* query */

string query_current_room();
Comment: returns the filename of the players current environment(). Note this
will give an error is the player is logging in.

string query_real_name();
Comment: this is the same as lower case <name>.

string query_cap_name();
Comment: capitalized real name.

string query_invis_name();
Comment: returns name when a player is invisible. Equivalent to
query_alt_name().

int query_level_drained();
Comment: Returns the number of times a player has been level drained.

int query_level();
string query_msgin();
string query_msgout();
string query_mmsgin();
string query_mmsgout();

string *query_languages_known();
string *query_weapon_prof();
string *query_classes();

status query_ghost();
status query_dead();

status query_no_wimpy();
int query_wimpy();
string query_custom();
  
int query_hp();
int query_max_hp();

int query_exp();
int query_money();
int query_age();
int query_alignment();
  
status query_spell_immune(string arg);
mixed *query_loaded_spell();
void unload_spell();
int query_magic_resist();

string query_speak_language();
status query_npc();
int query_invis();

int query_ac();
int query_armour_class();
object *query_armour_worn();
int query_ac_bonus();

int query_right_wc();
object query_right_weapon();
string query_right_weapon_type();

int query_left_wc();
object query_left_weapon();
string query_left_weapon_type();

string query_attacker(); 
object query_attack();
object query_primary_attack();

object *query_secondary_attacks();
object *query_alt_attackers();


/*** Primary skills ***/ 
 
int query_combat();
int query_dexterity();
int query_intelligence();
int query_wisdom();
int query_charisma();
int query_constitution();
int query_strength();


string *query_classes();


/* gender stuff */

int query_gender();
Comment: returns 0 - neuter, 1 - male, 2 - female.

status query_neuter();
status query_male();
status query_female();
  
string query_gender_string ();
Comment: returns "male", "female", or "neuter".
    
string query_pronoun ();
Comment: returns "he", "she", or "it".  

string query_possessive ();
Comment: returns "his", "her", or "its".
  
string query_objective ();
Comment: returns "him", "her", or "it".


/**************************************************************************/
/* adj */

Adjustments move the current value by +,1 value.

int adj_level(int i);
Comment: Automatically adjusts level drained.

int adj_level_drained(int i);
Comment: No adjustment to level. Do not use this, its a mainly a fixing
function. Use drain_level(), restore_level(). (Logged)
 
int adj_wimpy(int i);
  
int adj_hp(int i);
Comment: will not adjust hip points above max hit points.

int adj_max_hp(int i);

int adj_exp(int i);
int adj_money(int i);
int adj_age(int i);

int adj_alignment(int i);
int adj_magic_resist(int i);

int adj_ac(int i);
int adj_armour_class(int i);
int adj_ac_bonus(int i);

int adj_right_wc(int i);
int adj_right_weapon_bonus(int i);
 
int adj_left_wc(int i);
int adj_left_weapon_bonus(int i);
  
/*** Primary skills ***/ 
 
int adj_combat(int i);
int adj_dexterity(int i);
int adj_intelligence(int i);
int adj_wisdom(int i);
int adj_charisma(int i);
int adj_constitution(int i);
int adj_strength(int i);

/****************************************************************************/
/* adds */  

status add_weight(int wt);

Comment: Attempts to add weight to weight value. If the player hasn't got the
strength to carry it, it returns 0.

int add_exp(int i);
int add_money(int i);
  
/****************************************************************************/
/* show age in clock time */  

string show_age(status arg);
Comment: writes the age. If the flag 'arg' is set it doesn't write the age, but
returns the string.

/***************************************************************************/
/* level draining stuff */
  
void restore_level();
Comment: restore a drained level to the player.

void drain_level();
Comment: drain a level from the player.

/***********************************************************************/
/* spell_immune array stuff */
  
status query_spell_immunity(string str);
  
void add_spell_immunity(string str);
  
void remove_spell_immunity(string str);

Comment: This is to replace query_spell_immune(), add_spell_immune(),
remove_spell_immune().  These give the monster an immunity to certain spells. So
that it is standard across the mud. The following are immunities currently in
use. Immunities: "poison", "death", "disintergration", "light", "darkness",
"draining", "earth", "air", "fire", "water", "cold", "acid", "lightning",
"disease", "time", "fear", "charm", "illusion".


/**********************************************************************/
/* languages_known array stuff */
  
status query_language(string str);
  
void add_language(string str);
  
void remove_language(string str);

Comment: These are the languages a player can speak, and understand.


/**************************************************************************/
/* weapon_prof array stuff */

status query_weapon_proficiency(string str);

void add_weapon_proficiency(string str);
  
void remove_weapon_proficiency(string str);

Comment: These functions set the weapons a player can use without penalty. These
are used by the training arenas.

/**********************************************************************/
/* classes array stuff */

status query_class(string str);
  
void add_class(string str);
  
void remove_class(string str);

Comment: classes allow the player to use various skills. These are used by the
guild rooms.
  
/************************************************************************/ 
/* secondary_attacks array stuff */

status query_secondary_attacker(object ob);

void add_secondary_attacker(object ob);
  
void remove_secondary_attacker(object ob);

Comments: when a fight starts. The opponent is added to the secondary attacks
list. The first opponent in the room is classed as the primary attacker. This is
used by the multi attack and multi opponent routines.  To start an attack
against ob call add_secondary_attacker(ob).

/************************************************************************/ 
/* armour_worn array stuff */

status query_armour(object ob);
Comment: returns 1 if ob is worn by the player.

object query_armour_type(object|string);
Comment: Accepts a string or object as argument. returns 0 if type not worn.
returns worn object.

void add_armour_worn(object ob);
Comment: adds object ob to the list of currently worn armour.  


/***************************************************************************/
/* move_player */

varargs void move_player(string dir_dest,object|string destination,status safe);
Comment: This function moves the player from one room to another. Uses msgout,
msgin, mmsgout, and mmsgin.  If safe status is set, no inventory is destructed
when making a move between domains. If destination is 0, it will scan dest_dir
for the string format "direction#destination_filename". destination can by an
object or the destination filename.

Eg.  move_player("north#room/shop")   - move north to shop
     move_player("north","room/shop") - same as above
     move_player("X#room/shop")       - move to shop magically
  
/************************************************************************/  
/* insta-kill */
  
void death();
Comment: Kill the monster instantly. Any spell, function that calls this must
show justification.

/***********************************************************************/
/* hit player */

int hit_player(int dam);
Comment: Causes damage, and starts fight only with monster. An interactive
player calling hit_player() in another player does not start a fight, but still
causes damage, and can still kill the player. See area effect spells.

/**************************************************************************/
/* stop fight */


varargs void stop_fight(object arg);
Comment: stops a fight with object arg. If arg is zero it stops the fight with
the primary attack.

/**************************************************************************/  
/* attack */  

  
void attack();
Comment: called by the heart beat to time the attack routine.

/**************************************************************************/
/* spell attacks */
 
do_spell_object
(ob, msg_me, msg_you, msg_room, sp_cost, hp_dam, immune, my_skill);
Comment: Old spell socket. DO NOT use this fn.


status load_spell(mixed *arr);


void cast_spell();
 

/* thus in process_msg(), this_object() == target, this_player() == caster */

int spell_hit(int spell_dam,
          string caster_msg,
          string target_msg,
            string room_msg,
                object prev,
               string fname,
               string immune,
              mixed type,
              status passive);
Comment: Spells are a little too complex to comment on. See spell2.doc and
spell.h.

/****************************************************************************/
/* wimpy */
  
void run_away();
Comment: called from heart beat when hit points are below wimpy. It is also used
by monsters for random move.


/****************************************************************************/
/* Externally Configurable bonuses */

int carry_bonus();

int right_wc_bonus();

int left_wc_bonus();

int ac_bonus();
Comment: Theses functions are called when the appropriate recalc fn is used.
They look for objects on the player with the id "external".  It will call the fn
query_%%_bonus() (%% carry, ac, etc) and add a bonus amount (this could be a
penalty).

Eg.

id(str) { str == "external"; }

query_ac_bonus() { return 1; }

A call to recalc_ac() will make the player have an ac bonus of 1. This for
example could be a bless spell.


/***************************************************************************/
/* carry, ac, wc calculators - these should fix problems */

void recalc_carry();

void recalc_wc();

void recalc_ac();
Comment: These functions are used by armour and weapons. They dynamically
calculate the ac, right_wc, and left_wc of the player. These are also used by
the 'fix' action.

/**************************************************************************/
  
status communicate(string str);
Comment: the 'say' action. Used by language chat of monsters.


/*************************************************************************/

void attack_msg(int dam, string type, object who, string side);
Comment: This function writes the appropriate attack message. dam is damage done
to opponent. type can be "thrust", "slash", "crush", "cleave", "spell",
"unarmed".  who is the opponent. side is "left" or "right".