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