summaryrefslogtreecommitdiff
path: root/npc/functions/magic.txt
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2009-06-16 19:07:28 +0000
committerFate <fate-tmw@googlemail.com>2009-06-16 19:07:28 +0000
commit14bce66d32c572f69718f3bfe25eb16213705e50 (patch)
tree96e7256cbbf73b4cf79473ee0775fa72b4b77b3c /npc/functions/magic.txt
parent019faa40cd140261846320d1741f3872b8d36e81 (diff)
downloadserverdata-14bce66d32c572f69718f3bfe25eb16213705e50.tar.gz
serverdata-14bce66d32c572f69718f3bfe25eb16213705e50.tar.bz2
serverdata-14bce66d32c572f69718f3bfe25eb16213705e50.tar.xz
serverdata-14bce66d32c572f69718f3bfe25eb16213705e50.zip
Added SkillUp function and used it whenever we magic-skill-up
Diffstat (limited to 'npc/functions/magic.txt')
-rw-r--r--npc/functions/magic.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/npc/functions/magic.txt b/npc/functions/magic.txt
index 0094e94a..2bf8ef64 100644
--- a/npc/functions/magic.txt
+++ b/npc/functions/magic.txt
@@ -136,3 +136,28 @@ L_Q_post_imp:
set @c, @choice_idx[@menu];
return @c;
}
+
+
+// ------------------------------------------------------------
+// Level up a skill
+// @SUP_id skill ID to level up
+// @SUP_lvl skill level to attain
+// @SUP_name$ name of the skill to level up
+// @SUP_xp # of experience points to award if the level up succeeds
+// ------------------------------------------------------------
+function script SkillUp {
+ if (getskilllv(@SUP_id) >= @SUP_lvl)
+ goto L_shortcut;
+
+ misceffect sfx_skillup, strcharinfo(0);
+ setskill @SUP_id, @SUP_lvl;
+ getexp @SUP_xp, 0;
+ if (@SUP_xp)
+ mes "[" + @SUP_xp + " experience points]";
+ mes "[Level " + @SUP_lvl + " in " + @SUP_name$ + "]";
+ return;
+
+L_shortcut:
+ mes "[You already have level " + getskilllv(@SUP_id) + " in " + @SUP_name$ + "]";
+ return;
+}