summaryrefslogtreecommitdiff
path: root/npc/functions/util.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/util.txt')
-rw-r--r--npc/functions/util.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 2abb6c9bc..2a079436e 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -714,13 +714,18 @@ function script learn_magic {
.@ski=getarg(0);
.@learn$=l("Learning");
+ // Check if skill is valid
+ .@mlv=$@MSK_MAXLV[.@ski];
+ if (.@mlv < 1) {
+ return Exception("ERROR: The skill "+.@ski+" is not valid!");
+ }
+
// Load a few temporary variables
.@pre=$@MSK_PREREQ[.@ski];
.@it=$@MSK_ITEM[.@ski];
.@am=$@MSK_AMOUNT[.@ski];
.@msp=$@MSK_MSPCOST[.@ski];
.@ap=$@MSK_COST[.@ski];
- .@mlv=$@MSK_MAXLV[.@ski];
// Pre-requisite check
if (.@pre) {