diff options
Diffstat (limited to 'npc')
-rw-r--r-- | npc/functions/util.txt | 7 |
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) { |