diff options
author | Jesusaves <cpntb1@ymail.com> | 2018-07-15 22:41:58 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-07-15 22:41:58 -0300 |
commit | 1c7d81931e2e7b160b1ff14129efd553d7d3c710 (patch) | |
tree | 4cff9185591574dfa226f9bd1bc802c060cb57b9 /npc/functions/util.txt | |
parent | e1d2cf8b36b48ba7f66eb4724226508202f9452e (diff) | |
download | serverdata-1c7d81931e2e7b160b1ff14129efd553d7d3c710.tar.gz serverdata-1c7d81931e2e7b160b1ff14129efd553d7d3c710.tar.bz2 serverdata-1c7d81931e2e7b160b1ff14129efd553d7d3c710.tar.xz serverdata-1c7d81931e2e7b160b1ff14129efd553d7d3c710.zip |
More utils for skills. This is to make easier scripting
Diffstat (limited to 'npc/functions/util.txt')
-rw-r--r-- | npc/functions/util.txt | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt index f36ff8a4d..37764ed1b 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -274,6 +274,23 @@ function script max_subclass { // Gets subclass current degree // degree_subclass() function script degree_subclass { - return (MAGIC_LVL/2)+(MAGIC_LVL%1); + return (MAGIC_LVL/2)+(MAGIC_LVL%2); } +// Returns true if a skill can be leveled up, based on degree_subclass(). +// sk_canlvup( sk ) +function script sk_canlvup { + if (getskilllv(getarg(0)) <= degree_subclass()) + return 1; + return 0; +} + +// Level up a skill in 1 level +// sk_lvup( sk ) +function script sk_lvup { + .@lvl=getskilllv(getarg(0)); + addtoskill(getarg(0),.@lvl+1,0); + return; +} + + |