summaryrefslogtreecommitdiff
path: root/npc/functions/util.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-06-25 06:41:07 -0300
committerJesusaves <cpntb1@ymail.com>2020-06-25 06:41:07 -0300
commit79092018414d656f40734cdaab4c73698f9128aa (patch)
tree697715d9527b42407d3250803e0c2c07beff78b2 /npc/functions/util.txt
parent14a0487a49e0a0bcba13f370cba8ecfbd5577a97 (diff)
downloadserverdata-79092018414d656f40734cdaab4c73698f9128aa.tar.gz
serverdata-79092018414d656f40734cdaab4c73698f9128aa.tar.bz2
serverdata-79092018414d656f40734cdaab4c73698f9128aa.tar.xz
serverdata-79092018414d656f40734cdaab4c73698f9128aa.zip
Check if the skill is valid in learn_magic
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) {