summaryrefslogtreecommitdiff
path: root/npc/magic/config.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/magic/config.txt')
-rw-r--r--npc/magic/config.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/npc/magic/config.txt b/npc/magic/config.txt
index 229c0521..ddbbf99d 100644
--- a/npc/magic/config.txt
+++ b/npc/magic/config.txt
@@ -369,6 +369,23 @@ function script isfocused {
return (FOCUSING & .@f);
}
+// mcharge(item, school, charges) {inheirs = @skillId}
+function script mcharge {
+ .@it=getarg(0);
+ .@sc=getarg(1);
+ .@cr=getarg(2, 0);
+ if (@MCHARGE[@skillId] < 1) {
+ delitem .@it, 1;
+ @MCHARGE[@skillId] = .@cr+getskilllv(SKILL_MAGIC)+getskilllv(.@cr);
+ // Low supply warning
+ if (countitem(.@it) <= 3)
+ dispbottom col(b(l("Warning, %d remaining: %s",
+ 3, getitemname(.@it))), 1);
+ }
+ @MCHARGE[@skillId]-=1;
+ return;
+}
+
- script Magic Load NPC_HIDDEN,{
OnInit:
end;