diff options
author | toams <toams85@gmail.com> | 2020-05-31 21:28:44 +0200 |
---|---|---|
committer | toams <toams85@gmail.com> | 2020-05-31 21:28:44 +0200 |
commit | 3c8c5a6eb84315dfeab09663b3788d2d01562698 (patch) | |
tree | e697bfa790624f1dfe59471c6ba37e0a4e26dd95 | |
parent | f62a011e56e0fcd1f97b5967c8e89b86b2f8ec30 (diff) | |
download | serverdata-3c8c5a6eb84315dfeab09663b3788d2d01562698.tar.gz serverdata-3c8c5a6eb84315dfeab09663b3788d2d01562698.tar.bz2 serverdata-3c8c5a6eb84315dfeab09663b3788d2d01562698.tar.xz serverdata-3c8c5a6eb84315dfeab09663b3788d2d01562698.zip |
Improving style and readability of the code.
-rw-r--r-- | npc/008-2-2/kfahr.txt | 759 |
1 files changed, 405 insertions, 354 deletions
diff --git a/npc/008-2-2/kfahr.txt b/npc/008-2-2/kfahr.txt index da594512..478c8c6e 100644 --- a/npc/008-2-2/kfahr.txt +++ b/npc/008-2-2/kfahr.txt @@ -15,255 +15,268 @@ 008-2-2,44,36,0 script Kfahr#008-2-2 NPC_YOUNG_MAN_KFAHR,{ + @beer_count = 0; + @current_story = 0; + @last_story = 0; + @has_beer = 0; -@beer_count = 0; -@current_story = 0; -@last_story = 0; -@has_beer = 0; - -function tale_sub{ - - @story_abort = 0; - - //don't to tell the same story again - if (@current_story == @last_story){ + function kfahr_first_met; + function kfahr_default_greeting; + function kfahr_main_dialog; + function tale_check; + function gain_power; + function give_beer; + function pc_no_beer; + function kfahr_has_beer; + function kfahr_drunk; + function tale_desert_worm; + function desert_worm_see_bones; + function tale_desert_worm_final; + function tale_desert_temple; + function tale_hero_tulimshar; + function tale_desert; + function bone_quest; + function bone_quest_tooweak; + function bone_quest_items; + function bone_quest_check_items; + function bone_quest_final_check; + function bone_quest_finished; + +switch (getq(HurnscaldQuests_Kfahr)) { + case 0: narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr frowns."); + l("You stand before a battle-scarred, darkly tanned warrior, brimming with muscles."), + l("Just looking at him you smell danger, adventure, excitement..."), + l("..."), + l("On second thought, he really could use a bath."), + l("..."), + l("The warrior turns towards you, grinning broadly."); + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("I only just told you that story. Trust me, the others are worth hearing, too!"); - @story_abort = 1; - return; - } + l("Why, hello there! Come to visit Kfahr the Warrior to hear of my exploits, have you?"); + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("He laughs heartily and gives you a slap on the back."); - //don't to tell a story if out of beer - if (@has_beer == 0){ - if (@beer_count > 4){ - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("I think I've talked 'nuff for now... but thanks for lis'ning!"); - } - if (@beer_count <= 4){ speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Now that's one of my favorite tales, but my throat is just a little too dry to talk about something like that... could you help me out a little here?"); + l("Can't blame you, can't blame you at all! Here, take a seat!"); + select + l("Who are you?"), + l("Goodbye."); + switch (@menu) { + case 1: + kfahr_first_met; + break; + case 2: + close; } - @story_abort = 1; - return; - } - @has_beer = 0; - @last_story = @current_story; + break; + case 1: + kfahr_default_greeting; + kfahr_main_dialog; + break; + case 2: + bone_quest_check_items; + kfahr_main_dialog; + break; + default: + kfahr_default_greeting; + kfahr_main_dialog; + break; } -function bone_quest_items{ +close; - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Bring me " + .BLACK_STINGERS_NR + " @@ and " + .MUSHROOMS_NR + " @@ to prove that you are a competent warrior, and I'll see if I have something for you.", getitemlink("BlackScorpionStinger"), getitemlink("SmallMushroom")); +function kfahr_first_met { narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He grins."); - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l( "But while you are here... perhaps you would like to listen to another story?"); -} - -function bone_quest_final_check{ + l("Kfahr laughs again."); - if (countitem("BlackScorpionStinger") < .BLACK_STINGERS_NR){ + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Surely you jest! You must have heard of Kfahr, Slayer of Toby Rick the Desert Worm, Raider of the Lost Temple, Hero of Tulimshar?"); - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("No, no... I said " + .BLACK_STINGERS_NR + " black scorpion stingers."); - if (countitem("BlackScorpionStinger") > 0) - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You will need " + (.BLACK_STINGERS_NR - (countitem ("BlackScorpionStinger"))) + " more of those."); - else + select + l("Uhm..."), + l("Well..."), + l("To be quite honest..."), + l("Excuse me, someone is, er, whispering me..."); + switch (@menu) { + case 4: + close; + default: speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You didn't bring even a single one!"); - close; + l("ah, I knew it! So you have come to hear some tales about the dangers of the desert? You've come to the right man!"); + setq HurnscaldQuests_Kfahr, 1; + close; } - if (countitem("SmallMushroom") < .MUSHROOMS_NR){ - - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("No, no... I said " + .MUSHROOMS_NR + " small mushrooms."); - if (countitem("SmallMushroom") > 0) - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You will need " + (.MUSHROOMS_NR - (countitem ("SmallMushroom"))) + " more of those."); - else - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You didn't bring me even a single little mushroom!"); - close; - } + return; +} +function kfahr_default_greeting { narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr is delighted."); - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Well done, well done! Now that's what I call Warrior spirit!"); - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He laughs, then suddenly stops, turning to you with suspicion in his eyes."); - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You DID get those yourself, didn't you? Not buy them or somesuch...?"); - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Before you can answer, he laughs and slaps you on the back again."); - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Ah, what am I thinking! Too many years in the desert make you a little suspicious of everyone and everything! Naah, I believe you."); - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He pulls a strangely curved knife out of a side pocket and holds it up to the light. The blade is partly transparent, and looks quite sharp."); - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("It's a bone knife, carved out of the umplex bone of a desert worm... you can probably guess which one."); - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He grins broadly again, weighing the weapon."); - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("It's a little heavy, but one of the best knives you can get. Certainly beats a short sword any time of day."), - l("I had the nomads make me a few of them, and I hardly use them nowadays, so I think I can part with this one."); + l("Kfahr nods and grins as you greet him."); + speech S_LAST_NEXT, + l("Came back for more stories about Desert Worms, Desert Temples and the Hero of Tulimshar? Have a seat!"); - if (countitem("BlackScorpionStinger") < .BLACK_STINGERS_NR){ + return; +} - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You just had " + .BLACK_STINGERS_NR + " black scorpion stingers. What happened to them?"); - if (countitem("BlackScorpionStinger") > 0) - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You will need " + (.BLACK_STINGERS_NR - (countitem ("BlackScorpionStinger"))) + " more of those."); - else - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You didn't bring even a single one!"); - close; - } +function kfahr_main_dialog { + do { + select + l("What's a Desert Worm?"), + l("Desert Temple?"), + l("Hero of Tulimshar?"), + l("Tell me about the desert!"), + l("I want to become as powerful as you!"), + l("Here, have a beer!"), + l("Goodbye!"); + switch (@menu) { + case 1: + tale_desert_worm; + break; + case 2: + tale_desert_temple; + break; + case 3: + tale_hero_tulimshar; + break; + case 4: + tale_desert; + break; + case 5: + gain_power; + break; + case 6: + give_beer; + break; + case 7: + close; + } + } while (1); - if (countitem("SmallMushroom") < .MUSHROOMS_NR){ + return; +} +function tale_check { + //don't to tell the same story again + if (@current_story == @last_story) { + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Kfahr frowns."); speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You just had " + @MUSHROOMS_NR + " small mushrooms. What happened to them?"); - if (countitem("SmallMushroom") > 0) - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You will need " + (.MUSHROOMS_NR - (countitem ("SmallMushroom"))) + " more of those."); - else - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You didn't bring me even a single little mushroom!"); - close; + l("I only just told you that story. Trust me, the others are worth hearing, too!"); + return true; } - getinventorylist; - if (@inventorylist_count == 100){ - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You don't have room for this. Come back when you do."); - close; + //don't to tell a story if out of beer + if (@has_beer == 0) { + if (@beer_count > 4) { + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("I think I've talked 'nuff for now... but thanks for lis'ning!"); + } + if (@beer_count <= 4) { + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Now that's one of my favorite tales, but my throat is just a little too dry to talk about something like that... could you help me out a little here?"); + } + return true; } + @has_beer = 0; + @last_story = @current_story; - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He hands you the knife."), - l("Oh, and I think I'll keep those in return; I know someone who will trade them for antidote potions."); - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He pockets the stingers and mushrooms."); - - setq HurnscaldQuests_Kfahr, 3; - delitem "BlackScorpionStinger", .BLACK_STINGERS_NR; - delitem "SmallMushroom", .MUSHROOMS_NR; - getexp .KNIFE_QUEST_XP, 0; - getitem "BoneKnife", 1; - next; + return false; } -function bone_quest_check_items{ - - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr eyes you with unconcealed amusement."); +function gain_power { speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Welcome back! Did you bring me the things I asked for?"); - next; - select - l("Yes, here they are!"), - l("Er, what were those things again?"), - l("No, sorry, I didn't have the time. I'm more interested in hearing your stories."), - l("I forgot! Let me get them right now."); - switch (@menu){ - case 1: bone_quest_final_check; - return; - case 2: bone_quest_items; - return; - case 3: return; - case 4: close; - } -} - -function bone_quest_finished{ + l("Yeees, yes... doesn't everyone?"); + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("He laughs briefly."); speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("I really don't have anything else I'd want to give away to make you stronger. Look around a bit yourself! You won't become a hero if you keep begging for help!"); -} + l("Don't worry – you can't become as powerful as I, of course, but if you keep practicing, you can get pretty damn close! Just make sure to pick your opponents carefully, and know when to run to live another day!"); -function bone_quest_tooweak{ - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You know, little one, if you keep practicing a little and come back once you're a bit stronger, I might have something for you..."); - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He winks."); + return; } -function bone_quest{ +function give_beer { - if (getq(HurnscaldQuests_Kfahr) == 2){ - bone_quest_items; + if (countitem(Beer) < 1) { + pc_no_beer(); return; } - if (getq(HurnscaldQuests_Kfahr) > 2){ - bone_quest_finished; + if (@has_beer) { + kfahr_has_beer(); return; } + else + @has_beer = 1; - if (BaseLevel < 40){ - bone_quest_tooweak; - return; - } + if (@beer_count > 4) + kfahr_drunk(); + + ++@beer_count; + + setarray .beermessages$[1], + l("Ah yes... a warrior's drink!"), + l("Generous, generous! I like that!"), + l("Hahah! That's just what I needed!"), + l("I love this town! Hurnscaldian hospitality! Mrahahahah!"), + l("A'ight, one more can't hurt, eh?"); narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr stares at you for a moment, then nods."); + l("Kfahr is visibly delighted."); speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You seem reasonably skilled. I think I may have something that I no longer need, but I don't want to give it to just anyone..."); + .beermessages$[@beer_count]; narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He hesitates, obviously trying to make up his mind about something, then continues."); + l("He takes a deep sip."); + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Aaah, magnificent!"); + if (@beer_count > 4) + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Kfahr seems quite relaxed now."); - setq HurnscaldQuests_Kfahr, 2; - bone_quest_items; -} + next; -function tale_desert_worm_final{ + return; +} +function pc_no_beer { + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Kfahr stares at you, then begins to laugh."); speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Nothing much else happened on that trip. When we arrived in Tulimshar, people at first didn't believe the story, of course, until we showed them the treasures and the bones. Ah, those were wonderful days..."); + l("Mrahahahahaha! Here's the beer! Right, right! Naah, I get it! Save your gold for whatever you need it for! But if you have some spare and want to share a beer, you know where to find me!"); - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - "He sighs and leans back, a nostalgic look on his face."; + return; } - -function desert_worm_see_bones{ - - if (BaseLevel >= 40) - bone_quest; - return; - +function kfahr_has_beer { + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Kfahr leans back and sighs heavily."); speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Of course!"); - + l("Generous, generous! But I still have plenty in here!"); narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He pulls out a strangely curved knife with a yellow-whiteish blade that is almost transparent at the edge."); + l("He laughs and takes a sip from the beer you gave him earlier."); - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("When hardened properly, this bone knife can last a lifetime! One of the best knives you will find, too."); + return; +} +function kfahr_drunk { narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He puts the knife back into his pocket."); + l("Kfahr leans back and sighs heavily."); + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Very, very generous... bu' I think I'm fine for now."); + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("He suppresses a burp."); - mes l(" > \"That knife looks sharp!\""); - mes ""; - mes l(" > \"But, what happened next?\""); - tale_desert_worm_final; + return; } -function tale_desert_worm{ - +function tale_desert_worm { @current_story = 1; - tale_sub; - if (@story_abort) + if (tale_check()) return; -narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, l("Kfahr smiles and leans back."); speech S_FIRST_BLANK_LINE | S_LAST_NEXT, @@ -338,13 +351,12 @@ narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, l("I never told Arvek that it was his brew that killed it; he'd never have forgiven me."), l("One of the nomads that had been travelling with the other caravan then told me that you could make special kinds of knives and swords and armor out of desert worm bones."); - select l("Hang on... bones in a... worm?"), l("That's neat! Do you have any that I could see?"), l("And then?"), l("Zzzzzzzz......."); - switch (@menu){ + switch (@menu) { case 1: speech S_FIRST_BLANK_LINE | S_LAST_NEXT, l("Weren't you listening? A desert worm is not a regular worm; a worm couldn't survive in the desert."); @@ -352,7 +364,7 @@ narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, l("Do you have any bones that I could see?"), l("Never mind that, what happened then?"), l("Zzzzzzzz......."); - switch (@menu){ + switch (@menu) { case 1: desert_worm_see_bones; return; case 2: tale_desert_worm_final; @@ -365,13 +377,49 @@ narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, return; case 4: close; } + + return; +} + +function desert_worm_see_bones { + if (BaseLevel >= 40) { + bone_quest; + return; + } + + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Of course!"); + + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("He pulls out a strangely curved knife with a yellow-whiteish blade that is almost transparent at the edge."); + + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("When hardened properly, this bone knife can last a lifetime! One of the best knives you will find, too."); + + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("He puts the knife back into his pocket."); + + mes l(" > \"That knife looks sharp!\""); + mes ""; + mes l(" > \"But, what happened next?\""); + tale_desert_worm_final; + + return; } -function tale_desert_temple{ +function tale_desert_worm_final { + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Nothing much else happened on that trip. When we arrived in Tulimshar, people at first didn't believe the story, of course, until we showed them the treasures and the bones. Ah, those were wonderful days..."); + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + "He sighs and leans back, a nostalgic look on his face."; + + return; +} + +function tale_desert_temple { @current_story = 2; - tale_sub; - if (@story_abort) + if (tale_check()) return; speech S_FIRST_BLANK_LINE | S_LAST_NEXT, @@ -430,27 +478,31 @@ function tale_desert_temple{ l("What happened to the tablet?"), l("Did you go there again?"), l("Zzzzzzz....."); - switch (@menu){ - case 1: break; - case 2: speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Well, we couldn't read it. We later sold it for a good price, to a young travelling archeologist; Doctor Nohlidge or something like that. She said that the engravings described sacrifical practices of an ancient snake cult..."); - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He shrugs."); - break; - case 3: narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr laughs."); - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Of course we tried to go there again. After seeing all that treasure, George wouldn't give up on it. We tried many times – as did others, from what I've heard – but we never found it again."); - break; - case 4: close; + switch (@menu) { + case 1: + break; + case 2: + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Well, we couldn't read it. We later sold it for a good price, to a young travelling archeologist; Doctor Nohlidge or something like that. She said that the engravings described sacrifical practices of an ancient snake cult..."); + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("He shrugs."); + break; + case 3: + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Kfahr laughs."); + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Of course we tried to go there again. After seeing all that treasure, George wouldn't give up on it. We tried many times – as did others, from what I've heard – but we never found it again."); + break; + case 4: + close; } -} -function tale_hero_tulimshar{ + return; +} +function tale_hero_tulimshar { @current_story = 3; - tale_sub; - if (@story_abort) + if (tale_check()) return; speech S_FIRST_BLANK_LINE | S_LAST_NEXT, @@ -504,13 +556,13 @@ function tale_hero_tulimshar{ speech S_FIRST_BLANK_LINE | S_LAST_NEXT, l("And from that day on they called me the `Hero of Tulimshar'"); -} -function tale_desert{ + return; +} +function tale_desert { @current_story = 4; - tale_sub; - if (@story_abort) + if (tale_check()) return; narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, @@ -534,187 +586,186 @@ function tale_desert{ speech S_FIRST_BLANK_LINE | S_LAST_NEXT, l("Not terribly healthy, though, I s'pose..."); + + return; } -function gain_power{ +function bone_quest { + if (getq(HurnscaldQuests_Kfahr) == 2) { + bone_quest_items; + return; + } - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Yeees, yes... doesn't everyone?"); - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He laughs briefly."); - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Don't worry – you can't become as powerful as I, of course, but if you keep practicing, you can get pretty damn close! Just make sure to pick your opponents carefully, and know when to run to live another day!"); -} + if (getq(HurnscaldQuests_Kfahr) > 2) { + bone_quest_finished; + return; + } -function pc_no_beer{ + if (BaseLevel < 40) { + bone_quest_tooweak; + return; + } narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr stares at you, then begins to laugh."); + l("Kfahr stares at you for a moment, then nods."); speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Mrahahahahaha! Here's the beer! Right, right! Naah, I get it! Save your gold for whatever you need it for! But if you have some spare and want to share a beer, you know where to find me!"); -} + l("You seem reasonably skilled. I think I may have something that I no longer need, but I don't want to give it to just anyone..."); + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("He hesitates, obviously trying to make up his mind about something, then continues."); -function kfahr_has_beer{ + setq HurnscaldQuests_Kfahr, 2; + bone_quest_items; - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr leans back and sighs heavily."); + return; +} + +function bone_quest_tooweak { speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Generous, generous! But I still have plenty in here!"); + l("You know, little one, if you keep practicing a little and come back once you're a bit stronger, I might have something for you..."); narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He laughs and takes a sip from the beer you gave him earlier."); -} + l("He winks."); -function kfahr_drunk{ + return; +} - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr leans back and sighs heavily."); +function bone_quest_items { speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Very, very generous... bu' I think I'm fine for now."); + l("Bring me %d %s and %d %s to prove that you are a competent warrior, and I'll see if I have something for you.", .BLACK_STINGERS_NR, getitemlink(BlackScorpionStinger), .MUSHROOMS_NR, getitemlink(SmallMushroom)); narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He suppresses a burp."); + l("He grins."); + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l( "But while you are here... perhaps you would like to listen to another story?"); + + return; } -function give_beer{ +function bone_quest_check_items { - if (countitem("Beer") < 1){ - pc_no_beer(); - return; + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Kfahr eyes you with unconcealed amusement."); + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Welcome back! Did you bring me the things I asked for?"); + next; + select + l("Yes, here they are!"), + l("Er, what were those things again?"), + l("No, sorry, I didn't have the time. I'm more interested in hearing your stories."), + l("I forgot! Let me get them right now."); + switch (@menu) { + case 1: + bone_quest_final_check; + return; + case 2: + bone_quest_items; + return; + case 3: + return; + case 4: + close; } - if (@has_beer){ - kfahr_has_beer(); - return; - } - else @has_beer = 1; + return; +} - if (@beer_count > 4) - kfahr_drunk(); +function bone_quest_final_check { + if (countitem(BlackScorpionStinger) < .BLACK_STINGERS_NR) { - ++@beer_count; + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("No, no... I said %d %s.", .BLACK_STINGERS_NR, getitemlink(BlackScorpionStinger)); + if (countitem(BlackScorpionStinger) > 0) + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("You will need %d more of those.", (.BLACK_STINGERS_NR - (countitem (BlackScorpionStinger)))); + else + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("You didn't bring even a single one!"); + close; + } - setarray .beermessages$[1], - l("Ah yes... a warrior's drink!"), - l("Generous, generous! I like that!"), - l("Hahah! That's just what I needed!"), - l("I love this town! Hurnscaldian hospitality! Mrahahahah!"), - l("A'ight, one more can't hurt, eh?"); + if (countitem(SmallMushroom) < .MUSHROOMS_NR) { + + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("No, no... I said %d %s.", .MUSHROOMS_NR, getitemlink(SmallMushroom)); + if (countitem(SmallMushroom) > 0) + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("You will need %d more of those.", (.MUSHROOMS_NR - (countitem (SmallMushroom)))); + else + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("You didn't bring me even a single little mushroom!"); + close; + } narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr is visibly delighted."); + l("Kfahr is delighted."); speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - .beermessages$[@beer_count]; + l("Well done, well done! Now that's what I call Warrior spirit!"); narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He takes a deep sip."); + l("He laughs, then suddenly stops, turning to you with suspicion in his eyes."); speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Aaah, magnificent!"); - if (@beer_count > 4) - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr seems quite relaxed now."); -} - - -function kfahr_main_dialog{ - do - { - select - l("What's a Desert Worm?"), - l("Desert Temple?"), - l("Hero of Tulimshar?"), - l("Tell me about the desert!"), - l("I want to become as powerful as you!"), - l("Here, have a beer!"), - l("Goodbye!"); - switch (@menu){ - case 1: tale_desert_worm; - break; - case 2: tale_desert_temple; - break; - case 3: tale_hero_tulimshar; - break; - case 4: tale_desert; - break; - case 5: gain_power; - break; - case 6: give_beer; - break; - case 7: close; - } - } while (1); -} - - - -function kfahr_first_met { + l("You DID get those yourself, didn't you? Not buy them or somesuch...?"); narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr laughs again."); - + l("Before you can answer, he laughs and slaps you on the back again."); speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Surely you jest! You must have heard of Kfahr, Slayer of Toby Rick the Desert Worm, Raider of the Lost Temple, Hero of Tulimshar?"); + l("Ah, what am I thinking! Too many years in the desert make you a little suspicious of everyone and everything! Naah, I believe you."); + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("He pulls a strangely curved knife out of a side pocket and holds it up to the light. The blade is partly transparent, and looks quite sharp."); + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("It's a bone knife, carved out of the umplex bone of a desert worm... you can probably guess which one."); + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("He grins broadly again, weighing the weapon."); + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("It's a little heavy, but one of the best knives you can get. Certainly beats a short sword any time of day."), + l("I had the nomads make me a few of them, and I hardly use them nowadays, so I think I can part with this one."); - select - l("Uhm..."), - l("Well..."), - l("To be quite honest..."), - l("Excuse me, someone is, er, whispering me..."); - switch (@menu){ - case 4: - close; - default: + if (countitem(BlackScorpionStinger) < .BLACK_STINGERS_NR) { + + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("You just had %d %s. What happened to them?", .BLACK_STINGERS_NR, getitemlink(BlackScorpionStinger)); + if (countitem(BlackScorpionStinger) > 0) speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("ah, I knew it! So you have come to hear some tales about the dangers of the desert? You've come to the right man!"); - setq HurnscaldQuests_Kfahr, 1; - close; + l("You will need %d more of those.",(.BLACK_STINGERS_NR - (countitem (BlackScorpionStinger)))); + else + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("You didn't bring even a single one!"); + close; } -} - -switch (getq(HurnscaldQuests_Kfahr)){ - case 0: - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("You stand before a battle-scarred, darkly tanned warrior, brimming with muscles."), - l("Just looking at him you smell danger, adventure, excitement..."), - l("..."), - l("On second thought, he really could use a bath."), - l("..."), - l("The warrior turns towards you, grinning broadly."); + if (countitem(SmallMushroom) < .MUSHROOMS_NR) { speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Why, hello there! Come to visit Kfahr the Warrior to hear of my exploits, have you?"); + l("You just had %d %s. What happened to them?", .MUSHROOMS_NR, getitemlink(SmallMushroom)); + if (countitem(SmallMushroom) > 0) + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("You will need %d more of those.", (.MUSHROOMS_NR - (countitem (SmallMushroom)))); + else + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("You didn't bring me even a single little mushroom!"); + close; + } - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("He laughs heartily and gives you a slap on the back."); + inventoryplace BoneKnife, 1; - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Can't blame you, can't blame you at all! Here, take a seat!"); - select - l("Who are you?"), - l("Goodbye."); - switch (@menu) - { - case 1: - kfahr_first_met; - break; - case 2: - close; - } - break; - case 1: - narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Kfahr nods and grins as you greet him."); - speech S_LAST_NEXT, - l("Came back for more stories about Desert Worms, Desert Temples and the Hero of Tulimshar? Have a seat!"); - kfahr_main_dialog; - break; - case 2: - bone_quest_check_items; - kfahr_main_dialog; - break; - default: - kfahr_main_dialog; - break; + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("He hands you the knife."), + l("Oh, and I think I'll keep those in return; I know someone who will trade them for antidote potions."); + narrator S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("He pockets the stingers and mushrooms."); + + setq HurnscaldQuests_Kfahr, 3; + delitem BlackScorpionStinger, .BLACK_STINGERS_NR; + delitem SmallMushroom, .MUSHROOMS_NR; + getexp .KNIFE_QUEST_XP, 0; + getitem BoneKnife, 1; + next; + + return; } -close; +function bone_quest_finished { + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("I really don't have anything else I'd want to give away to make you stronger. Look around a bit yourself! You won't become a hero if you keep begging for help!"); + + return; +} OnInit: |