[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /std/living/skills.c</h2>
This skills modules for living creates.  This deals will all the
skill interactions needed for the living objects.
<p>Written by Pinkfish
<h2>Includes</h2>
This class includes the following files /include/tune.h, /include/skills.h and /include/tasks.h<h2>Method index</h2>
<ul>
<li><a href="#add_skill_level">add_skill_level</a>(string, int, mixed)<br/>
This method adds a skill level to the specified skill to the
system.
<li><a href="#add_teach_offer">add_teach_offer</a>(object, string, int, int, int)<br/>
This method adds a teaching offer to the living object.
<li><a href="#calc_bonus">calc_bonus</a>(int, string, int)<br/>
This method calculates the bonus for the skill.
<li><a href="#flatten_it">flatten_it</a>(string)<br/>
This is used to convert a previously not only_leaf tree into an only_leaf
tree.
<li><a href="#not_there">not_there</a>(string)<br/>
This method checks to see if the skill exists in the skill array or
not.
<li><a href="#query_bonus_cache">query_bonus_cache</a>()<br/>
This method returns the current bonus cache for the living thing.
<li><a href="#query_complete_skill_branch">query_complete_skill_branch</a>(string)<br/>
This method fills out a complete skill branch, complete with ALL child skill
s.
<li><a href="#query_complete_skill_tree">query_complete_skill_tree</a>()<br/>
This method fills out a complete skill tree, complete with ALL child skills.
<li><a href="#query_skill">query_skill</a>(string)<br/>
This returns jus the skill level.
<li><a href="#query_skill_bonus">query_skill_bonus</a>(string, int)<br/>
This method returns the skill bonus for the specified skill.
<li><a href="#query_skill_successful">query_skill_successful</a>(string, int)<br/>
This method does a skill successful check.
<li><a href="#query_skills">query_skills</a>()<li><a href="#query_stat_cache">query_stat_cache</a>()<br/>
This method returns the cached values for the stats.
<li><a href="#query_teach_offer">query_teach_offer</a>()<br/>
This method returns the current list of teach offerings on the
living object.
<li><a href="#set_skills">set_skills</a>(mapping)<li><a href="#stat_modify">stat_modify</a>(int, string, int)<br/>
This method returns the skill as it should be modified by the
stats associated with it.
<li><a href="#stop_teaching_skills">stop_teaching_skills</a>(int, mixed)<br/>
The method to call when we stop teaching skills.
<li><a href="#tm_check_ok">tm_check_ok</a>(string, object)<li><a href="#totaly_zap_bonus_cache">totaly_zap_bonus_cache</a>()<br/>
This method zaps the bonus cache.
<li><a href="#totaly_zap_stat_cache">totaly_zap_stat_cache</a>()<br/>
This method zaps the stat cache.
<li><a href="#zap_stat_cache">zap_stat_cache</a>()<br/>
This method zaps the stat cache when a certain stat changes.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="add_skill_level">
add_skill_level</a><pre class="autodocfuncdef">
varargs int add_skill_level(string skill,
                            int lvl,
                            mixed exp)
</pre><dd><br />
This method adds a skill level to the specified skill to the
system.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
skill - the skill to add a level to<br />
lvl - the number of levels to add<br />
exp - the amount of exp spent on the skill<br />
<br />
<dd><b>Returns:</b>
<br />1 if the skill level was changed<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_skill">query_skill()</a> and <a href="#query_skill_bonus">query_skill_bonus()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="add_teach_offer">
add_teach_offer</a><pre class="autodocfuncdef">
void add_teach_offer(object ob,
                     string skill,
                     int num,
                     int lvl,
                     int xp)
</pre><dd><br />
This method adds a teaching offer to the living object.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
ob - the object teaching us<br />
skill - the skill they are teaching<br />
num - the number of levels they are teaching<br />
lvl - the level they are teaching us from<br />
xp - the cost of the level increase in xp
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="calc_bonus">
calc_bonus</a><pre class="autodocfuncdef">
varargs int calc_bonus(int lvl,
                       string skill,
                       int use_base_stats)
</pre><dd><br />
This method calculates the bonus for the skill.  It takes the raw
level and turns that into a bonus and then adds on the stats
modifications.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
lvl - the level to turn into bonus<br />
skill - the skill to modify the bonus of<br />
use_base_stats - use the real unmodified stats<br />
<br />
<dd><b>Returns:</b>
<br />the bonus associated with the skill
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="not_there">
not_there</a><pre class="autodocfuncdef">
int not_there(string skill)
</pre><dd><br />
This method checks to see if the skill exists in the skill array or
not.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
skill - the skill to check for non-existance<br />
<br />
<dd><b>Returns:</b>
<br />0 if it does not exist, 1 if it does
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_bonus_cache">
query_bonus_cache</a><pre class="autodocfuncdef">
mapping query_bonus_cache()
</pre><dd><br />
This method returns the current bonus cache for the living thing.
The bonus cache is where the calculated bonuses for the skills are
kept.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the bonus cache mapping
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_complete_skill_branch">
query_complete_skill_branch</a><pre class="autodocfuncdef">
mapping query_complete_skill_branch(string branch)
</pre><dd><br />
This method fills out a complete skill branch, complete with ALL child skill
s.
It saves using many call_others to check skills.<br />

<dt class="autodocfuncname"><a name="query_complete_skill_tree">
query_complete_skill_tree</a><pre class="autodocfuncdef">
mapping query_complete_skill_tree()
</pre><dd><br />
This method fills out a complete skill tree, complete with ALL child skills.
It saves using many call_others to check skills.
This also flushes the tree and updates everything.<br />

<dt class="autodocfuncname"><a name="query_skill">
query_skill</a><pre class="autodocfuncdef">
int query_skill(string skill)
</pre><dd><br />
This returns jus the skill level.  Used a lot to determine if you
can use/teach/whatever a skill.
This also uses a cache.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
skill - the skill to return the level of<br />
<br />
<dd><b>Returns:</b>
<br />the skill level
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_skill_bonus">
query_skill_bonus</a><pre class="autodocfuncdef">
varargs int query_skill_bonus(string skill,
                              int use_base_stats)
</pre><dd><br />
This method returns the skill bonus for the specified skill.
It returns the skill + all its bonsues for stats/whatever.
It first checks to see if the skill is in it's cache.   THe
real stat values are ones not modified by bonuses or temporary
values.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
skill - the skill to get the bonus for<br />
use_base_stats - tells the system not to use the real stat values<br />
<br />
<dd><b>Returns:</b>
<br />the skill bonus
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_skill_successful">
query_skill_successful</a><pre class="autodocfuncdef">
int query_skill_successful(string str,
                           int mod)
</pre><dd><br />
This method does a skill successful check.  Does this check:<br>
(bonus + mos) >= random(200)<br />
<br /><dl>
<dd><b>Parameters:</b><br />
str - the skill to check<br />
mod - the modification value<br />
<br />
<dd><b>Returns:</b>
<br />1 if the skill check is successful
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_skills">
query_skills</a><pre class="autodocfuncdef">
mapping query_skills()
</pre>
<dt class="autodocfuncname"><a name="query_stat_cache">
query_stat_cache</a><pre class="autodocfuncdef">
mapping query_stat_cache()
</pre><dd><br />
This method returns the cached values for the stats.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the caches stat values
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_teach_offer">
query_teach_offer</a><pre class="autodocfuncdef">
mapping query_teach_offer()
</pre><dd><br />
This method returns the current list of teach offerings on the
living object.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the mapping containing the teach offerings
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_skills">
set_skills</a><pre class="autodocfuncdef">
void set_skills(mapping map)
</pre>
<dt class="autodocfuncname"><a name="stat_modify">
stat_modify</a><pre class="autodocfuncdef">
varargs int stat_modify(int lvl,
                        string skill,
                        int use_base_stats)
</pre><dd><br />
This method returns the skill as it should be modified by the
stats associated with it.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
lvl - the level to modify<br />
skill - the skill the modify the bonus of<br />
use_base_stats - use the real unmodified stat values<br />
<br />
<dd><b>Returns:</b>
<br />the stat modification
<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_skill_bonus">query_skill_bonus()</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="stop_teaching_skills">
stop_teaching_skills</a><pre class="autodocfuncdef">
void stop_teaching_skills(int left,
                          mixed bing)
</pre><dd><br />
The method to call when we stop teaching skills.  THis will stop the
stuff being taught if the stop is successful, and only teach partial
amounts if we are not finished yet.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
left - the amount of time left<br />
bing - the data associated with the command
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="tm_check_ok">
tm_check_ok</a><pre class="autodocfuncdef">
int tm_check_ok(string skill,
                object exp)
</pre>
<dt class="autodocfuncname"><a name="totaly_zap_bonus_cache">
totaly_zap_bonus_cache</a><pre class="autodocfuncdef">
void totaly_zap_bonus_cache()
</pre><dd><br />
This method zaps the bonus cache.
<br />

<dt class="autodocfuncname"><a name="zap_stat_cache">
zap_stat_cache</a><pre class="autodocfuncdef">
void zap_stat_cache()
</pre><dd><br />
This method zaps the stat cache when a certain stat changes.
It calls the function stats_to_zap() on the living object to
figure out which stats have changed.<br />
<br /><dl>
<dd><b>See also:</b>
<br /><a href="std.living.stats.c.shtml#stats_to_zap">/std/living/stats->stats_to_zap()
</a><br /><br /><br /></dl>

</dl>
<h2>Protected Functions</h2>
These are functions that only objects inheriting the class can access.<p>
<dl>
<dt class="autodocfuncname"><a name="flatten_it">
flatten_it</a><pre class="autodocfuncdef">
void flatten_it(string skill)
</pre><dd><br />
This is used to convert a previously not only_leaf tree into an only_leaf
tree.
<br />

<dt class="autodocfuncname"><a name="totaly_zap_stat_cache">
totaly_zap_stat_cache</a><pre class="autodocfuncdef">
void totaly_zap_stat_cache()
</pre><dd><br />
This method zaps the stat cache.
<br />

</dl>
[an error occurred while processing this directive]

