summaryrefslogtreecommitdiff
path: root/npc/magic/forget.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-07-30 15:35:20 -0300
committerJesusaves <cpntb1@ymail.com>2020-07-30 15:35:20 -0300
commit49a396f91e0978851c648cfeff90334c53faee41 (patch)
treea1f02dcd6231b3726f0ca3712dffea27777345a1 /npc/magic/forget.txt
parent784326d8574b76eb325ebec37a9f2efb5fddcc49 (diff)
downloadserverdata-49a396f91e0978851c648cfeff90334c53faee41.tar.gz
serverdata-49a396f91e0978851c648cfeff90334c53faee41.tar.bz2
serverdata-49a396f91e0978851c648cfeff90334c53faee41.tar.xz
serverdata-49a396f91e0978851c648cfeff90334c53faee41.zip
Revert a regression: Forgetful NPCs work again.
And with new rules. And I excluded Destructive magic from the NPCs.
Diffstat (limited to 'npc/magic/forget.txt')
-rw-r--r--npc/magic/forget.txt51
1 files changed, 51 insertions, 0 deletions
diff --git a/npc/magic/forget.txt b/npc/magic/forget.txt
new file mode 100644
index 000000000..0b8357fd0
--- /dev/null
+++ b/npc/magic/forget.txt
@@ -0,0 +1,51 @@
+// TMW2 script
+// Author: Jesusalva <admin@tmw2.org>
+//
+// Magic Script: Forgetful NPCs
+// Allows you to get rid of unwanted skills
+
+// ForgetfulNPC( NAME, SCHOOL )
+function script ForgetfulNPC {
+ .@n$=getarg(0);
+ .@school=getarg(1);
+ mesc l("Teaching %s your skills will make you both forget them.", .@n$), 1;
+ mesc l("Once your skill is forgotten, the Magic Skill Points used will be freed."), 1;
+ mesc l("But be careful: learning fees and research points WILL NOT be given back!"), 1;
+ do
+ {
+ next;
+ mesc l("Which skill will you FORGET permanently today?"), 1;
+ setarray .@forget$, l("Cancel"), 0;
+ freeloop(true);
+ for (.@i=0; .@i < getarraysize($@MSK_MAGIC) ; .@i++) {
+ .@sk=$@MSK_MAGIC[.@i];
+ if (getskilllv(.@sk) > 1) {
+ if ($@MSK_CLASS[.@sk] == .@school) {
+ array_push(.@forget$, getskillname(.@sk));
+ array_push(.@forget$, str(.@sk));
+ }
+ }
+ }
+ freeloop(false);
+ menuint2(".@forget$");
+ if (!@menuret)
+ close;
+ mes "";
+ mesc l("Skill @@ will be permanently lost!", getskillname(@menuret)), 1;
+ mesc l("Continue anyway?"), 1;
+ if (askyesno() == ASK_YES) {
+ .@msp=0;
+ .@lv=$@MSK_MSPCOST[@menuret]+max(0, getskilllv(@menuret)-5);
+ skill @menuret, 0, 0;
+ MAGIC_PTS-=.@lv;
+ mesc l("Skill @@ has been lost", getskillname(@menuret)), 3;
+ mesc l("You recovered @@ magic skill points", .@lv), 3;
+ } else {
+ mesn l("%s, the Forgetful", .@n$);
+ mesq l("Uh, what?");
+ }
+ } while (@menuret);
+ return;
+}
+
+