summaryrefslogtreecommitdiff
path: root/npc/magic/forget.txt
diff options
context:
space:
mode:
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;
+}
+
+