//######################################################################################
//# Nurse
//# AUTHORS: Jenalya and Pjotr Orial
//# REVIEWED BY:
//# heals player below level 20 for free and tells players about the doctor on the 3rd floor.
//#
//# gives the resist-poison skill, used global (!) variable: "$NPC_NURSE", split up in 4 bytes:
//# byte0 (bit 0-7) = healing_needed, byte1 (bit 8-15) = venum_needed, byte2 (bit 16-23) = stabilizer_needed
//# byte3 (bit 24-31) still unused
//# used player-variable: QUEST_Forestbow, nibble7
//# states:
//# 0 if skills are available, she tells you about her plans of doing the antidote,
//# need black scorpion stingers and grass snake tongues
//# 1 waits for ingredients: black scorpion stingers and grass snake tongues
//# 2 waits for ingredients: acorns, apples, orange, healing potion, when these ingreds are there,
//# she mixes the stuff (modify global variable!)
//# 3 you can start the minigame, 3 tries remaining
//# 4 you can start the minigame, 2 tries remaining
//# 5 you can start the minigame, 1 try remaining
//# 6 not enough stuff remaining, jump to state 1
//# 7 yay! you made it!
//######################################################################################
009-2.gat,147,65,0 script Nurse 119, {
set @GSNAKET_AMOUNT, 5;
set @BSCORPIONST_AMOUNT, 10;
set @QUEST1_EXP, 5000;
set @ACORNS_AMOUNT, 10;
set @GREENAPPLE_AMOUNT, 5;
set @REDAPPLE_AMOUNT, 5;
set @ORANGE_AMOUNT, 5;
set @HEALING_AMOUNT, 3;
set @QUEST2_EXP, 10000;
set @ANTIDOTE_EXP, 10000;
set @Q_poison_MASK, NIBBLE_7_MASK;
set @Q_poison_SHIFT, NIBBLE_7_SHIFT;
set @Q_poison, (QUEST_Forestbow_state & @Q_poison_MASK) >> @Q_poison_SHIFT;
if (@Q_poison == 7) goto state7;
if (@Q_poison == 6) goto state6;
if (@Q_poison == 5) goto state5;
if (@Q_poison == 4) goto state4;
if (@Q_poison == 3) goto state3;
if (@Q_poison == 2) goto state2;
if (@Q_poison == 1) goto state1;
if (getskilllv(SKILL_POOL)) goto state0;
L_Usual:
mes "[Nurse]";
mes "\"How can I help you?\"";
next;
if (Inspector == 1)
menu
"Oooh, these wounds! They hurts so much!", L_Heal,
"I don't feel so well, I might be sick.", L_Doctor,
"Have you seen anything out of the ordinary?", L_NohMask,
"No, I'm fine.", -;
if (Inspector != 1)
menu
"Oooh, these wounds! They hurts so much!", L_Heal,
"I don't feel so well, I might be sick.", L_Doctor,
"No, I'm fine.", -;
mes "[Nurse]";
mes "\"Then I would ask you to leave. There are people who really need our help.\"";
close;
L_Doctor:
mes "[Nurse]";
mes "\"Then you should better see the doctor. He is usually in his office on the 3rd floor.\"";
close;
L_Heal:
if (baselevel > 20) goto L_NoHeal;
mes "[Nurse]";
mes "\"Here, let me heal you.\"";
next;
heal 10000, 10000;
close;
L_NoHeal:
mes "[Nurse]";
mes "\"I'm sorry but I'm here only to help young people.";
mes "Your level is already higher than 20.";
mes "You can get some rest in the inn near here.\"";
close;
L_NohMask:
mes "[Nurse]";
mes "\"I'm to busy here to observe the town.\"";
close;
state0:
mes "[Nurse]";
mes "\"Welcome! You really look like a competent person. Maybe you can help to deal with a problem we have.\"";
next;
mes "\"We recently had some accidents in the mines. It seems, that the creatures in the mines become more aggressive.\"";
next;
mes "\"Unfortunaly, some of them are poisonous and it is very difficult for us to help the miners.\"";
next;
mes "\"For this reason, I want to do some research on this subject, to create an anitdote. But I need help to get some ingredients, someone who is able to deal with the dangerous creatures in the mines.\"";
next;
menu
"I will do what I can. What do you need?", L_,
"I'm really sorry, but I don't think, I can help you.", -;
mes "\"That is disagreeable to hear. Maybe i can find another person to take this task.\"";
next;
goto L_Usual;
set @Q_poison, 1;
callsub S_Update_Var;
mes "\"That's great! First, I need some parts of the creatures, that cause the poison.\"";
next;
L_ExplainAgain1:
mes "\"Please bring me five tongues of grass snakes and ten stingers of black scorpions.\"";
close;
state1:
mes "[Nurse]";
mes "\"You are back, wonderful! Did you get, what we need for the antidote?\"";
next;
menu
"Actually, I have another question.", L_Usual,
"Sorry, I forgot. What shall I bring you?", L_ExplainAgain1,
"I have what you asked for.", -,
"I'm still working on that.", quit;
if (countitem("GrassSnakeTongue") < @GSNAKET_AMOUNT || countitem("BlackScorpionStinger") < @BSCORPIONST_AMOUNT) goto L_NotEnough;
delitem "GrassSnakeTongue", @GSNAKET_AMOUNT;
delitem "BlackScorpionStinger", @BSCORPIONST_AMOUNT;
getexp @QUEST1_EXP, 0;
set @Q_poison, 2;
callsub S_Update_Var;
mes "[Nurse]";
mes "\"Very good. Now I have to extract the poison from this, it will take some time.\"";
next;
mes "\"But there are some other things we will need in any case. It would be courteous, if you could get them meanwhile.\"";
next;
L_ExplainAgain2:
mes "\"Please bring me ten acorns, five red apples and five green apples, also five oranges. And we need some small healing potions. They will be useful to hold off the baneful effects. I guess, three of them will be enough.\"";
close;
state2:
mes "You look at the nurse, who seems to be really tired with shadows under her eyes. When she regocnize you, she smiles.";
mes "[Nurse]";
mes "\"I managed to extract the poisonous components. We should be able to create an anitidote, if you have anything else we need.\"";
next;
menu
"Actually, I have another question.", L_Usual,
"I have a bad memory. Can you tell me again, what we need?", L_ExplainAgain2,
"I managed to get everything we need.", -,
"I will go and get it.", quit;
if (countitem("Acorn") < @ACORNS_AMOUNT || countitem("GreenApple") < @GREENAPPLE_AMOUNT || countitem("RedApple") < @REDAPPLE_AMOUNT || countitem("Orange") < @ORANGE_AMOUNT || countitem("SmallHealingPotion") < @HEALING_AMOUNT) goto L_NotEnough;
delitem "Acorn", @ACORNS_AMOUNT;
delitem "GreenApple", @GREENAPPLE_AMOUNT;
delitem "RedApple", @REDAPPLE_AMOUNT;
delitem "Orange", @ORANGE_AMOUNT;
delitem "SmallHealingPotion", @HEALING_AMOUNT;
getexp @QUEST2_EXP, 0;
set @Q_poison, 3;
callsub S_Update_Var;
L_Chemistry:
callsub L_Shuffle_Need;
mes "The nurse takes the ingredients you brought and starts to squeeze the fruits and to crush the acorns. Then she put the fruit juices in some complicated looking chemical device.";
next;
mes "After some minutes, it is blubbering and steaming and some liquidity is dropping in a pot under the device.";
next;
mes "Then she takes the acorn flour and the liquidity and goes to a place back in the room, where she does something you don't see.";
next;
mes "After just a few moments, she comes back with a smiling face, holding two different bottles in her hand.";
next;
mes "[Nurse]";
mes "\"That was easy compared to the things to be done with the stingers and snake tongues.\"";
next;
mes "Then her facial expression gets more serious.";
next;
mes "\"When we try to find the right mixture for the antidote, we need to test it.\"";
next;
mes "\"For that purpose, I will poison you. Then you drink the antidote to see, if it works.\"";
next;
mes "\"If we make a mistake, this might be exhausting and painful, so you should rest a while and prepare yourself.\"";
next;
mes "\"Come back, when you feel ready for that task.\"";
close;
state3:
mes "[Nurse]";
mes "\"Hello my friend. You feel prepared to test the antidote?\"";
next;
menu
"Actually, I have another question.", L_Usual,
"Yes, let us begin.",-;
L_Exp_Game:
mes "[Nurse]";
mes "\"Listen carefully! I will explain, what you need to do.\"";
next;
mes "\"I have here two different distillate. One is the venom extract, the other one a stabilizer.\"";
next;
mes "\"We also have the healing potion.\"";
next;
mes "\"The problem is, that i can only guess the concentration of the venom and the stabilizer. My equipment isn't good enough to determine it precise.\"";
next;
mes "\"You need to find the right amount of each ingredient. I will tell you, what I can know with my analysis methods.\"";
next;
mes "\"Shall we start? \"";
next;
menu
"Please explain it again.", L_Exp_Game,
"Allright", -;
L_Game:
set @Q_poison, @Q_poison + 1;
callsub S_Update_Var;
// healing, venom, stabilizer
callsub L_Load_Need;
//descriptions
set @desc_length, 6;
setarray @desc$,"very little","only a little", "little","much", "a lot", "very much", "a huge amount";
set @divisor, @count / @desc_length;
set @hlIndex, (@hl_need-@offset) /@divisor;
set @vnIndex, (@hl_need-@offset) /@divisor;
set @stIndex, (@hl_need-@offset) /@divisor;
mes "\"I guess you need " + @desc$[@hlIndex] + " of the healing potion.\"";
mes "\"I guess you need " + @desc$[@vnIndex] + " of the venom extracts.\"";
mes "\"I guess you need " + @desc$[@stIndex] + " of the stabilizer.\"";
if(hlNeed/vnNeed > 1 ) mes "\"I see that the healing potions are needed at least " + hlNeed/vnNeed + "times as much as the venom potion. \"";
if(vnNeed/hlNeed > 1 ) mes "\"I see that the venom extracts are needed at least " + vnNeed/hlNeed + "times as much as the healing potion.\"";
//the same for vn<->st
//the same for vn<->hl
set @max, @count+@offset-1;
set @min, @offset;
mes "\"My scale goes up to" + @max + ". I suggest to put at least " + @min +" drops on the scale.\"";
mes "\"How many drops of the healing potion should we use?\"";
input @hlPut;
mes "\"How many drops of the venom extract potion should we use? \"";
input @vnPut;
mes "\"How many drops of the stabilizer potion should we use? \"";
input @stPut;
mes "The nurse puts the potions together according to your instructions. Then she takes a spoon and stirs it.";
next;
mes "You take the glass and look suspiciously at the liquid, which has changed to an odd colour.";
next;
mes "[Nurse]";
mes "\"Allright, now i will inject the venom into you, then you should drink the antidote immidiatly. Are you ready?\"";
next;
mes "You take a deep breath and nod.";
next;
mes "The nurse take a scary looking syringe out of a drawer and swabs your arm with disinfection dabber.";
next;
mes "Then she stings the syringe in your vein and pushs it down. After a few seconds, your heart starts pounding quicker and you began to sweat all over your body";
next;
mes "[Nurse]";
mes "\"Drink the antidote!\"";
next;
mes "You lift the glass to you lips and drink it all at once";
if ( (@hlPut > @hlNeed) && (@vnPut > @vnNeed) ) goto m_hl_m_vn;
if ( (@hlPut > @hlNeed) && (@vnPut <= @vnNeed) ) goto m_hl_l_vn;
if ( (@hlPut <= @hlNeed) && (@vnPut > @vnNeed) ) goto l_hl_m_vn;
if ( (@hlPut < @hlNeed) && (@vnPut < @vnNeed) ) goto l_hl_l_vn;
set @hl_vn_ok, 1;
goto check_st;
m_hl_m_vn:
//poison for 3 minutes
sc_start SC_Poison,180000,0;
mes "You began to feel really dizzy. And you feel so light - you can't help yourself and burst out with laughter. What a strange feeling!";
next;
mes "The nurse looks at you with a really worried look in her face. As you open your mouth to tell her, that you feel allright, the content of your stomache finds its way out through your throat and on the floor.";
next;
"The feeling of happieness disappears, but you seems to be still poisoned.";
goto check_st;
m_hl_l_vn:
//poison for 1 minute
sc_start SC_Poison,60000,0;
mes "You feel the pain of the poison weaken. This seems promising. The thought, you might have been succesful makes you feel enormously happy.";
next;
mes "But a few seconds later, you wonder, what the reason for your happiness was.";
next;
mes "Anyway, what are you doing here? Actually, where are you?";
next;
mes "You don't care, you feel so great. You start to giggle and laugh uncontrollable. What a wonderful feeling. ";
next;
mes "Suddenly, the world has some really strange colors. As you watch this women in front of you chaning her color from dark green to a light purple, you become really tired.";
next;
mes "You lay down on the floor and fall asleep.";
next;
mes "As you open your eyes again, the nurse shines in your face with a lamp and pulls your eyelids open. Then she nodds.";
next;
mes "/"Very well, you are sober again./"";
next;
goto check_st;
l_hl_m_vn:
// first poison for 10 minutes, player will die anyway
sc_start SC_Poison,600000,0;
mes "You feel a sting in your stomach and your heart starts pounding loudly.";
next;
mes "The room is getting dark."
next;
mes "...and darker..."
next;
mes "......."
// bye bye player!
heal -Hp, 0;
// close instead of telling how much stabilizer is needed
close;
// goto check_st;
l_hl_l_vn:
//poison for 1 minute
sc_start SC_Poison, 60000,0;
mes "The antidote seems to have no effect."
goto check_st;
check_st:
if ( (@stPut < @stNeed) ) goto l_st;
if ( (@stPut > @stNeed) ) goto m_st;
if (@hl_vn_ok == 1) goto allcorrect;
mes "[Nurse]";
mes "\"The amount of the stabilizer seems alright, but we have to think again about the other ingredients.\"";
next;
goto notallcorrect;
l_st:
mes "[Nurse]";
mes "\"It seems, as if we took not enough of the stabilizer, the antidote would loose its effect after some time.\"";
next;
goto notallcorrect;
m_st:
mes "[Nurse]";
mes "\"It seems, as if we took too much of the stabilizer. The antidote would turn into venom again after some time.\"";
next;
goto notallcorrect;
allcorrect:
mes "[Nurse]";
mes "\"Wonderfull! You made it! Now i will be able to help all the people, who get poisoned in the mines!\""
next;
mes "[Nurse]";
mes "\"Thank you so much! Oh, and it seems, as if you have gained the skill to resist posion someway. This is great.\"";
next;
mes "[Nurse]";
mes "\"You should talk to someone, who can help you to focus on your skills.\"";
next;
getexp @ANTIDOTE, 0;
setskill TMW_POISON_RESISTANCE, 1;
notallcorrect:
mes "[Nurse]";
mes "\"It didn't work. You are a really brave person. Now you should rest and recover. I hope, you won't give up now. Please come back later, so we can try it again.\"";
next;
close;
state4:
mes "The nurse has a worried look in her face.";
mes "[Nurse]";
mes "\"Hello. I hope you recovered well?\"";
next;
mes "\"There is enough of the distillates left to have another try.\"";
next;
mes "\"Oh no, with all that trouble, I forgot to label your distillate.\"";
next;
mes "She holds up two ampullas.";
next;
mes "\"I hope, this one are yours. I'm sorry.\"";
next;
mes "\"If you feel ok, we could try it again.\"";
next;
menu
"I still feel a bit dizzy, so I don't want to do it now.", L_Usual,
"I'm ok. We can try, but please explain again.", L_Exp_Game,
"Let's start right now.", L_Game;
state5:
mes "The nurse looks at you pitiful.";
mes "[Nurse]";
mes "\"Hello. I'm really sorry for causing you so much pain.\"";
next;
mes "\"But if we can suceed, you are a hero! I will be able to help a lot of people.\"";
next;
mes "\"Next time you might remember me to label the distillates right. I am sorry that it screwed up again.\"";
next;
mes "\"There is enough stuff left for one last try.\"";
next;
mes "\"If we don't get it this time, you will have to get new ingredients.\"";
next;
mes "\"Do you want to have another try?\"";
next;
menu
"I still feel a bit dizzy, so I don't want to do it now.", L_Usual,
"I'm ok. We can try, but please explain again.", L_Exp_Game,
"Let's start right now.", L_Game;
state6:
mes "The nurse looks at you pitiful.";
mes "[Nurse]";
mes "\"There is not enough stuff left for another try.\"";
next;
mes "\"We should try again, right?\"";
set @Q_poison, 1;
callsub S_Update_Var;
goto L_ExplainAgain1;
state7: // geschafft
mes "[Nurse]";
mes "\"Thanks a lot, you can call yourself a true hero now!\"";
next;
mes "\"I am able to help the poisoned miners quite well now.\"";
next;
goto L_Usual;
L_NotEnough:
mes "[Nurse]";
mes "\"This must be a missunderstanding. You don't have all the things I asked you for.\"";
if (@Q_poison == 1) goto L_ExplainAgain1;
if (@Q_poison == 2) goto L_ExplainAgain2;
// the following close *should* never be reached, but who knows, whoever will mess this script up!
close;
quit:
close;
S_Update_Var:
set QUEST_Forestbow_state,
(QUEST_Forestbow_state & ~(@Q_poison_MASK)
| (@Q_poison << @Q_poison_SHIFT));
return;
L_Shuffle_Need:
set @count, 24;
set @offset, 1;
set @hlNeed, @offset + rand(@count);
set @vnNeed, @offset + rand(@count);
set @stNeed, @offset + rand(@count);
set $NPC_NURSE,
($NPC_NURSE & ~(BYTE_0_MASK | BYTE_1_MASK | BYTE_2_MASK)
| (@hlNeed << BYTE_0_SHIFT)
| (@vnNeed << BYTE_1_SHIFT)
| (@stNeed << BYTE_2_SHIFT));
return;
L_Load_Need:
set @hlNeed, ($NPC_NURSE & BYTE_0_MASK) >> BYTE_0_SHIFT;
set @vnNeed, ($NPC_NURSE & BYTE_1_MASK) >> BYTE_1_SHIFT;
set @stNeed, ($NPC_NURSE & BYTE_2_MASK) >> BYTE_2_SHIFT;
return;
}