summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/001-1_Tulimshar/bard.txt145
-rw-r--r--npc/001-1_Tulimshar/children.txt32
-rw-r--r--npc/001-1_Tulimshar/elanore.txt303
-rw-r--r--npc/002-3_Desert_mines/miners.txt10
-rw-r--r--npc/008-1_Hurnscald_outskirts/hinnak.txt131
-rw-r--r--npc/009-2_Hurnscald/_import.txt1
-rw-r--r--npc/009-2_Hurnscald/shops.txt2
-rw-r--r--npc/009-2_Hurnscald/wyara.txt153
-rw-r--r--npc/009-3_Cave_beneath_Hurnscald/sword.txt126
-rw-r--r--npc/011-1_Woodland/_import.txt1
-rw-r--r--npc/011-1_Woodland/alchemist.txt134
-rw-r--r--npc/011-1_Woodland/auldsbel.txt929
-rw-r--r--npc/012-1_Woodland_Hills/_import.txt1
-rw-r--r--npc/012-1_Woodland_Hills/injured-mouboo.txt231
-rw-r--r--npc/012-3_Cave/_import.txt1
-rw-r--r--npc/012-3_Cave/mana-seed.txt265
-rw-r--r--npc/013-1_Woodland_hills/_import.txt1
-rw-r--r--npc/013-1_Woodland_hills/sagatha.txt230
-rw-r--r--npc/013-3_Cave/barrier.txt2
-rw-r--r--npc/015-1_Woodland/sword.txt155
-rw-r--r--npc/018-1_Woodland_mining_camp/_import.txt1
-rw-r--r--npc/018-1_Woodland_mining_camp/sword.txt12
-rw-r--r--npc/018-3_Cave/_import.txt1
-rw-r--r--npc/018-3_Cave/sword.txt12
-rw-r--r--npc/functions/magic.txt15
-rw-r--r--npc/functions/mob_points.txt35
26 files changed, 2903 insertions, 26 deletions
diff --git a/npc/001-1_Tulimshar/bard.txt b/npc/001-1_Tulimshar/bard.txt
index 8d53fc72..d361b860 100644
--- a/npc/001-1_Tulimshar/bard.txt
+++ b/npc/001-1_Tulimshar/bard.txt
@@ -1,10 +1,153 @@
//
-001-1.gat,50,44,0 script Bard 152,{
+001-1.gat,37,73,0 script Bard 152,{
setarray @songs$, "\"There once was a bard, who had it hard, because a man in dark green, was very mean.\"",
"\"At Hurnscald inn, there was a person of fairest skin, declining wedding bands from quite a many hands.\"",
"\"As the Sun sets down in the forest's brown, she whom the fragrance holds counts her gold.\"";
set @id, rand(3);
+ mes "[Bill Wobbleball the Bard]";
+ if (Sex)
+ mes "\"Greetings, traveler! Have you come to listen to my stories?\"";
+ if (!Sex)
+ mes "\"Greetings, fair lady! Well met, on such a lovely day! Might I entertain you with a tale or two?\"";
+ next;
+
+L_Main:
+ menu "Sing me a song, lute man!", L_Song,
+ "Have you heard any news?", L_News,
+ "What do you know about...", L_Question,
+ "Farewell!", -;
+ close;
+
+L_News:
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"News I have for you indeed, lest you have already overheard (for then it would no longer be news to you!)\"";
+ next;
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"Rumor has it that an ancient source of magic, a Mana Seed, has been sighted in the west, beyond the fair town of Hurnscald.\"";
+ next;
+ set MFLAG, MFLAG | MFLAG_MANASEED_RUMOUR;
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"Whence it came, nobody knows... but they say that sometimes such Mana Seeds may choose a powerful individual to impart some of its mystic power to!\"";
+ next;
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"I wonder who might be qualified?\"";
+ next;
+ 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];
+
+ 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_WYARA) goto L_Q_wyara;
+ if (@c == @QQ_SAGATHA) goto L_Q_sagatha;
+ if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
+ close;
+
+L_Q_elanore:
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"Elanore is this town's healer. Rumor has it that she traveled far and wide when she was younger, to learn the deepest secrets of healing magic, after her brother caught a mysterious illness.\"";
+ next;
+ goto L_Main;
+
+L_Q_manaseed:
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"The Mana Seed is said to be a source of great magic. Perhaps some witch or wizard might know more about it?\"";
+ next;
+ goto L_Main;
+
+L_Q_wyara:
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"Wyara is not actually from Hurnscald. As a young witch, she decided to settle down there to help the people of Hurnscald. She is kind and gentle, except towards the Doctor, who seems to have little respect for her potions.\"";
+ next;
+ goto L_Main;
+
+L_Q_sagatha:
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"Sagatha! Ah, such a wonderful and mysterious being; the center of many a tale...\"";
+ next;
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"Some say that she is the most powerful witch in all of Argaes. I don't know whether that is true, but I am quite certain that the is the most beautiful of all the witches! Alas, she will let no man touch her...\"";
+ mes "He sighs.";
+ next;
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"I met her only twice, back in my traveling days, but there are two pieces of advice I can give you:\"";
+ next;
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"First, she will suffer no fool easily, particularly no man.\"";
+ next;
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"Second, the creatures of the forest mean everything to her. Harm them, and you may find her an enemy-- and a powerful one at that...\"";
+ next;
+ goto L_Main;
+
+L_Q_auldsbel:
+ mes "[Bill Wobbleball the Bard]";
+ mes "\"Auldsbel is some wizard from further north, from what I have gathered. He bought a hut near Hurnscald some years back and often comes here to experiment on things, probably because he is not allowed to do these experiments where he comes from.\"";
+ next;
+ goto L_Main;
+
+
+L_Song:
mes @songs$[@id];
close;
}
diff --git a/npc/001-1_Tulimshar/children.txt b/npc/001-1_Tulimshar/children.txt
index e68cfe95..e2771cf0 100644
--- a/npc/001-1_Tulimshar/children.txt
+++ b/npc/001-1_Tulimshar/children.txt
@@ -54,7 +54,8 @@ L_8:
}
001-1.gat,39,67,0 script Nina 103,{
- set @TEMP,rand(8);
+ mes "[Nina]";
+ set @TEMP,rand(10);
if(@TEMP == 0) goto L_1;
if(@TEMP == 1) goto L_1;
if(@TEMP == 2) goto L_2;
@@ -64,44 +65,55 @@ L_8:
if(@TEMP == 6) goto L_6;
if(@TEMP == 7) goto L_7;
if(@TEMP == 8) goto L_8;
+ goto L_9;
L_1:
- mes "[Nina]";
mes "\"If I learned anything from school, Grenxen founded Tulimshar.\"";
close;
L_2:
- mes "[Nina]";
mes "\"When I was picking rocks from the field, I saw a red scorpion.\"";
close;
L_3:
- mes "[Nina]";
mes "\"Its polite to state your name before talking to anyone.\"";
close;
L_4:
- mes "[Nina]";
+
mes "\"I have a Scorpion Doll!\"";
close;
L_5:
- mes "[Nina]";
mes "\"I always take some spare Cactus Juices with me on the field. They are heavy, though.\"";
close;
L_6:
- mes "[Nina]";
mes "\"When you are feeling bad, eating something can usually help you heal faster.\"";
close;
L_7:
- mes "[Nina]";
mes "\"Grenxen is the Demon that founded Tulimshar.\"";
close;
L_8:
- mes "[Nina]";
- mes "That volcano eruption was terrifying; much of Tulimshar was destroyed. Fortunately the mayor had everything rebuilt quickly.";
+ mes "\"That volcano eruption was scary; much of Tulimshar was destroyed. But the mayor had everything rebuilt quickly.\"";
close;
+
+L_9:
+ mes "\"I know a bad word, but I promised my mom that I wouldn't tell anyone.\"";
+ menu "That's good. You shouldn't tell such things.", -,
+ "What's that bad word?", L_badword;
+
+L_badword
+ mes "[Nina]";
+ mes "She looks around nervously, then motions you to come closer.";
+ mes "\"It's '" + getspellinvocation("aggravate") + "', she whispers in your ear.\"";
+ next;
+
+ mes "[Nina]";
+ mes "Terrified, she looks around once more.";
+ mes "\"But you mustn't tell anyone!\"";
+ next;
+ close;
}
diff --git a/npc/001-1_Tulimshar/elanore.txt b/npc/001-1_Tulimshar/elanore.txt
index 4171e54f..fabb0e24 100644
--- a/npc/001-1_Tulimshar/elanore.txt
+++ b/npc/001-1_Tulimshar/elanore.txt
@@ -2,6 +2,28 @@
001-1.gat,58,68,0 script Elanore 108,{
+ set @has_magic, getskilllv(SKILL_MAGIC);
+
+ set @Q_MASK, NIBBLE_5_MASK;
+ set @Q_SHIFT, NIBBLE_5_SHIFT;
+
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+ set @Q_heal_exp, MAGIC_EXPERIENCE >> 24;
+
+ set @BUGLEG, 518;
+ set @MAGGOTSLIME, 505;
+ set @MAUVE, 680;
+ set @GAMBOGE, 681;
+ set @COBALT, 682;
+ set @ALIZARIN, 683;
+ set @LIFESTONE, 730;
+
+ set @STATUS_INITIAL, 0;
+ set @STATUS_LEARNED_LIGHT_HEAL, 1;
+ set @STATUS_MASTERED_LIGHT_HEAL, 2;
+ set @STATUS_LEARNED_LAY_ON_HANDS, 3;
+
+
if (baselevel > 10) goto L_NoHeal;
set @TEMP,rand(4);
@@ -78,7 +100,10 @@ Heal_4:
close;
L_NoHeal:
+ if (MAGIC_FLAGS)
+ goto L_Chat;
+L_NoHealMessage:
mes "[Elanore the Healer]";
mes "\"I'm sorry but unless you are young and in need, I can't help you, and your level is already higher than ten.";
mes "With so many people still injured from the earthquake, I really have no time to help.";
@@ -86,5 +111,283 @@ L_NoHeal:
close;
+L_Chat:
+ mes "[Elanore the Healer]";
+ mes "\"Hello! Can I help you?\"";
+ next;
+L_Main:
+ if (@has_magic && (@Q_status == @STATUS_INITIAL))
+ menu
+ "Can you heal me?", L_NoHealMessage,
+ "Can you teach me magic?", L_Teach,
+ "What do you know about...", L_Question;
+
+ if (@has_magic && (@Q_status > @STATUS_INITIAL))
+ menu
+ "Can you heal me?", L_NoHealMessage,
+ "Can you teach me more?", L_Teach,
+ "Where can I get more lifestones?, L_Lifestones,
+ "What do you know about...", L_Question;
+
+ if (!@has_magic)
+ menu
+ "Can you heal me?", L_NoHealMessage,
+ "What do you know about...", L_Question;
+ close;
+
+OnPCKillEvent:
+ attachrid(@killerrid);
+ set @Q_heal_exp, MAGIC_EXPERIENCE >> 24;
+ if (@Q_heal_exp < 8)
+ goto L_OnPcKillWipe;
+ @Q_heal_exp = @Q_heal_exp - 8;
+ goto L_OnPcKillFinish;
+L_OnPcKillWipe:
+ @Q_heal_exp = 0;
+L_OnPcKillFinish:
+ set MAGIC_EXPERIENCE, (MAGIC_EXPERIENCE & ~(255 << 24)) | (@Q_heal_exp << 24);
+ close;
+
+L_Lifestones:
+ mes "[Elanore the Healer]";
+ mes "\"I always need components for my own healing spells. If you bring me ten gamboge leaves, ten alizarin leaves, ten mauve leaves and ten cobalt leaves, I can make ten lifestones; I will give you half of them.\"";
+ next;
+
+ menu
+ "OK, I will get them.", -,
+ "No way!", -,
+ "Here you are!", L_Lifestones_Trade,
+ "Can I make them myself?", L_Lifestones_MakeSelf;
+ close;
+
+L_Lifestones_Trade:
+ if (countitem(@MAUVE) < 10) goto L_Lifestones_Trade_Missing;
+ if (countitem(@GAMBOGE) < 10) goto L_Lifestones_Trade_Missing;
+ if (countitem(@ALIZARIN) < 10) goto L_Lifestones_Trade_Missing;
+ if (countitem(@COBALT) < 10) goto L_Lifestones_Trade_Missing;
+ getinventorylist;
+ if (@inventorylist_count == 100 && countitem(@LIFESTONE) == 0
+ && countitem(@MAUVE) > 10
+ && countitem(@GAMBOGE) > 10
+ && countitem(@ALIZARIN) > 10
+ && countitem(@COBALT) > 10) goto L_Lifestones_NoRoom;
+
+ delitem @MAUVE, 10;
+ delitem @GAMBOGE, 10;
+ delitem @ALIZARIN, 10;
+ delitem @COBALT, 10;
+ getitem @LIFESTONE, 5;
+ getexp 200, 1;
+ mes "[Elanore the Healer]";
+ mes "Elanore carefully goes over your leaves, then smiles.";
+ mes "\"These will do just fine.\";
+ mes "She picks up all fourty and presses them together in her hands, then whispers something.\"";
+ next;
+ mes "[Elanore the Healer]";
+ mes "As she opens her hands again, the leaves have turned into ten golden crystals.";
+ mes "\"Five for you and five for me.\"";
+ mes "She smiles.";
+ mes "[200 experience points]";
+ next;
+ close;
+
+L_Lifestones_NoRoom:
+ mes "[Elanore the Healer]";
+ mes "\"Oh... it seems that you have no room for the lifestones. But please do come back later when you have made a little space.\"";
+ next;
+ close;
+
+L_Lifestones_Trade_Missing:
+ mes "[Elanore the Healer]";
+ mes "Elanore counts the leaves you show her.";
+ mes "\"No, I am sorry. Please bring me ten leaves each of gamboge, alizarin, mauve, and cobalt.\"";
+ next;
+ close;
+
+L_Lifestones_MakeSelf:
+ mes "[Elanore the Healer]";
+ if (@has_magic >= 2)
+ mes "\"Oh, but of course! You are powerful enough to make your own lifestones, using the enchantment '" + getspellinvocation("enchant-lifestone") + "'. This will consume a bug leg or a maggot slime or one of each of the four healing herbs, though.\"";
+ if (@has_magic < 2)
+ mes "\"No, you are not powerful enough yet. Please come back and ask me again when you have learned to control more powerful magic, though!.\"";
+ next;
+ close;
+
+L_Teach:
+ if (@Q_status == @STATUS_INITIAL) goto L_Teach_Initial;
+ if (@Q_status == @STATUS_LEARNED_LIGHT_HEAL) goto L_Teach_CheckAdvanceTo2;
+ if (@Q_status == @STATUS_MASTERED_LIGHT_HEAL) goto L_Teach_CheckAdvanceToLOH;
+ //if (@Q_status == @STATUS_LEARNED_LAY_ON_HANDS) goto L_Teach_CheckAdvanceTo3; // not done yet. :-)
+
+ mes "[Elanore the Healer]";
+ mes "\"You have made good progress, but you lack the magical power to advance further. Also, I would like to observe you some more to be certain that you will make a good healer.\"";
+ next;
+ close;
+
+L_Teach_Initial:
+ mes "[Elanore the Healer]";
+ mes "\"I will only teach you magic of the school of Life, and that only if you prove yourself to be a good healer-- that is, if you use your powers to help others.\"";
+ mes "She hesistates.";
+ next;
+ mes "[Elanore the Healer]";
+ mes "\"I don't know you very well, but I don't think that there is any harm in teaching you a simple spell.\"";
+ mes "She reaches inside her satchel and pulls out a piece of crystal, glittering in the sun.";
+ mes "\"This here is a lifestone, life energy encased in a crystal shell. You will need it for most healing magic.\"";
+ next;
+ mes "[Elanore the Healer]";
+ mes "\"To heal someone, first locate the injury. As a beginner, you have to touch the wound; with practice, it will be enough to think about it. Hold the lifestone in one hand, touching the wound with the other.\"";
+ mes "\"Then say, '" + getspellinvocation("lesser-heal") + "', followed by the name of the one you wish to heal.\"";
+ next;
+ mes "[Elanore the Healer]";
+ mes "\"You might want to write that down, actually. In fact, you might want to make sure to keep notes of all spells you hear, for you never now if you will hear them again!\"";
+ mes "\"The invocation was '" + getspellinvocation("lesser-heal") + "'.\"";
+ next;
+ mes "[Elanore the Healer]";
+ mes "\"This will only cure cuts and bruises, though, and it will take some time to take effect. It will be useless to mend broken bones or more severe injuries!\"";
+ mes "\"To heal yourself, it's enough to just say '" + getspellinvocation("lesser-heal") + "' by itself.\"";
+ next;
+ mes "[Elanore the Healer]";
+ mes "\"Let me give you a lifestone to get started with.\"";
+ next;
+
+ getinventorylist;
+ if (@inventorylist_count == 100 && countitem(@LIFESTONE) == 0)
+ goto L_Teach_Initial_Noroom;
+
+ getitem @LIFESTONE, 1;
+ set @Q_status, @STATUS_LEARNED_LIGHT_HEAL;
+ callsub S_update_var;
+
+ mes "[Elanore the Healer]";
+ mes "Elanore hands you the crystal.";
+ mes "\"Here you are. I hope that it will allow you to do good!\"";
+ next;
+ close;
+
+L_Teach_Initial_Noroom:
+ mes "[Elanore the Healer]";
+ mes "\"Oh... you managed to put things into every little nook and pocket, haven't you? Well, come back later, I will give it to you then.\"";
+ close;
+
+L_Teach_CheckAdvanceTo2:
+ close;
+L_Teach_CheckAdvanceToLOH:
+ close;
+
+L_NoMagicNoTeach:
+ mes "[Elanore the Healer]";
+ mes "Elanore shakes her head.";
+ mes "\"I am sorry, but you don't have any magical abilities. I can only teach those who already have the power to do magic.\"";
+ next;
+ 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];
+
+ if (@c == 0) goto L_Main;
+ 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_SAGATHA) goto L_Q_sagatha;
+ if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
+ close;
+
+L_Q_manaseed:
+ mes "[Elanore the Healer]";
+ mes "She smiles.";
+ mes "\"If the rumors are true and there really is a Mana Seed, then that would be wonderful news-- perhaps we will have a few more healers soon!\"";
+ next;
+ goto L_Main;
+
+L_Q_manapotion:
+ mes "[Elanore the Healer]";
+ mes "\"I'm sorry, but I can't help you with that.\"";
+ next;
+ goto L_Main;
+
+L_Q_wyara:
+ mes "[Elanore the Healer]";
+ mes "\"Wyara is the Hurnscald town witch. She was also the town healer before the Doctor moved there.\"";
+ next;
+ goto L_Main;
+
+L_Q_sagatha:
+ mes "[Elanore the Healer]";
+ mes "\"Oh, I have only met Sagatha once or twice, while collecting herbs. She is a warm and gentle person, but she tries to hide it.\"";
+ next;
+ goto L_Main;
+
+L_Q_auldsbel:
+ mes "[Elanore the Healer]";
+ mes "\"Oh, sorry-- I don't really know him very well.\"";
+ next;
+ goto L_Main;
+
+
+S_update_var:
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
}
diff --git a/npc/002-3_Desert_mines/miners.txt b/npc/002-3_Desert_mines/miners.txt
index 2ee99b26..7f120598 100644
--- a/npc/002-3_Desert_mines/miners.txt
+++ b/npc/002-3_Desert_mines/miners.txt
@@ -2,16 +2,24 @@
002-3.gat,35,35,6 script Nathan 109,{
mes "[Nathan the Miner]";
+
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+
mes "\"It's very dangerous in here.";
mes "We had a big earthquake here";
mes "just recently, too... so be";
mes "careful!\"";
close;
+
+L_message:
+ mes "\"We found a good way to carry our ores out of here safely: one of us always runs ahead shouting '" + getspellinvocation("aggravate") + "'. Somehow this seems to distract the monsters.\"";
+ close;
}
002-3-1.gat,85,97,6 script Naem 109,{
mes "[Naem the Miner]";
mes "\"We discovered an underground palace.";
- mes "You can get there using the passage ont he left.\"";
+ mes "You can get there using the passage on the left.\"";
close;
}
diff --git a/npc/008-1_Hurnscald_outskirts/hinnak.txt b/npc/008-1_Hurnscald_outskirts/hinnak.txt
index ce0af655..96e6e145 100644
--- a/npc/008-1_Hurnscald_outskirts/hinnak.txt
+++ b/npc/008-1_Hurnscald_outskirts/hinnak.txt
@@ -86,8 +86,135 @@ L_Exchange_TooMany:
L_ThanksAgain:
mes "[Farmer Hinnak]";
- mes "\"Thanks again for helping me with the pinkies.\"";
- close;
+ mes "\"Good to see you again, and thanks again for helping me with the pinkies!\"";
+
+ set @BEER, 539;
+
+ next;
+
+ menu
+ "Sure, any time!", -,
+ "Anything else you want me to do?", -,
+ "You're welcome. Bye!", L_Bye;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Actually, it's been a long day. If it's no trouble, could you get me a beer?\"";
+ next;
+
+ menu
+ "Here you are.", L_GiveBeer,
+ "Sure, I'll go get one. Bye!", L_Bye,
+ "You shouldn't drink while working!", -;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Well, I'm done for the day...\";
+
+ menu
+ "Sorry... here you are.", L_GiveBeer,
+ "I don't have any.", L_NoBeer;
+
+L_GiveBeer:
+ if (countitem(@BEER) < 0) goto L_NoBeer;
+ delitem @BEER, 1;
+ mes "[Farmer Hinnak]";
+ mes "Hinnak takes a sip.";
+ mes "\"Aaah! Nothing like a well-deserved beer after a long day of tending the crops!\"";
+ mes "\"Thanks, that was very kind of you!\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "He takes another sip.";
+ mes "\"Thanks! You know, I had the strangest thing happen to me. I had this patch of ground that was really clumpy; lots of clay, you see.\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Right over there.\"";
+ mes "He points to a stretch of soft, raked ground.";
+ mes "\"Looks much better now, doesn't it? But how I got there is kind-a scary...\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"I'd been trying to break it up for a while, but that kind of work is a pain. So my wife said that I should go and see the witch, just in case she knows something.\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"And sure enough I ask the witch, and she has a look at it. 'Nothing I can do', she says, 'but I can ask a friend'.\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"So the next day another witch shows up. Gorgeous woman, but when she looked at me, the scares went scuttling down my spine....\"";
+ mes "\"First thing she asked was if I'm a farmer. Said her friend had told her that I needed help.\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"I show her what the problem is, and she tells me to go inside and wait.\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Hinnak drains his beer in one long sip, then hesitates.";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"So I go inside. I've barely entered when it starts raining outside, pouring cats and mouboos!\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Not so weird, perhaps, except that it had been bright and sunny just a second before! So I rush out, my wife telling me to leave her alone, and I see that witch standing there in the middle of the rain...\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"None of the raindrops touched her, as if they was afraid!\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"Then she yells out some gobbledygood word, and out of the ground there comes a swarm of maggots, crawling and digging and climbing over each other's backs...\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"And then she turns to me! Seeing her stare, for a moment there I think that she'll turn me into a pinkie, for sure...\"";
+ next;
+
+ mes "[Farmer Hinnak]";
+ mes "\"But all she says is, 'if you'd stayed inside, you wouldn't be wet now'.\"";
+ next;
+
+ next
+ "Hahaha!", L_Sagatha_hahaha,
+ "Whoah, scary...", L_Sagatha_scary,
+ "What was that gobbledygood word?", L_Sagatha_word,
+ "I better go now.", -;
+ goto L_Bye;
+
+L_Sagatha_hahaha:
+ mes "[Farmer Hinnak]";
+ mes "\"Yeah, funny now... But you should've seen that stare! Ah, well, never mind.\"";
+ next;
+ close
+
+L_Sagatha_scary:
+ mes "[Farmer Hinnak]";
+ mes "\"Yeah, you could say that...\"";
+ mes "He stares into his empty beer jug, as if hoping for it to re-fill by magic.";
+ next;
+ close
+
+L_Sagatha_word:
+ mes "[Farmer Hinnak]";
+ mes "\"Oh, I can be sure... but something like '" + getspellinvocation("summon-maggots") + "', I think.\"";
+ next;
+ close
+
+L_NoBeer:
+ mes "[Farmer Hinnak]";
+ mes "\"Ah... no beer? Oh well.\"";
+ next;
+ close;
+
+L_Bye:
+ mes "[Farmer Hinnak]";
+ mes "\"Bye!\"";
+ next;
+ close;
L_NohMask:
menu
diff --git a/npc/009-2_Hurnscald/_import.txt b/npc/009-2_Hurnscald/_import.txt
index d2badb7b..773191c7 100644
--- a/npc/009-2_Hurnscald/_import.txt
+++ b/npc/009-2_Hurnscald/_import.txt
@@ -13,3 +13,4 @@ npc: npc/009-2_Hurnscald/richard.txt
npc: npc/009-2_Hurnscald/selim.txt
npc: npc/009-2_Hurnscald/shops.txt
npc: npc/009-2_Hurnscald/waitress.txt
+npc: npc/009-2_Hurnscald/wyara.txt
diff --git a/npc/009-2_Hurnscald/shops.txt b/npc/009-2_Hurnscald/shops.txt
index ebd9f767..f943ac8f 100644
--- a/npc/009-2_Hurnscald/shops.txt
+++ b/npc/009-2_Hurnscald/shops.txt
@@ -22,7 +22,7 @@
// Potion Shop
// sells cactus drink, cactus potion, iron potion and concentration potion
-009-2.gat,121,26,0 shop Witch 103,501:50,502:70,567:500,568:500
+009-2.gat,123,22,0 shop Potions#_M 127,501:50,502:70,567:500,568:500
// Blacksmith
// Sells all knives, chainmail armor, light platemail
diff --git a/npc/009-2_Hurnscald/wyara.txt b/npc/009-2_Hurnscald/wyara.txt
new file mode 100644
index 00000000..f0492368
--- /dev/null
+++ b/npc/009-2_Hurnscald/wyara.txt
@@ -0,0 +1,153 @@
+009-2.gat,121,26,0 script Wyara#_M 103,{
+
+ set @MAUVE, 680;
+ set @BOTTLE_WATER, 541;
+ set @MANAPOTION, 705;
+
+ set @has_magic, getskilllv(SKILL_MAGIC);
+
+ mes "[Wyara the Witch]";
+ next;
+
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_WYARA;
+L_Main:
+ menu "Q: generic", L_Question,
+ "Q: buy", L_Shop,
+ "Bye", -;
+ close;
+
+L_Shop:
+ mes "[Wyara the Witch]";
+ mes "cf. Potion Shelf behind me";
+ next;
+ goto L_Main;
+
+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];
+
+ 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_SAGATHA) goto L_Q_sagatha;
+ if (@c == @QQ_AULDSBEL) goto L_Q_auldsbel;
+ close;
+
+L_Q_elanore:
+ mes "[Wyara the Witch]";
+ mes "\"FIXME\"";
+ next;
+ goto L_Main;
+
+L_Q_manaseed:
+ if (!@has_magic && (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED))
+ goto L_Q_manaseed_unabsorbed;
+ mes "[Wyara the Witch]";
+ mes "\"FIXME: No idea\"";
+ next;
+ goto L_Main;
+
+L_Q_manaseed_unabsorbed:
+ mes "[Wyara the Witch]";
+ mes "\"FIXME: Perhaps a mana potion would help\"";
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_MANAPOTION;
+ next;
+ goto L_Main;
+
+L_Q_manapotion:
+ mes "[Wyara the Witch]";
+ mes "\"FIXME: Can make one for you: 40 mauve, bottle of water\"";
+ next;
+ menu "OK", L_make_manapotion,
+ "No", L_Main;
+ goto L_Main;
+
+L_make_manapotion:
+ if(countitem(@MAUVE) < 40) goto L_make_manapotion_lack;
+ if(countitem(@WATER) < 1) goto L_make_manapotion_lack;
+
+ delitem @MAUVE, 40;
+ delitem @WATER, 1;
+ getitem @MANAPOTION, 1;
+
+ mes "[Wyara the Witch]";
+ mes "\"FIXME: Here.\"";
+
+ goto L_Main;
+
+L_make_manapotion_lack:
+ mes "[Wyara the Witch]";
+ mes "\"FIXME: Need: 40 mauve, bottle of water\"";
+ goto L_Main;
+
+L_Q_sagatha:
+ mes "[Wyara the Witch]";
+ mes "\"FIXME\"";
+ next;
+ goto L_Main;
+
+L_Q_auldsbel:
+ mes "[Wyara the Witch]";
+ mes "\"FIXME\"";
+ next;
+ goto L_Main;
+
+
+}
diff --git a/npc/009-3_Cave_beneath_Hurnscald/sword.txt b/npc/009-3_Cave_beneath_Hurnscald/sword.txt
new file mode 100644
index 00000000..a99c4a6b
--- /dev/null
+++ b/npc/009-3_Cave_beneath_Hurnscald/sword.txt
@@ -0,0 +1,126 @@
+009-3.gat,26,100,0 script #MysticSword#_M 127,{
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+ close;
+
+L_message:
+ set @Q_MASK, NIBBLE_6_MASK;
+ set @Q_SHIFT, NIBBLE_6_SHIFT;
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+
+ set @STATUS_INITIAL, 0;
+ set @STATUS_LEARNED_FLAREDART, 1;
+ set @STATUS_LEARNED_MAGICBLADE, 2;
+
+ 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_PostMagicBlade;
+
+ mes "[Mystic Sword]";
+ mes "Come back when thou art stronger.";
+ next;
+ close;
+
+L_Initial:
+ mes "[Mystic Sword]";
+ mes "As you look at the sword, you suddenly hear a voice in your head!";
+ mes "\"Welcome to my prison, mortal!\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "Well, either you are going mad, or that sword in the stone is talking to you.";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "Or, well, both.";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "The deep basso voice continues.";
+ mes "\"I know not what brought thee hither, but I kindly ask that you leave me alone in my sorrow.\"";
+ next;
+
+ menu
+ "Leave", L_Close,
+ "Sorry.", -,
+ "Who or what are you?", -,
+ "What sorrow?", -,
+ "Can I help?", -,
+ "Can you teach me magic?", -;
+
+ mes "[Mystic Sword]";
+ mes "There is no answer.";
+ next;
+ close;
+
+L_PostFlareDart:
+ mes "[Mystic Sword]";
+ mes "As you look at the sword, you hear a deep voice resounding in your head.";
+ mes "\"Welcome, mortal!\"";
+ next;
+
+ mes
+ "Hi! How are you?", L_PostFlareDart_hi,
+ "Can you teach me magic?", L_PostFlareDart_teach,
+ "Your sister sent me.", L_PostFlareDart_sister,
+ "Bye!", -;
+ close;
+
+L_PostFlareDart_hi:
+ mes "[Mystic Sword]";
+ mes "\"Mortal... I have seen pain and death beyond thine reckoning! Mock me not with thine idle questions!\"";
+ next;
+ close;
+
+L_PostFlareDart_sister:
+ mes "[Mystic Sword]";
+ mes "\"My sister...? Alas! I remember now; abandoned she was, just as I; buried in stone, never to be wielded again.\"";
+ mes "\"Wherefore did she send thee?\"";
+ next;
+
+ menu "She asked me to ask you to teach me a spell.", -;
+
+L_PostFlareDart_teach:
+ mes "[Mystic Sword]";
+ mes "\"Beware, mortal... the only spells I can teach thee are those of the school of war. Dark and dreary spells, that lot! Pain and misery is all they bring...\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "The sword's voice is growing apprehensive.";
+ mes "\"Once a spell has been learned, it cannot be taken back, no more than a death can be undone. So be careful, mortal... dost thou truly wish to know the secrets of thus destructive power?\"";
+ next;
+
+ menu
+ "Yes.", -,
+ "No.", L_Close;
+
+ mes "[Mystic Sword]";
+ mes "\"So thou art bound to the path of War, as am I, as is my sister...\"";
+ next;
+
+ mes "[Mystic Sword]";
+ mes "\"So be it, fellow warrior. Hear the incantation for the blade spell: '" + getspellinvocation("magic-blade") + "'\"";
+ mes "\"Hold a knife, sharp or regular, when you speak it.\"";
+ set @Q_status, @STATUS_LEARNED_MAGICBLADE;
+ callsub S_update_var;
+ next;
+
+ mes "[Mystic 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...\"";
+ next;
+ close;
+
+L_PostFlareDart_teach:
+ mes "[Mystic Sword]";
+ mes "\"Seek out my sister, and leave me alone in my sorrows.\"";
+ next;
+
+L_Close:
+ close;
+
+S_update_var:
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/011-1_Woodland/_import.txt b/npc/011-1_Woodland/_import.txt
index ce529acf..3e18f94e 100644
--- a/npc/011-1_Woodland/_import.txt
+++ b/npc/011-1_Woodland/_import.txt
@@ -2,5 +2,6 @@ map: 011-1.gat
npc: npc/011-1_Woodland/_mobs.txt
npc: npc/011-1_Woodland/_warps.txt
npc: npc/011-1_Woodland/alchemist.txt
+npc: npc/011-1_Woodland/auldsbel.txt
npc: npc/011-1_Woodland/monsters.txt
npc: npc/011-1_Woodland/oscar.txt
diff --git a/npc/011-1_Woodland/alchemist.txt b/npc/011-1_Woodland/alchemist.txt
index 6329a5d6..8ce50f06 100644
--- a/npc/011-1_Woodland/alchemist.txt
+++ b/npc/011-1_Woodland/alchemist.txt
@@ -9,6 +9,7 @@
set @Q_MASK, NIBBLE_3_MASK;
set @Q_SHIFT, NIBBLE_3_SHIFT;
+ set @wants_sulphur, (QUEST_MAGIC & NIBBLE_6_MASK);
set @Q_status, (QUEST_Forestbow_state & @Q_MASK) >> @Q_SHIFT;
// End of Setzer quest/monster oil quest participation
@@ -18,8 +19,13 @@
set @MAUVE, 680;
set @PETAL, 565;
set @PEARL, 700;
+ set @WATER, 541;
+ set @ASH, 701;
+ set @MANAPOTION, 705;
set @ORE, 640;
set @MAGGOTSLIME, 505;
+ set @SULPHUR, 703;
+ set @IRONPOWDER, 704;
set @QUEST_CAN_GET_DYE_HERE, 2;
set @QUEST_HAS_SOLVED_DYE_PUZZLE, 3;
@@ -30,9 +36,11 @@
set @CHOICE_DYEING_INTRO, 2;
set @CHOICE_DYE, 3;
set @CHOICE_MONSTER_OIL, 4;
- set @CHOICE_ABORT, 5;
+ set @CHOICE_MANA_POTION, 5;
+ set @CHOICE_SULPHUR_POWDER, 6;
+ set @CHOICE_ABORT, 7;
- setarray @menuitems$, "", "", "", "", "";
+ setarray @menuitems$, "", "", "", "", "", "";
set @c, 0;
set @menuitems$[@c], "Iron potion.";
@@ -43,6 +51,13 @@
set @menuID[@c], @CHOICE_CONCENTRATION;
set @c, @c + 1;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION))
+ goto L_post_mana_potion_c;
+ set @menuitems$[@c], "Mana potion.";
+ set @menuID[@c], @CHOICE_MANA_POTION;
+ set @c, @c + 1;
+L_post_mana_potion_c:
+
if (QUEST_clothdyer_knowsdye >= @QUEST_CAN_GET_DYE_HERE)
goto L_skip_introducing;
@@ -70,13 +85,20 @@ L_skip_introducing:
set @c, @c + 1;
goto L_certain_condition;
-
L_pre_dyeing:
+
set @menuitems$[@c], "Actually, can you make dye?";
set @menuID[@c], @CHOICE_DYEING_INTRO;
set @c, @c + 1;
-
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 @c, @c + 1;
+L_post_sulphur_option;
+
if (@Q_status == @SETZER_INITIAL)
goto L_main_menu;
set @menuitems$[@c], "Can you make monster oil?";
@@ -93,7 +115,9 @@ L_main_menu:
@menuitems$[1], -,
@menuitems$[2], -,
@menuitems$[3], -,
- @menuitems$[4], -;
+ @menuitems$[4], -,
+ @menuitems$[5], -,
+ @menuitems$[6], -;
set @menu, @menu - 1;
@@ -103,8 +127,108 @@ L_main_menu:
if (@menuID[@menu] == @CHOICE_DYEING_INTRO) goto L_dyeing_intro;
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_ABORT) goto L_abort;
+L_sulphur:
+ mes "[Rauk the Alchemist]";
+ mes "\"Oh, that is easy. Bring me three piles of volcanic ash and three mauve leaves, and I will extract twelve piles of sulphur ash for you.\"";
+ next;
+ menu
+ "I will be back.", L_abort,
+ "No, I won't!", L_abort,
+ "Here you are!", -;
+
+ if (countitem(@ASH) < 3) goto L_sulphur_noash;
+ if (countitem(@MAUVE) < 3) goto L_sulphur_nomauve;
+ getinventorylist;
+ if (@inventorylist_count == 100
+ && countitem(@SULPHUR) == 0
+ && countitem(@ASH) > 3
+ && countitem(@MAUVE) > 3)
+ goto L_sulphur_nospace;
+
+ delitem @ASH, 3;
+ delitem @MAUVE, 3;
+ getitem @SULPHUR, 12;
+ mes "[Rauk the Alchemist]";
+ mes "You watch Rauk burn the mauve leaves in the midst of the ashes. He then dissolves the result and pours it through a filter, finally heating up the residual liquid.";
+ next;
+ mes "[Rauk the Alchemist]";
+ mes "The water having evaporated, only some yellow powder is left over. Rauk carefully pours it into your hand.";
+ mes "\"This should be precisely twelve half-ounces of sulphur powder.\"";
+ next;
+ close;
+
+L_sulphur_noash:
+ mes "[Rauk the Alchemist]";
+ mes "\"You don't seem to have all three piles of volcanic ash.\"";
+ next;
+ close;
+
+L_sulphur_nomauve:
+ mes "[Rauk the Alchemist]";
+ mes "\"You don't seem to have the three mauve leaves I asked for.\"";
+ next;
+ close;
+
+L_sulphur_nospace:
+ mes "[Rauk the Alchemist]";
+ mes "\"Oh dear. You don't seem to be able to carry the sulphur powder.\"";
+ next;
+ close;
+
+L_mana_potion:
+ mes "[Rauk the Alchemist]";
+ mes "\"Humh... I do believe that I have a recipe somewhere. One moment...\"";
+ mes "Rauk pulls a small book out of his sleeve and leafs through it.";
+ mes "\"Aha, here we are. Hmm, I'm not convinced that this is the best possible recipe...\"";
+ next;
+ mes "[Rauk the Alchemist]";
+ mes "\"I shall need one pearl, one bottle of water, thirty mauve leaves, twenty gamboge leaves, and five piles of volcanic ash.\"";
+ next;
+
+ menu "Here you are!", L_get_mana_potion,
+ "Never mind.", L_main_menu;
+
+ goto L_main_menu;
+
+L_get_mana_potion:
+ if(countitem(@MAUVE) < 30) goto L_mana_potion_lacking;
+ if(countitem(@YELLOW) < 20) goto L_mana_potion_lacking;
+ if(countitem(@ASH) < 5) goto L_mana_potion_lacking;
+ if(countitem(@PEARL) < 1) goto L_mana_potion_lacking;
+ if(countitem(@WATER) < 1) goto L_mana_potion_lacking;
+
+ delitem @MAUVE, 30;
+ delitem @YELLOW, 20;
+ delitem @ASH, 5;
+ delitem @PEARL, 1;
+ delitem @WATER, 1;
+ getitem @MANAPOTION, 1;
+
+ mes "[Rauk the Alchemist]";
+ mes "Rauk grinds the leaves, then crushes the pearl. Taking out a small charcoal oven, he heats up your water bottle and dissolves first the pearl powder, then the ashes.";
+ mes "The brew begins to bubble violently.";
+ next;
+
+ mes "[Rauk the Alchemist]";
+ mes "Taking the bottle with a pair of tongs, he pours the liquid through a fine sieve, discarding the liquid.";
+ mes "He then mixes the residual paste with the leaves, stirs in a little water from the pond and fills the result into a separate bottle.";
+ next;
+
+ mes "[Rauk the Alchemist]";
+ mes "\"Here you are. I hope that this is what you wanted.\"";
+ next;
+
+ goto L_main_menu;
+
+L_mana_potion_lacking:
+ mes "[Rauk the Alchemist]";
+ mes "\"Sorry, but I need one pearl, one bottle of water, 30 mauve leaves, 20 gamboge leaves, and five piles of volcanic ash.\"";
+ goto L_main_menu;
+
L_iron:
if(countitem(566) < 20) goto L_no_iron;
getinventorylist;
diff --git a/npc/011-1_Woodland/auldsbel.txt b/npc/011-1_Woodland/auldsbel.txt
new file mode 100644
index 00000000..30124d79
--- /dev/null
+++ b/npc/011-1_Woodland/auldsbel.txt
@@ -0,0 +1,929 @@
+// Auldsbel the Wizard
+// Transmutation Magic expert
+
+011-1.gat,50,68,0 script Auldsbel#_M 168,{
+
+ set @RED, 683;
+ set @YELLOW, 682;
+ set @BLUE, 681;
+ set @MAUVE, 680;
+ set @PETAL, 565;
+ set @PEARL, 700;
+ set @BOTTLE_WATER, 541;
+ set @MANA_POTION, 705;
+ set @SMALL_HEALING_POTION, 685;
+ set @MEDIUM_HEALING_POTION, 686;
+ set @IRON_POTION, 567;
+ set @CONCENTRATION_POTION, 568;
+ set @COCOON, 718;
+ set @STINGER, 507;
+ set @RED_STINGER, 517;
+ set @BLACK_STINGER, 709;
+ set @SNAKE_TONGUE, 710;
+ set @CAVE_SNAKE_TONGUE, 713;
+ set @MOUNTAIN_SNAKE_TONGUE, 711;
+ set @GRASS_SNAKE_TONGUE, 712;
+ set @MAGGOT_SLIME, 505;
+ set @ASH, 701;
+ set @SULPHUR, 703;
+ set @IRONPOWDER, 704;
+
+ 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_wants_sulphur, (QUEST_MAGIC & NIBBLE_6_MASK);
+
+ set @Q_MASK, NIBBLE_0_MASK | NIBBLE_1_MASK;
+ set @Q_SHIFT, NIBBLE_0_SHIFT;
+
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+
+ set @Q_main_status, @Q_status & 31;
+ set @Q_component_quest, @Q_status >> 5;
+
+ set @has_magic, getskilllv(SKILL_MAGIC);
+
+ set @address$, "chap";
+ if (Sex == 0)
+ set @address$, "girl";
+
+ if (@Q_status >= @Q_STATUS_POSTINTRO)
+ goto L_short_intro;
+
+ mes "[Robed Man]";
+ mes "You notice a middle-aged man in expensive-looking robes.";
+ mes "\"Ah, splendid, you finally came!\"";
+ mes "He motions you to come closer.";
+ next;
+
+ mes "[Robed Man]";
+ mes "The man is visibly excited.";
+ mes "\"Here, I found a silk cocoon. Now if you can just give me the obsidian salt, we can see whether it works!\"";
+ next;
+
+ menu "Whether what works?", L_intro_explain,
+ "What are you talking about?", L_intro_explain,
+ "I don't have any obsidian salt.", L_intro_nopowder,
+ "Do I know you?", L_intro_identity,
+ "Goodbye.", -;
+ close;
+
+ set @name_complaint, 0;
+
+L_intro_explain:
+ mes "[Robed Man]";
+ mes "He frowns.";
+ mes "\"The transmutation experiment, of course! You can't have forgotten already...?\"";
+ next;
+ goto L_intro_identity;
+
+L_intro_nopowder:
+ mes "[Robed Man]";
+ mes "\"What!? You traveled all this way without any obsidian...\"";
+ next;
+ goto L_intro_identity;
+
+L_intro_identity:
+ mes "[Robed Man]";
+ mes "He eyes you more carefully.";
+ if (Sex == 0)
+ mes "\"How odd. I could have sworn that you were a man the last time we met. Not that I mind...\"";
+
+ mes "\"Wait. You're not Padric.\"";
+ next;
+
+ set @xmsg$, "Right... my name is " + strcharinfo(0) + ".";
+ if (strcharinfo(0) == "Padric")
+ set @xmsg$, "Actually, I am, but I don't know you..?";
+
+ menu @xmsg$, L_intro_wrongperson,
+ "You're not very good with faces, are you?", L_intro_nogood,
+ "Who are you?", L_intro_who_are_you,
+ "Goodbye.", -;
+ close;
+
+L_intro_wrongperson:
+ mes "[Robed Man]";
+ mes "He laughs.";
+ mes "\"Ah, I knew it... you're not the first one today, either. I should apologize, I am horrible with faces. Well, if you don't mind, please hurry along, I should go back to my experiments.\"";
+ next;
+
+L_intro_primary_menu:
+ menu "Who are you?", L_intro_who_are_you,
+ "Goodbye.", -;
+ close;
+
+L_intro_nogood:
+ mes "[Robed Man]";
+ mes "He laughs.";
+ mes "\"Yes, you could say that. Well, I shall get back to my experiments, then; I think I shall manage something that requires no obsidian salt instead.\"";
+ next;
+
+ menu "Who are you?", L_intro_who_are_you,
+ "What is obsidian salt, anyway?", L_intro_obsidian_salt,
+ "Goodbye.", -;
+ close;
+
+L_intro_obsidian_salt:
+ mes "[Robed Man]";
+ mes "\"Oh, obsidian salt is a catalyst... or rather a theoretical catalyst. We know that it has to have an application somewhere, and I do have the strong suspicion that it may be linked to natural transmogrification...\"";
+ next;
+ goto L_intro_primary_menu;
+
+L_intro_who_are_you:
+ mes "[Robed Man]";
+ mes "\"Oh, oh my... of course you wouldn't know me, being from the countryside and all.\"";
+ mes "He laughs.";
+ mes "\"Well, my young friend, I am none other than Auldsbel the Graying, of the Council of Transmuters!\"";
+ next;
+
+ set @Q_main_status, @Q_STATUS_POSTINTRO;
+ callsub S_update_var;
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_AULDSBEL;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"That means that I'm a wizard, in case you were wondering.\"";
+ next;
+ goto L_main_menu;
+
+L_short_intro:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Welcome back, Padric!\"";
+ next;
+ goto L_main_menu;
+
+L_main_menu:
+ if (@has_magic)
+ goto L_main_menu_magic;
+
+ menu "How does this 'magic' work?", L_about_magic,
+ "I want to become a wizard!", L_learn_magic,
+ "Where are you from?", L_about_auldsbel,
+ "Do you need help with your experiments?", L_quest,
+ "What do you know about...", L_question,
+ "Goodbye.", -;
+ close;
+
+L_main_menu_magic:
+ if (@wants_sulphur)
+ 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,
+ "Goodbye.", -;
+ if (!@wants_sulphur)
+ 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,
+ "Goodbye.", -;
+ close;
+
+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
+ "No, thank you.", -,
+ "I will see what I can find.", -,
+ "Here you are.", L_sulphur_buy;
+ close;
+
+L_sulphur_buy:
+ if (zeny < @cost)
+ goto L_sulphur_nozeny;
+ if (countitem(@ASH) < 1)
+ goto L_sulphur_noash;
+ getinventorylist;
+ if (@inventorylist_count == 100
+ && countitem(@SULPHUR) > 1
+ && countitem(@ASH) == 0)
+ goto L_sulphur_noroom;
+
+ set zeny, zeny - @cost;
+ delitem @ASH, 1;
+ getitem @SULPHUR, 1;
+ mes "[Auldsbel the Wizard]";
+ next "\"I shall transmute it later. Here, have five half-ounces from my own stock.\"";
+ next;
+ goto L_main_menu;
+
+L_sulphur_nozeny:
+ mes "[Auldsbel the Wizard]";
+ next "\"No GP, no service.\"";
+ next;
+ goto L_main_menu;
+
+L_sulphur_noash:
+ mes "[Auldsbel the Wizard]";
+ next "\"Without volcanic ash, I can't give you any sulphur powder. Try hunting some fire goblins, or somesuch.\"";
+ next;
+ goto L_main_menu;
+
+L_sulphur_noroom:
+ mes "[Auldsbel the Wizard]";
+ next "\"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;
+
+L_about_magic:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Magic is a universal force that comes from within; only few individuals have the power to channel and manipulate it. Most magic users resort to spells-- prefabricated invocations-- to access and control their magical power.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Most spells are claimed by one of the five schools of magic. To properly use them, a magic user need not only have sufficient prowess in magic overall, but also in the specifics of that particular school.\"";
+ next;
+
+L_about_magic_minimenu:
+ menu
+ "What are the five schools?", L_about_magic_schools,
+ "How can I advance in magic?", L_about_magic_advance,
+ "How do spells work?", L_about_magic_spells,
+ "Where can I learn spells?", L_about_magic_learn,
+ "Never mind.", -;
+ goto L_main_menu;
+
+L_about_magic_schools:
+ mes "[Auldsbel the Wizard]";
+ mes "\"With few exceptions, all spells belong to one of the five schools of magic: Transmutation, War, Astral, Life, and Nature.\"";
+ next;
+
+L_about_schools_minimenu:
+ menu
+ "What's Transmutation magic?", L_about_transmutation,
+ "What's War magic?", L_about_war,
+ "What's Astral magic?", L_about_astral,
+ "What's Life magic?", L_about_life,
+ "What's Nature magic?", L_about_nature,
+ "Are there other spells?", L_about_other_spells,
+ "Thank you.", -;
+ goto L_about_magic_minimenu;
+
+L_about_transmutation:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Transmutation magic deals with forming matter into a new shape. Some advanced transmutation magic can also expose special properties of the material in question.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "He smiles.";
+ mes "\"Transmutation magic is the engine of human civilization. By allowing us to shape buildings, tools, and other items according to the power of our imagination, it gives us mastery over nature.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+L_about_astral:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Astral magic comprises a family of spells that connect the caster to the Astral World. This connection can be used to pull the caster 'through'-- effectively teleporting them-- or to 'pull others through'-- summoning creatures.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"There are also some more direct uses of powers of the Astral World; mainly spells that affect other spells.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+L_about_war:
+ mes "[Auldsbel the Wizard]";
+ mes "\"War magic deals with the inevitable necessity of struggle against other creatures, and sometimes even against other humans. War magic exclusively focusses on dealing damage and destruction.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"If you use War magic, You better have a Transmuter around for the aftermath, to clear up your collateral damage.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+L_about_life:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Life magic deals with healing. Not much of a surprise there.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+L_about_nature:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Nature magic is a rather subtle (and, in my eyes, rather weak) kind of magic that deals with manipulating nature as it is. Think of it as Transmutation magic without being able to actually shape things the way you want.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+L_about_other_spells:
+ mes "[Auldsbel the Wizard]";
+ mes "\"A few spells are not claimed by any particular school of magic. In practice, this means that anyone can cast them if they just have sufficient magical power. The most prominent example is the 'detect magic' spell, '" + getspellinvocation("detect-magic") + "'.\"";
+ next;
+ goto L_about_schools_minimenu;
+
+
+
+L_about_magic_advance:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Advancing in your magical powers must come from two sources: from within and from a person who can guide you in whichever school of magic you wish to advance.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"For advancing in your general magic power, you must practice magical spells. Make sure to vary them; you will learn little if you cast the same spell over and over. Also, spells that consume no components seem not to be very instructive in practice.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Once you have gathered enough spellcasting experience, you should be able to advance to the next level of magic. If you received your magic from a sponsor, you may have to seek out the sponsor again to advance.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Similarly, to advance in a particular school of magic, you should seek out someone sufficiently competent in that school. Each school has a different rite for advancing its students, so make sure to talk to the right person.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I myself am a Transmutation Wizard. Of course I know some spells from the other schools, but my focus is on Transmutation. Theoretically speaking, I can advance you in this school.\"";
+ next;
+ goto L_about_magic_minimenu;
+
+L_about_magic_learn:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Finding and learning new spells is of course important in a magic user's quest towards becoming a full-fledged wizard.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Some wizards will be willing to share their knowledge, usually for a price. But they are not the only sources of magical spells: many magical books contain spells, and you can occasionally find them written down in the most unusual of places.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Some are even hiding as part of folklore or gossip. Of course, for those it can sometimes be hard to determine just what their prerequisites are...\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"If you decide to hunt for spells, make sure to keep a journal with you. Some spell invocations may only cross your path once in your lifetime; you must not allow them to get away!\"";
+ next;
+ goto L_about_magic_minimenu;
+
+L_about_magic_spells:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Magical spells are shortcuts, true magic bound to a word. No-one today remembers how they were created at the beginning of time, though many have tried to find it out, and failed...\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"These magical words are the spells' invocations. Spoken by someone who can't use magic, or by someone who doesn't satisfy the prerequisites, the word stands just for itself.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"But when spoken by a competent magic user, the word may unleash its effect-- consuming any components it may require, draining the caster's mana, changing the world around it.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Some spells require catalysts on top of components, others vary in power depending on whom they are cast on or under what conditions. However, all spells are affected by the caster's astral power.\"";
+ next;
+
+L_about_spells_minimenu:
+ menu
+ "What is this 'astral power'?", L_about_astral_power,
+ "What is a catalyst?", L_about_catalysts,
+ "What is a component?", L_about_components,
+ "What other prerequisites are there?", L_about_other_prerequisites,
+ "Where can I learn spells?", L_about_magic_learn,
+ "How often can I cast spells?", L_about_speed,
+ "Never mind.", L_about_magic_minimenu;
+ close;
+
+L_about_astral_power:
+ mes "[Auldsbel the Wizard]";
+ mes "\"A person's astral power is determined by several factors: overall experience, intelligence, and any and all equipment the person may be wearing at a given time.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Greater astral power mans more powerful spells. Since equipment can greatly decrease astral power, most magic users tend to be careful about what they wear-- it takes a while to recover astral power even after armour is unequipped.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"The worst offenders are metal items, particularly shields and body armour. Helmets and gloves get in the way, too. Still, a few special or enchanted items may even increase magical power.\"";
+ next;
+ goto L_about_spells_minimenu;
+
+L_about_catalysts:
+ mes "[Auldsbel the Wizard]";
+ mes "\"A catalyst is a material prerequisite to a spell that is not consumed as part of the spell. For example, the Transmuter's Tablet is required to properly perform many of the more powerful transmutation spells, but it is never consumed.\"";
+ next;
+ goto L_about_spells_minimenu;
+
+L_about_components:
+ mes "[Auldsbel the Wizard]";
+ mes "\"A material component is an item that is consumed as part of the spell's magic. For example, when transmuting wood into arrows, you must consume a raw log to shape the arrows out of it.\"";
+ next;
+ goto L_about_spells_minimenu;
+
+L_about_other_prerequisites:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Some spells have additional requirements-- they can only be cast underground, or when you are standing very close to the person you are casting them on, or only when you are wearing a particular enchanted item. Spells are quirky, so read their descriptions carefully-- if you do find a description.\"";
+ next;
+ goto L_about_spells_minimenu;
+
+L_about_speed:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Most spells are effective immediately, unless they require some complex astral connectoin-- summoning or teleporting can take a while to take effect, for example. Still, after casting a spell you usually need a moment to recover before casting the next.\"";
+ next;
+ goto L_about_spells_minimenu;
+
+
+L_about_auldsbel:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Well, there is no harm in giving you the general picture, I suppose.\"";
+ mes "He sighs, as if he had been forced to repeat something one time too many.";
+ mes "\"I am from the Council of Transmuters, the head organ of organized Transmutation magic in the known world.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"The council oversees recruitment, education, accreditation, and, if necessary, disciplining of Transmuters.";
+ mes "It ensures that Transmuter conduct is according to its statutes and acts as representative and point of contact towards other entities.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Of all the schools of magic, the School of Transmutation the most organised by far, and held in high esteem by rulers all across the world. Of course this is not only due to the outstanding and rigid structure of the school, but also because of the exceptional services that its members provide.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"The Council, presently overseen by Lord Transmogrifier Pontorias the Plaid (May His Shape Reflect His Soul Forever), consists of fourty-nine members and is situated in the citadel of Dorngard, in the northern mountains near the Crimson Cascade.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"The Council is souvereign over three hundred acres of land and nearby farming communities and has been ever since Yorick the Younger shaped Dorngard out of a mountain by sheer power of will, to build a home for the school his father had founded.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"The Council has held peaceful relations with nearby realms for almost two centruries now and is widely regarded as a reliable partner in shaping civilization to allow it to evolve towards its next stage.\"";
+ next;
+
+ menu
+ "All right, but what about you?.", L_about_auldsbel_2,
+ "Never mind.", -;
+ goto L_main_menu;
+
+L_about_auldsbel_2:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Oh, myself? I am just vacationing in the area. Very relaxed and peaceful place, the Hurnscald area. And plenty of splendid specimen for experimentation.\"";
+ next;
+ goto L_main_menu;
+
+L_learn_magic:
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel laughs heartily.";
+ mes "\"Hah, if only it were so easy! No, my young friend, I fear that 'learning magic' here is not an option. Either you are born with it, or without.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Sure, there are a few entities that may grant you magic-- Ether Spirits or Mana Seeds or Great Dragons-- but those are the stuff of legends, so I suggest that you don't waste your life trying to find one of them.\"";
+ next;
+ 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;
+
+ 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;
+
+L_Q_elanore:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Ah, Elanore. A kind little woman. Also a very proficient healer, from what I have been told, though we have interacted little. If you are interested in Life magic, you might want to talk to her.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_wyara:
+ mes "[Auldsbel the Wizard]";
+ mes "\"The village witch? Not exactly the brightest person, but she has managed to figure out how to brew potions. I doubt that she can do any real magic, though.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_sagatha:
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel frowns.";
+ mes "\"That witch, hmm? She's a well-known trouble-maker, and quite a clever one at that; she once prevented us from cutting down a forest near Dorngaard that the villages wanted to use for farming, using some ingenious magic.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"That woman has spent too much time alone in the forests... I have the strong suspicion that she is more loyal towards her animals than towards us humans! I recommend that you stay away from her, if you value your well-being.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_manaseed_rumour:
+ mes "[Auldsbel the Wizard]";
+ mes "\"A mana seed? Around here? Nah, they've been pulling your leg. Those things are extremely rare, after all.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_manaseed:
+ mes "[Auldsbel the Wizard]";
+ if (@has_magic)
+ goto L_Q_manaseed_withmagic;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANASEED)) // rumour only?
+ goto L_Q_manaseed_rumour;
+ if (MAGIC_FLAGS & MFLAG_DRANK_POTION)
+ goto L_Q_manaseed_prepared;
+ if (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED)
+ goto L_Q_manaseed_touched;
+ mes "\"You have found an acual Mana Seed? That's impossible! Well, very unlikely... Then again, some others have told me similar rumours. I find it hard to believe that...\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Well, if it's true, then try touching it. It should do you no harm, but if you are very, very lucky, it just might grant you some minuscle magical power.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_manaseed_touched:
+ if (MAGIC_FLAGS & MFLAG_DRANK_POTION)
+ goto L_Q_manaseed_prepared;
+ mes "\"So you touched the Mana Seed, and its power flowed right through you? You are lucky-- it is willing to share-- but you are also unlucky, in that you lack the discipline and control needed to contain this power.\"";
+ next;
+
+ if (MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION)
+ goto L_Q_manaseed_touched_short;
+
+ mes "[Auldsbel the Wizard]";
+ mes "\"Legend has it that you can substitute for such control by imbibing a Mana Potion. I am not sure whether that legend is true, but it might be worth trying out for you.\"";
+ next;
+
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_MANAPOTION;
+L_Q_manaseed_touched_short:
+ menu
+ "Where can I get a Mana Potion?", L_where_mana_potion,
+ "Can you make a Mana Potion?", L_make_mana_potion,
+ "Thank you.", -;
+ goto L_main_menu;
+
+L_where_mana_potion:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Well, quite a few alchemists should be able to brew one for you. Or maybe the village witch, even, though I personally would recommend seeing an alchemist.\"";
+ next;
+ goto L_Q_manaseed_touched_short;
+
+L_make_mana_potion:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Certainly, I can transmute some components into a Mana Potion for you. Let's see... I will need one pearl, 10,000 GP, about twenty Mauve leaves, and some Gamboge ones... ten should do, I think. Oh, and a bottle of water, of course.\"";
+ next;
+ menu
+ "Here you are.", -,
+ "I will look for those items.", L_main_menu,
+ "I'm not interested.", L_Q_manaseed_touched_short;
+
+ if (zeny < 10000)
+ goto L_make_mana_potion_missing;
+ if (countitem(@YELLOW) < 10)
+ goto L_make_mana_potion_missing;
+ if (countitem(@MAUVE) < 20)
+ goto L_make_mana_potion_missing;
+ if (countitem(@PEARL) < 1)
+ goto L_make_mana_potion_missing;
+ if (countitem(@BOTTLE_WATER) < 1)
+ goto L_make_mana_potion_missing;
+
+ set zeny, zeny - 10000;
+ delitem @YELLOW, 10;
+ delitem @MAUVE, 20;
+ delitem @PEARL, 1;
+ delitem @BOTTLE_WATER, 1;
+ getitem @MANA_POTION, 1;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel pockets your GP and the pearl, then stuffs the leaves into the bottle. Holding the bottle between his hands, he focusses briefly. The water and leaves flash bright red, then the leaves dissolve.";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "The wizard pours the resultant mixture into a different bottle. \"It will lose its power quickly if left in a glass bottle\", he explains.";
+ mes "He hands you the final result, which feels surprisingly heavy.";
+ next;
+
+ menu
+ "Thank you!", L_main_menu,
+ "What about the pearl and GP?", -;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel raises his eyebrows in surprise.";
+ mes "\"Those were payment. You don't expect me to work for free, now do you?\"";
+ next;
+
+ goto L_main_menu;
+
+L_make_mana_potion_missing:
+ mes "[Auldsbel the Wizard]";
+ mes "\"No, I need one pearl, 10,000 GP, 20 Mauve leaves, 10 Gamboge leaves, and one bottle of water.\"";
+ next;
+ goto L_Q_manaseed_touched_short;
+
+L_Q_manaseed_prepared:
+ mes "\"So you found a Mana Seed and preprared yourself by drinking a mana potion? I recommend that you visit the seed again and see if that actually works...\"";
+ next;
+ goto L_main_menu;
+
+L_Q_manaseed_withmagic:
+ if (MAGIC_FLAGS & MFLAG_MANASEED_MAXEDOUT)
+ goto L_Q_manaseed_maxedout;
+ mes "\"I still find it hard to believe that you have found an actual Mana Seed here, in the middle of nowhere... Well, I suggest that you keep visiting it. As your control over magic grows, it may grant you additional power.\"";
+ next;
+ goto L_main_menu;
+
+L_Q_manaseed_maxedout:
+ mes "\"So the mana seed isn't giving you any more power? You might want to try again later; normally those seeds grow in power, over time.\"";
+ next;
+ goto L_main_menu;
+
+L_quest:
+ if (@Q_component_quest == 0)
+ goto L_component_quest_0;
+ if (@Q_component_quest == 1)
+ goto L_component_quest_1;
+ if (@Q_component_quest == 2)
+ goto L_component_quest_2;
+ if (@Q_component_quest == 3)
+ goto L_component_quest_3;
+ if (@Q_component_quest == 4)
+ goto L_component_quest_4;
+ if (@Q_component_quest == 5)
+ goto L_component_quest_5;
+ mes "[Auldsbel the Wizard]";
+ mes "\"You have been very helpful, but at this point I have everything I need. Except perhaps for a Wumpus Egg, though I have no idea where you could find one... If you ever come across one, I will give you a special reward for it, though.\"";
+ next;
+ goto L_main_menu;
+
+L_component_quest_0:
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel is visibly delighted.";
+ mes "\"Ah, indeed, indeed! I can often use help with my experiments, and you just happen to be arriving at a particularly opportune time. See, I found this...\"";
+ mes "He pulls something from his pocket and shows it to you.";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"It's a silk cocoon. This area has been virtually infested with silkworms, from what I have seen. This is splendid! I will try to... do something very special with this one. But for that I will need twenty Mauve leaves.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"There are plenty of Mauve plants around, so I'm sure that you won't have a hard time finding the leaves.\"";
+ next;
+ menu
+ "I have them here.", -,
+ "Sure, I will look for them.", L_main_menu;
+
+ if (countitem (@MAUVE) < 20)
+ goto L_component_quest_missing;
+
+ delitem @MAUVE, 20;
+ set zeny, zeny + 2500;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Well done, my young friend! Here are 2,500 GP to compensate you for your efforts.\"";
+ mes "[You gain 250 experience points]";
+ getexp 250, 0;
+ set @Q_component_quest, 1;
+ callsub S_update_var;
+ next;
+
+ goto L_main_menu;
+
+L_component_quest_1:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Good, good... I am trying to come up with a way to best use the Mauve leaves you brought me, but it seems that I will need further components. I am not sure about the exact composition yet, but I will need a few potions.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Please be a good " + @address$ + " and get me an iron potion, a concentration potion, and three small and three medium healing potions.\"";
+ next;
+ menu
+ "Here you are.", -,
+ "I'm not your 'good " + @address$ + "'!", L_main_menu,
+ "I'll see what I can do.", L_main_menu;
+
+ if (countitem (@SMALL_HEALING_POTION) < 3)
+ goto L_component_quest_missing;
+ if (countitem (@MEDIUM_HEALING_POTION) < 3)
+ goto L_component_quest_missing;
+ if (countitem (@IRON_POTION) < 1)
+ goto L_component_quest_missing;
+ if (countitem (@CONCENTRATION_POTION) < 1)
+ goto L_component_quest_missing;
+
+ delitem @SMALL_HEALING_POTION, 3;
+ delitem @MEDIUM_HEALING_POTION, 3;
+ delitem @IRON_POTION, 1;
+ delitem @CONCENTRATION_POTION, 1;
+ set zeny, zeny + 2500;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Ah, excellent, excellent! These are precisely what I needed. Here are another 2,500 GP to compensate you for your efforts.\"";
+ mes "[You gain 500 experience points]";
+ getexp 500, 0;
+ set @Q_component_quest, 2;
+ callsub S_update_var;
+ next;
+
+ goto L_main_menu;
+
+
+L_component_quest_2:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Ah! Excellent! Yes, yes, indeed I need help. I have managed to transmute the components you brought me into a liquid that I believe to be a demetamorphosis stock, but it seems that the details still need some fine-tuning, and I am out of silk cocoons...\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I would like to run the next batch of experiments on a larger scale, though. Would you be so kind as to fetch me some one hundred silk cocoons, please?\"";
+ next;
+
+ menu
+ "One hundred cocoons, here you are.", -,
+ "That's a lot; I'll see what I can do.", L_main_menu;
+
+ if (countitem (@COCOON) < 100)
+ goto L_component_quest_missing;
+
+ delitem @COCOON, 20;
+ set zeny, zeny + 5000;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Splendid, splendid! Here are 5,000 GP for you.\"";
+ mes "Auldsbel attempts to cram the cocoons into his pockets, with little success. Finally he gives up and takes them into his hut.";
+ mes "[You gain 2,000 experience points]";
+ getexp 2000, 0;
+ set @Q_component_quest, 3;
+ callsub S_update_var;
+ next;
+
+ goto L_main_menu;
+
+L_component_quest_3:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Yes... I'm actually not certain that my demetamorphosis stock will not drain the life out of these little creatures. Perhaps an alchemical revitalization tincture would be called for. Fortunately this one is easy, I can make it myself.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I'm still not sure how to integrate it into the spell... but leave that to me. Can you get me twenty-five red scorpion stingers and twenty-five lumps of maggot slime? Those should be just what I need.\"";
+ next;
+ menu
+ "Here are your stingers and slimes.", -,
+ "I will get back to you once I have them.", L_main_menu;
+
+ if (countitem (@RED_STINGER) < 25)
+ goto L_component_quest_missing;
+ if (countitem (@MAGGOT_SLIME) < 25)
+ goto L_component_quest_missing;
+
+ delitem @RED_STINGER, 25;
+ delitem @MAGGOT_SLIME, 25;
+ set zeny, zeny + 5000;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Good " + @address$ + "! Another 5,000 GP for you.\"";
+ mes "\"I believe that I have figured out one possible way to integrate the tincture into the spell... I will let you know how that goes.\"";
+ mes "[You gain 10,000 experience points]";
+ getexp 10000, 0;
+ set @Q_component_quest, 4;
+ callsub S_update_var;
+ next;
+
+ goto L_main_menu;
+
+L_component_quest_4:
+ mes "[Auldsbel the Wizard]";
+ mes "\"Hmmyes... See, the thing is that transmuting living beings is not normally something that transmutation magic can do. It seems that the beings' life force must be overcome to transmute them, but that in turn kills them.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"But I was wondering whether creatures that already can auto-transmute-- or metamorphose, as some people call it-- might not allow themselves to be subjected to magical transmutation more easily... Still, all of my demetamorphosis attempts so far have failed.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"I am thinking of injecting the life force of another creature, perhaps using some astral channelling. Snakes sound most promising, as they have a similar physical shape but a strong life force.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Could you get me twenty regular, cave, and mountain snake tongues, please? So a total of sixty tongues. This is where most of their life force is concentrated, incidentally.\"";
+ next;
+ menu
+ "Here are your tongues.", -,
+ "I will hunt some snakes for you.", L_main_menu;
+
+ if (countitem (@SNAKE_TONGUE) < 20)
+ goto L_component_quest_missing;
+ if (countitem (@CAVE_SNAKE_TONGUE) < 20)
+ goto L_component_quest_missing;
+ if (countitem (@MOUNTAIN_SNAKE_TONGUE) < 20)
+ goto L_component_quest_missing;
+
+ delitem @SNAKE_TONGUE, 20;
+ delitem @CAVE_SNAKE_TONGUE, 20;
+ delitem @MOUNTAIN_SNAKE_TONGUE, 20;
+ set zeny, zeny + 8000;
+ mes "[Auldsbel the Wizard]";
+ mes "\"8,000 GP should cover your efforts, I think.\"";
+ mes "\"Now let's see if this works...\"";
+ mes "[You gain 40,000 experience points]";
+ getexp 40000, 0;
+ set @Q_component_quest, 5;
+ callsub S_update_var;
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel focuses on the bundle of snake tongues, which begin to assume a bright red colour, then start to glow. Yellow sparks drop to the ground, as Auldsbel rolls the tongues into a ball.";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "He tosses in a cocoon, then squeezes everything together. A bright red flash blinds you momentarily.";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "As Auldsbel opens his hands, there is nothing there.";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "He frowns. \"Their life force was still not strong enough. Hmm.\"";
+ next;
+
+ goto L_main_menu;
+
+L_component_quest_5:
+ mes "[Auldsbel the Wizard]";
+ mes "\"I do have another assignment for you, but this one will be tricky. I will need fifty grass snake tongues. I believe that this may be just enough life force to return the silkworm back to its original shape.\"";
+ next;
+ menu
+ "Here they are.", -,
+ "That's quite a challenge.", L_main_menu;
+
+ if (countitem (@GRASS_SNAKE_TONGUE) < 50)
+ goto L_component_quest_missing;
+
+ delitem @GRASS_SNAKE_TONGUE, 50;
+ set zeny, zeny + 10000;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Excellent! Here are 10,000 GP for you, and now let's see how this goes.\"";
+ mes "[You gain 100,000 experience points]";
+ getexp 100000, 0;
+ set @Q_component_quest, 6;
+ callsub S_update_var;
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "Auldsbel rolls the snake tongues into a ball again, whilst chanting some words that you fail to discern. As the ball begins to glow, he tosses in a silkworm cocoon.";
+ mes "He then presses his hands together; you are blinded by a blue flash.";
+ next;
+
+ mes "[Auldsbel the Wizard]";
+ mes "The wizard steps back in horror.";
+ mes "\"Oh my... I should have known. I have stepped into Astral spell territory here. This is bad...\"";
+ mes "He mumbles a brief spell invocation.";
+ mes "\"I suggest that you run.\"";
+ next;
+
+ monster "this", 50, 68, "Grass Snake", 1034, 4;
+ close;
+
+L_component_quest_missing:
+ mes "[Auldsbel the Wizard]";
+ mes "\"No, you are missing some items. Come back later when you have everything!\"";
+ next;
+ goto L_main_menu;
+
+L_learn_spell:
+ if (@Q_main_status == @Q_STATUS_INITIATION) goto LL_initiation;
+
+ 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?\"";
+ mes "He raises an eyebrow at you, then grins.";
+ mes "\"Only one way to find out! Let me teach you a first spell.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"This spell is a simple transmutation invocation. All it takes is a clean wooden log. Hold it in your hand, focus your powers, and say the magic invocation.\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"You can turn the log into a wooden figurine by saying 'kular' followed by the last syllable of the name of the creature you want to shape it as. And mind you, that syllable has to be from the Old-Tritan name...\"";
+ next;
+ mes "[Auldsbel the Wizard]";
+ mes "\"Oh, actually, make sure to write that down. You should keep track of all spells and spell fragments, really. I always keep a notebook handy, in fact.\"";
+ next;
+ set @Q_main_status, @Q_STATUS_INITIATION;
+ callsub S_update_var;
+ goto L_main_menu;
+
+LL_initiation:
+ mes "[Auldsbel the Wizard]";
+ mes "\"So, have you managed to transmute something?\"";
+ next;
+ goto L_main_menu;
+
+S_update_var:
+ set @Q_status, @Q_main_status | (@Q_component_quest << 5);
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/012-1_Woodland_Hills/_import.txt b/npc/012-1_Woodland_Hills/_import.txt
index 851f97fc..c4438c6c 100644
--- a/npc/012-1_Woodland_Hills/_import.txt
+++ b/npc/012-1_Woodland_Hills/_import.txt
@@ -2,4 +2,5 @@ map: 012-1.gat
npc: npc/012-1_Woodland_Hills/_mobs.txt
npc: npc/012-1_Woodland_Hills/_warps.txt
npc: npc/012-1_Woodland_Hills/monsters.txt
+npc: npc/012-1_Woodland_Hills/injured-mouboo.txt
npc: npc/012-1_Woodland_Hills/shops.txt
diff --git a/npc/012-1_Woodland_Hills/injured-mouboo.txt b/npc/012-1_Woodland_Hills/injured-mouboo.txt
new file mode 100644
index 00000000..c017a35a
--- /dev/null
+++ b/npc/012-1_Woodland_Hills/injured-mouboo.txt
@@ -0,0 +1,231 @@
+// The following auxiliary function is used both by appropriate magic and within the regular script:
+
+function script QuestMoubooHeal {
+ set @Q_MASK, NIBBLE_2_MASK;
+ set @Q_SHIFT, NIBBLE_2_SHIFT;
+
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+ set @Q_status_upper, @Q_status & 12;
+ set @Q_status, @Q_status & 3;
+
+ set @STATE_INITIAL, 0;
+ set @STATE_HEALED_MOUBOO, 3;
+
+ if (@Q_status != @STATE_INITIAL)
+ goto L_nothing;
+
+ set @Q_status, @STATE_HEALED_MOUBOO;
+ callsub S_update_var;
+ mes "[Injured Mouboo]";
+ mes "A soft white glow surrounds the mouboo's leg, which slowly shifts back into place.";
+ mes "As the glow subsides, the mouboo gets up, carefully, and takes a few steps. It seems to be fully healed!";
+ mes "[5000 experience points]";
+ getexp 5000, 0;
+ next;
+
+ mes "[Injured Mouboo]";
+ mes "Visibly happy, the mouboo lies down on the ground and snuggles with a black piece of cloth it had been lying on.";
+ mes "The healing process must have been exhausting, for it is asleep in an instant.";
+ next;
+ set @value, 15;
+ callfunc "QuestSagathaHappy";
+ close;
+
+L_nothing:
+ mes "Your spell has no effect.";
+ next;
+ close;
+
+S_update_var:
+ set @Q_wr_status, @Q_status | @Q_status_upper;
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_wr_status << @Q_SHIFT));
+ return;
+}
+
+
+
+012-1.gat,57,153,0 script Mouboo 171,{
+ set @Q_MASK, NIBBLE_2_MASK;
+ set @Q_SHIFT, NIBBLE_2_SHIFT;
+
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+ set @Q_status_upper, @Q_status & 12;
+ set @Q_status, @Q_status & 3;
+
+ set @STATE_INITIAL, 0;
+ set @STATE_KILLED_MOUBOO, 1;
+ set @STATE_TOOK_KILL_REWARD, 2;
+ set @STATE_HEALED_MOUBOO, 3;
+
+ if (@Q_status == @STATE_KILLED_MOUBOO)
+ goto L_dead;
+ if (@Q_status == @STATE_TOOK_KILL_REWARD)
+ goto L_took_reward;
+ if (@Q_status == @STATE_HEALED_MOUBOO)
+ goto L_healed;
+
+ mes "[Injured Mouboo]";
+ mes "You notice a mouboo lying on the ground, groaning, as if in pain.";
+ next;
+
+L_menu:
+ menu
+ "Examine the mouboo", L_examine,
+ "Give the mouboo something", L_give,
+ "Kill the mouboo", L_kill,
+ "Leave", -;
+ close;
+
+L_examine:
+ mes "[Injured Mouboo]";
+ mes "Looking closer, you notice that the mouboo's left hind leg is bent in a very unnatural angle-- that seems to be the cause for its pain.";
+ next;
+ mes "[Injured Mouboo]";
+ mes "You also notice that the mouboo is lying on top of what appears to be a black turtleneck sweater.";
+ mes "Do you want to pick up the sweater?";
+ next;
+ menu
+ "Yes.", L_pickup_alive,
+ "No.", L_menu;
+ goto L_menu;
+
+L_pickup_alive:
+ mes "[Injured Mouboo]";
+ mes "The Mouboo groans and pushes your hand away. It seems to be rather fond of the sweater.";
+ next;
+ goto L_menu;
+
+L_give:
+ set @items_nr, 12;
+ setarray @items, 501, 502, 509, 527, 534, 535, 539, 541, 684, 685, 686, 687;
+ setarray @itemeat, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0;
+
+ setarray @choice$, "", "", "", "", "", "", "", "", "", "", "", "";
+ set @choices_nr, 0;
+ setarray @choice_idx, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
+ setarray @choice_eat, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
+
+ set @n, 0;
+L_nloop:
+ set @k, @items[@n];
+ if (countitem(@k) == 0)
+ goto L_nloop_skip;
+
+ set @name$, getitemname(@k);
+ set @choice$[@n], @name$;
+ set @choice_idx[@n], @k;
+ set @choice_eat[@n], @itemeat[@n];
+
+L_nloop_skip:
+
+ set @n, @n+1;
+ if (@n < @items_nr)
+ goto L_nloop;
+
+ menu
+ @choice$[0], -
+ @choice$[1], -
+ @choice$[2], -
+ @choice$[3], -
+ @choice$[4], -
+ @choice$[5], -
+ @choice$[6], -
+ @choice$[7], -
+ @choice$[8], -
+ @choice$[9], -
+ @choice$[10], -
+ @choice$[11], -;
+
+ set @menu, @menu - 1;
+ set @choice, @choice_idx[@menu];
+ set @choice_e, @choice_eat[@menu];
+ set @verb$, "drinks";
+ if (@choice_e)
+ set @verb$, "eats";
+
+ if (@choice && countitem(@choice))
+ goto L_consume;
+
+ goto L_menu;
+
+L_consume:
+ mes "[Injured Mouboo]";
+
+ mes "The mouboo " + @verb$ + " your " + getitemname(@choice) + ".";
+ delitem @choice, 1;
+ next;
+
+ if (@choice == 687)
+ goto L_do_heal;
+
+
+ mes "[Injured Mouboo]";
+ mes "Unfortunately, it seems to have had no effect.";
+ goto L_menu;
+
+L_do_heal:
+ callfunc "QuestMoubooHeal";
+
+L_kill:
+ mes "[Injured Mouboo]";
+ if (BaseLevel > 44)
+ goto L_kill_success;
+ mes "The mouboo deflects your attack and counterattacks!";
+ mes "It misses you only barely.";
+ mes "Injured though it may be, this mouboo is still more than a match for you!";
+ next;
+ goto L_menu;
+
+L_kill_success:
+ mes "After some wrestling, the mouboo succumbs to your attacks.";
+ mes "[100 experience points]";
+ getexp 100, 0;
+
+ set @Q_status, @STATE_KILLED_MOUBOO;
+ callsub S_update_var;
+
+ next;
+
+L_dead:
+ mes "[Dead Mouboo]";
+ mes "The dead mouboo is lying on top of a black T-neck sweater.";
+
+ getinventorylist;
+ if (@inventorylist_count == 100)
+ goto L_nopickup;
+
+ getitem 2076, 1;
+ mes "You pull out the sweater and stuff it into your backpack.";
+
+ set @Q_status, @STATE_TOOK_KILL_REWARD;
+ callsub S_update_var;
+
+ next;
+ close;
+
+L_took_reward:
+ mes "[Dead Mouboo]";
+ mes "You see a dead mouboo.";
+ next;
+ close;
+
+L_nopickup:
+ mes "Unfortunately, you can't carry any more.";
+ next;
+ close;
+
+L_healed:
+ mes "[Mouboo]";
+ mes "The mouboo is sleeping soundly, smiling in its dreams.";
+ next;
+ close;
+
+S_update_var:
+ set @Q_wr_status, @Q_status | @Q_status_upper;
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_wr_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/012-3_Cave/_import.txt b/npc/012-3_Cave/_import.txt
index 92995992..7d427ad8 100644
--- a/npc/012-3_Cave/_import.txt
+++ b/npc/012-3_Cave/_import.txt
@@ -1,4 +1,5 @@
map: 012-3.gat
npc: npc/012-3_Cave/_mobs.txt
npc: npc/012-3_Cave/_warps.txt
+npc: npc/012-3_Cave/mana-seed.txt
npc: npc/012-3_Cave/monsters.txt
diff --git a/npc/012-3_Cave/mana-seed.txt b/npc/012-3_Cave/mana-seed.txt
new file mode 100644
index 00000000..6ad8a37e
--- /dev/null
+++ b/npc/012-3_Cave/mana-seed.txt
@@ -0,0 +1,265 @@
+012-3.gat,62,130,0 script Mana Seed#MAGIC 166,{
+
+ setarray @magic_exp_needed,
+ 0, // level 0
+ 0,
+ 100,
+ 1200,
+ 8000,
+ 40000; // level 5
+
+ setarray @exp_bonus,
+ 0,
+ 1000, // level 1
+ 10000,
+ 100000,
+ 400000,
+ 2000000; // level 5
+
+ setarray @min_level,
+ 0,
+ 10,
+ 30,
+ 50,
+ 65,
+ 80; // level 5
+
+ set @visions_nr, 13;
+ setarray @visions$,
+ "You see a dark underground temple; you are kneeling, praying for the safety of the planet. You smile as a friend joins you in the dark-- but suddenly a shadow falls over you from above, and a stabbing pain...",
+ "It is midnight; you are in an underground cavern deep inside the desert ruins. Slowly, as if half-asleep, you wander up the spiral pathway, towards the ancient vase at its center. As you reach out to touch it...",
+ "The old castle smells of mildew and swamp gas. It has not been used in centuries, but you were here before, when the world was young. You turn to face your companions-- but something is wrong with all three; an ancient force has possessed them...",
+ "As you put the horn to your lips, you feel winds flowing, gathering, condensing in your chest. Soon, you can no longer contain it; the storm unleashes through your mouth, into a deafening fanfare. The black dome around you begins to crack...",
+ "You are alone inside your head, confined by the laughing man's circlet. Powerless, you witness how your hands shoot out flame after flame, incinerating innocents for that man's experiments...",
+ "The village may be in ruins, but it must have been where you grew up. The engravings on the walls-- images of powerful beasts-- look strangely familiar, and you can make out writing, words about you, wishes and prayers for you... You are at home...",
+ "Deep underneath the city, the rocky cavern maze turns into an opulent palace. This must be where the beast of the many eyes resides. Nervously you grip the wand; will the power to repel it be sufficient to defeat it and its magic?",
+ "At the bottom of the abyss, infinity opens before you. You have proven yourself worthy, and the ancient finally reveals its wisdom...",
+ "You may only be children, but you recognize that it is this man only who can save the world. As the walls rush towards you to crush your small group, you exchange a glance with your twin sister-- there is no doubt what you must do...",
+ "The sacred place is surrounded by nothingness; were it not for your magic, you would have no hope of returning. The old and young man stands nearby; he has been waiting for you, for centuries. He has all the time in the world, after all...",
+ "Nothing remains behind. The underground castle is empty now, its chambers plundered, its throne destroyed. Shivering, you climb down the stairs, towards the wailing of the underworld that is waiting beneath...",
+ "You feel soft, fluffy fur brushing against your skin and are filled with happines. Somehow, the word `" + getspellinvocation("happy-curse") + "' comes to mind...";
+
+ set @max_magic, 2;
+
+ set @has_magic, getskilllv(SKILL_MAGIC);
+ set @drank_potion, MAGIC_FLAGS & MFLAG_DRANK_POTION;
+ set @knows_seed, MAGIC_FLAGS & MFLAG_KNOWS_MANASEED;
+
+ if (@has_magic)
+ goto L_magic_start;
+
+ if (@knows_seed)
+ goto L_quick_nomagic;
+
+ // first time here
+
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_MANASEED;
+
+ mes "[Mana Seed]";
+ mes "You see a glowing orb, swimming in the water like a sea rose.";
+ mes "An unearthly glow is emanating from within, lighting up the water and filling the cave with an eerie light.";
+ next;
+
+ mes "[Mana Seed]";
+ if (@drank_potion)
+ mes "Slowly, the tingling sensation you felt before begins to spread through your body again.";
+ mes "What would you like to do?";
+ next;
+ goto L_nomagic_mainmenu;
+
+L_quick_nomagic:
+ mes "[Mana Seed]";
+ mes "Again you stand before the orb.";
+ if (@drank_potion)
+ mes "Slowly, the tingling sensation you felt before begins to spread through your body again.";
+ mes "What would you like to do?";
+ next;
+
+ goto L_nomagic_mainmenu;
+
+// Non-Magic main menu ------------------------------------------------------------
+L_nomagic_mainmenu:
+ menu "Examine it more closely", L_nomagic_examine,
+ "Take it with you", L_nomagic_touch,
+ "Touch it", L_nomagic_touch,
+ "Throw a rock at it", L_nomagic_throwrock,
+ "Destroy it", L_nomagic_destroy,
+ "Leave it alone", L_end;
+ close;
+
+L_nomagic_examine:
+ mes "[Mana Seed]";
+ mes "The orb seems to be perfectly round and emitting a steady glow. It appears to be floating in the water.";
+ next;
+ goto L_nomagic_mainmenu;
+
+L_nomagic_throwrock:
+ mes "[Mana Seed]";
+ mes "Your rock makes hardly a sound as it strikes the orb and glances off into the water, leaving neither scratch nor impression.";
+ mes "The orb budges slightly, but then floats back into its old position, as if it were tethered into place.";
+ next;
+ goto L_nomagic_mainmenu;
+
+L_nomagic_touch:
+ mes "[Mana Seed]";
+ if (@drank_potion)
+ goto L_magic_level_1;
+ mes "As you touch the orb, you feel a terrible force within, separated from you by only the thinnest of membranes-- like a tempest, all packed up in one tiny waterskin.";
+ next;
+ mes "[Mana Seed]";
+ mes "For one instant you feel that force rushing past your hands, through your body, as if you had unleashed this tempest upon yourself. Unable to contain the power, you stumble backwards, away from the orb.";
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_TOUCHED_MANASEED;
+ next;
+ goto L_nomagic_mainmenu;
+
+L_magic_level_1:
+ if (getskilllv(SKILL_MAGIC))
+ goto L_end; // shouldn't be happening
+
+ mes "Again you feel the tempest rushing through the Mana Seed's membrane, into your body. You only manage to hold on to it for an instant and find yourself forced to pull your hands away again quickly.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "But this time something is different-- that tingling sensation is back, and stronger than before. It is spreading through your body, head to toes, and you feel yourself brimming with energy.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "It is a light-headed feeling, and you find yourself forced to sit down for a few seconds to recover.";
+ mes "Something is different. A new power has grown within you and is waiting to be understood.";
+ mes "[1000 experience points]";
+ next;
+
+ skill SKILL_MAGIC, 1;
+ getexp 1000, 0;
+ next;
+
+ goto L_end;
+
+L_nomagic_destroy:
+ mes "[Mana Seed]";
+ mes "Try as you might, the orb seems impervious to all forms of attack you can fathom. You are forced to abandon your efforts.";
+ next;
+ goto L_nomagic_mainmenu;
+
+// Magic main menu ------------------------------------------------------------
+L_magic_start:
+ mes "[Mana Seed]";
+ mes "The Mana Seed is still in the same place as during your last visit, spreading its light throughout the cavern.";
+ mes "What would you like to do?";
+ next;
+
+L_magic_mainmenu:
+ menu "Touch it", L_magic_touch,
+ "Destroy it", L_magic_destroy,
+ "Leave it alone", L_end;
+ close;
+
+L_magic_touch:
+ mes "[Mana Seed]";
+ mes "You touch the Mana Seed again.";
+
+ if (getskilllv(SKILL_MAGIC) >= @max_magic)
+ goto L_magic_maxed_out;
+
+ set @exp_needed, @magic_exp_needed[getskilllv(SKILL_MAGIC) + 1];
+ set @magic_exp, MAGIC_EXPERIENCE & 65535;
+ if (@magic_exp >= @exp_needed)
+ goto L_magic_levelup;
+
+ set @prev_exp_needed, @magic_exp_needed[getskilllv(SKILL_MAGIC)];
+ set @exp_diff, @exp_needed - @prev_exp_needed;
+ set @index, ((@magic_exp - @prev_exp_needed) * 5) / @exp_diff;
+ setarray @messages$,
+ "The orb's energy effortlessly rushes through you, ignoring your feeble attempts at containing it. You will need considerably more practice with your magical skills before you can hope to contain it.",
+ "You only barely manage to hang on to some strands of the orb's energy, but not enough to contain it. You still need noticeably more practice with your magical skills.",
+ "The orb's powers are still no match for you; you will need more practice to contain more of its powers.",
+ "You feel close to being able to contain the orb's powers. Still, some more practice is needed.",
+ "The orb's energy only barely evades your attempts at containing it. Soon you will be able to extract more power from it.";
+
+ mes @messages$[@index];
+ next;
+ goto L_magic_mainmenu;
+
+L_magic_levelup:
+ set @baselevel_needed, @min_level[getskilllv(SKILL_MAGIC) + 1];
+ if (base_level < @baselevel_needed)
+ goto L_insufficient_baselevel;
+ mes "Its energy permeates you, surrounds you. You are suddenly uncertain if it is you who is containing the orb's powers or if it is the orb who is seeking out yours.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "The Seed's tempest is calming beneath your hands, and its energies resonate with yours.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "A feeling of harmony is spreading through your body, and the tingling sensation is back, within and without.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "As the tingling increases, you feel light-headed, weightless.";
+ mes "Everything fades...";
+ next;
+
+ mes "Both the tingling and the sense of harmony have vanished, making room for darkness. You can't feel the Mana Seed anymore...";
+ next;
+
+ mes "... you can't feel anything.";
+ next;
+
+ mes "You are floating...";
+ next;
+
+ mes "The darkness is no longer complete. You begin to make out stars in the distance, circling each other, dancing a cosmic dance.";
+ next;
+
+ mes "Images rush past you, shadows of thoughts and dreams. Some touch you, filling you with powerful emotions-- despair, extasy; sometimes loss, sometimes hope; hate, love.";
+ next;
+
+ mes "Someone else's thoughts pass through your mind...";
+ next;
+
+ set @nr, rand(@visions_nr);
+ mes @visions$[@nr];
+ next;
+
+ mes "The image fades.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "You awaken, lying on the ground.";
+ next;
+
+ mes "[Mana Seed]";
+ mes "Something has changed... you feel more confident in your magical abilities.";
+
+ skill SKILL_MAGIC, 1 + getskilllv(SKILL_MAGIC);
+ set @exp, @exp_bonus[getskilllv(SKILL_MAGIC)];
+ itemheal 0, 10000;
+ getexp @exp, 0;
+ mes "[" + @exp + " experience points]";
+ next;
+
+ goto L_magic_end;
+
+L_magic_maxed_out:
+ mes "Strangely, you feel nothing, as if its membrane had closed towards you.";
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_MANASEED_MAXEDOUT;
+ next;
+
+ goto L_magic_mainmenu;
+
+L_insufficent_baselevel:
+ mes "Its energies rush through you. You fight to keep them under control, to contain them in your body. Alas, your body is too frail-- you have to let go.";
+ mes "Frustrated, you give up. You have the skill needed to control this power, but you will have to grow up some more before your body can handle it.";
+ next;
+ goto L_magic_mainmenu;
+
+L_magic_destroy:
+ mes "[Mana Seed]";
+ mes "Try as you might, you cannot find a way, magical or physical, to destroy the seed. Frustrated, you give up.";
+ next;
+ goto L_magic_mainmenu;
+
+L_end:
+ close;
+}
diff --git a/npc/013-1_Woodland_hills/_import.txt b/npc/013-1_Woodland_hills/_import.txt
index c4c325bc..899d3d7e 100644
--- a/npc/013-1_Woodland_hills/_import.txt
+++ b/npc/013-1_Woodland_hills/_import.txt
@@ -2,3 +2,4 @@ map: 013-1.gat
npc: npc/013-1_Woodland_hills/_mobs.txt
npc: npc/013-1_Woodland_hills/_warps.txt
npc: npc/013-1_Woodland_hills/monsters.txt
+npc: npc/013-1_Woodland_hills/sagatha.txt
diff --git a/npc/013-1_Woodland_hills/sagatha.txt b/npc/013-1_Woodland_hills/sagatha.txt
new file mode 100644
index 00000000..a0b1c1b8
--- /dev/null
+++ b/npc/013-1_Woodland_hills/sagatha.txt
@@ -0,0 +1,230 @@
+// Sagatha the witch, expert for nature and ether magic
+//----------------------------------------
+
+function script QuestSagathaHappy {
+ set @unhappiness, (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
+ if (@unhappiness < @value)
+ goto L_zero;
+
+ set @unhappiness, @unhappiness - @value;
+ goto L_write;
+
+L_zero:
+ set @unhappiness, 0;
+
+L_write:
+ set QUEST_MAGIC, (QUEST_MAGIC & ~NIBBLE_3_MASK) | (@unhappiness << NIBBLE_3_SHIFT);
+}
+
+//----------------------------------------
+function script QuestSagathaAnnoy {
+ set @unhappiness, (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
+ if ((@unhappiness + @value) > 15)
+ goto L_max;
+
+ set @unhappiness, @unhappiness + @value;
+ goto L_write;
+
+L_max:
+ set @unhappiness, 15;
+
+L_write:
+ set QUEST_MAGIC, (QUEST_MAGIC & ~NIBBLE_3_MASK) | (@unhappiness << NIBBLE_3_SHIFT);
+}
+
+
+//----------------------------------------
+013-1.gat,131,24,0 script Sagatha#_M 167,{
+ set @has_magic, getskilllv(SKILL_MAGIC);
+ set @evil, 0;
+ set @good, 0;
+ set @unhappy, (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT;
+
+ set @Q_MASK, NIBBLE_4_MASK;
+ set @Q_SHIFT, NIBBLE_4_SHIFT;
+
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+
+
+ if (MAGIC_FLAGS & FLAG_DID_CUTTREE)
+ set @evil, 1;
+
+ set @mouboo, ((QUEST_MAGIC & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT) & 3;
+
+ if (@mouboo == 3)
+ set @good, @good + 1;
+ if (@mouboo == 2)
+ set @evil, 1;
+ if (@mouboo == 1)
+ set @evil, 1;
+
+ set @druid, (((QUEST_MAGIC & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT) & 12) >> 2;
+ if (@druid == 3)
+ set @good, @good + 1;
+
+ if (MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA)
+ mes "[Sagatha the Witch]";
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
+ mes "[Witch]";
+
+ if (@evil)
+ goto L_evil;
+
+ if (@unhappy > 10)
+ goto L_unhappy;
+
+ mes "Before you stands a beautiful woman, dressed in dark purple robes and wearing a witch's hat.";
+ mes "At first glance, ";
+ if (Sex)
+ mes "She looks at you suspiciously.";
+ if (!Sex)
+ mes "She looks at you impassively.";
+ next;
+
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_SAGATHA;
+
+L_evil:
+ mes "The witch's eyes flare up in anger as she notices you, and she turns away from you.";
+ mes "Whatever the reason, she doesn't seem to like you.";
+ next;
+ close;
+
+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!\"";
+ next;
+ close;
+
+L_Main:
+ menu "What do you know about...", L_Question;
+ close;
+
+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:
+
+ 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 == @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;
+
+L_Q_elanore:
+ mes "[Sagatha the Witch]";
+ mes "\"FIXME.\"";
+ next;
+ goto L_Main;
+
+L_Q_manaseed:
+ mes "[Sagatha the Witch]";
+ if (!@has_magic && (MAGIC_FLAGS & MFLAG_TOUCHED_MANASEED))
+ goto L_Q_manaseed_unabsorbed;
+ if (@has_magic)
+ goto L_Q_manaseed_m;
+ mes "\"arimasu\"";
+ next;
+ goto L_Main;
+
+L_Q_manaseed_unabsorbed:
+ mes "[Sagatha the Witch]";
+ mes "\"...unattuned.\"";
+ next;
+ goto L_Main;
+
+L_Q_manaseed_m:
+ mes "[Sagatha the Witch]";
+ mes "\"...\"";
+ next;
+ goto L_Main;
+
+L_Q_manapotion:
+ mes "[Sagatha the Witch]";
+ mes "\"Can't make one without a cauldron.\"";
+ next;
+ goto L_Main;
+
+L_Q_wyara:
+ mes "[Sagatha the Witch]";
+ mes "\"\"";
+ next;
+ goto L_Main;
+
+L_Q_auldsbel:
+ mes "[Sagatha the Witch]";
+ mes "\"\"";
+ next;
+ goto L_Main;
+
+
+S_update_var:
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/013-3_Cave/barrier.txt b/npc/013-3_Cave/barrier.txt
index 90d10ce5..004452f9 100644
--- a/npc/013-3_Cave/barrier.txt
+++ b/npc/013-3_Cave/barrier.txt
@@ -1,6 +1,6 @@
//
-013-3.gat,71,21,0 script #DemonMineBarrier1 127,1,1,{
+013-3.gat,71,21,0 script #DemonMineBarrier1#_M 127,1,1,{
if (QUEST_demon_mines >= 2) close;
if (QUEST_demon_mines == 1 && countitem(1198) >= 1) goto L_Has_Jack_O_Soul;
diff --git a/npc/015-1_Woodland/sword.txt b/npc/015-1_Woodland/sword.txt
new file mode 100644
index 00000000..07b2d9b6
--- /dev/null
+++ b/npc/015-1_Woodland/sword.txt
@@ -0,0 +1,155 @@
+015-1.gat,97,97,0 script #MagicSword#_M 127,{
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+ close;
+
+L_message:
+ set @Q_MASK, NIBBLE_6_MASK;
+ set @Q_SHIFT, NIBBLE_6_SHIFT;
+ set @Q_status, (QUEST_MAGIC & @Q_MASK) >> @Q_SHIFT;
+
+ set @STATUS_INITIAL, 0;
+ set @STATUS_LEARNED_FLAREDART, 1;
+ set @STATUS_LEARNED_MAGICBLADE, 2;
+
+ if (@Q_status == @STATUS_INITIAL) goto L_Initial;
+ if (@Q_status == @STATUS_LEARNED_FLAREDART) goto L_FlareStage;
+ if (@Q_status == @STATUS_LEARNED_FLAREDART) goto L_MagicBladeStage;
+
+ mes "[Magic Sword]";
+ mes "\"I have taught thee all I can teach for now.\"";
+ next;
+ close;
+
+L_Initial:
+ mes "[Magic Sword]";
+ mes "At this point, the river deepens, slowing down to a leisurely pace. In its center you notice an unusual stone, waves breaking around it.";
+ mes "Sticking out of the rock is a sword hilt.";
+ next;
+
+ mes "[Magic Sword]";
+ mes "Suddenly, you hear a strange, metallic voice in your head, the voice of a woman.";
+ mes "\"A blissful day to thee, mortal!\"";
+ next;
+
+ mes "[Magic Sword]";
+ mes "\"What is it is that brings thee to this place?\"";
+ next;
+
+ menu
+ "Who are you?", L_noq,
+ "Nothing in particular.", L_Initial_nothing,
+ "I was just exploring...", L_Initial_nothing,
+ "I am trying to learn magic!", L_Initial_learn;
+ close;
+
+L_noq:
+ mes "[Magic Sword]";
+ mes "The voice sounds slightly amused.";
+ mes "\"How sad to hear how manners have degenerated in recent centuries. Farewell for now, dear mortal.\"";
+ next;
+ close;
+
+L_Initial_nothing:
+ mes "[Magic Sword]";
+ mes "\"Then I wish thee well in thy travels, wanderer!\"";
+ next;
+ close;
+
+L_Initial_learn:
+ mes "[Magic Sword]";
+ mes "\"Magic? Unless I am very mistaken thou already possessest some magic. Yet perhaps I can grant thee some slight aid by providing a magical invocation?\"";
+ next;
+
+ mes "[Magic Sword]";
+ mes "\"Alas, my nature is not quite conductive for spells of healing or protection, though I can bestow upon thee the powers for a rather more martial kind of power.\"";
+ mes "\"But first... why is it that thou seekest this power?\"";
+ next;
+
+ mes
+ "Never mind.", L_Farewell;
+ "To become stronger!", L_Initial_selfish,
+ "To kill!", L_Initial_selfish,
+ "I don't know yet...", L_Initial_dontknow,
+ "To protect the ones I love!", L_Initial_protect;
+ close;
+
+L_Initial_selfish:
+ mes "[Magic Sword]";
+ mes "\"Please return when thou art taking thy quest for magic a little more seriously.\"";
+ next;
+ close;
+
+L_Initial_dontknow:
+ mes "[Magic Sword]";
+ mes "\"A fair and honest thought at so early a point in thine quest.\"";
+ goto L_Initial_ok;
+
+L_Initial_protect:
+ mes "[Magic Sword]";
+ mes "\"Quite a high and laundable goal thou hast chosen for thyself! I do hope that thou canst live up to it.\"";
+
+L_Initial_ok:
+ mes "\"Hark, then, mortal! For I shall bestow upon thee the secret of the flare dart spell!\"";
+ next;
+
+ mes "[Magic Sword]";
+ mes "\"Oh, my apologies-- that was a little overly dramatic. But I do not get to talk to thy kin anymore all that often.\"";
+ next;
+
+ mes "[Magic Sword]";
+ mes "\"For the flare dart spell throw a handful of sulphur powder up into the air, and say, '" + getspellinvocation("flare-dart") + "'.\"";
+ set @Q_status, @STATUS_LEARNED_FLAREDART;
+ callsub S_update_var;
+ next;
+ close;
+
+L_FlareStage:
+ menu;
+ "Uhm... Hello, Sword?", L_FlareStage_hello,
+ "Can you teach me more magic?", L_FlareStage_impolite,
+ "Where can I get sulphur powder?", L_FlareStage_impolite;
+ close;
+
+L_FlareStage_impolite:
+ mes "[Magic Sword]";
+ mes "You hear a metallic chime in your head. After a second, you come to the conclusion that it was probably the sword sighing.";
+ mes "\"Greetings to thee, too, mortal, and farewell until thou hast learned some proper manners.\"";
+ next;
+ close;
+
+L_FlareStage_hello:
+ mes "[Magic Sword]";
+ mes "\"Well met once more, mortal! What brings thee here?\"";
+ next;
+
+ menu
+ "Can you teach me more magic?", L_FlareStage_moremagic,
+ "Where can I find sulphur powder?", L_FlareStage_sulphur,
+ "Farewell!", L_Farewell;
+ close;
+
+L_FlareStage_moremagic:
+ mes "[Magic Sword]";
+ mes "\"I can indeed! But first I must see if thou art worthy. Find my brother, and talk to him! If thou canst find him, she shall teach thee another spell.\"";
+ next;
+ goto L_Farewell;
+
+L_FlareStage_sulphur:
+ mes "[Magic Sword]";
+ mes "\"I do not know, though I suggest to seek out a local alchemist, if there is any.\"";
+ next;
+ goto L_Farewell;
+
+L_Farewell:
+ mes "[Magic Sword]";
+ mes "\"Farewell for now!\"";
+ next;
+ close;
+
+S_update_var:
+ set QUEST_MAGIC,
+ (QUEST_MAGIC & ~(@Q_MASK)
+ | (@Q_status << @Q_SHIFT));
+ return;
+}
diff --git a/npc/018-1_Woodland_mining_camp/_import.txt b/npc/018-1_Woodland_mining_camp/_import.txt
index 9be2065c..06c8a307 100644
--- a/npc/018-1_Woodland_mining_camp/_import.txt
+++ b/npc/018-1_Woodland_mining_camp/_import.txt
@@ -2,3 +2,4 @@ map: 018-1.gat
npc: npc/018-1_Woodland_mining_camp/_mobs.txt
npc: npc/018-1_Woodland_mining_camp/_warps.txt
npc: npc/018-1_Woodland_mining_camp/miners.txt
+npc: npc/018-1_Woodland_mining_camp/sword.txt
diff --git a/npc/018-1_Woodland_mining_camp/sword.txt b/npc/018-1_Woodland_mining_camp/sword.txt
new file mode 100644
index 00000000..7352384d
--- /dev/null
+++ b/npc/018-1_Woodland_mining_camp/sword.txt
@@ -0,0 +1,12 @@
+018-1.gat,110,43,0 script #IceSword#_M 127,{
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+
+ close;
+
+L_message:
+ mes "[Sword in Pond]";
+ mes "\"Zzzzzz.....\"";
+ next;
+ close;
+}
diff --git a/npc/018-3_Cave/_import.txt b/npc/018-3_Cave/_import.txt
index cf5a8562..2f30ca7c 100644
--- a/npc/018-3_Cave/_import.txt
+++ b/npc/018-3_Cave/_import.txt
@@ -2,3 +2,4 @@ map: 018-3.gat
npc: npc/018-3_Cave/_mobs.txt
npc: npc/018-3_Cave/_warps.txt
npc: npc/018-3_Cave/bookcase.txt
+npc: npc/018-3_Cave/sword.txt
diff --git a/npc/018-3_Cave/sword.txt b/npc/018-3_Cave/sword.txt
new file mode 100644
index 00000000..c4a62a8a
--- /dev/null
+++ b/npc/018-3_Cave/sword.txt
@@ -0,0 +1,12 @@
+018-3.gat,71,127,0 script #DemonSword#_M 127,{
+ if (getskilllv(SKILL_MAGIC))
+ goto L_message;
+
+ close;
+
+L_message:
+ mes "[Sword in Rock]";
+ mes "\"Ouch... my head...\"";
+ next;
+ close;
+}
diff --git a/npc/functions/magic.txt b/npc/functions/magic.txt
new file mode 100644
index 00000000..eab4b60a
--- /dev/null
+++ b/npc/functions/magic.txt
@@ -0,0 +1,15 @@
+// Basic magic functionality
+
+// Magic system uses:
+// - MAGIC_EXP (magic experience points, gained for spellcasting)
+// - MAGIC_FLAGS
+
+// ------------------------------------------------------------
+// Gain initial magic skill
+// ------------------------------------------------------------
+function script MagicGainBasic {
+
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DRANK_POTION;
+ close;
+
+}
diff --git a/npc/functions/mob_points.txt b/npc/functions/mob_points.txt
index 9e8dad92..ede2d474 100644
--- a/npc/functions/mob_points.txt
+++ b/npc/functions/mob_points.txt
@@ -5,13 +5,13 @@ function script MobPoints {
setarray @points,
1, // Maggot
- 2, // Scorpion
- 20, // Red Scorpion
+ 2, // Scorpion [1003]
+ 20, // Red Scorpion [1004]
10, // Green Slime
30, // Giant Maggot
15, // Yellow Slime
25, // Red Slime
- 45, // Black Scorpion
+ 45, // Black Scorpion [1009]
50, // Snake
4, // Fire Goblin
55, // Spider
@@ -22,7 +22,7 @@ function script MobPoints {
2, // Bat
16, // Pinkie
17, // Shroom
- 14, // Fluffy
+ 14, // Fluffy [1020]
25, // Cave Snake
100, // Jack-O
80, // Fire Skull
@@ -30,7 +30,7 @@ function script MobPoints {
20, // Stumpy
70, // Mountain Snake
15, // Easter Fluffy
- 40, // Mouboo
+ 40, // Mouboo [1028]
0, // Mauve Plant
0, // Gamboge Plant
0, // Cobalt Plant
@@ -38,5 +38,30 @@ function script MobPoints {
20, // Sea Slime
0; // Silk Worm
+
if (MPQUEST == 1) set Mobpt, Mobpt + @points[@mobID - 1002];
+
+ if ((@mobID == 1003) || (@mobID == 1004) || (@mobID == 1009))
+ goto L_good;
+
+
+ // Attitude adjustment for the witch (can we refactor this to another function? Not sure about max. recursion depth)
+
+ set @value, 0;
+ if (@mobID == 1028)
+ set @value, 4;
+ if (@mobID == 1020)
+ set @value, 3;
+
+ if (@value == 0)
+ goto L_end;
+
+ callfunc "QuestSagathaAnnoy";
+ goto L_end;
+
+L_good:
+ set @value, 1;
+ callfunc "QuestSagathaHappy";
+L_end:
+ set @value, 0;
}