summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/util.txt19
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;
+}
+
+