diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-07-19 18:03:32 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-07-19 18:03:32 -0300 |
commit | acd03d6f8ce35fcd88455655756db196aa3e1ba0 (patch) | |
tree | dda88b07869dc76d87a37941d16f1ba527a42219 /npc/functions/util.txt | |
parent | 08adcd908cc10ee901f8ee77b175a466515b8e0d (diff) | |
download | serverdata-acd03d6f8ce35fcd88455655756db196aa3e1ba0.tar.gz serverdata-acd03d6f8ce35fcd88455655756db196aa3e1ba0.tar.bz2 serverdata-acd03d6f8ce35fcd88455655756db196aa3e1ba0.tar.xz serverdata-acd03d6f8ce35fcd88455655756db196aa3e1ba0.zip |
Prepare new utils for new skill point system
Diffstat (limited to 'npc/functions/util.txt')
-rw-r--r-- | npc/functions/util.txt | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 01ed71056..519c14f00 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -551,6 +551,7 @@ function script mstone { readparam(Sp) == readparam(MaxSp)); } +/* // Gets how many subclasses were actually filled // total_subclass( ) function script total_subclass { @@ -579,18 +580,22 @@ function script total_subclass { function script max_subclass { return (MAGIC_LVL/2); } - - -// Gets subclass current degree -// degree_subclass() -function script degree_subclass { - return (MAGIC_LVL/2)+(MAGIC_LVL%2); +*/ + +// Returns how many points you can use +function script sk_maxpoints { + // 2 points per magic level + .@val=(MAGIC_LVL)*2; + // 1 point per skill permit level + .@val+=getskilllv(TMW2_SKILLPERMIT); + return .@val; } -// Returns true if a skill can be leveled up, based on degree_subclass(). -// sk_canlvup( sk ) +// Returns true if a skill can be leveled up. +// Ideally, we would also check for skill max level... +// sk_canlvup( sk, {cost=1} ) function script sk_canlvup { - if (getskilllv(getarg(0)) <= degree_subclass()) + if (MAGIC_PTS+getarg(1,1) >= sk_maxpoints()) return 1; return 0; } @@ -604,15 +609,7 @@ function script sk_lvup { return; } -// Returns the intelligence cost based on skill level -// sk_intcost( sk ) -function script sk_intcost { - .@cost=(getskilllv(getarg(0))+1)*10; - if (readparam(bInt) >= .@cost) - return 1; - return 0; -} - +/* // Magic School Learning Interface // mlearn( skill, {item 1, amount 1}, {item 2, amount 2}... ) // returns false if cheater @@ -651,6 +648,7 @@ function script mlearn { return true; } +*/ // Returns a value defining your current magic control (affects success ratio, higher is better) // A value of '5' means perfect control, and a value of '0' means overwhelm. |