summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2009-01-09 16:01:13 -0700
committerFate <fate-tmw@googlemail.com>2009-01-09 16:01:13 -0700
commit072189e7036fa29d9849b992ce2f4a55c63cc066 (patch)
treeb7cc451f90cbdc85694783d4a9e28d9aeb9fc49d
parentb2ec357e68a1b2e692f1c1081c4cc4f11682576a (diff)
downloadserverdata-072189e7036fa29d9849b992ce2f4a55c63cc066.tar.gz
serverdata-072189e7036fa29d9849b992ce2f4a55c63cc066.tar.bz2
serverdata-072189e7036fa29d9849b992ce2f4a55c63cc066.tar.xz
serverdata-072189e7036fa29d9849b992ce2f4a55c63cc066.zip
Finished first pass of magic quest scripting
-rw-r--r--conf/magic.conf44
-rw-r--r--db/const.txt3
-rw-r--r--npc/001-1_Tulimshar/bard.txt77
-rw-r--r--npc/001-1_Tulimshar/elanore.txt119
-rw-r--r--npc/005-1_Snake_desert/_import.txt2
-rw-r--r--npc/005-1_Snake_desert/spirit.txt303
-rw-r--r--npc/005-1_Snake_desert/tree.txt32
-rw-r--r--npc/009-2_Hurnscald/misc.txt49
-rw-r--r--npc/009-2_Hurnscald/wyara.txt135
-rw-r--r--npc/009-3_Cave_beneath_Hurnscald/sword.txt63
-rw-r--r--npc/011-1_Woodland/alchemist.txt72
-rw-r--r--npc/011-1_Woodland/auldsbel.txt309
-rw-r--r--npc/013-1_Woodland_hills/sagatha.txt317
-rw-r--r--npc/013-2_Magic_house/wizard.txt68
-rw-r--r--npc/015-1_Woodland/sword.txt99
-rw-r--r--npc/functions/magic.txt120
16 files changed, 1441 insertions, 371 deletions
diff --git a/conf/magic.conf b/conf/magic.conf
index 83fe031d..a46055b5 100644
--- a/conf/magic.conf
+++ b/conf/magic.conf
@@ -23,6 +23,7 @@ CONST ELT_GHOST = 8
CONST ELT_UNDEAD = 9
# Schools of magic
+CONST SC_HIDE = 194
CONST SC_HALT_REGENERATE = 195
CONST SC_FLYING_BACKPACK = 196
CONST SC_MBARRIER = 197
@@ -65,11 +66,12 @@ PROCEDURE set_var(name, mask, shift, value) =
PROCEDURE gain_heal_xp(value, gain) = # `gain' influences the likelihood of an increase
last_heal_xp = (script_int(caster, SCRIPT_XP) >> SCRIPT_HEALSPELL_SHIFT) & SCRIPT_HEALSPELL_MASK;
IF (target <> caster
- && value > (20 + last_heal_xp + random(last_heal_xp + 1) + random(last_heal_xp + 1))) (
+ && value > (20 + last_heal_xp + random(last_heal_xp + 1) + random(last_heal_xp + 1)))
+ THEN (
heal_xp = last_heal_xp + gain;
IF (heal_xp > SCRIPT_HEALSPELL_MASK)
- heal_xp = SCRIPT_HEALSPELL_MASK;
- set_var(SCRIPT_XP, SCRIPT_HEALSPELL_MASK, SCRIPT_HEALSPELL_SHIFT, heal_xp);
+ THEN heal_xp = SCRIPT_HEALSPELL_MASK;
+ CALL set_var(SCRIPT_XP, SCRIPT_HEALSPELL_MASK, SCRIPT_HEALSPELL_SHIFT, heal_xp);
)
PROCEDURE gain_xp(gain) =
@@ -162,6 +164,9 @@ PROCEDURE elt_damage(target, damage, dmgplus, bonus_elt, malus_elt, effect) =
PROCEDURE melee_damage(target, damage, dmgplus) =
CALL attack_check(target);
d = damage + random(dmgplus);
+ evade = level(target) + mdef(target);
+ IF (spellpower - random(100) < evade)
+ THEN d = 0;
injure(caster, target, d, 0);
@@ -324,7 +329,7 @@ SPELL make-arrows : "#T10" =
COMPONENTS ["RawLog"])
=> EFFECT CALL adjust_spellpower(school);
CALL default_effect();
- CALL create_item("Arrow", 1 + spellpower / 40 + (random(max(1, 800 - spellpower)) / 80), "WarpedLog", 250);
+ CALL create_item("Arrow", 1 + spellpower / 40 + (random(max(1, 800 - spellpower)) / 80), "WarpedLog", 500);
CALL gain_xp(1);
SPELL make-shirt : "#T11" =
@@ -336,7 +341,7 @@ SPELL make-shirt : "#T11" =
COMPONENTS [5 * "CottonCloth"])
=> EFFECT CALL adjust_spellpower(school);
CALL default_effect();
- CALL create_item("CottonShirt", 1, "CottonCloth", 400);
+ CALL create_item("CottonShirt", 1, "CottonCloth", 425);
CALL gain_xp(2);
SPELL make-tanktop : "#T12" =
@@ -348,7 +353,7 @@ SPELL make-tanktop : "#T12" =
COMPONENTS [4 * "CottonCloth"])
=> EFFECT CALL adjust_spellpower(school);
CALL default_effect();
- CALL create_item("WhiteTankTop", 1, "CottonCloth", 500);
+ CALL create_item("WhiteTankTop", 1, "CottonCloth", 350);
CALL gain_xp(2);
SPELL make-short-tanktop : "#T13" =
@@ -360,7 +365,7 @@ SPELL make-short-tanktop : "#T13" =
COMPONENTS [3 * "CottonCloth"])
=> EFFECT CALL adjust_spellpower(school);
CALL default_effect();
- CALL create_item("WhiteShortTankTop", 1, "CottonCloth", 550);
+ CALL create_item("WhiteShortTankTop", 1, "CottonCloth", 250);
CALL gain_xp(2);
SPELL make-iron-powder : "#T14" =
@@ -562,8 +567,9 @@ LOCAL SPELL rain : "#N13" =
CALL gain_xp(1);
range = min(MAX_RAIN_SPELL_RADIUS, 3 + spellpower / 30);
area = rbox(location(caster), range);
- IF (is_in(location(npc("#DruidTree0#_M", area)))
- || is_in(location(npc("#DruidTree1#_M", area)))) {
+ IF (is_in(location(npc("#DruidTree0#_M")), area)
+ || is_in(location(npc("#DruidTree1#_M")), area))
+ THEN {
set @flag, 1;
callfunc "QuestTreeTrigger";
};
@@ -632,7 +638,8 @@ SPELL detect-players : "#G10" =
CALL default_effect();
message = "";
FOREACH PC target IN rbox(location(caster), spellpower / 2)
- DO IF target <> caster
+ DO IF ((target <> caster)
+ && not (running_status_update(pc(target), SC_HIDE)))
THEN (IF message <> ""
THEN message = message + ", ";
message = message + name_of (target);
@@ -707,6 +714,20 @@ SPELL sense-spouse : "#G13" =
ELSE message(caster, "You sense " + name + " in the " + dir + ".");
)
+SPELL hide (target : PC) : "#A13" =
+ LET level = 1
+ school = ASTRAL
+ IN (MANA 11, CASTTIME 1000,
+ REQUIRE skill(caster, MAGIC) > level,
+ REQUIRE skill(caster, school) > level,
+ (REQUIRE skill(caster, school) > 3 OR COMPONENTS ["CottonCloth"]),
+ REQUIRE rdistance(location(target), location(caster)) < 2 + spellpower / 30)
+ => EFFECT CALL adjust_spellpower(school);
+ sfx(target, SFX_DEFAULT, 0);
+ IF (caster <> target)
+ THEN CALL default_effect();
+ status_change(target, SC_HIDE, 0, 0, 0, 0, 5000 + (spellpower * 2500));
+ CALL gain_xp(2);
#--------------------------------------------------------------------------------
# Level 2 spells
@@ -899,7 +920,8 @@ PROCEDURE hug_tree(target) =
|| target = "tree" || target = "tree*"
|| target = "Tree" || target = "Tree*"
|| target = "druid" || target = "druid*"
- || target = "Druid" || target = "Druid*") {
+ || target = "Druid" || target = "Druid*")
+ THEN {
set @flag, 2;
callfunc "QuestTreeTrigger";
};
diff --git a/db/const.txt b/db/const.txt
index 43739b9b..0cccd5dc 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -198,3 +198,6 @@ MFLAG_MANASEED_RUMOUR 256 // Has heard rumour about mana seed
MFLAG_KNOWS_CUTTREE 512 // Knows about the `cut the tree' quest
MFLAG_DID_CUTTREE 1024 // Did cut off a branch from the druid tree
MFLAG_KNOWS_DRUIDTREE 2048 // Knows about the druid tree quest
+
+MFLAG_KNOWS_IMP 4096 // Knows about the imprisoned forest spirit
+MFLAG_KNOWS_OLD_WIZARD 8192 // Knows Bjorn's old wizard
diff --git a/npc/001-1_Tulimshar/bard.txt b/npc/001-1_Tulimshar/bard.txt
index 5d52f0a6..a740b1d5 100644
--- a/npc/001-1_Tulimshar/bard.txt
+++ b/npc/001-1_Tulimshar/bard.txt
@@ -36,64 +36,9 @@ L_News:
goto L_Main;
L_Question:
- set @QQ_ELANORE, 1;
- set @QQ_MANASEED, 2;
- set @QQ_WYARA, 3;
- set @QQ_SAGATHA, 4;
- set @QQ_AULDSBEL, 5;
-
- setarray @choice$, "", "", "", "", "", "";
- set @choices_nr, 0;
- setarray @choice_idx, 0, 0, 0, 0, 0, 0;
-
- set @choice$[@choices_nr], "...Elanore the Healer?";
- set @choice_idx[@choices_nr], @QQ_ELANORE;
- set @choices_nr, @choices_nr + 1;
-
- if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR)))
- goto L_Q_post_manaseed;
- set @choice$[@choices_nr], "...the Mana Seed?";
- set @choice_idx[@choices_nr], @QQ_MANASEED;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_manaseed:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_WYARA))
- goto L_Q_post_wyara;
- set @choice$[@choices_nr], "...Wyara the Witch?";
- set @choice_idx[@choices_nr], @QQ_WYARA;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_wyara:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
- goto L_Q_post_sagatha;
- set @choice$[@choices_nr], "...Sagatha the Witch?";
- set @choice_idx[@choices_nr], @QQ_SAGATHA;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_sagatha:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_AULDSBEL))
- goto L_Q_post_auldsbel;
- set @choice$[@choices_nr], "...Auldsbel the Wizard?";
- set @choice_idx[@choices_nr], @QQ_AULDSBEL;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_auldsbel:
-
- set @choice$[@choices_nr], "...never mind.";
- set @choice_idx[@choices_nr], 0;
- set @choices_nr, @choices_nr + 1;
-
- menu @choice$[0], -,
- @choice$[1], -,
- @choice$[2], -,
- @choice$[3], -,
- @choice$[4], -;
-
- set @menu, @menu - 1;
-
- if (@menu >= @choices_nr)
- set @menu, 0;
-
- set @c, @choice_idx[@menu];
+ callfunc "MagicTalkOptionsSetup";
+ set @ignore, 0;
+ callfunc "MagictalkMenu";
if (@c == 0) goto L_Main;
if (@c == @QQ_ELANORE) goto L_Q_elanore;
@@ -101,7 +46,21 @@ L_Q_post_auldsbel:
if (@c == @QQ_WYARA) goto L_Q_wyara;
if (@c == @QQ_SAGATHA) goto L_Q_sagatha;
if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
- close;
+ if (@c == @QQ_OLDWIZ) goto L_Q_oldwiz;
+
+ mes "[" + @name + "]";
+ mes "\"Alas, I know very little about this matter.\"";
+ next;
+ goto L_Main;
+
+L_Q_oldwiz:
+ mes "[" + @name + "]";
+ mes "\"The old wizard has been an old man for as long as I remember, living near the mountains in his magic hut-- a hut that is bigger on the inside, just like in the old tales of Gyer Filla the Wise....\"";
+ next;
+ mes "[" + @name + "]";
+ mes "\"I doubt that they are the same person, though. For one, I have never seen his hut fly. For another, Gyer never took apprentices.\"";
+ next;
+ goto L_Main;
L_Q_elanore:
mes "[" + @name + "]";
diff --git a/npc/001-1_Tulimshar/elanore.txt b/npc/001-1_Tulimshar/elanore.txt
index 2efaab93..3f18c80c 100644
--- a/npc/001-1_Tulimshar/elanore.txt
+++ b/npc/001-1_Tulimshar/elanore.txt
@@ -4,10 +4,10 @@
set @has_magic, getskilllv(SKILL_MAGIC);
- set @Q_MASK, NIBBLE_5_MASK;
- set @Q_SHIFT, NIBBLE_5_SHIFT;
+ set @Q_MASK, NIBBLE_1_MASK;
+ set @Q_SHIFT, NIBBLE_1_SHIFT;
- set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+ set @Q_status, (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
set @Q_heal_exp, MAGIC_EXPERIENCE >> 24;
set @BUGLEG, 518;
@@ -319,6 +319,37 @@ L_Teach_CheckAdvanceTo2_fail:
close;
L_Teach_CheckAdvanceToLOH:
+ if (getskilllv(SKILL_MAGIC) < 2)
+ goto L_Teach_LOH_advance_abort0;
+ if (@Q_heal_exp < 30)
+ goto L_Teach_LOH_advance_abort1;
+
+ mes "[Elanore the Healer]";
+ mes "\"I will now teach you how to heal by laying on your hands. The technique is similar to the spell I taught you at the beginning, but this time you transfer your own health instead of drawing health from a lifestone.\"";
+ next;
+
+ mes "[Elanore the Healer]";
+ mes "\"First, lay your hand on the person you wish to heal. You needn't touch the injury itself, though you have to touch the skin until you are a little more experienced. Then, medidate on the word '" + getspellinvocation("lay-on-hands") + "'\"";
+ next;
+
+ mes "[Elanore the Healer]";
+ mes "\"This will let your own life force flow into the person you are healing. If you are badly injured yourself, you will not be able to do this.\"";
+ mes "[1000 experience points]";
+ next;
+
+ getexp 1000, 0;
+ set @Q_status, @STATUS_LEARNED_LAY_ON_HANDS;
+ callsub S_update_var;
+ close;
+
+L_Teach_LOH_advance_abort0:
+ mes "[Elanore the Healer]";
+ mes "\"You don't have enough magical power to learn the next healing spell yet.\"";
+ close;
+
+L_Teach_LOH_advance_abort1:
+ mes "[Elanore the Healer]";
+ mes "\"I'm sorry, but I am not yet convinced that you are a good enough healer. Please continue in your endeavours.\"";
close;
L_NoMagicNoTeach:
@@ -329,67 +360,9 @@ L_NoMagicNoTeach:
goto L_Main;
L_Question:
- set @QQ_MANAPOTION, 1;
- set @QQ_MANASEED, 2;
- set @QQ_WYARA, 3;
- set @QQ_SAGATHA, 4;
- set @QQ_AULDSBEL, 5;
-
- setarray @choice$, "", "", "", "", "", "";
- set @choices_nr, 0;
- setarray @choice_idx, 0, 0, 0, 0, 0, 0;
-
- if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR)))
- goto L_Q_post_manaseed;
- set @choice$[@choices_nr], "...the Mana Seed?";
- set @choice_idx[@choices_nr], @QQ_MANASEED;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_manaseed:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION))
- goto L_Q_post_manapotion;
- set @choice$[@choices_nr], "...Mana Potions?";
- set @choice_idx[@choices_nr], @QQ_MANAPOTION;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_manapotion:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_WYARA))
- goto L_Q_post_wyara;
- set @choice$[@choices_nr], "...Wyara the Witch?";
- set @choice_idx[@choices_nr], @QQ_WYARA;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_wyara:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
- goto L_Q_post_sagatha;
- set @choice$[@choices_nr], "...Sagatha the Witch?";
- set @choice_idx[@choices_nr], @QQ_SAGATHA;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_sagatha:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_AULDSBEL))
- goto L_Q_post_auldsbel;
- set @choice$[@choices_nr], "...Auldsbel the Wizard?";
- set @choice_idx[@choices_nr], @QQ_AULDSBEL;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_auldsbel:
-
- set @choice$[@choices_nr], "...never mind.";
- set @choice_idx[@choices_nr], 0;
- set @choices_nr, @choices_nr + 1;
-
- menu @choice$[0], -,
- @choice$[1], -,
- @choice$[2], -,
- @choice$[3], -,
- @choice$[4], -;
-
- set @menu, @menu - 1;
-
- if (@menu >= @choices_nr)
- set @menu, 0;
-
- set @c, @choice_idx[@menu];
+ callfunc "MagicTalkOptionsSetup";
+ set @ignore, @QQ_ELANORE;
+ callfunc "MagictalkMenu";
if (@c == 0) goto L_Main;
if (@c == @QQ_MANASEED) goto L_Q_manaseed;
@@ -397,7 +370,19 @@ L_Q_post_auldsbel:
if (@c == @QQ_WYARA) goto L_Q_wyara;
if (@c == @QQ_SAGATHA) goto L_Q_sagatha;
if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
- close;
+ if (@c == @QQ_OLDWIZ) goto L_Q_oldwiz;
+
+ mes "[Elanore the Healer]";
+ mes "Elanore shakes her head.";
+ mes "\"I am sorry, but I don't think that I know anything that would help you.\"";
+ next;
+ goto L_Main;
+
+L_Q_oldwiz:
+ mes "[Elanore the Healer]";
+ mes "\"He is a kind old man. He stays mostly with his books and his apprentice, though we have chatted a few times.\"";
+ next;
+ goto L_Main;
L_Q_manaseed:
mes "[Elanore the Healer]";
@@ -432,8 +417,8 @@ L_Q_auldsbel:
S_update_var:
- set QUEST_MAGIC,
- (QUEST_MAGIC & ~(@Q_MASK)
+ set QUEST_MAGIC2,
+ (QUEST_MAGIC2 & ~(@Q_MASK)
| (@Q_status << @Q_SHIFT));
return;
}
diff --git a/npc/005-1_Snake_desert/_import.txt b/npc/005-1_Snake_desert/_import.txt
index 3174cc31..997fde69 100644
--- a/npc/005-1_Snake_desert/_import.txt
+++ b/npc/005-1_Snake_desert/_import.txt
@@ -2,3 +2,5 @@ map: 005-1.gat
npc: npc/005-1_Snake_desert/_mobs.txt
npc: npc/005-1_Snake_desert/_warps.txt
npc: npc/005-1_Snake_desert/npcs.txt
+npc: npc/005-1_Snake_desert/spirit.txt
+npc: npc/005-1_Snake_desert/tree.txt
diff --git a/npc/005-1_Snake_desert/spirit.txt b/npc/005-1_Snake_desert/spirit.txt
new file mode 100644
index 00000000..2ab3bf03
--- /dev/null
+++ b/npc/005-1_Snake_desert/spirit.txt
@@ -0,0 +1,303 @@
+function script EarthImpTouch {
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+ close;
+
+L_message:
+ set @Q_MASK, NIBBLE_0_MASK;
+ set @Q_SHIFT, NIBBLE_0_SHIFT;
+ set @Q_status, (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
+
+ set @Q_STATUS_INITIAL, 0;
+ set @Q_STATUS_ONQUEST, 1;
+ set @Q_STATUS_STUDENT0, 2;
+ set @Q_STATUS_STUDENT1, 3;
+ set @Q_STATUS_STUDENT2, 4;
+ set @Q_STATUS_STUDENT3, 5;
+
+ set @BRANCH, 732;
+
+ set @s, "girl";
+ if (Sex)
+ set @s, "boy";
+
+ if (MAGIC_FLAGS & MFLAG_KNOWS_IMP)
+ goto L_wb;
+
+ mes "[Well]";
+ mes "Something is inside that well, and now that you have turned your attention towards it, it seems to be talking to you!";
+ next;
+
+ mes "[Well]";
+ mes "\"Hey! You there! Yes, I'm talking to you!\"";
+ mes "That strange voice seems to be coming from inside your head!";
+ next;
+
+ menu
+ "Who, me?", -,
+ "Leave me alone!", L_close,
+ "Aaah! I'm hearing voices!", L_silly_close;
+
+ mes "[Well]";
+ mes "\"I'm in here, in the well, talking to you! If I'm not very mistaken, you are a powerful wizard-to-be, except that nobody has showed you how to properly do magic yet!\"";
+ next;
+
+ menu
+ "Who are you?", -,
+ "Aaaah! The voices are after me!", L_silly_close,
+ "Whatever it is, I'm not interested.", L_close;
+
+ mes "[Earth Spirit]";
+ mes "\"I'm a forest spirit; my name isn't important... all that matters is that I like you, and that I will help you become a powerful wizard if you help me. A fair deal, if you will...\"";
+ next;
+
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_IMP;
+
+ goto L_main;
+L_wb:
+ mes "[Earth Spirit]";
+ mes "\"It's excellent to see you again!\"";
+ next;
+
+L_main:
+ menu
+ "How did you get trapped?", L_Q_trapped,
+ "Can you teach me magic and spells?", L_Q_magic,
+ "What do you know about...", L_Q,
+ "Goodbye!", -;
+ close;
+
+L_Q_trapped:
+ mes "[Earth Spirit]";
+ mes "\"Oh, a wicked witch grew jealous of my power and locked me up in this well.\"";
+ next;
+ goto L_main;
+
+L_Q:
+ mes "[Earth Spirit]";
+ mes "\"Stop bothering me with your questions, will you? I'm trying to make you a powerful wizard, after all!\"";
+ next;
+ goto L_main;
+
+L_Q_magic:
+ if (@Q_status == @Q_STATUS_ONQUEST)
+ goto L_Q_magic_1;
+ if (@Q_status == @Q_STATUS_STUDENT0)
+ goto L_Q_magic_2;
+ if (@Q_status == @Q_STATUS_STUDENT1)
+ goto L_Q_magic_3;
+ if (@Q_status == @Q_STATUS_STUDENT2)
+ goto L_Q_magic_4;
+
+ mes "[Earth Spirit]";
+ mes "\"Good, good... that's the right attitude! Yes, I can teach you magic, but first you must prove that you are worthy to be my student!\"";
+ next;
+
+ mes "[Earth Spirit]";
+ mes "\"North-west of here sits and old, dead tree. Well, not completely dead, not yet, but almost. It's nothing special. Well, maybe a little, but not really. I want you to cut off one of its branches.\"";
+ next;
+
+ menu
+ "No way.", L_silly_close,
+ "Sure.", L_Q_tree_ok,
+ "Why that particular tree?", -;
+
+ mes "[Earth Spirit]";
+ mes "\"Oh, you and your questions! Well, that tree was a druid once, so the branches contain a bit of its lifeforce. And that's useful.\"";
+ next;
+
+ menu
+ "Yuck.", L_silly_close,
+ "Sure, whatever.", L_Q_tree_ok,
+ "Isn't that like cutting off someone's arm?", -;
+
+ mes "[Earth Spirit]";
+ mes "\"Oooh... now come on! Don't be so sentimental. He turned himself into a tree, he can hardly expect everyone to leave him alone.\"";
+ next;
+
+ mes "[Earth Spirit]";
+ mes "\"Besides, think of it like that: if you want to bake a cake, you've got to break a few eggs. Not everything's sweetness in life, my " + @s + "!.\"";
+ next;
+
+ menu
+ "No way.", L_silly_close,
+ "Alright, that makes sense.", L_Q_tree_ok;
+
+L_Q_tree_ok:
+ mes "[Earth Spirit]";
+ mes "\"Good, good, good! Yes, that will be very good! So, come back when you have the branch. Oh, and bring 100,000 GP, too, as an enrollment fee.\"";
+ set @Q_status, @Q_STATUS_ONQUEST;
+ callsub S_update_var;
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_CUTTREE;
+ next;
+ goto L_main;
+
+L_Q_magic_1:
+ mes "[Earth Spirit]";
+ mes "\"Yes, yes, if you brought me the branch and the money, then I will!\"";
+ next;
+ menu
+ "Here is the branch and the money.", -,
+ "How much money did you want again?", L_Q_tree_howmuch,
+ "How can I cut it?", L_Q_tree_how,
+ "Where was the tree again?", L_Q_tree_where,
+ "What is that tree?", L_Q_tree_what;
+
+ if (countitem(@BRANCH) < 1)
+ goto L_Q_tree_none;
+ if (!(MAGIC_FLAGS & MFLAG_DID_CUTTREE))
+ goto L_Q_tree_dry;
+ if (zeny < 100000)
+ goto L_Q_tree_nomoney;
+
+ set zeny, zeny - 100000;
+ delitem @BRANCH, 1;
+
+ mes "[Earth Spirit]";
+ mes "Following the earth sprite's instructions, you throw branch and GP into the well.";
+ next;
+
+ mes "[Earth Spirit]";
+ mes "\"Well done, very well done! Consider yourself my student now.\"";
+
+ mes "[5000 experience points]";
+ if (getskilllv(SKILL_MAGIC_NATURE) < 2)
+ mes "[Level 2 in Nature Magic]";
+ getexp 5000, 0;
+ if (getskilllv(SKILL_MAGIC_NATURE) < 2)
+ skill SKILL_MAGIC_NATURE, 2;
+ next;
+
+ set @Q_status, @Q_STATUS_STUDENT0;
+ callsub S_update_var;
+ goto L_main;
+
+L_Q_magic_finish:
+ mes "[1000 experience points]";
+ set @Q_status, @Q_status + 1;
+ callsub S_update_var;
+ getexp 1000,0;
+ next;
+ goto L_main;
+
+L_Q_magic_2:
+ mes "[Earth Spirit]";
+ mes "\"Yes, of course! For just 20,000 GP I will teach you your first spell!\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "No.", L_main;
+
+ if (zeny < 20000)
+ goto L_no20k;
+
+ set zeny, zeny - 20000;
+
+ mes "[Earth Spirit]";
+ mes "\"Kekeke... excellent! Yes, here goes your first spell, the flying backpack! If you are overloaded, it will take the load off your shoulders.\"";
+ next;
+
+ mes "[Earth Spirit]";
+ mes "\"Take a cocoon, living or dead, and suffuse it in magic. Whisper '" + getspellinvocation("flying-backpack") + "', and feel it float!\"";
+ goto L_Q_magic_finish;
+
+L_Q_magic_3:
+ mes "[Earth Spirit]";
+ mes "\"But yes, yes! Only 20,000 GP, once again, and I will teach you a far more useful spell!\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "No.", L_main;
+
+ if (zeny < 20000)
+ goto L_no20k;
+
+ set zeny, zeny - 20000;
+
+ mes "[Earth Spirit]";
+ mes "\"Yeees, good! This one is a protection spell, making your skin harder. You need a hard spike for it, though. Hold that spike in your hands, and focus on it.\"";
+ next;
+
+ mes "[Earth Spirit]";
+ mes "\"Next, say '" + getspellinvocation("protect") + "', and feel your skin grow rigid! Very useful against stings and stabs and pokes and pricks and that sort of stuff.\"";
+ goto L_Q_magic_finish;
+
+L_Q_magic_4:
+ mes "[Earth Spirit]";
+ mes "\"Naah, you're too weak now! Come back later when you have grown!\"";
+ next;
+ goto L_main;
+
+L_no20k:
+ mes "[Earth Spirit]";
+ mes "\"You can't pay me 20,000 if you don't have that much!\"";
+ next;
+ goto L_main;
+
+L_Q_tree_none:
+ mes "[Earth Spirit]";
+ mes "\"Where is your branch?\"";
+ next;
+ goto L_main;
+
+L_Q_tree_dry:
+ mes "[Earth Spirit]";
+ mes "\"That won't do. This branch is completely dead; you'll have to get another.\"";
+ next;
+ goto L_main;
+
+L_Q_tree_nomoney:
+ mes "[Earth Spirit]";
+ mes "\"No, you don't have enough money! Come back when you have 100,000.\"";
+ next;
+ goto L_main;
+
+L_Q_tree_howmuch:
+ mes "[Earth Spirit]";
+ mes "\"It's only 100,000 GP to become my student.\"";
+ next;
+ goto L_main;
+
+L_Q_tree_how:
+ mes "[Earth Spirit]";
+ mes "\"Oh... right, the tree might be protected. Only a bone knife will cut that. No idea where you can find one, but I'm sure you will manage!\"";
+ next;
+ goto L_main;
+
+L_Q_tree_where:
+ mes "[Earth Spirit]";
+ mes "\"North-west of here.\"";
+ next;
+ goto L_main;
+
+L_Q_tree_what:
+ mes "[Earth Spirit]";
+ mes "\"Just some silly druid who turned himself into a tree; nothing important.\"";
+ next;
+ goto L_main;
+
+L_silly_close:
+ if (MAGIC_FLAGS & MFLAG_KNOWS_IMP)
+ mes "[Earth Spirit]";
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_IMP))
+ mes "[Well]";
+ mes "\"Silly " + @s + ".\"";
+L_close:
+ close;
+
+S_update_var:
+ set QUEST_MAGIC2,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
+
+005-1.gat,118,70,0 script #EarthImp0#_M 127,{
+ callfunc "EarthImpTouch";
+}
+
+005-1.gat,119,70,0 script #EarthImp1#_M 127,{
+ callfunc "EarthImpTouch";
+}
diff --git a/npc/005-1_Snake_desert/tree.txt b/npc/005-1_Snake_desert/tree.txt
index d0072259..7c85c44b 100644
--- a/npc/005-1_Snake_desert/tree.txt
+++ b/npc/005-1_Snake_desert/tree.txt
@@ -78,17 +78,38 @@ L_water:
mes "This must be the druid tree.";
next;
menu
- "Water the tree", L_water,
+ "Water the tree", L_givewater,
"Kiss tree", L_kiss,
"Leave it alone", -;
close;
L_both:
mes "[Dying Tree]";
- mes "This must be the druid tree, the one the earth spirit asked you to cut.";
+ mes "This must be the druid tree that Wyara and the earth spirit were talking about.";
next;
menu
- "Water the
+ "Water the tree", L_givewater,
+ "Kiss tree", L_kiss,
+ "Cut off a branch", L_do_cut,
+ "Leave it alone", -;
+ close;
+
+L_givewater:
+ set @WATER, 541;
+ set @BOTTLE, 540;
+
+ if (countitem(@WATER) < 1)
+ goto L_no_water;
+ delitem @WATER, 1;
+ getitem @BOTTLE, 541;
+
+ mes "[Dying Tree]";
+ mes "You pour a bottle of water into the sand. The water dissipates quickly, without any effect.";
+ next;
+ close;
+
+L_no_water:
+ mes "[Dying Tree]";
mes "You don't have any water.";
next;
close;
@@ -118,7 +139,7 @@ L_do_cut:
"Yes, let's cut!", L_really_cut;
close;
-L_really_cut;
+L_really_cut:
set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DID_CUTTREE;
getitem 732, 1;
mes "[Dying Tree]";
@@ -133,10 +154,7 @@ L_no_boneknife:
next;
close;
-L_do_cut:
-
L_happy:
-
close;
}
diff --git a/npc/009-2_Hurnscald/misc.txt b/npc/009-2_Hurnscald/misc.txt
index 56d02bf9..f3bbe545 100644
--- a/npc/009-2_Hurnscald/misc.txt
+++ b/npc/009-2_Hurnscald/misc.txt
@@ -9,3 +9,52 @@
close;
// In case you don't get the joke - it's a parody on Illutia.
}
+
+//Bookshelf
+009-2.gat,109,44,0 script #Book 127, {
+ if (getskilllv(SKILL_MAGIC))
+ goto L_magic;
+ mes "[Bookshelf]";
+ mes "This bookshelf seems to have a selection of diaries and manuscripts, though you can't make out anything that strikes you as being particularly interesting.";
+ close;
+
+L_magic:
+ mes "[Bookshelf]";
+ mes "Browsing through the books, you come across a manuscript entitled 'Notes of Potaffe, On Transmutation'.";
+ next;
+
+ if (getskilllv(SKILL_MAGIC_TRANSMUTE) < 2)
+ goto L_magic_boring;
+
+ mes "[Bookshelf]";
+ mes "Leafing through the manuscript, you find that you can read little of the tiny handwriting, and understand only a fraction of what is said.";
+ next;
+
+ mes "[Bookshelf]";
+ mes "After a while, you stumble across a section that appears to be in more careful handwriting. The author notes that he (or she?) is describing a completely new transmutation there.";
+ next;
+
+ mes "[Bookshelf]";
+ mes "Excitedly, you turn the page-- only to find that it is stuck to the next, and won't get unstuck!";
+ next;
+
+ mes "[Bookshelf]";
+ mes "The page after that is more scribbly again, with many crossed-out words and sections, and side remarks such as 'It almost worked' or 'Worked fine yesterday.'";
+ next;
+
+ mes "[Bookshelf]";
+ mes "The last word on that page is '" + getspellinvocation("make-iron-powder") + "', underlined twice, with a comment saying 'finally got it right'.";
+ next;
+
+ mes "[Bookshelf]";
+ mes "Unfortunately, you can't make out from the text what the transmutation is for or whether it requires any material components...";
+ next;
+
+ mes "[Bookshelf]";
+ mes "You can't make out anything else of value, so you place the manuscript back in the bookshelf.";
+ next;
+
+L_magic_boring:
+ mes "[Bookshelf]";
+ mes "Leafing through the manuscript, you find that you understand too little of what is said there to make any sense of it.";
+}
diff --git a/npc/009-2_Hurnscald/wyara.txt b/npc/009-2_Hurnscald/wyara.txt
index 89f2ea3f..d38bf04d 100644
--- a/npc/009-2_Hurnscald/wyara.txt
+++ b/npc/009-2_Hurnscald/wyara.txt
@@ -1,14 +1,39 @@
function script PurificationPotion {
- announce "Meh.", 7;
+ set @STATUS_PURIFY_ONCE, 2;
+ set @STATUS_PURIFY_TWICE, 3;
+
+ set @PURIFICATIONPOTION, 733;
+
+ if (isat("011-1.gat", 88,67))
+ goto L_correct;
+ announce "This doesn't seem to be the right place.", 7;
+ getitem @PURIFICATIONPOTION, 1;
+ close;
+L_correct:
+ set @Q_MASK, NIBBLE_2_MASK;
+ set @Q_SHIFT, NIBBLE_2_SHIFT;
+ set @Q_status, (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
+
+ if (@Q_status == @STATUS_PURIFY_ONCE)
+ set @Q_status, @STATUS_PURIFY_TWICE;
+ if (@Q_status < @STATUS_PURIFY_ONCE)
+ set @Q_status, @STATUS_PURIFY_ONCE;
+
+ announce "You pour the potion into the pond.", 7;
+
+ set QUEST_MAGIC2,
+ (QUEST_MAGIC2 & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
}
// ----------------------------------------
// Wyara the Hurnscald witch
// ----------------------------------------
009-2.gat,121,26,0 script Wyara#_M 103,{
- set @Q_MASK, NIBBLE_7_MASK;
- set @Q_SHIFT, NIBBLE_7_SHIFT;
- set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+ set @Q_MASK, NIBBLE_2_MASK;
+ set @Q_SHIFT, NIBBLE_2_SHIFT;
+ set @Q_status, (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
set @STATUS_INITIAL, 0;
set @STATUS_PURIFY_EXPLAINED, 1;
@@ -23,9 +48,12 @@ function script PurificationPotion {
set @has_magic, getskilllv(SKILL_MAGIC);
- mes "[Wyara the Witch]";
- mes "The witch waves you in.";
- mes "\"Hello and welcome! Can I interested you in some potions?\"";
+
+ mes "[Wyara the witch]";
+ if (!Sex)
+ mes "\"Greetings, fair traveller! What can I do for you?\"";
+ if (Sex)
+ mes "\"Hello! What brings you here?\"";
next;
set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_WYARA;
@@ -43,64 +71,9 @@ L_Shop:
close;
L_Question:
- set @QQ_ELANORE, 1;
- set @QQ_MANASEED, 2;
- set @QQ_MANAPOTION, 3;
- set @QQ_SAGATHA, 4;
- set @QQ_AULDSBEL, 5;
-
- setarray @choice$, "", "", "", "", "", "";
- set @choices_nr, 0;
- setarray @choice_idx, 0, 0, 0, 0, 0, 0;
-
- set @choice$[@choices_nr], "...Elanore the Healer?";
- set @choice_idx[@choices_nr], @QQ_ELANORE;
- set @choices_nr, @choices_nr + 1;
-
- if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR)))
- goto L_Q_post_manaseed;
- set @choice$[@choices_nr], "...the Mana Seed?";
- set @choice_idx[@choices_nr], @QQ_MANASEED;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_manaseed:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION))
- goto L_Q_post_manapotion;
- set @choice$[@choices_nr], "...Mana Potions?";
- set @choice_idx[@choices_nr], @QQ_MANAPOTION;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_manapotion:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
- goto L_Q_post_sagatha;
- set @choice$[@choices_nr], "...Sagatha the Witch?";
- set @choice_idx[@choices_nr], @QQ_SAGATHA;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_sagatha:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_AULDSBEL))
- goto L_Q_post_auldsbel;
- set @choice$[@choices_nr], "...Auldsbel the Wizard?";
- set @choice_idx[@choices_nr], @QQ_AULDSBEL;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_auldsbel:
-
- set @choice$[@choices_nr], "...never mind.";
- set @choice_idx[@choices_nr], 0;
- set @choices_nr, @choices_nr + 1;
-
- menu @choice$[0], -,
- @choice$[1], -,
- @choice$[2], -,
- @choice$[3], -,
- @choice$[4], -;
-
- set @menu, @menu - 1;
-
- if (@menu >= @choices_nr)
- set @menu, 0;
-
- set @c, @choice_idx[@menu];
+ callfunc "MagicTalkOptionsSetup";
+ set @ignore, @QQ_WYARA;
+ callfunc "MagictalkMenu";
if (@c == 0) goto L_Main;
if (@c == @QQ_ELANORE) goto L_Q_elanore;
@@ -108,7 +81,25 @@ L_Q_post_auldsbel:
if (@c == @QQ_MANAPOTION) goto L_Q_manapotion;
if (@c == @QQ_SAGATHA) goto L_Q_sagatha;
if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
- close;
+ if (@c == @QQ_IMP) goto L_Q_imp;
+ if (@c == @QQ_OLDWIZ) goto L_Q_old_wizard;
+
+ mes "[Wyara the Witch]";
+ mes "\"I fear that I can't help you with that.\"";
+ next;
+ goto L_Main;
+
+
+L_Q_old_wizard:
+ mes "[Wyara the Witch]";
+ mes "\"I don't know his name, but I do know that he has been living in the mountains since I first came here. He is a master of many schools of magic, I believe.\"";
+ next;
+ mes "[Wyara the Witch]";
+ mes "She smiles.";
+ mes "\"He is also a nice and friendly person to talk to, and quite knowledgeable about the teas of this area.\"";
+ next;
+ goto L_Main;
+
L_Q_elanore:
mes "[Wyara the Witch]";
@@ -172,6 +163,12 @@ L_make_manapotion_lack:
goto L_Main;
+L_Q_imp:
+ mes "[Wyara the Witch]";
+ mes "\"Sagatha told me that she imprisoned an evil earth spirit in a dried-up well. She wants it to stay there until it has mended its ways, or forever, if it doesn't.\"";
+ next;
+ goto L_main_menu;
+
L_Q_sagatha:
mes "[Wyara the Witch]";
mes "Wyara smiles.";
@@ -223,7 +220,7 @@ L_Magic_explain:
next;
mes "[Wyara the Witch]";
- mes "\"There are different kinds of magic, too; nature, ether, and so on, but if this interest you, you should talk to a scholar.\"";
+ mes "\"There are different kinds of magic, too; nature, ether, and so on, but if this interests you, you should talk to a scholar.\"";
next;
goto L_Magic_main;
@@ -544,8 +541,8 @@ L_Magic_train_sagatha_fail:
goto L_Magic_main;
S_update_var:
- set QUEST_MAGIC,
- (QUEST_MAGIC & ~(@Q_MASK)
+ set QUEST_MAGIC2,
+ (QUEST_MAGIC2 & ~(@Q_MASK)
| (@Q_status << @Q_SHIFT));
return;
}
diff --git a/npc/009-3_Cave_beneath_Hurnscald/sword.txt b/npc/009-3_Cave_beneath_Hurnscald/sword.txt
index b042bce7..a1f9949a 100644
--- a/npc/009-3_Cave_beneath_Hurnscald/sword.txt
+++ b/npc/009-3_Cave_beneath_Hurnscald/sword.txt
@@ -12,10 +12,18 @@ L_message:
set @STATUS_LEARNED_FLAREDART, 1;
set @STATUS_LEARNED_MAGICBLADE, 2;
set @STATUS_LEVEL2, 3;
+ set @STATUS_W11, 4;
+ set @STATUS_W12, 5;
+ set @STATUS_W11_12, 6;
+ set @STATUS_L2_ALLSPELLS, 7;
if (@Q_status == @STATUS_INITIAL) goto L_Initial;
if (@Q_status == @STATUS_LEARNED_FLAREDART) goto L_PostFlareDart;
if (@Q_status == @STATUS_LEARNED_MAGICBLADE) goto L_PostFlareDart_teach;
+ if (@Q_status == @STATUS_LEVEL2) goto L_L2_W11;
+ if (@Q_status == @STATUS_W12) goto L_L2_W11;
+ if (@Q_status == @STATUS_W11) goto L_L2_almost_done;
+ if (@Q_status == @STATUS_W11_12) goto L_L2_almost_done;
mes "[Magic Sword]";
mes "Come back when thou art stronger.";
@@ -107,7 +115,7 @@ L_PostFlareDart_teach:
next;
mes "[Magic Sword]";
- mes "\"But beware... the path of war that thou hast embarked upon is one from which few return. May luck be on your side...\"";
+ mes "\"But beware... the path of war that thou hast embarked upon is one from which few return. May luck be on thy side...\"";
next;
close;
@@ -119,6 +127,59 @@ L_PostFlareDart_teach:
L_Close:
close;
+L_L2_W11:
+ mes "[Magic Sword]";
+ mes "\"You have returned. That must mean that thy wish to learn the magic of war is still alive?\"";
+ next;
+ menu
+ "No, I just wanted to say `hi'.", L_sayhi,
+ "Yes, teach me more!", -;
+
+ mes "[Magic Sword]";
+ mes "\"If that is thy wish, I shall not stop thee. But do not expect to find merriment down this road.\"";
+ mes "\"I must ask that you sacrifice a thousand monster points for this, however.\"";
+
+ "No, I don't want that.", L_farewell,
+ "I agree.", -;
+
+ if (Mobpt < 1000) goto L_lacking_mobpoints;
+
+ mes "[Magic Sword]";
+ mes "\"So be it, then.\"";
+ mes "[1000 experience points]";
+ set Mobpt, Mobpt - 1000;
+ getexp 1000, 0;
+ set @Q_status, @Q_status + 1;
+ callsub S_update_var;
+ next;
+
+ mes "[Magic Sword]";
+ mes "\"The spell I shall teach thee is the hail of arrows spell. It will make arrows fall down from the heavens unto thy enemies.\"";
+ next;
+
+ mes "[Magic Sword]";
+ mes "\"Take twenty arrows, sprinkle sulphur powder over them, and then speak '" + getspellinvocation("arrow-hail") + "'. Throw them high up in the air, and watch the hail unfold before thy feet.\"";
+ next;
+ close;
+
+
+L_L2_almost_done:
+ mes "[Magic Sword]";
+ mes "\"Return to my sister now. I expect that she shall teach you one more spell.\"";
+ next;
+ close;
+
+L_lacking_mobpoints:
+ mes "[Magic Sword]";
+ mes "\"Thou lackest the monster points needed to prove thy worthiness. I shall not reveal more to you until thou hast slain more monsters.\"";
+ next;
+ close;
+
+L_sayhi:
+ mes "[Magic Sword]";
+ mes "\"Please leave me in peace.\"";
+ next;
+ close;
S_update_var:
set QUEST_MAGIC,
diff --git a/npc/011-1_Woodland/alchemist.txt b/npc/011-1_Woodland/alchemist.txt
index f6067d39..bc7b53f3 100644
--- a/npc/011-1_Woodland/alchemist.txt
+++ b/npc/011-1_Woodland/alchemist.txt
@@ -9,7 +9,8 @@
set @Q_MASK, NIBBLE_3_MASK;
set @Q_SHIFT, NIBBLE_3_SHIFT;
- set @wants_sulphur, (QUEST_MAGIC & NIBBLE_6_MASK);
+ set @wants_sulphur, (QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK));
+ set @wants_ironpowder, (((QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK)) >> NIBBLE_6_SHIFT) >= 7);
set @Q_status, (QUEST_Forestbow_state & @Q_MASK) >> @Q_SHIFT;
// End of Setzer quest/monster oil quest participation
@@ -38,9 +39,10 @@
set @CHOICE_MONSTER_OIL, 4;
set @CHOICE_MANA_POTION, 5;
set @CHOICE_SULPHUR_POWDER, 6;
- set @CHOICE_ABORT, 7;
+ set @CHOICE_IRON_POWDER, 7;
+ set @CHOICE_ABORT, 8;
- setarray @menuitems$, "", "", "", "", "", "";
+ setarray @menuitems$, "", "", "", "", "", "", "", "";
set @c, 0;
set @menuitems$[@c], "Iron potion.";
@@ -95,10 +97,17 @@ L_certain_condition:
if (!@wants_sulphur)
goto L_post_sulphur_option;
set @menuitems$[@c], "Can you make sulphur powder?";
- set @menuID[@c], @CHOICE_SULPHUR;
+ set @menuID[@c], @CHOICE_SULPHUR_POWDER;
set @c, @c + 1;
L_post_sulphur_option:
+ if (!@wants_ironpowder)
+ goto L_post_ironpowder_option;
+ set @menuitems$[@c], "Can you make iron powder?";
+ set @menuID[@c], @CHOICE_IRON_POWDER;
+ set @c, @c + 1;
+L_post_ironpowder_option:
+
if (@Q_status == @SETZER_INITIAL)
goto L_main_menu;
set @menuitems$[@c], "Can you make monster oil?";
@@ -117,7 +126,8 @@ L_main_menu:
@menuitems$[3], -,
@menuitems$[4], -,
@menuitems$[5], -,
- @menuitems$[6], -;
+ @menuitems$[6], -,
+ @menuitems$[7], -;
set @menu, @menu - 1;
@@ -128,8 +138,58 @@ L_main_menu:
if (@menuID[@menu] == @CHOICE_DYE) goto L_pick_colour;
if (@menuID[@menu] == @CHOICE_MONSTER_OIL) goto L_monster_oil;
if (@menuID[@menu] == @CHOICE_MANA_POTION) goto L_mana_potion;
- if (@menuID[@menu] == @CHOICE_SULPHUR) goto L_sulphur;
+ if (@menuID[@menu] == @CHOICE_SULPHUR_POWDER) goto L_sulphur;
+ if (@menuID[@menu] == @CHOICE_IRON_POWDER) goto L_iron_powder;
if (@menuID[@menu] == @CHOICE_ABORT) goto L_abort;
+ goto L_abort;
+
+L_iron_powder:
+ mes "[Rauk the Alchemist]";
+ mes "\"Iron powder? Hmm, I can extract some iron powder out of a chunk of iron ore, but that will require me to dissolve it. If you give me a chunk of iron ore and 100 GP for the acid, I can do it.\"";
+ menu
+ "Never mind.", L_abort,
+ "Here you are!", -;
+
+ if (countitem(@ORE) < 1)
+ goto L_iron_powder_noore;
+ if (zeny < 100)
+ goto L_iron_powder_nozeny;
+ getinventorylist;
+ if (@inventorylist_count == 100
+ && countitem(@ORE) > 1
+ && countitem(@IRONPOWDER) < 1)
+ goto L_iron_powder_full;
+ delitem @ORE, 1;
+ set zeny, zeny - 100;
+ getitem @IRONPOWDER, 4;
+ mes "[Rauk the Alchemist]";
+ mes "Rauk places your chunk of ore in a strange glass container, then pours a steaming yellow liquid over it. Before your eyes, the ore dissolves.\"";
+ next;
+
+ mes "[Rauk the Alchemist]";
+ mes "Rauk pours another liquid over the resultant mixture, then pours the result through a piece of cloth placed in a funnel. He removes some amount of metal powder from the cloth and hands it to you.\"";
+ mes "\"This is about as fine as I can make it without mechanical help.\"";
+ next;
+
+ close;
+
+L_iron_powder_noore:
+ mes "[Rauk the Alchemist]";
+ mes "\"I do need a chunk of iron ore. Please return when you have one.\"";
+ next;
+ close;
+
+L_iron_powder_nozeny:
+ mes "[Rauk the Alchemist]";
+ mes "\"I'm sorry, but I must ask that you pay 100 GP-- the acid I use is not cheap.\"";
+ next;
+ close;
+
+L_iron_powder_full:
+ mes "[Rauk the Alchemist]";
+ mes "\"I don't think that you have room to carry this. Please come back later.\"";
+ next;
+ close;
L_sulphur:
mes "[Rauk the Alchemist]";
diff --git a/npc/011-1_Woodland/auldsbel.txt b/npc/011-1_Woodland/auldsbel.txt
index ef88277f..c71694ca 100644
--- a/npc/011-1_Woodland/auldsbel.txt
+++ b/npc/011-1_Woodland/auldsbel.txt
@@ -9,6 +9,7 @@
set @MAUVE, 680;
set @PETAL, 565;
set @PEARL, 700;
+ set @WOOD, 569;
set @BOTTLE_WATER, 541;
set @MANA_POTION, 705;
set @SMALL_HEALING_POTION, 685;
@@ -28,13 +29,20 @@
set @SULPHUR, 703;
set @IRONPOWDER, 704;
set @MOUBOO_FIGURINE, 728;
+ set @BUGLEG, 518;
set @Q_STATUS_INITIAL, 0;
set @Q_STATUS_POSTINTRO, 1;
set @Q_STATUS_INITIATION, 2; // quest for being able to cast `create mouboo figurine'
set @Q_STATUS_STUDENT, 3; // accepted as student
+ set @Q_STATUS_STUDENT0, 4; // accepted as student
+ set @Q_STATUS_STUDENT1, 5;
+ set @Q_STATUS_STUDENT2, 6;
+ set @Q_STATUS_STUDENT3, 7;
+ set @Q_STATUS_STUDENT4, 8;
- set @Q_wants_sulphur, (QUEST_MAGIC & NIBBLE_6_MASK);
+ set @wants_sulphur, (QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK));
+ set @wants_ironpowder, (((QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK)) >> NIBBLE_6_SHIFT) >= 7);
set @Q_MASK, NIBBLE_0_MASK | NIBBLE_1_MASK;
set @Q_SHIFT, NIBBLE_0_SHIFT;
@@ -168,6 +176,15 @@ L_main_menu:
close;
L_main_menu_magic:
+ if (@wants_sulphur && @wants_ironpowder)
+ menu "How does magic work?", L_about_magic,
+ "Can you teach me a spell?", L_learn_spell,
+ "Where are you from?", L_about_auldsbel,
+ "Do you need help with your experiments?", L_quest,
+ "What do you know about...", L_question,
+ "Can you make sulphur powder?", L_sulphur,
+ "Can you make iron powder?", L_ironpowder,
+ "Goodbye.", -;
if (@wants_sulphur)
menu "How does magic work?", L_about_magic,
"Can you teach me a spell?", L_learn_spell,
@@ -185,12 +202,28 @@ L_main_menu_magic:
"Goodbye.", -;
close;
+L_ironpowder:
+ mes "[Auldsbel the Wizard]";
+ mes "\"No, I do not know the spell for this. I expect that it shouldn't be too hard an invocation, but I'm too busy to work it out.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I know that they used to make iron ore around here, though, many years ago. Perhaps the secret is still hidden somewhere?\"";
+ next;
+ goto L_main_menu;
+
L_sulphur:
mes "[Auldsbel the Wizard]";
set @cost, 400 - (@component_quest * 30);
mes "\"Sulphur powder? Ah, so we have picked up a little offensive magic, haven't we? Good thinking, good thinking. And yes, of course I can transmute volcanic ashes into sulphur powder at a ratio of 1:5, for a mere " + @cost + " GP.\"";
next;
- menu
+ if (@Q_status >= @Q_STATUS_STUDENT)
+ menu
+ "No, thank you.", -,
+ "I will see what I can find.", -,
+ "Can you teach me how to make it myself?", L_sulphur_teach_spell,
+ "Here you are.", L_sulphur_buy;
+ if (@Q_status < @Q_STATUS_STUDENT)
+ menu
"No, thank you.", -,
"I will see what I can find.", -,
"Here you are.", L_sulphur_buy;
@@ -231,7 +264,34 @@ L_sulphur_noroom:
mes "[Auldsbel the Wizard]";
mes "\"Hmm, you really managed to squeeze something into every little place you had that we could have stored the powder in... you might want to return once you have resolved this matter.\"";
next;
- close;
+ goto L_main_menu;
+
+L_sulphur_teach_spell:
+ if (@Q_component_quest <= 4)
+ goto L_sulphur_teach_spell_no;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Very well, then. You have been quite helpful with my experiments, after all. As you may have noticed, the spell takes a pile of volcanic ashes. Close your hands around it, then whisper the invocation.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"That invocation is '" + getspellinvocation("make-sulphur") + "'.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"You may find that you can transmute the powder more effectively after a while; that is perfectly natural.\"";
+ next;
+ goto L_main_menu;
+
+L_sulphur_teach_spell_no:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Hmm... how about this: you help me with a few of my experiments, and I tell you?\"";
+ next;
+ menu
+ "Very well, I will help you.", L_quest,
+ "No.", -;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Then I fear that I shall not reveal the spell to you either.\"";
+ next;
+ goto L_main_menu;
L_about_magic:
mes "[Auldsbel the Wizard]";
@@ -454,66 +514,37 @@ L_learn_magic:
goto L_main_menu;
L_question:
- set @QQ_ELANORE, 1;
- set @QQ_MANASEED, 2;
- set @QQ_WYARA, 3;
- set @QQ_SAGATHA, 4;
-
- setarray @choice$, "", "", "", "", "";
- set @choices_nr, 0;
- setarray @choice_idx, 0, 0, 0, 0, 0;
-
- set @choice$[@choices_nr], "...Elanore the Healer?";
- set @choice_idx[@choices_nr], @QQ_ELANORE;
- set @choices_nr, @choices_nr + 1;
-
- if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR)))
- goto L_Q_post_manaseed;
- set @choice$[@choices_nr], "...the Mana Seed?";
- set @choice_idx[@choices_nr], @QQ_MANASEED;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_manaseed:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_WYARA))
- goto L_Q_post_wyara;
- set @choice$[@choices_nr], "...Wyara the Witch?";
- set @choice_idx[@choices_nr], @QQ_WYARA;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_wyara:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
- goto L_Q_post_sagatha;
- set @choice$[@choices_nr], "...Sagatha the Witch?";
- set @choice_idx[@choices_nr], @QQ_SAGATHA;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_sagatha:
-
- set @choice$[@choices_nr], "...never mind.";
- set @choice_idx[@choices_nr], 0;
- set @choices_nr, @choices_nr + 1;
-
- menu @choice$[0], -,
- @choice$[1], -,
- @choice$[2], -,
- @choice$[3], -,
- @choice$[4], -;
-
- set @menu, @menu - 1;
-
- if (@menu >= @choices_nr)
- set @menu, 0;
-
- set @c, @choice_idx[@menu];
-
-// mes "menu = " + @menu + ", c = " + @c + " nr=" + @choices_nr + ", ids = " + @choice_idx[0];
-// next;
+ callfunc "MagicTalkOptionsSetup";
+ set @ignore, @QQ_AULDSBEL;
+ callfunc "MagictalkMenu";
if (@c == 0) goto L_main_menu;
if (@c == @QQ_ELANORE) goto L_Q_elanore;
if (@c == @QQ_MANASEED) goto L_Q_manaseed;
if (@c == @QQ_WYARA) goto L_Q_wyara;
if (@c == @QQ_SAGATHA) goto L_Q_sagatha;
- close;
+ if (@c == @QQ_IMP) goto L_Q_imp;
+ if (@c == @QQ_OLDWIZ) goto L_Q_old_wizard;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Let us talk about something else.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_oldwiz:
+ mes "[Auldsbel the Wizard]";
+ mes "\"I'm still not sure what exactly to make of him. At first appearance, he seems like a senile old man, but there can be no doubt that he has-- or at least had, at some point-- a very deep understanding of magic.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I have not had the opportunity to talk to him too much, though.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_imp:
+ mes "[Auldsbel the Wizard]";
+ mes "\"There are many different kinds of spirits in the world. Some are good-natured, others evil; some are weak, others very powerful. I don't know the particular one you have encountered, though I urge caution.\"";
+ next;
+ goto L_main_menu;
L_Q_elanore:
mes "[Auldsbel the Wizard]";
@@ -898,6 +929,11 @@ L_component_quest_missing:
L_learn_spell:
if (@Q_main_status == @Q_STATUS_INITIATION) goto LL_initiation;
if (@Q_main_status == @Q_STATUS_STUDENT) goto LL_student_start;
+ if (@Q_main_status == @Q_STATUS_STUDENT0) goto LL_student_0;
+ if (@Q_main_status == @Q_STATUS_STUDENT1) goto LL_student_1;
+ if (@Q_main_status == @Q_STATUS_STUDENT2) goto LL_student_2;
+ if (@Q_main_status == @Q_STATUS_STUDENT3) goto LL_student_3;
+ if (@Q_main_status == @Q_STATUS_STUDENT4) goto LL_student_4;
mes "[Auldsbel the Wizard]";
mes "\"Wellll.... you do seem to have some magical abilities. But do you possess the talent and diligence needed for a true wizard?\"";
@@ -981,7 +1017,7 @@ LL_initiation_check:
next;
mes "[Auldsbel the Wizard]";
- mes "You feel new powers curse flowing into your body!";
+ mes "You feel new powers flowing into your body!";
mes "[5000 experience points]";
mes "[Level 2 in Transmutation Magic]";
@@ -993,6 +1029,163 @@ LL_initiation_check:
goto L_main_menu;
LL_student_start:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Next, I shall teach you a higher-level transmutation spell.\"";
+ if (getskilllv(SKILL_MAGIC) < 2)
+ msg "\"Beware, for you will not be able to use it yet.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Bring me ten bug legs, and I will reveal its invocation to you.\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "I'll be back with them.", L_main_menu;
+
+ if (countitem(@BUGLEG) < 10)
+ goto L_component_quest_missing;
+
+ delitem @BUGLEG, 10;
+ getexp 1000, 0;
+ set @Q_status, @Q_STATUS_STUDENT0;
+ callsub S_update_var;
+
+ mes "[Auldsbel the Wizard]";
+ mes "He picks up the bug legs.";
+ mes "\"Good. These will come in handy later...\"";
+ mes "He grins.";
+ mes "[1000 experience points]";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Now, listen carefully: to make a short tank top out of three pieces of cloth, you must use the invocation '" + getspellinvocation("make-short-tanktop") + "'.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"But be careful; transmutations can go wrong, and that can injure you. When you have some more overall spellcasting practice, come back to me.\"";
+ next;
+ goto L_main_menu;
+
+LL_notready:
+ mes "[Auldsbel the Wizard]";
+ mes "\"You still need more practice with spellcasting; I won't give you another spell until you are ready.\"";
+ next;
+ goto L_main_menu;
+
+LL_student_0:
+ if (@mexp < 350) goto LL_notready;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"The next transmutation spell is a little harder than the last one I taught you, but you should be able to manage.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Bring me twenty mauve leaves, and I will reveal its invocation.\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "I'll be back with them.", L_main_menu;
+
+ if (countitem(@MAUVE) < 20)
+ goto L_component_quest_missing;
+
+ delitem @MAUVE, 20;
+ getexp 1000, 0;
+ set @Q_status, @Q_STATUS_STUDENT1;
+ callsub S_update_var;
+
+ mes "[Auldsbel the Wizard]";
+ mes "He pockets your mauve leaves.";
+ mes "\"Those should go very well with the salmon.\"";
+ mes "[1000 experience points]";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"The next spell I have will make a normal tank top out of four pieces of cloth. The invocation is '" + getspellinvocation("make-tanktop") + "', make sure to write this down.\"";
+ next;
+
+ goto L_main_menu;
+
+LL_student_1:
+ if (@mexp < 425) goto LL_notready;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Up next is the transmutation spell for regular shirts.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"For this, I would like ten scorpion stingers.\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "I'll be back with them.", L_main_menu;
+
+ if (countitem(@STINGER) < 10)
+ goto L_component_quest_missing;
+
+ delitem @STINGER, 10;
+ getexp 1000, 0;
+ set @Q_status, @Q_STATUS_STUDENT2;
+ callsub S_update_var;
+
+ mes "[Auldsbel the Wizard]";
+ mes "He carefully takes the stingers.";
+ mes "\"You are being quite helpful. If my experiments go well, I will make sure to acknowledge you in a footnote somewhere.\"";
+ mes "[1000 experience points]";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"To make a shirt, use the invocation '" + getspellinvocation("make-shirt") + "'. This will require five pieces of cloth.\"";
+ next;
+
+ goto L_main_menu;
+
+LL_student_2:
+ if (@mexp < 500) goto LL_notready;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"You may find the next spell particularly useful.\"";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Bring me twenty wooden logs, and I will teach you.\"";
+ next;
+
+ menu
+ "Here you are.", -,
+ "I'll be back with them.", L_main_menu;
+
+ if (countitem(@WOOD) < 20)
+ goto L_component_quest_missing;
+
+ delitem @WOOD, 20;
+ getexp 1000, 0;
+ set @Q_status, @Q_STATUS_STUDENT3;
+ callsub S_update_var;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel places the logs next to his hut.";
+ mes "\"I'm hoping to animate them into the shape of one of those odd log heads.\"";
+ mes "[1000 experience points]";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"This spell makes arrows out of a single wooden log. Its invocation is '" + getspellinvocation("make-arrows") + "'.\"";
+ next;
+
+ goto L_main_menu;
+
+LL_student_3:
+ // Future extensions go here
+ mes "[Auldsbel the Wizard]";
+ mes "\"No, not at this time. You will have to advance in your overall magic skill before I can teach you more.\"";
+ next;
+
+ goto L_main_menu;
+
S_update_var:
set @Q_status, @Q_main_status | (@Q_component_quest << 5);
diff --git a/npc/013-1_Woodland_hills/sagatha.txt b/npc/013-1_Woodland_hills/sagatha.txt
index e2e71cdb..51de9191 100644
--- a/npc/013-1_Woodland_hills/sagatha.txt
+++ b/npc/013-1_Woodland_hills/sagatha.txt
@@ -33,6 +33,7 @@ L_write:
}
function script SagathaStatus {
+ set @mexp, MAGIC_EXPERIENCE & 65535;
set @has_magic, getskilllv(SKILL_MAGIC);
set @evil, 0;
set @good, 0;
@@ -58,9 +59,17 @@ function script SagathaStatus {
013-1.gat,131,24,0 script Sagatha#_M 167,{
callfunc "SagathaStatus";
- set @Q_MASK, NIBBLE_4_MASK;
+ set @Q_MASK, NIBBLE_4_MASK | NIBBLE_5_MASK;
set @Q_SHIFT, NIBBLE_4_SHIFT;
+ set @STATUS_INITIAL, 0;
+ set @STATUS_STUDENT, 1; // N10
+ set @STATUS_STUDENT_A10, 2;
+ set @STATUS_STUDENT_A11, 3;
+ set @STATUS_STUDENT_A12, 4;
+ set @STATUS_STUDENT_N11, 5;
+ set @STATUS_STUDENT_LEVEL_3, 6;
+
set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
if (MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA)
@@ -74,6 +83,9 @@ function script SagathaStatus {
if (@unhappy > 10)
goto L_unhappy;
+ if (MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA)
+ goto L_wb;
+
mes "Before you stands a beautiful woman, dressed in dark purple robes and wearing a witch's hat.";
if (Sex)
@@ -82,7 +94,39 @@ function script SagathaStatus {
mes "She looks at you impassively.";
next;
+ menu
+ "Who are you?", -,
+ "What's your name?", L_intro_name,
+ "Hello! My name is " + strcharinfo(0) + ".", L_intro_givename,
+ "Goodbye.", L_close;
+
+ mes "[Witch]";
+ mes "\"I am what you humans call a witch. I am a human who has chosen all living creatures as what you call family.\"";
+ next;
+
+ menu
+ "No, I mean... what's your name?", L_intro_name,
+ "Hello! My name is " + strcharinfo(0) + ".", L_intro_givename,
+ "Uh.... goodbye.", L_close;
+
+ close;
+
+L_intro_name:
+ mes "[Sagatha the Witch]";
+ mes "\"They call me Sagatha.\"";
set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_SAGATHA;
+ next;
+ goto L_main;
+
+L_intro_givename:
+ mes "[Witch]";
+ mes "\"Ah.\"";
+ next;
+
+ menu
+ "What's yours?", L_intro_name,
+ "Uhm... bye.", -;
+ close;
L_evil:
mes "The witch's eyes flare up in anger as she notices you, and she turns away from you.";
@@ -92,95 +136,193 @@ L_evil:
L_unhappy:
mes "The witch glares at you in anger.";
- mes "\"I hope you enjoyed killing those innocent forest creatures!\"";
- mes "She turns away, clearly not interested in any discussion.";
- mes "\"Don't come back until you have come to your senses!\"";
+ mes "\"I wonder if you can still sleep after killing those innocent forest creatures! I am sure that they will come back to haunt you in your dreams!\"";
next;
close;
-L_Main:
- menu "What do you know about...", L_Question;
+L_wb:
+ mes "[Sagatha the Witch]";
+ if (@good > 1)
+ msg "Sagatha nods as she notices you.";
+ if (@good == 1)
+ msg "Sagatha raises an eyebrow as you address her.";
+ if (@good == 0)
+ msg "Sagatha glances at you, suspicion evident in her eyes.";
+ next;
+
+L_main:
+ if (@Q_status)
+ menu
+ "Can you explain magic to me?", L_explain_magic,
+ "Can you teach me more magic?", L_teach,
+ "What do you know about...", L_Question;
+ if (!@Q_status)
+ menu
+ "Can you explain magic to me?", L_explain_magic,
+ "Can you teach me magic?", L_teach_initial,
+ "What do you know about...", L_Question;
close;
+L_teach_initial:
+ if (@good < 2)
+ goto L_teach_initial_nogood;
+ if (getskilllv(SKILL_MAGIC_NATURE) < 2)
+ goto L_teach_initial_nonature;
+
+ mes "[Sagatha the Witch]";
+ mes "She nods.";
+ mes "\"For now, yes. But you will have to prove that you really care about more than yourself.\"";
+ next;
+
+ mes "[Sagatha the Witch]";
+ mes "She snaps her fingers, and without warning you begin to acutely sense the magical energies around you, for a brief instant!";
+ mes "[5000 experience points]";
+ mes "[Level 2 in Ether Magic]";
+
+ set @Q_status, @STATUS_STUDENT;
+ callsub S_update_var;
+ getexp 5000, 0;
+ if (getskilllv(SKILL_MAGIC_ETHER) < 2)
+ skill SKILL_MAGIC_ETHER, 2;
+
+ mes "[Sagatha the Witch]";
+ mes "\"In the future, I will teach you nature and ether magic. For the other schools there are better teachers around.\"";
+ next;
+
+ goto L_main;
+
+
+L_teach_initial_nogood:
+ mes "[Sagatha the Witch]";
+ mes "\"I don't take strangers as students.\"";
+ next;
+ goto L_main;
+
+L_teach_initial_nonature:
+ mes "[Sagatha the Witch]";
+ mes "\"I might, but you don't even understand the basics of nature magic.\"";
+ next;
+ goto L_main;
+
+L_explain_magic:
+ mes "[Sagatha the Witch]";
+ mes "\"No.\"";
+ next;
+ goto L_main;
+
+L_teach:
+ if (@Q_status == @STATUS_STUDENT)
+ goto L_teach_N10;
+ if (@Q_status == @STATUS_STUDENT_A10)
+ goto L_teach_A10;
+ if (@Q_status == @STATUS_STUDENT_A11)
+ goto L_teach_A11;
+ if (@Q_status == @STATUS_STUDENT_A12)
+ goto L_teach_A12;
+ if (@Q_status == @STATUS_STUDENT_N11)
+ goto L_teach_N11;
+
+ mes "[Sagatha the Witch]";
+ mes "\"Not yet. You have to ask the mana seed to give you more power.\"";
+ next;
+ goto L_main;
+
+L_practice:
+ mes "[1000 experience points]";
+ set @Q_status, @Q_status + 1;
+ callsub S_update_var;
+ getexp 1000,0;
+ next;
+ mes "[Sagatha the Witch]";
+ mes "\"Now go and practice.\"";
+ next;
+ goto L_main;
+
+L_teach_N10:
+ if (@mexp < 150) goto L_teach_noexp;
+ mes "[Sagatha the Witch]";
+ mes "\"First, a nature spell. Take a cocoon shell. Hold it in your hand. Feel its lightness.\"";
+ next;
+ mes "[Sagatha the Witch]";
+ mes "\"Now whisper '" + getspellinvocation("flying-backpack") + "', and if your backpack was pressing on you you should no longer feel it now.\"";
+ goto L_practice;
+
+L_teach_A10:
+ if (@mexp < 250) goto L_teach_noexp;
+ mes "[Sagatha the Witch]";
+ mes "\"To protect against others' magic, take a small mushroom from a shady place. Mushrooms draw things out of the earth. Rub your mushroom into pieces between your hands.\"";
+ next;
+ mes "[Sagatha the Witch]";
+ mes "\"Then say '" + getspellinvocation("barrier") + "' and let the musroom's power take over.\"";
+ next;
+ goto L_practice;
+
+L_teach_A11:
+ if (@mexp < 350) goto L_teach_noexp;
+ mes "[Sagatha the Witch]";
+ mes "\"If you must fight, call allies. You can call scorpions with a scorpion stinger. Hold up the stinger and call out to them: '" + getspellinvocation("summon-scorps") + "'.\"";
+ next;
+ goto L_practice;
+
+L_teach_A12:
+ if (@mexp < 450) goto L_teach_noexp;
+ mes "[Sagatha the Witch]";
+ mes "\"You can call red scorpions, too. But for them you must call out '" + getspellinvocation("summon-red-scorps") + "' instead.\"";
+ next;
+ goto L_practice;
+
+L_teach_N11:
+ if (@mexp < 550) goto L_teach_noexp;
+ mes "[Sagatha the Witch]";
+ mes "\"You can harden your skin with a hard spike. Hold it in your hands and speak '" + getspellinvocation("protect") + "', then draw its hardness into your skin.\"";
+ next;
+ mes "[Sagatha the Witch]";
+ mes "\"Or call it into someone else's skin, by saying that someone's name right after the '" + getspellinvocation("protect") + "'.\"";
+ next;
+ goto L_practice;
+
+L_teach_noexp:
+ mes "[Sagatha the Witch]";
+ mes "\"You must practice more first.\"";
+ next;
+ goto L_main;
+
L_Question:
- set @QQ_ELANORE, 1;
- set @QQ_MANASEED, 2;
- set @QQ_WYARA, 3;
- set @QQ_AULDSBEL, 5;
-
- setarray @choice$, "", "", "", "", "", "";
- set @choices_nr, 0;
- setarray @choice_idx, 0, 0, 0, 0, 0, 0;
-
- set @choice$[@choices_nr], "...Elanore the Healer?";
- set @choice_idx[@choices_nr], @QQ_ELANORE;
- set @choices_nr, @choices_nr + 1;
-
- if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR)))
- goto L_Q_post_manaseed;
- set @choice$[@choices_nr], "...the Mana Seed?";
- set @choice_idx[@choices_nr], @QQ_MANASEED;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_manaseed:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION))
- goto L_Q_post_manapotion;
- set @choice$[@choices_nr], "...Mana Potions?";
- set @choice_idx[@choices_nr], @QQ_MANAPOTION;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_manapotion:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_WYARA))
- goto L_Q_post_wyara;
- set @choice$[@choices_nr], "...Wyara the Witch?";
- set @choice_idx[@choices_nr], @QQ_WYARA;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_wyara:
+ callfunc "MagicTalkOptionsSetup";
+ set @ignore, @QQ_SAGATHA;
+ callfunc "MagictalkMenu";
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
- goto L_Q_post_sagatha;
- set @choice$[@choices_nr], "...Sagatha the Witch?";
- set @choice_idx[@choices_nr], @QQ_SAGATHA;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_sagatha:
-
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_AULDSBEL))
- goto L_Q_post_auldsbel;
- set @choice$[@choices_nr], "...Auldsbel the Wizard?";
- set @choice_idx[@choices_nr], @QQ_AULDSBEL;
- set @choices_nr, @choices_nr + 1;
-L_Q_post_auldsbel:
-
- set @choice$[@choices_nr], "...never mind.";
- set @choice_idx[@choices_nr], 0;
- set @choices_nr, @choices_nr + 1;
-
- menu @choice$[0], -,
- @choice$[1], -,
- @choice$[2], -,
- @choice$[3], -,
- @choice$[4], -;
-
- set @menu, @menu - 1;
-
- if (@menu >= @choices_nr)
- set @menu, 0;
-
- set @c, @choice_idx[@menu];
-
- if (@c == 0) goto L_Main;
+ if (@c == 0) goto L_main;
if (@c == @QQ_ELANORE) goto L_Q_elanore;
if (@c == @QQ_MANASEED) goto L_Q_manaseed;
if (@c == @QQ_MANAPOTION) goto L_Q_manapotion;
if (@c == @QQ_WYARA) goto L_Q_wyara;
if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
- close;
+ if (@c == @QQ_IMP) goto L_Q_imp;
+ if (@c == @QQ_OLDWIZ) goto L_Q_old_wizard;
+
+ mes "[Sagatha the Witch]";
+ mes "\"That doesn't concern you.\"";
+ next;
+ goto L_main;
+
+L_Q_old_wizard:
+ mes "[Sagatha the Witch]";
+ mes "\"A kind and wise wizard.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_imp:
+ mes "[Sagatha the Witch]";
+ mes "\"He is an evil and cruel one. He lies and cheats and will try to take advantage of you. Stay away from him.\"";
+ next;
+ goto L_main_menu;
L_Q_elanore:
mes "[Sagatha the Witch]";
- mes "\"FIXME.\"";
+ mes "\"Elanore is the Tulimshar town healer.\"";
next;
- goto L_Main;
+ goto L_main;
L_Q_manaseed:
mes "[Sagatha the Witch]";
@@ -188,40 +330,43 @@ L_Q_manaseed:
goto L_Q_manaseed_unabsorbed;
if (@has_magic)
goto L_Q_manaseed_m;
- mes "\"arimasu\"";
+ mes "\"There is a mana seed around here, but I don't see how this concerns you.\"";
next;
- goto L_Main;
+ goto L_main;
L_Q_manaseed_unabsorbed:
mes "[Sagatha the Witch]";
- mes "\"...unattuned.\"";
+ mes "\"If the mana seed didn't pass its magic to you, you clearly aren't attuned to magic.\"";
next;
- goto L_Main;
+ goto L_main;
L_Q_manaseed_m:
mes "[Sagatha the Witch]";
- mes "\"...\"";
+ mes "\"You were lucky that the mana seed gave you its magic.\"";
next;
- goto L_Main;
+ goto L_main;
L_Q_manapotion:
mes "[Sagatha the Witch]";
- mes "\"Can't make one without a cauldron.\"";
+ mes "\"I won't make one without a cauldron, that would be wasteful. And I'm not going to start carrying a cauldron around.\"";
next;
- goto L_Main;
+ goto L_main;
L_Q_wyara:
mes "[Sagatha the Witch]";
- mes "\"\"";
+ mes "\"Wyara decided to live with humans, in Hurnscald. She tries to make the world a better place in her own way. Please be kind to her, she is a very good person.\"";
next;
- goto L_Main;
+ goto L_main;
L_Q_auldsbel:
mes "[Sagatha the Witch]";
- mes "\"\"";
+ mes "She frowns.";
+ mes "\"He's a transmutation wizard, member of the northern council. Reasonably competent wizard, too.\"";
next;
- goto L_Main;
+ goto L_main;
+L_close:
+ close;
S_update_var:
set QUEST_MAGIC,
diff --git a/npc/013-2_Magic_house/wizard.txt b/npc/013-2_Magic_house/wizard.txt
index 25f30122..3abb0bb3 100644
--- a/npc/013-2_Magic_house/wizard.txt
+++ b/npc/013-2_Magic_house/wizard.txt
@@ -1,22 +1,78 @@
-013-2.gat,66,39,0 script Old Wizard 116,{
+013-2.gat,66,39,0 script Old Wizard#_W 116,{
+ set @has_magic, getskilllv(SKILL_MAGIC);
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_OLD_WIZARD;
+
+ mes "[Old Wizard]";
mes "\"Welcome, dear wanderer! Come into my humble home. Take a rest, eat and drink.\"";
next;
+
menu
- "Thanks, that's very kind of you!",thanks,
- "Oh, shut up!",shutup;
+ "Thanks, that's very kind of you!",thanks,
+ "Can you teach me magic?", L_teach_rude,
+ "Oh, shut up!",shutup;
+ close;
+
+L_teach_rude:
+ mes "[Old Wizard]";
+ mes "\"I certainly could, but I already have an apprentice.\"";
+ close;
+
shutup:
+ mes "[Old Wizard]";
mes "\"That attitude isn't going to get you very far, my dear.\"";
close;
thanks:
+ mes "[Old Wizard]";
mes "\"Behind this door, my apprentice will serve you.\"";
next;
- menu
- "Alright.",ok,
- "Your apprentice? ... No thanks.",nothx;
+ if (@has_magic)
+ menu
+ "Alright.",ok,
+ "I am studying magic, can you help?", L_new_student,
+ "Your apprentice? ... No thanks.",nothx;
+ if (!@has_magic)
+ menu
+ "Alright.",ok,
+ "Your apprentice? ... No thanks.",nothx;
nothx:
+ mes "[Old Wizard]";
mes "\"Goodbye, then!\"";
close;
+
+L_new_student:
+ mes "[Old Wizard]";
+ mes "\"Studying is always an excellent use of one's mind! I fear that I can't offer too much assistance to you, however. But if you are interested, I could perhaps teach you a simple spell?\"";
+
+ menu
+ "That would be very kind of you!", -,
+ "No, but thank you!", nothx;
+
+ mes "[Old Wizard]";
+ mes "\"This one may not seem too powerful, but it can be quite handy; it's the 'hide' spell. It will shield you from some forms of detection magic.\"";
+ next;
+
+ mes "[Old Wizard]";
+ mes "\"Put a piece of cotton cloth on your head, and speak out '" + getspellinvocation("hide") + "', loudly and clearly. The protection lasts quite long, but you may have to renew it on occasion.\"";
+ next;
+
+ mes "[Old Wizard]";
+ mes "\"You can also cast it on others, of course. Just speak their name after you prononuce the invocation.\"";
+ next;
+
+ mes "[Old Wizard]";
+ mes "\"You may find it useful for getting a little peace and quiet at times, but it can also get in the way of friends trying to find you, so use it with care.\"";
+ next;
+
+ if (getskilllv(SKILL_MAGIC_ASTRAL) >= 2)
+ close;
+
+ mes "[Old Wizard]";
+ mes "\"I'm not sure if you are experienced enough to cast it yet, though. You may need to first learn astral magic.\"";
+ next;
+ close;
+
ok:
+ mes "[Old Wizard]";
mes "\"Beware the flying notes though, some of them are really dangerous. I haven't been able to persuade them to get back into their book. And avoid the mirror, it's been acting strange lately.\"";
next;
mes "\"Oh, and please don't take my apprentice too seriously. He still has a lot to learn.\"";
diff --git a/npc/015-1_Woodland/sword.txt b/npc/015-1_Woodland/sword.txt
index a32b3b13..d666777e 100644
--- a/npc/015-1_Woodland/sword.txt
+++ b/npc/015-1_Woodland/sword.txt
@@ -4,7 +4,7 @@
close;
L_message:
- set @Q_MASK, NIBBLE_6_MASK;
+ set @Q_MASK, (NIBBLE_6_MASK | NIBBLE_7_MASK);
set @Q_SHIFT, NIBBLE_6_SHIFT;
set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
@@ -12,10 +12,20 @@ L_message:
set @STATUS_LEARNED_FLAREDART, 1;
set @STATUS_LEARNED_MAGICBLADE, 2;
set @STATUS_LEVEL2, 3;
+ set @STATUS_W11, 4;
+ set @STATUS_W12, 5;
+ set @STATUS_W11_12, 6;
+ set @STATUS_L2_ALLSPELLS, 7;
+ set @ORE, 640;
+ set @IRONPOWDER, 704;
if (@Q_status == @STATUS_INITIAL) goto L_Initial;
if (@Q_status == @STATUS_LEARNED_FLAREDART) goto L_FlareStage;
if (@Q_status == @STATUS_LEARNED_MAGICBLADE) goto L_MagicBladeStage;
+ if (@Q_status == @STATUS_LEVEL2) goto L_L2_W12;
+ if (@Q_status == @STATUS_W11) goto L_L2_W12;
+ if (@Q_status == @STATUS_W12) goto L_L2_almost_done;
+ if (@Q_status == @STATUS_W11_12) goto L_L2_W10;
mes "[Mystic Sword]";
mes "\"I have taught thee all I can teach for now.\"";
@@ -230,6 +240,93 @@ L_Farewell:
next;
close;
+L_L2_W12:
+ mes "[Mystic Sword]";
+ mes "\"Welcome back, traveler! Hast thou returned to advance in thy quest for magic?\"";
+ next;
+ menu
+ "No.", L_farewell,
+ "Yes.", -;
+
+ mes "[Mystic Sword]";
+ mes "\"Very well. I shall teach thee another spell, if thou provest thy progress by sacrificing another one thousand monster points.\"";
+ next;
+ menu
+ "No, I don't want that.", L_farewell,
+ "I agree.", -;
+
+ if (Mobpt < 1000) goto L_lacking_mobpoints;
+
+ mes "[Mystic Sword]";
+ mes "\"Indeed thou art worthy. The next spell I shall teach thee will enchant thy knuckles to turn them into powerful weapons; the component is a mere beer.\"";
+ mes "[1000 experience points]";
+ set Mobpt, Mobpt - 1000;
+ getexp 1000, 0;
+ set @Q_status, @Q_status + 2;
+ callsub S_update_var;
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"Speak '" + getspellinvocation("magic-knuckles") + "' and take a glass of beer and drink it, without ever taking it off your lips. This will harden and enchant thy fists, turning them into powerful weapons.\"";
+ next;
+ close;
+
+L_L2_almost_done:
+ mes "[Mystic Sword]";
+ mes "\"Greetings once more, traveler! I have another spell I wish to teach thee, but first thou must learn my brother's arrow spell.\"";
+ next;
+ close;
+
+L_L2_W10:
+ mes "[Mystic Sword]";
+ mes "\"Welcome back!\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"I shall now teach thee the final spell of this level of war magic. For further spells thou wilt have to increase thy magical powers more.\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"For this spell, I ask that thou bringest a lump of iron ore. Thou must also sacrifice five thousand monster points.\"";
+ next;
+
+ menu
+ "OK.", -;
+ "No way.", L_farewell;
+
+ if (countitem(@ORE) < 1)
+ goto L_no_ore;
+ if (MPQUEST && (Mobpt < 5000)) goto L_lacking_mobpoints;
+
+ mes "[Mystic Sword]";
+ mes "\"Raise up the ore, mortal!\"";
+ mes "As you do so, the ore begins to crumble, leaving only iron powder behind.";
+ mes "[1000 experience points]";
+ set Mobpt, Mobpt - 5000;
+ getexp 1000, 0;
+ delitem @ORE, 1;
+ getitem @IRONPOWDER, 5;
+ set @Q_status, @STATUS_L2_ALLSPELLS;
+ callsub S_update_var;
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"This powder thou shalst need to cast the lightning spell. Throw it up into the air and shout '" + getspellinvocation("lightning-strike") + "', and smite thine enemies with lightning.\"";
+ next;
+
+
+L_farewell:
+ mes "[Mystic Sword]";
+ mes "\"Then I bid thee farewell for now!\"";
+ next;
+ close;
+
+L_lacking_mobpoints:
+ mes "[Mystic Sword]";
+ mes "\"Thou dost not have enough monster points to prove thy worthiness. Return when thou hast slain more monsters!\"";
+ next;
+ close;
+
S_update_var:
set QUEST_MAGIC,
(QUEST_MAGIC & ~(@Q_MASK)
diff --git a/npc/functions/magic.txt b/npc/functions/magic.txt
index eab4b60a..470323c2 100644
--- a/npc/functions/magic.txt
+++ b/npc/functions/magic.txt
@@ -3,6 +3,9 @@
// Magic system uses:
// - MAGIC_EXP (magic experience points, gained for spellcasting)
// - MAGIC_FLAGS
+// Magic quests use:
+// - QUEST_MAGIC
+// - QUEST_MAGIC2
// ------------------------------------------------------------
// Gain initial magic skill
@@ -13,3 +16,120 @@ function script MagicGainBasic {
close;
}
+
+// ------------------------------------------------------------
+// Initialise Menu for selecting a choice of things to ask about
+// ------------------------------------------------------------
+function script MagicTalkOptionsSetup {
+ set @QQ_ELANORE, 1;
+ set @QQ_MANASEED, 2;
+ set @QQ_MANAPOTION, 3;
+ set @QQ_WYARA, 4;
+ set @QQ_SAGATHA, 5;
+ set @QQ_AULDSBEL, 6;
+ set @QQ_IMP, 7;
+ set @QQ_OLDWIZ, 8;
+}
+
+// ------------------------------------------------------------
+// Print and run menu for choice of things to ask about
+// Ignores the entry in @ignore
+// Returns the result in `@c, or `0'
+// ------------------------------------------------------------
+
+function script MagicTalkMenu {
+ setarray @choice$, "", "", "", "", "", "", "", "", "";
+ set @choices_nr, 0;
+ setarray @choice_idx, 0, 0, 0, 0, 0, 0, 0, 0, 0;
+
+ if (@ignore == @QQ_ELANORE)
+ goto L_Q_post_elanore;
+ set @choice$[@choices_nr], "...Elanore the Healer?";
+ set @choice_idx[@choices_nr], @QQ_ELANORE;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_elanore:
+
+ if (@ignore == @QQ_MANASEED)
+ goto L_Q_post_manaseed;
+ if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR)))
+ goto L_Q_post_manaseed;
+ set @choice$[@choices_nr], "...the Mana Seed?";
+ set @choice_idx[@choices_nr], @QQ_MANASEED;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_manaseed:
+
+ if (@ignore == @QQ_MANAPOTION)
+ goto L_Q_post_manapotion;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION))
+ goto L_Q_post_manapotion;
+ set @choice$[@choices_nr], "...Mana Potions?";
+ set @choice_idx[@choices_nr], @QQ_MANAPOTION;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_manapotion:
+
+ if (@ignore == @QQ_WYARA)
+ goto L_Q_post_wyara;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_WYARA))
+ goto L_Q_post_wyara;
+ set @choice$[@choices_nr], "...Wyara the Witch?";
+ set @choice_idx[@choices_nr], @QQ_WYARA;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_wyara:
+
+ if (@ignore == @QQ_SAGATHA)
+ goto L_Q_post_sagatha;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
+ goto L_Q_post_sagatha;
+ set @choice$[@choices_nr], "...Sagatha the Witch?";
+ set @choice_idx[@choices_nr], @QQ_SAGATHA;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_sagatha:
+
+ if (@ignore == @QQ_AULDSBEL)
+ goto L_Q_post_auldsbel;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_AULDSBEL))
+ goto L_Q_post_auldsbel;
+ set @choice$[@choices_nr], "...Auldsbel the Wizard?";
+ set @choice_idx[@choices_nr], @QQ_AULDSBEL;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_auldsbel:
+
+ if (@ignore == @QQ_OLDWIZ)
+ goto L_Q_post_oldwiz;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_OLD_WIZARD))
+ goto L_Q_post_oldwiz;
+ set @choice$[@choices_nr], "...the Old Wizard?";
+ set @choice_idx[@choices_nr], @QQ_OLDWIZ;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_oldwiz:
+
+ if (@ignore == @QQ_IMP)
+ goto L_Q_post_imp;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_IMP))
+ goto L_Q_post_imp;
+ set @choice$[@choices_nr], "...the Earth Spirit in the desert well?";
+ set @choice_idx[@choices_nr], @QQ_IMP;
+ set @choices_nr, @choices_nr + 1;
+L_Q_post_imp:
+
+ set @choice$[@choices_nr], "...never mind.";
+ set @choice_idx[@choices_nr], 0;
+ set @choices_nr, @choices_nr + 1;
+
+ menu @choice$[0], -,
+ @choice$[1], -,
+ @choice$[2], -,
+ @choice$[3], -,
+ @choice$[4], -,
+ @choice$[5], -,
+ @choice$[6], -,
+ @choice$[7], -,
+ @choice$[8], -;
+
+ set @menu, @menu - 1;
+
+ if (@menu >= @choices_nr)
+ set @menu, 0;
+
+ set @c, @choice_idx[@menu];
+}