Daemon skill_d

Documentation for the daemons-skill_d daemon in /daemons/skill_d.c.

Module Information

This daemon keeps track of valid skills, registers new skills, and removes unwanted skills. It also creates percentages for skills, calculates skill ranks for players and monsters (Wait, skill ranks for monsters? Yes, you can use the skills command to see which skills your monsters have.)

A couple of useful commands:

  • Dump current skills to config file: @SKILL_D->dump_skills_to_file()

  • Load skills from config file: @SKILL_D->init_skills()

This might eventually get an admtool interface.

Functions

string *register_skill(string skill)

Register a new skill with the daemon. This function needs the Mudlib:daemons privilege. Example:

register_skill(“combat/melee/grenade”);

string *remove_skill(string skill)

Removes a skill from the daemon. This function needs the Mudlib:daemons privilege. Example:

remove_skill(“combat/melee/grenade”);

string *query_skills()

Returns a string array of all the skills in the daemon.

int valid_skill(string s)

Check if argument is a valid skill or not.

int pts_for_rank(int rank)

Returns the skill points needed to achieve a specific rank. This is the reverse of the skill_title_from_pts(int skill_pts) method.

int skill_title_from_pts(int skill_pts)

Returns which skill rank you should have if you have skill_pts number of points in your skill. This is the reverse of the pts_for_rank(int rank) method.

int rank_name_from_pts(int skill_pts)

Returns the rank from a given set of skill_pts. This function is similar to the skill_title_from_pts method.

int skill_rank(object player, string skill_name)

Returns the skill rank for a player of a specific skill.

mixed titles()

Returns the titles of all the ranks.

mixed ranks()

Returns the ranks (thresholds) of skill points you have to hit to gain a new skill rank.

string skill_req_pretty(string skill_name, int rank)

Returns a string that clearly communicates a skill name and a rank in the current rank scheme defined in <config/skills.h>.

@SKILL_D->skill_req_pretty(“/combat/sword”,12) –> “Sword [XII]”

This is used in M_DAMAGE_SOURCE to tell players about skill restrictions to weapons.

string skill_rank_pretty(object player, string skill_name)

Returns a string that clearly communicates a skill name and a rank in the current rank scheme defined in <config/skills.h>.

@SKILL_D->skill_rank_pretty(.me,”combat/melee/blade”)–> “Blade [2]”

string monster_skill_rank_pretty(object mob, string skill_name)

Same as skill_rank_pretty() but for monsters.

string skill_rank_simple(object player, string skill_name)

Returns a simplestring that clearly communicates a skill name and a rank. This is default output for screen readers.

void init_skills()

Load /data/config/skill-tree as new skill configuration.

void dump_skills_to_file()

Dump all skills to /data/config/skill-tree.

int percent_for_next_rank(object player, string skill_name)

Returns the percent until the player hits the next skill rank.

int monster_percent_for_next_rank(object mob, string skill_name)

Returns the percent until the monster hits the next skill rank.

File generated by Lima 1.1a4 reStructured Text daemon.