//
001-1.gat,58,68,0 script Elanore#_M 108,{
set @has_magic, getskilllv(SKILL_MAGIC);
set @Q_MASK, NIBBLE_1_MASK;
set @Q_SHIFT, NIBBLE_1_SHIFT;
set @Q_status, (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
set @Q_heal_exp, MAGIC_EXPERIENCE >> 24;
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);
if(@TEMP == 0) goto Heal1;
if(@TEMP == 1) goto Heal2;
if(@TEMP == 2) goto Heal3;
if(@TEMP == 3) goto Heal4;
Heal1:
mes "[Elanore the Healer]";
mes "\"You don't look too well; let me treat your wounds.\"";
next;
goto Heal_L;
Heal2:
mes "[Elanore the Healer]";
mes "\"I will make quick work of your wounds.\"";
next;
goto Heal_L;
Heal3:
mes "[Elanore the Healer]";
mes "\"Need a healing?\"";
next;
goto Heal_L;
Heal4:
mes "[Elanore the Healer]";
mes "\"Sometimes you just need to run from battle.\"";
next;
goto Heal_L;
Heal_L:
set @TEMP,rand(3);
if(@TEMP == 0) goto Heal_1;
if(@TEMP == 1) goto Heal_2;
if(@TEMP == 2) goto Heal_3;
if(@TEMP == 3) goto Heal_4;
Heal_1:
mes "[Elanore the Healer]";
mes "\"Here you go!\"";
heal 10000,10000;
close;
Heal_2:
mes "[Elanore the Healer]";
mes "\"Painless, wasn't it?";
mes "Here you go!\"";
heal 10000,10000;
close;
Heal_3:
mes "[Elanore the Healer]";
mes "\"You should be more careful.\"";
heal 10000,10000;
close;
Heal_4:
mes "[Elanore the Healer]";
mes "\"Much better, right?!\"";
heal 10000,10000;
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.";
mes "You can get some rest in the inn near here.\"";
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;
set @Q_heal_exp, @Q_heal_exp - 8;
goto L_OnPcKillFinish;
L_OnPcKillWipe:
set @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("MauveHerb") < 10) goto L_Lifestones_Trade_Missing;
if (countitem("GambogeHerb") < 10) goto L_Lifestones_Trade_Missing;
if (countitem("AlizarinHerb") < 10) goto L_Lifestones_Trade_Missing;
if (countitem("CobaltHerb") < 10) goto L_Lifestones_Trade_Missing;
getinventorylist;
if (@inventorylist_count == 100 && countitem("Lifestone") == 0
&& countitem("MauveHerb") > 10
&& countitem("GambogeHerb") > 10
&& countitem("AlizarinHerb") > 10
&& countitem("CobaltHerb") > 10) goto L_Lifestones_NoRoom;
delitem "MauveHerb", 10;
delitem "GambogeHerb", 10;
delitem "AlizarinHerb", 10;
delitem "CobaltHerb", 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)
goto L_Lifestones_MakeSelf_no;
L_Lifestones_MakeSelf_yes:
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.\"";
next;
mes "[Elanore the Healer]";
mes "\"You will have to make sure that your powers are pure, though, either by wearing a white robe or some other special magical item that does this for you.\"";
next;
close;
L_Lifestones_MakeSelf_no:
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:
mes "[Elanore the Healer]";
if (@Q_heal_exp < 20)
goto L_Teach_CheckAdvanceTo2_fail;
mes "Elanore smiles at you.";
mes "\"From what I have been hearing, you seem to be doing well on your way to becoming a healer. I have decided to accept you as a student of the School of Life Magic.\"";
next;
if (getskilllv(SKILL_MAGIC) < 2)
goto L_Teach_AdvanceTo2_warn;
goto L_Teach_AdvanceTo2_skip;
L_Teach_AdvanceTo2_warn:
mes "[Elanore the Healer]";
mes "\"But be warned: you won't be able to use advanced healing magic until you are more capable in your regular magic usage.\"";
next;
L_Teach_AdvanceTo2_skip:
mes "[Elanore the Healer]";
mes "\"Please stand still.\"";
mes "She walks up to you, holds your shoulders, and smiles at you.";
next;
mes "[Elanore the Healer]";
mes "Then, she rises up on her tiptoes and kisses you on your forehead.";
next;
mes "[Elanore the Healer]";
mes "You feel a strange, tingling kind of warmth spread through your body.";
mes "[5000 experience points]";
mes "[Level 2 in Life Magic]";
set @Q_status, @STATUS_MASTERED_LIGHT_HEAL;
callsub S_update_var;
getexp 5000, 0;
if (getskilllv(SKILL_MAGIC_LIFE) < 2)
setskill SKILL_MAGIC_LIFE, 2;
close;
L_Teach_CheckAdvanceTo2_fail:
mes "\"I think I would like to observe you for a little longer to see if you would make a good healer.\"";
if (@Q_heal_exp < 5)
mes "\"You are still at the beginning of your path, but do keep practicing.\"";
if ((@Q_heal_exp >= 5) && (@Q_heal_exp < 15))
mes "\"You are making progress, but you still need more practice.\"";
if (@Q_heal_exp >= 15)
mes "\"You have made good progress, but please do continue in your efforts.\"";
close;
L_Teach_CheckAdvanceToLOH:
if (getskilllv(SKILL_MAGIC) < 2)
goto L_Teach_LOH_advance_abort0;
if (@Q_heal_exp < 30)
goto L_Teach_LOH_advance_abort1;
mes "[Elanore the Healer]";
mes "\"I will now teach you how to heal by laying on your hands. The technique is similar to the spell I taught you at the beginning, but this time you transfer your own health instead of drawing health from a lifestone.\"";
next;
mes "[Elanore the Healer]";
mes "\"First, lay your hand on the person you wish to heal. You needn't touch the injury itself, though you have to touch the skin until you are a little more experienced. Then, medidate on the word '" + getspellinvocation("lay-on-hands") + "'\"";
next;
mes "[Elanore the Healer]";
mes "\"This will let your own life force flow into the person you are healing. If you are badly injured yourself, you will not be able to do this.\"";
mes "[1000 experience points]";
getexp 1000, 0;
set @Q_status, @STATUS_LEARNED_LAY_ON_HANDS;
callsub S_update_var;
next;
close;
L_Teach_LOH_advance_abort0:
mes "[Elanore the Healer]";
mes "\"You don't have enough magical power to learn the next healing spell yet.\"";
close;
L_Teach_LOH_advance_abort1:
mes "[Elanore the Healer]";
mes "\"I'm sorry, but I am not yet convinced that you are a good enough healer. Please continue in your endeavours.\"";
close;
L_NoMagicNoTeach:
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:
callfunc "MagicTalkOptionsSetup";
set @ignore, @QQ_ELANORE;
callfunc "MagicTalkMenu";
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;
if (@c == @QQ_OLDWIZ) goto L_Q_oldwiz;
mes "[Elanore the Healer]";
mes "Elanore shakes her head.";
mes "\"I am sorry, but I don't think that I know anything that would help you.\"";
next;
goto L_Main;
L_Q_oldwiz:
mes "[Elanore the Healer]";
mes "\"He is a kind old man. He stays mostly with his books and his apprentice, though we have chatted a few times.\"";
next;
goto L_Main;
L_Q_manaseed:
mes "[Elanore the Healer]";
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_MAGIC2,
(QUEST_MAGIC2 & ~(@Q_MASK)
| (@Q_status << @Q_SHIFT));
return;
}