From 3ba5d56d872bf0a6afe2ef612ab74ffdc0eae2f7 Mon Sep 17 00:00:00 2001 From: Fate Date: Sat, 29 Nov 2008 14:21:20 -0700 Subject: Added mana seed NPC --- npc/012-3_Cave/mana-seed.txt | 265 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 265 insertions(+) create mode 100644 npc/012-3_Cave/mana-seed.txt (limited to 'npc/012-3_Cave/mana-seed.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..1d973fff --- /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; +} -- cgit v1.2.3-70-g09d2 From 98860f7aa06060e6c6b59efeb3414b3bec67695a Mon Sep 17 00:00:00 2001 From: Fate Date: Sun, 30 Nov 2008 16:39:49 -0700 Subject: Added magic constants and Auldsbel the wizard (tested except for the mana seed part, still needs the magic quests) --- db/const.txt | 2 + db/item_db.txt | 2 +- db/magic_const.txt | 17 + npc/011-1_Woodland/_import.txt | 1 + npc/011-1_Woodland/auldsbel.txt | 836 ++++++++++++++++++++++++++++++++++++++++ npc/012-3_Cave/mana-seed.txt | 4 +- 6 files changed, 859 insertions(+), 3 deletions(-) create mode 100644 db/magic_const.txt create mode 100644 npc/011-1_Woodland/auldsbel.txt (limited to 'npc/012-3_Cave/mana-seed.txt') diff --git a/db/const.txt b/db/const.txt index 73e60c04..080efbad 100644 --- a/db/const.txt +++ b/db/const.txt @@ -174,3 +174,5 @@ NIBBLE_6_MASK 251658240 NIBBLE_7_SHIFT 28 NIBBLE_7_MASK 4026531840 + +import: db/magic_const.txt diff --git a/db/item_db.txt b/db/item_db.txt index 591a5de8..c55a5aa1 100644 --- a/db/item_db.txt +++ b/db/item_db.txt @@ -194,7 +194,7 @@ 702, WeddingRing, Wedding Ring, 5, 1000, 1, 1, , 0, , 1, 0, 10477567, 2, 128, , 0, 0, {}, {} 703, SulphurPowder, Sulphur Powder, 3, 1000, 100, 2, , , , , , 10477567, 2, , , 0, , {}, {} 704, IronPowder, Iron Powder, 3, 800, 80, 3, , , , , , 10477567, 2, , , 0, , {}, {} -705, MagicPotion, Magic Potion, 0, 2000, 300, 50, , , , , , 10477567, 2, , , 0, , { itemheal 0, 10; callfunc "MagicGainBasic"; }, {} +705, ManaPotion, Mana Potion, 0, 2000, 300, 50, , , , , , 10477567, 2, , , 0, , { itemheal 0, 10; callfunc "MagicGainBasic"; }, {} 706, GoldenScorpionStinger, Golden Scorpion Stinger, 3, 2000, 500, 2, , , , , , , , , , , , {}, {} 707, MonsterOilPotion, Monster Oil Potion, 3, 10000, 2000, 50, , , , , , , , , , , , {}, {} 708, LeatherPatch, Leather Patch, 3, 300, 150, 18, , , , , , , , , , , , {}, {} diff --git a/db/magic_const.txt b/db/magic_const.txt new file mode 100644 index 00000000..791c446e --- /dev/null +++ b/db/magic_const.txt @@ -0,0 +1,17 @@ +SKILL_MAGIC 340 +SKILL_MAGIC_LIFE 341 +SKILL_MAGIC_WAR 342 +SKILL_MAGIC_TRANSMUTE 343 +SKILL_MAGIC_NATURE 344 +SKILL_MAGIC_ASTRAL 345 + +// Flags for the magic quests +MFLAG_DRANK_POTION 1 // Character drank at least one magic potion as prerequisite for the mana seed quest +MFLAG_KNOWS_MANASEED 2 // Character has found the Mana Seed +MFLAG_TOUCHED_MANASEED 4 // Character has touched the Mana Seed +MFLAG_MANASEED_MAXEDOUT 8 // Character has touched the Mana Seed while maxed out on magic + +MFLAG_KNOWS_AULDSBEL 16 // Character has met Auldsbel +MFLAG_KNOWS_WYARA 32 // Character has met Wyara +MFLAG_KNOWS_SAGATHA 64 // Character has met Sagatha +MFLAG_KNOWS_MANAPOTION 128 // Has heard about the mana potion 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/auldsbel.txt b/npc/011-1_Woodland/auldsbel.txt new file mode 100644 index 00000000..5be274a6 --- /dev/null +++ b/npc/011-1_Woodland/auldsbel.txt @@ -0,0 +1,836 @@ +// 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 @Q_STATUS_INITIAL, 0; + set @Q_STATUS_POSTINTRO, 1; + + 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 Mostly Grayish, 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: + 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_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)) + 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: + mes "[Auldsbel the Wizard]"; + if (@has_magic) + goto L_Q_manaseed_withmagic; + 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: + mes "[Auldsbel the Wizard]"; + 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-3_Cave/mana-seed.txt b/npc/012-3_Cave/mana-seed.txt index 1d973fff..6ad8a37e 100644 --- a/npc/012-3_Cave/mana-seed.txt +++ b/npc/012-3_Cave/mana-seed.txt @@ -42,8 +42,8 @@ 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; + set @drank_potion, MAGIC_FLAGS & MFLAG_DRANK_POTION; + set @knows_seed, MAGIC_FLAGS & MFLAG_KNOWS_MANASEED; if (@has_magic) goto L_magic_start; -- cgit v1.2.3-70-g09d2 From 54238fbc5acca341449cd0b73b12e3b257a6d2cb Mon Sep 17 00:00:00 2001 From: Fate Date: Sat, 10 Jan 2009 13:21:56 -0700 Subject: Numerous fixes. Magic level 0 should be fully operational now. --- conf/magic.conf.template | 54 ++++++++++++-------------- db/const.txt | 4 +- npc/001-1_Tulimshar/children.txt | 1 + npc/005-1_Snake_desert/spirit.txt | 8 ++-- npc/005-1_Snake_desert/tree.txt | 2 +- npc/008-1_Hurnscald_outskirts/hinnak.txt | 11 +++--- npc/009-2_Hurnscald/wyara.txt | 38 ++++++++++++------- npc/009-3_Cave_beneath_Hurnscald/_import.txt | 1 + npc/009-3_Cave_beneath_Hurnscald/sword.txt | 20 +++++----- npc/011-1_Woodland/alchemist.txt | 21 +++++++++- npc/011-1_Woodland/auldsbel.txt | 57 ++++++++++++++++++---------- npc/012-1_Woodland_Hills/injured-mouboo.txt | 34 +++++++++-------- npc/012-3_Cave/mana-seed.txt | 6 +-- npc/013-1_Woodland_hills/sagatha.txt | 25 ++++++------ npc/015-1_Woodland/_import.txt | 1 + npc/015-1_Woodland/sword.txt | 39 +++++++++++++------ 16 files changed, 192 insertions(+), 130 deletions(-) (limited to 'npc/012-3_Cave/mana-seed.txt') diff --git a/conf/magic.conf.template b/conf/magic.conf.template index 646b412e..66e44cfa 100644 --- a/conf/magic.conf.template +++ b/conf/magic.conf.template @@ -121,11 +121,13 @@ PROCEDURE adjust_spellpower(school) = experience = (script_int(caster, SCRIPT_XP) >> SCRIPT_XP_SHIFT) & SCRIPT_XP_MASK; spellpower = spellpower + (skill(caster, MAGIC) + skill(caster, school)) * 10; # Below, we adjust by special items - IF ((school = LIFE || school = NATURE) && (target = partner(caster))) - THEN (spellpower = spellpower + 200; + IF (not(failed(target)) && (school = LIFE || school = NATURE)) + THEN IF (target) + THEN IF (pc(target) = partner(caster)) + THEN (spellpower = spellpower + 200; IF is_equipped(caster, "WeddingRing") THEN spellpower = spellpower + 50; - IF is_equipped(target, "WeddingRing") + IF is_equipped(pc(target), "WeddingRing") THEN spellpower = spellpower + 50;) PROCEDURE heal(target, max_heal) = @@ -198,7 +200,6 @@ SPELL transmute-wood-to-mouboo : "#T00" = school = TRANSMUTE IN (MANA 5, CASTTIME 4000, REQUIRE skill(caster, MAGIC) > level, - REQUIRE skill(caster, school) > level, COMPONENTS ["RawLog"]) => EFFECT CALL adjust_spellpower(school); CALL default_effect(); @@ -210,7 +211,6 @@ SPELL make-sulphur : "#T01" = school = TRANSMUTE IN (MANA 4, CASTTIME 4000, REQUIRE skill(caster, MAGIC) > level, - REQUIRE skill(caster, school) > level, COMPONENTS ["PileOfAsh"]) => EFFECT CALL adjust_spellpower(school); CALL default_effect(); @@ -233,7 +233,7 @@ SPELL lesser-heal (target : STRING) : "#L00" = THEN { mes "Your spell seems to have no effect on the mouboo."; next; close; } ELSE target = caster;) ELSE target = pc(target); - CALL gain_heal_xp(100, 1); # report half values for non-instaheal + CALL gain_heal_xp(min(100, max_hp(target) - hp(target)) / 2, 1); # report half values for non-instaheal CALL heal(target, 200); CALL gain_xp(1); @@ -838,7 +838,7 @@ SPELL debug : "debug" = + ", lastspell=" + ((script_int(caster, "MAGIC_EXPERIENCE") >> 16) & 0xff) + ", healexp=" + ((script_int(caster, "MAGIC_EXPERIENCE") >> 24) & 0xff)); message (caster, "STATUS: " - + "auldsbel:" + (script_int(caster, "QUEST_MAGIC") & 0x1f) + "," + (script_int(caster, "QUEST_MAGIC") >> 5) + ", " + + "auldsbel:" + (script_int(caster, "QUEST_MAGIC") & 0x1f) + "," + ((script_int(caster, "QUEST_MAGIC") >> 5) & 0x7) + ", " + "dt/mb:" + ((script_int(caster, "QUEST_MAGIC") >> 8) & 0xf) + ", " + "s-unhappy:" + ((script_int(caster, "QUEST_MAGIC") >> 12) & 0xf) + ", " + "sagatha:" + ((script_int(caster, "QUEST_MAGIC") >> 16) & 0xff) + ", " @@ -856,28 +856,28 @@ PROCEDURE debug_xmod(name, mask, shift, gain) = CALL set_var(name, mask, shift, value); PROCEDURE debug_mod(name, delta) = - IF (name = "mexp") THEN CALL debug_xmod("MAGIC_EXP", 0xffff, 0, delta); - ELSE IF (name = "lastspell") THEN CALL debug_xmod("MAGIC_EXP", 0xff, 16, delta); - ELSE IF (name = "lifeexp") THEN CALL debug_xmod("MAGIC_EXP", 0xff, 24, delta); - ELSE IF (name = "F:drank") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 0, delta); - ELSE IF (name = "F:Kmseed") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 1, delta); - ELSE IF (name = "F:touched-mseed") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 2, delta); - ELSE IF (name = "F:mseed-max") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 3, delta); - ELSE IF (name = "F:Kauldsbel") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 4, delta); - ELSE IF (name = "F:Kwyara") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 5, delta); - ELSE IF (name = "F:Ksagatha") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 6, delta); - ELSE IF (name = "F:Kmpotion") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 7, delta); - ELSE IF (name = "F:mseed-rumour") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 8, delta); - ELSE IF (name = "F:Kcuttree") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 9, delta); - ELSE IF (name = "F:cut") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 10, delta); - ELSE IF (name = "F:Kdruidtree") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 11, delta); - ELSE IF (name = "F:Kimp") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 12, delta); - ELSE IF (name = "F:oldwiz") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 13, delta); + IF (name = "mexp") THEN CALL debug_xmod("MAGIC_EXPERIENCE", 0xffff, 0, delta); + ELSE IF (name = "lastspell") THEN CALL debug_xmod("MAGIC_EXPERIENCE", 0xff, 16, delta); + ELSE IF (name = "lifeexp") THEN CALL debug_xmod("MAGIC_EXPERIENCE", 0xff, 24, delta); + ELSE IF (name = "drank") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 0, delta); + ELSE IF (name = "Kmseed") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 1, delta); + ELSE IF (name = "touched-mseed") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 2, delta); + ELSE IF (name = "mseed-max") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 3, delta); + ELSE IF (name = "Kauldsbel") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 4, delta); + ELSE IF (name = "Kwyara") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 5, delta); + ELSE IF (name = "Ksagatha") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 6, delta); + ELSE IF (name = "Kmpotion") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 7, delta); + ELSE IF (name = "mseed-rumour") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 8, delta); + ELSE IF (name = "Kcuttree") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 9, delta); + ELSE IF (name = "cut") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 10, delta); + ELSE IF (name = "Kdruidtree") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 11, delta); + ELSE IF (name = "Kimp") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 12, delta); + ELSE IF (name = "oldwiz") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 13, delta); ELSE IF (name = "auldsbel") THEN CALL debug_xmod("QUEST_MAGIC", 0x1f, 0, delta); ELSE IF (name = "Qauldsbel") THEN CALL debug_xmod("QUEST_MAGIC", 0x7, 5, delta); ELSE IF (name = "dt") THEN CALL debug_xmod("QUEST_MAGIC", 0x3, 10, delta); ELSE IF (name = "mb") THEN CALL debug_xmod("QUEST_MAGIC", 0x3, 8, delta); - ELSE IF (name = "s-unhappy") THEN CALL debug_xmod("MAGIC_EXP", 0xff, 12, delta); + ELSE IF (name = "s-unhappy") THEN CALL debug_xmod("QUEST_MAGIC", 0xff, 12, delta); ELSE IF (name = "sagatha") THEN CALL debug_xmod("QUEST_MAGIC", 0xff, 16, delta); ELSE IF (name = "swords") THEN CALL debug_xmod("QUEST_MAGIC", 0xff, 24, delta); ELSE IF (name = "imp") THEN CALL debug_xmod("QUEST_MAGIC2", 0xf, 0, delta); @@ -908,10 +908,6 @@ SPELL debug-reset : "debug-reset" = set_script_variable(caster, "MAGIC_FLAGS", 0); set_script_variable(caster, "MAGIC_EXP", 0); -SPELL debug-gotonpc (name : STRING) : "warpnpc" = - REQUIRE DEBUG - => EFFECT warp(caster, location(npc(name))); - #-------------------------------------------------------------------------------- # Special-purpose quasispells diff --git a/db/const.txt b/db/const.txt index 0cccd5dc..c5d06c7a 100644 --- a/db/const.txt +++ b/db/const.txt @@ -172,8 +172,8 @@ NIBBLE_5_MASK 15728640 NIBBLE_6_SHIFT 24 NIBBLE_6_MASK 251658240 -NIBBLE_7_SHIFT 28 -NIBBLE_7_MASK 4026531840 +NIBBLE_7_SHIFT 28 // Only three bits available in this one +NIBBLE_7_MASK 1879048192 // should be 4026531840 // Magic skills SKILL_MAGIC 340 diff --git a/npc/001-1_Tulimshar/children.txt b/npc/001-1_Tulimshar/children.txt index 452df411..3f3ec522 100644 --- a/npc/001-1_Tulimshar/children.txt +++ b/npc/001-1_Tulimshar/children.txt @@ -102,6 +102,7 @@ L_8: L_9: mes "\"I know a very bad word. But I must not say it, because monsters will come and get me if I do!\""; + next; menu "A bad word?", L_tell, "Oh, you better keep it for yourself then.", -; diff --git a/npc/005-1_Snake_desert/spirit.txt b/npc/005-1_Snake_desert/spirit.txt index 2ab3bf03..f51b242c 100644 --- a/npc/005-1_Snake_desert/spirit.txt +++ b/npc/005-1_Snake_desert/spirit.txt @@ -17,9 +17,9 @@ L_message: set @BRANCH, 732; - set @s, "girl"; + set @s$, "girl"; if (Sex) - set @s, "boy"; + set @s$, "boy"; if (MAGIC_FLAGS & MFLAG_KNOWS_IMP) goto L_wb; @@ -116,7 +116,7 @@ L_Q_magic: next; mes "[Earth Spirit]"; - mes "\"Besides, think of it like that: if you want to bake a cake, you've got to break a few eggs. Not everything's sweetness in life, my " + @s + "!.\""; + mes "\"Besides, think of it like that: if you want to bake a cake, you've got to break a few eggs. Not everything's sweetness in life, my " + @s$ + "!.\""; next; menu @@ -283,7 +283,7 @@ L_silly_close: mes "[Earth Spirit]"; if (!(MAGIC_FLAGS & MFLAG_KNOWS_IMP)) mes "[Well]"; - mes "\"Silly " + @s + ".\""; + mes "\"Silly " + @s$ + ".\""; L_close: close; diff --git a/npc/005-1_Snake_desert/tree.txt b/npc/005-1_Snake_desert/tree.txt index 7c85c44b..5e576cea 100644 --- a/npc/005-1_Snake_desert/tree.txt +++ b/npc/005-1_Snake_desert/tree.txt @@ -101,7 +101,7 @@ L_givewater: if (countitem(@WATER) < 1) goto L_no_water; delitem @WATER, 1; - getitem @BOTTLE, 541; + getitem @BOTTLE, 1; mes "[Dying Tree]"; mes "You pour a bottle of water into the sand. The water dissipates quickly, without any effect."; diff --git a/npc/008-1_Hurnscald_outskirts/hinnak.txt b/npc/008-1_Hurnscald_outskirts/hinnak.txt index cb7503b1..c2a547d4 100644 --- a/npc/008-1_Hurnscald_outskirts/hinnak.txt +++ b/npc/008-1_Hurnscald_outskirts/hinnak.txt @@ -107,14 +107,15 @@ L_ThanksAgain: "You shouldn't drink while working!", -; mes "[Farmer Hinnak]"; - mes "\"Well, I'm done for the day...\""; + mes "\"Well, I'm done for the day, and I'm quite old enough to decide when I can have a beer, thank you!\""; + next; menu "Sorry... here you are.", L_GiveBeer, "I don't have any.", L_NoBeer; L_GiveBeer: - if (countitem(@BEER) < 0) goto L_NoBeer; + if (countitem(@BEER) < 1) goto L_NoBeer; delitem @BEER, 1; mes "[Farmer Hinnak]"; mes "Hinnak takes a sip."; @@ -155,11 +156,11 @@ L_GiveBeer: next; mes "[Farmer Hinnak]"; - mes "\"So I go inside. I've barely entered when it starts raining outside, pouring cats and mouboos!\""; + mes "\"So I go inside. I'm barely in 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...\""; + mes "\"Not so weird, perhaps, except that it was been bright and sunny just a second before! So I rush out, my wife telling me to leave the witch alone, and I see her standing there in the middle of the rain...\""; next; mes "[Farmer Hinnak]"; @@ -194,7 +195,7 @@ L_Sagatha_hahaha: 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."; + mes "He stares into his empty beer jug, as if wishing it weren't empty yet."; next; close; diff --git a/npc/009-2_Hurnscald/wyara.txt b/npc/009-2_Hurnscald/wyara.txt index 1666643d..d97f6c86 100644 --- a/npc/009-2_Hurnscald/wyara.txt +++ b/npc/009-2_Hurnscald/wyara.txt @@ -103,7 +103,7 @@ L_Q_old_wizard: L_Q_elanore: mes "[Wyara the Witch]"; - mes "\"Elanore is the Tulimshar healer. She is a very nice person and was very helpful when I first moved here.\""; + mes "\"Elanore is the Tulimshar healer. She is a very kind person and an outstanding healer.\""; next; goto L_Main; @@ -129,16 +129,28 @@ L_Q_manapotion: mes "[Wyara the Witch]"; mes "\"I have a simple recipe for making mana potions, but I don't have one ready right now. Can you bring me 40 mauve leaves and a bottle of water? I can make one from those quite easily.\""; next; - menu "OK", L_make_manapotion, - "No", L_Main; + menu "Sure!", L_make_manapotion, + "No.", L_Main; + goto L_Main; + +L_manapotion_toomany: + mes "[Wyara the Witch]"; + mes "\"Hmm... looking at you, I don't think that you would be able to carry it.\""; + next; goto L_Main; L_make_manapotion: if(countitem(@MAUVE) < 40) goto L_make_manapotion_lack; - if(countitem(@WATER) < 1) goto L_make_manapotion_lack; + if(countitem(@BOTTLE_WATER) < 1) goto L_make_manapotion_lack; + getinventorylist; + if ((@inventorylist_count == 100) + && (countitem(@MAUVE) > 40) + && (countitem(@BOTTLE_WATER) > 100) + && (countitem(@MANAPOTION) < 1)) + goto L_manapotion_toomany; delitem @MAUVE, 40; - delitem @WATER, 1; + delitem @BOTTLE_WATER, 1; getitem @MANAPOTION, 1; mes "[Wyara the Witch]"; @@ -176,7 +188,7 @@ L_Q_sagatha: next; mes "[Wyara the Witch]"; - mes "\"She does hold all plants and animals very dear, though. Well, the peaceful ones more than the aggressive ones, I suppose.\""; + mes "\"She does hold all plants and animals very dear, though. Well, the peaceful ones more than the aggressive ones, I suppose, and scorpions not very much at all.\""; next; goto L_Main; @@ -226,10 +238,10 @@ L_Magic_explain: goto L_Magic_main; L_Magic_spell: - if (getskilllv(SKILL_MAGIC) > 1) - goto L_Magic_spell2; if (getskilllv(SKILL_MAGIC_NATURE) > 1) goto L_Magic_spell3; + if (getskilllv(SKILL_MAGIC) > 1) + goto L_Magic_spell2; mes "[Wyara the Witch]"; mes "\"No... I don't think that you are ready yet. But please ask me again when you have some more control over your magical powers.\""; next; @@ -246,11 +258,11 @@ L_Magic_spell2: mes "\"Here is an easy and useful one: '" + getspellinvocation("detect-players") + "'. It will tell you the names of everyone nearby, but beware that there are ways to protect against it.\""; next; - if (!getpartnerid2(0)) + if (!(getpartnerid2(0))) goto L_Magic_main; mes "[Wyara the Witch]"; - mes "\"Married partners can find each other even more easily. Use the '" + getspellinvocation("detect-spouse") + "' spell instead.\""; + mes "\"Married partners can find each other even more easily. Use the '" + getspellinvocation("sense-spouse") + "' spell instead.\""; next; goto L_Magic_main; @@ -467,7 +479,7 @@ L_Magic_train_sagatha: mes "[Wyara the Witch]"; mes "\"The tree has been there alone and unattended for a long time; what he needs most is water and affection. Give him both.\""; next; - goto Magic_main; + goto L_Magic_main; L_Magic_train_tree_backgd: mes "[Wyara the Witch]"; @@ -514,9 +526,9 @@ L_Magic_tree_menu: menu "How should I give him water?", L_Magic_tree_water, "How should I thank him?", L_Magic_tree_remind, - "OK.", -, + "I will.", -, "No.", -; - goto L_Magic_menu; + goto L_Magic_main; L_Magic_tree_water: mes "[Wyara the Witch]"; diff --git a/npc/009-3_Cave_beneath_Hurnscald/_import.txt b/npc/009-3_Cave_beneath_Hurnscald/_import.txt index 0297260b..6a2a2a8e 100644 --- a/npc/009-3_Cave_beneath_Hurnscald/_import.txt +++ b/npc/009-3_Cave_beneath_Hurnscald/_import.txt @@ -2,3 +2,4 @@ map: 009-3.gat npc: npc/009-3_Cave_beneath_Hurnscald/_mobs.txt npc: npc/009-3_Cave_beneath_Hurnscald/_warps.txt npc: npc/009-3_Cave_beneath_Hurnscald/monsters.txt +npc: npc/009-3_Cave_beneath_Hurnscald/sword.txt diff --git a/npc/009-3_Cave_beneath_Hurnscald/sword.txt b/npc/009-3_Cave_beneath_Hurnscald/sword.txt index a1f9949a..d60ac123 100644 --- a/npc/009-3_Cave_beneath_Hurnscald/sword.txt +++ b/npc/009-3_Cave_beneath_Hurnscald/sword.txt @@ -19,7 +19,7 @@ L_message: if (@Q_status == @STATUS_INITIAL) goto L_Initial; if (@Q_status == @STATUS_LEARNED_FLAREDART) goto L_PostFlareDart; - if (@Q_status == @STATUS_LEARNED_MAGICBLADE) goto L_PostFlareDart_teach; + if (@Q_status == @STATUS_LEARNED_MAGICBLADE) goto L_PostFlareDart_teach2; if (@Q_status == @STATUS_LEVEL2) goto L_L2_W11; if (@Q_status == @STATUS_W12) goto L_L2_W11; if (@Q_status == @STATUS_W11) goto L_L2_almost_done; @@ -46,7 +46,7 @@ L_Initial: mes "[Magic 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.\""; + mes "\"I know not what brought thee hither, but I kindly ask that thou leavest me alone in my sorrow.\""; next; menu @@ -68,7 +68,7 @@ L_PostFlareDart: mes "\"Welcome, mortal!\""; next; - mes + menu "Hi! How are you?", L_PostFlareDart_hi, "Can you teach me magic?", L_PostFlareDart_teach, "Your sister sent me.", L_PostFlareDart_sister, @@ -109,7 +109,7 @@ L_PostFlareDart_teach: mes "[Magic 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.\""; + mes "\"Hold a knife, sharp or regular, when thou speakest it.\""; set @Q_status, @STATUS_LEARNED_MAGICBLADE; callsub S_update_var; next; @@ -119,7 +119,7 @@ L_PostFlareDart_teach: next; close; -L_PostFlareDart_teach: +L_PostFlareDart_teach2: mes "[Magic Sword]"; mes "\"Seek out my sister, and leave me alone in my sorrows.\""; next; @@ -129,7 +129,7 @@ L_Close: L_L2_W11: mes "[Magic Sword]"; - mes "\"You have returned. That must mean that thy wish to learn the magic of war is still alive?\""; + mes "\"Thou hast returned. That must mean that thy wish to learn the magic of war is still alive?\""; next; menu "No, I just wanted to say `hi'.", L_sayhi, @@ -137,8 +137,8 @@ L_L2_W11: mes "[Magic Sword]"; mes "\"If that is thy wish, I shall not stop thee. But do not expect to find merriment down this road.\""; - mes "\"I must ask that you sacrifice a thousand monster points for this, however.\""; - + mes "\"I must ask that thou sacrificest a thousand monster points for this, however.\""; + menu "No, I don't want that.", L_farewell, "I agree.", -; @@ -165,13 +165,13 @@ L_L2_W11: L_L2_almost_done: mes "[Magic Sword]"; - mes "\"Return to my sister now. I expect that she shall teach you one more spell.\""; + mes "\"Return to my sister now. I expect that she shall teach thee one more spell.\""; next; close; L_lacking_mobpoints: mes "[Magic Sword]"; - mes "\"Thou lackest the monster points needed to prove thy worthiness. I shall not reveal more to you until thou hast slain more monsters.\""; + mes "\"Thou lackest the monster points needed to prove thy worthiness. I shall not reveal more to thee until thou hast slain more monsters.\""; next; close; diff --git a/npc/011-1_Woodland/alchemist.txt b/npc/011-1_Woodland/alchemist.txt index bc7b53f3..a821a3c1 100644 --- a/npc/011-1_Woodland/alchemist.txt +++ b/npc/011-1_Woodland/alchemist.txt @@ -109,16 +109,18 @@ L_post_sulphur_option: L_post_ironpowder_option: if (@Q_status == @SETZER_INITIAL) - goto L_main_menu; + goto L_post_monster_oil; set @menuitems$[@c], "Can you make monster oil?"; set @menuID[@c], @CHOICE_MONSTER_OIL; set @c, @c + 1; -L_main_menu: +L_post_monster_oil: set @menuitems$[@c], "No thanks."; set @menuID[@c], @CHOICE_ABORT; set @c, @c + 1; +L_main_menu: + menu @menuitems$[0], -, @menuitems$[1], -, @@ -260,6 +262,14 @@ L_get_mana_potion: 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; + getinventorylist; + if ((@inventorylist_count == 100) + && (countitem(@MAUVE) > 30) + && (countitem(@ASH) > 5) + && (countitem(@PEARL) > 1) + && (countitem(@WATER) > 1) + && (countitem(@MANAPOTION) < 1)) + goto L_mana_potion_toomuch; delitem @MAUVE, 30; delitem @YELLOW, 20; @@ -284,9 +294,16 @@ L_get_mana_potion: goto L_main_menu; +L_mana_potion_toomuch: + mes "[Rauk the Alchemist]"; + mes "\"You look quite burdened already. Why don't you drop off a few things first, and come back later?\""; + 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.\""; + next; goto L_main_menu; L_iron: diff --git a/npc/011-1_Woodland/auldsbel.txt b/npc/011-1_Woodland/auldsbel.txt index 688fd690..f6d9c8a8 100644 --- a/npc/011-1_Woodland/auldsbel.txt +++ b/npc/011-1_Woodland/auldsbel.txt @@ -58,7 +58,7 @@ if (Sex == 0) set @address$, "girl"; - if (@Q_status >= @Q_STATUS_POSTINTRO) + if (@Q_main_status >= @Q_STATUS_POSTINTRO) goto L_short_intro; mes "[Robed Man]"; @@ -105,7 +105,7 @@ L_intro_identity: set @xmsg$, "Right... my name is " + strcharinfo(0) + "."; if (strcharinfo(0) == "Padric") - set @xmsg$, "Actually, I am, but I don't know you..?"; + 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, @@ -213,16 +213,16 @@ L_ironpowder: 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.\""; + set @cost, 400 - (@Q_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 " + @cost + " GP.\""; next; - if (@Q_status >= @Q_STATUS_STUDENT) + if (@Q_main_status >= @Q_STATUS_STUDENT) menu "No, thank you.", -, "I will see what I can find.", -, "Can you teach me how to make it myself?", L_sulphur_teach_spell, "Here you are.", L_sulphur_buy; - if (@Q_status < @Q_STATUS_STUDENT) + if (@Q_main_status < @Q_STATUS_STUDENT) menu "No, thank you.", -, "I will see what I can find.", -, @@ -242,7 +242,7 @@ L_sulphur_buy: set zeny, zeny - @cost; delitem @ASH, 1; - getitem @SULPHUR, 1; + getitem @SULPHUR, 5; mes "[Auldsbel the Wizard]"; mes "\"I shall transmute it later. Here, have five half-ounces from my own stock.\""; next; @@ -521,6 +521,7 @@ L_question: 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_MANAPOTION) goto L_make_mana_potion; if (@c == @QQ_WYARA) goto L_Q_wyara; if (@c == @QQ_SAGATHA) goto L_Q_sagatha; if (@c == @QQ_IMP) goto L_Q_imp; @@ -531,7 +532,7 @@ L_question: next; goto L_main_menu; -L_Q_oldwiz: +L_Q_old_wizard: mes "[Auldsbel the Wizard]"; mes "\"I'm still not sure what exactly to make of him. At first appearance, he seems like a senile old man, but there can be no doubt that he has-- or at least had, at some point-- a very deep understanding of magic.\""; next; @@ -586,7 +587,7 @@ L_Q_manaseed: 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.\""; + mes "\"Well, if it's true, then try touching it. That should do you no harm, but if you are very, very lucky, it just might grant you some minuscule amount of magical power.\""; next; goto L_main_menu; @@ -600,7 +601,7 @@ L_Q_manaseed_touched: 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.\""; + 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 for you it might be worth trying it out.\""; next; set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_MANAPOTION; @@ -619,7 +620,7 @@ L_where_mana_potion: 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.\""; + mes "\"Well, 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.", -, @@ -636,6 +637,14 @@ L_make_mana_potion: goto L_make_mana_potion_missing; if (countitem(@BOTTLE_WATER) < 1) goto L_make_mana_potion_missing; + getinventorylist; + if (@inventorylist_count == 100 + && countitem(@YELLOW) > 10 + && countitem(@MAUVE) > 20 + && countitem(@PEARL) > 1 + && countitem(@BOTTLE_WATER) > 1 + && countitem(@MANA_POTION) < 1) + goto L_mana_potion_toomuch; set zeny, zeny - 10000; delitem @YELLOW, 10; @@ -664,11 +673,17 @@ L_make_mana_potion: goto L_main_menu; +L_mana_potion_toomuch: + mes "[Auldsbel the Wizard]"; + mes "\"Burndened as you are, I doubt you could carry it. Get rid of some of your old things first, will 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; + goto L_main_menu; 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...\""; @@ -972,7 +987,8 @@ LL_initiation: menu "Not yet.", -, "How about this mouboo figurine?", LL_initiation_check; - if (!countitem(@MOUBOO_FIGURINE)) + + if (!(countitem(@MOUBOO_FIGURINE))) menu "Not yet.", -, "What was the spell again?", LL_repeat_spell; @@ -988,7 +1004,7 @@ LL_initiation_fail: goto L_main_menu; LL_initiation_check: - if (!countitem (@MOUBOO_FIGURINE)) + if (!(countitem(@MOUBOO_FIGURINE))) goto L_main_menu; delitem @MOUBOO_FIGURINE, 1; set @mexp, MAGIC_EXPERIENCE & 65535; @@ -1020,18 +1036,19 @@ LL_initiation_check: mes "[5000 experience points]"; mes "[Level 2 in Transmutation Magic]"; - set @Q_status, @Q_STATUS_STUDENT; + set @Q_main_status, @Q_STATUS_STUDENT; callsub S_update_var; getexp 5000, 0; if (getskilllv(SKILL_MAGIC_TRANSMUTE) < 2) skill SKILL_MAGIC_TRANSMUTE, 2; + next; goto L_main_menu; LL_student_start: mes "[Auldsbel the Wizard]"; mes "\"Next, I shall teach you a higher-level transmutation spell.\""; if (getskilllv(SKILL_MAGIC) < 2) - msg "\"Beware, for you will not be able to use it yet.\""; + mes "\"Beware, for you will not be able to use it yet.\""; next; mes "[Auldsbel the Wizard]"; @@ -1047,7 +1064,7 @@ LL_student_start: delitem @BUGLEG, 10; getexp 1000, 0; - set @Q_status, @Q_STATUS_STUDENT0; + set @Q_main_status, @Q_STATUS_STUDENT0; callsub S_update_var; mes "[Auldsbel the Wizard]"; @@ -1092,7 +1109,7 @@ LL_student_0: delitem @MAUVE, 20; getexp 1000, 0; - set @Q_status, @Q_STATUS_STUDENT1; + set @Q_main_status, @Q_STATUS_STUDENT1; callsub S_update_var; mes "[Auldsbel the Wizard]"; @@ -1127,7 +1144,7 @@ LL_student_1: delitem @STINGER, 10; getexp 1000, 0; - set @Q_status, @Q_STATUS_STUDENT2; + set @Q_main_status, @Q_STATUS_STUDENT2; callsub S_update_var; mes "[Auldsbel the Wizard]"; @@ -1162,7 +1179,7 @@ LL_student_2: delitem @WOOD, 20; getexp 1000, 0; - set @Q_status, @Q_STATUS_STUDENT3; + set @Q_main_status, @Q_STATUS_STUDENT3; callsub S_update_var; mes "[Auldsbel the Wizard]"; diff --git a/npc/012-1_Woodland_Hills/injured-mouboo.txt b/npc/012-1_Woodland_Hills/injured-mouboo.txt index c017a35a..c248b8e6 100644 --- a/npc/012-1_Woodland_Hills/injured-mouboo.txt +++ b/npc/012-1_Woodland_Hills/injured-mouboo.txt @@ -108,15 +108,17 @@ L_give: setarray @choice_eat, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; set @n, 0; + set @ct, 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]; + set @choice$[@ct], @name$; + set @choice_idx[@ct], @k; + set @choice_eat[@ct], @itemeat[@n]; + set @ct, @ct + 1; L_nloop_skip: @@ -124,19 +126,18 @@ L_nloop_skip: 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], -; + 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]; @@ -163,6 +164,7 @@ L_consume: mes "[Injured Mouboo]"; mes "Unfortunately, it seems to have had no effect."; + next; goto L_menu; L_do_heal: diff --git a/npc/012-3_Cave/mana-seed.txt b/npc/012-3_Cave/mana-seed.txt index 6ad8a37e..7b8c7796 100644 --- a/npc/012-3_Cave/mana-seed.txt +++ b/npc/012-3_Cave/mana-seed.txt @@ -127,8 +127,6 @@ L_magic_level_1: 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; @@ -182,7 +180,7 @@ L_magic_touch: L_magic_levelup: set @baselevel_needed, @min_level[getskilllv(SKILL_MAGIC) + 1]; - if (base_level < @baselevel_needed) + if (BaseLevel < @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; @@ -248,7 +246,7 @@ L_magic_maxed_out: goto L_magic_mainmenu; -L_insufficent_baselevel: +L_insufficient_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; diff --git a/npc/013-1_Woodland_hills/sagatha.txt b/npc/013-1_Woodland_hills/sagatha.txt index ed2a20b6..222c1aa1 100644 --- a/npc/013-1_Woodland_hills/sagatha.txt +++ b/npc/013-1_Woodland_hills/sagatha.txt @@ -1,7 +1,7 @@ // Sagatha the witch, expert for nature and ether magic //---------------------------------------- -function script QuestSagathaHappy { +function script QuestSagathaHappy { set @unhappiness, (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT; if (@unhappiness < @value) goto L_zero; @@ -18,7 +18,7 @@ L_write: } //---------------------------------------- -function script QuestSagathaAnnoy { +function script QuestSagathaAnnoy { set @unhappiness, (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT; if ((@unhappiness + @value) > 15) goto L_max; @@ -34,7 +34,7 @@ L_write: return; } -function script SagathaStatus { +function script SagathaStatus { set @mexp, MAGIC_EXPERIENCE & 65535; set @has_magic, getskilllv(SKILL_MAGIC); set @evil, 0; @@ -139,18 +139,18 @@ L_evil: L_unhappy: mes "The witch glares at you in anger."; - mes "\"I wonder if you can still sleep after killing those innocent forest creatures! I am sure that they will come back to haunt you in your dreams!\""; + mes "\"I wonder if you can still sleep after killing those innocent forest creatures!"; + mes "I am sure that they will come back to haunt you in your dreams!\""; next; close; L_wb: - mes "[Sagatha the Witch]"; if (@good > 1) - msg "Sagatha nods as she notices you."; + mes "Sagatha nods as she notices you."; if (@good == 1) - msg "Sagatha raises an eyebrow as you address her."; + mes "Sagatha raises an eyebrow as you address her."; if (@good == 0) - msg "Sagatha glances at you, suspicion evident in her eyes."; + mes "Sagatha glances at you, suspicion evident in her eyes."; next; L_main: @@ -187,6 +187,7 @@ L_teach_initial: getexp 5000, 0; if (getskilllv(SKILL_MAGIC_ETHER) < 2) skill SKILL_MAGIC_ETHER, 2; + next; mes "[Sagatha the Witch]"; mes "\"In the future, I will teach you nature and ether magic. For the other schools there are better teachers around.\""; @@ -313,13 +314,13 @@ L_Q_old_wizard: mes "[Sagatha the Witch]"; mes "\"A kind and wise wizard.\""; next; - goto L_main_menu; + goto L_main; L_Q_imp: mes "[Sagatha the Witch]"; mes "\"He is an evil and cruel one. He lies and cheats and will try to take advantage of you. Stay away from him.\""; next; - goto L_main_menu; + goto L_main; L_Q_elanore: mes "[Sagatha the Witch]"; @@ -338,14 +339,12 @@ L_Q_manaseed: goto L_main; L_Q_manaseed_unabsorbed: - mes "[Sagatha the Witch]"; mes "\"If the mana seed didn't pass its magic to you, you clearly aren't attuned to magic.\""; next; goto L_main; L_Q_manaseed_m: - mes "[Sagatha the Witch]"; - mes "\"You were lucky that the mana seed gave you its magic.\""; + mes "\"You were lucky that the mana seed gave you its magic. I hope that you will use this power for something good now.\""; next; goto L_main; diff --git a/npc/015-1_Woodland/_import.txt b/npc/015-1_Woodland/_import.txt index d92e0749..fcefd199 100644 --- a/npc/015-1_Woodland/_import.txt +++ b/npc/015-1_Woodland/_import.txt @@ -3,3 +3,4 @@ npc: npc/015-1_Woodland/_mobs.txt npc: npc/015-1_Woodland/_warps.txt npc: npc/015-1_Woodland/alice.txt npc: npc/015-1_Woodland/monsters.txt +npc: npc/015-1_Woodland/sword.txt diff --git a/npc/015-1_Woodland/sword.txt b/npc/015-1_Woodland/sword.txt index d666777e..5713656b 100644 --- a/npc/015-1_Woodland/sword.txt +++ b/npc/015-1_Woodland/sword.txt @@ -74,11 +74,19 @@ L_Initial_learn: mes "[Mystic 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; + menu + "I am not interested in that.", L_Farewell, + "It might be good for me to learn that.", -, + "I am quite interested.", -; + + mes "[Mystic Sword]"; + mes "\"Why is it that thou seekest this power?\""; + next; + + menu + "Never mind.", L_Farewell, "To become stronger!", L_Initial_selfish, "To kill!", L_Initial_selfish, "I don't know yet...", L_Initial_dontknow, @@ -113,10 +121,19 @@ L_Initial_ok: set @Q_status, @STATUS_LEARNED_FLAREDART; callsub S_update_var; next; - close; + + mes "[Mystic Sword]"; + mes "\"From then on, thou canst shoot fiery missiles from thy fingers, for a limited time.\""; + next; + + mes "[Mystic Sword]"; + mes "\"Use it wisely, mortal!.\""; + next; + + goto L_Farewell; L_FlareStage: - menu; + 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; @@ -142,7 +159,7 @@ L_FlareStage_hello: L_FlareStage_moremagic: mes "[Mystic 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.\""; + 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, he shall teach thee another spell.\""; next; goto L_Farewell; @@ -188,8 +205,8 @@ L_Levelup2_yes: mes "[Mystic Sword]"; mes "The sword begins to chant in your head!"; mes " \"Lords of Thunder, Fire, Rage!\""; - mes " \"Grant your powers to this mage,\""; - mes " \"Rising with your dreadful roar,\""; + mes " \"Grant thy powers to this mage,\""; + mes " \"Rising with thy dreadful roar,\""; if (Sex) mes " \"Answer to his call to War!\""; if (!Sex) @@ -214,7 +231,7 @@ L_Levelup2_yes: next; mes "[Mystic Sword]"; - mes "\"You have now taken your first true step down the path of war magic. Seek out my brother for thy next spell!\""; + mes "\"Thou hast now taken thy first true step down the path of war magic. Seek out my brother for thy next spell!\""; next; goto L_Farewell; @@ -267,7 +284,7 @@ L_L2_W12: next; mes "[Mystic Sword]"; - mes "\"Speak '" + getspellinvocation("magic-knuckles") + "' and take a glass of beer and drink it, without ever taking it off your lips. This will harden and enchant thy fists, turning them into powerful weapons.\""; + mes "\"Speak '" + getspellinvocation("magic-knuckles") + "' and take a glass of beer and drink it, without ever taking it off thy lips. This will harden and enchant thy fists, turning them into powerful weapons.\""; next; close; @@ -291,7 +308,7 @@ L_L2_W10: next; menu - "OK.", -; + "OK.", -, "No way.", L_farewell; if (countitem(@ORE) < 1) -- cgit v1.2.3-70-g09d2 From b33e9b4508101d7097ed684c7c3316cb48a4f995 Mon Sep 17 00:00:00 2001 From: Fate Date: Sun, 18 Jan 2009 12:18:38 -0700 Subject: Fixed use of "skill" where the more permanent "setskill" was needed --- npc/012-3_Cave/mana-seed.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'npc/012-3_Cave/mana-seed.txt') diff --git a/npc/012-3_Cave/mana-seed.txt b/npc/012-3_Cave/mana-seed.txt index 7b8c7796..e1804e19 100644 --- a/npc/012-3_Cave/mana-seed.txt +++ b/npc/012-3_Cave/mana-seed.txt @@ -127,7 +127,7 @@ L_magic_level_1: 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]"; - skill SKILL_MAGIC, 1; + setskill SKILL_MAGIC, 1; getexp 1000, 0; next; @@ -230,7 +230,7 @@ L_magic_levelup: mes "[Mana Seed]"; mes "Something has changed... you feel more confident in your magical abilities."; - skill SKILL_MAGIC, 1 + getskilllv(SKILL_MAGIC); + setskill SKILL_MAGIC, 1 + getskilllv(SKILL_MAGIC); set @exp, @exp_bonus[getskilllv(SKILL_MAGIC)]; itemheal 0, 10000; getexp @exp, 0; -- cgit v1.2.3-70-g09d2 From 0da4d27a4357f15a8cb0eb9eaa355c7acd99e1b2 Mon Sep 17 00:00:00 2001 From: Fate Date: Thu, 14 May 2009 03:27:53 +0000 Subject: Fixed broken GOTO in mana seed script after level-up --- conf/magic.conf.template | 44 ++++++++++++++++++++++++++++++++++++-------- npc/012-3_Cave/mana-seed.txt | 2 +- 2 files changed, 37 insertions(+), 9 deletions(-) (limited to 'npc/012-3_Cave/mana-seed.txt') diff --git a/conf/magic.conf.template b/conf/magic.conf.template index 19b36046..76df00f6 100644 --- a/conf/magic.conf.template +++ b/conf/magic.conf.template @@ -204,14 +204,42 @@ PROCEDURE summon_spell(mob_id, count, delay, lifetime, control_level) = # Level 0 spells #-------------------------------------------------------------------------------- -# SPELL ask-magic-exp : "#G01" = -# LET level = 0 -# school = MAGIC -# IN (MANA 1, CASTTIME 1000, -# REQUIRE skill(caster, MAGIC) > level) -# => EFFECT CALL adjust_spellpower(school); -# CALL default_effect(); -# message(caster, "You have " + (script_int(caster, "MAGIC_EXPERIENCE") & 0xffff) + " Magic Experience points."); +SPELL ask-magic-exp : "#G01" = + LET level = 0 + school = MAGIC + IN (MANA 1, CASTTIME 1000, + REQUIRE skill(caster, MAGIC) > level) + => EFFECT CALL adjust_spellpower(school); + CALL default_effect(); + level = skill (caster, MAGIC); + IF level > 4 + THEN message (caster, "You are as proficient as magic as you can possibly be."); + ELSE ( + experience = script_int(caster, "MAGIC_EXPERIENCE") & 0xffff; + # This duplicates the table in mana-seed.txt + IF level >= 4 + THEN max_experience = 40000; + ELSE IF level = 3 + THEN max_experience = 8000; + ELSE IF level = 2 + THEN max_experience = 1200; + ELSE max_experience = 100; + + ratio = (10 * experience) / max_experience; + message (caster, "level=" + level + " exp=" + experience + " / " + max_experience + " => " + ratio); + + IF ratio >= 10 + THEN message(caster, "You feel that are ready to advance to the next level of magic."); + ELSE IF ratio >= 9 + THEN message(caster, "You feel that are very close to having the prowess needed to advance to the next level of magic."); + ELSE IF ratio >= 7 + THEN message(caster, "You feel quite skilled at this level of magic but still need to get used to some more corner cases before you can advance."); + ELSE IF ratio >= 5 + THEN message(caster, "You feel competent at this level of magic but realise that you must practice more."); + ELSE IF ratio >= 3 + THEN message(caster, "You feel that you have grasped the basics of this level of magic, but still have some way to go."); + ELSE message (caster, "You feel that you are still at the beginning of your quest for mastering this level of magic."); + ) # SPELL ask-life-magic-exp : "#G02" = # LET level = 0 diff --git a/npc/012-3_Cave/mana-seed.txt b/npc/012-3_Cave/mana-seed.txt index e1804e19..58c2e3cd 100644 --- a/npc/012-3_Cave/mana-seed.txt +++ b/npc/012-3_Cave/mana-seed.txt @@ -237,7 +237,7 @@ L_magic_levelup: mes "[" + @exp + " experience points]"; next; - goto L_magic_end; + goto L_end; L_magic_maxed_out: mes "Strangely, you feel nothing, as if its membrane had closed towards you."; -- cgit v1.2.3-70-g09d2 From f10165d86c7697b90a1edb3c4b99844ed47cb39f Mon Sep 17 00:00:00 2001 From: Fate Date: Sun, 24 May 2009 15:35:45 +0000 Subject: Added magic level 3 quests for Aulsbel and Elanore. Also added appropriate quest items and extended magic debug functionality as needed. --- conf/magic.conf.template | 29 ++- db/const.txt | 2 + db/item_db.txt | 3 + npc/001-1_Tulimshar/elanore.txt | 166 +++++++++++++++- npc/001-2_Tulimshar/omar.txt | 339 ++++++++++++++++++++++++++++++++ npc/010-2_Dimonds_Cove/_import.txt | 1 + npc/010-2_Dimonds_Cove/chef.txt | 111 +++++++++++ npc/010-2_Dimonds_Cove/dimonds.txt | 5 - npc/011-1_Woodland/auldsbel.txt | 95 ++++++++- npc/012-3_Cave/mana-seed.txt | 2 +- npc/018-2_Woodland_mining_camp/caul.txt | 337 ++++++++++++++++++++++++++----- npc/021-2_Tulimshar/bakery.txt | 84 ++++++++ npc/024-1_Tulimshar_Canyon/ched.txt | 22 ++- 13 files changed, 1134 insertions(+), 62 deletions(-) create mode 100644 npc/010-2_Dimonds_Cove/chef.txt (limited to 'npc/012-3_Cave/mana-seed.txt') diff --git a/conf/magic.conf.template b/conf/magic.conf.template index 69660224..48a685f4 100644 --- a/conf/magic.conf.template +++ b/conf/magic.conf.template @@ -45,6 +45,10 @@ CONST SFX_HEAL = 3 CONST MAX_RAIN_SPELL_RADIUS = 20 +CONST MAGIC_FLAGS = "MAGIC_FLAGS" +CONST MFLAG_MADE_CONC_POTION = 16384 +CONST MFLAG_MADE_CONC_POTION_SHIFT = 14 + CONST SCRIPT_XP = "MAGIC_EXPERIENCE" CONST SCRIPT_XP_MASK = 0xffff CONST SCRIPT_XP_SHIFT = 0 @@ -52,7 +56,7 @@ CONST SCRIPT_LASTSPELL_MASK = 0xff CONST SCRIPT_LASTSPELL_SHIFT = 16 CONST SCRIPT_HEALSPELL_MASK = 0xff CONST SCRIPT_HEALSPELL_SHIFT = 24 -CONST DEBUG = 1 +CONST DEBUG = 0 CONST ATTACK_ICON_GENERIC = 2000 CONST ATTACK_ICON_SHEARING = 2001 @@ -101,10 +105,12 @@ PROCEDURE gain_xp(gain) = ) PROCEDURE create_item(good_item, count, bad_item, difficulty) = + success = 1; score = experience + random(min(spellpower, (experience / 3) + 1)); IF (score >= difficulty) THEN create_item(caster, good_item, count); ELSE ( + success = 0; score = score + random(luk(caster)) + random(luk(caster)); IF (score < difficulty / 3) THEN ( @@ -502,6 +508,8 @@ SPELL make-concentration-potion : "#T15" = CALL create_item( if_then_else(random(2000 + experience) < experience, "ConcentrationPotion", "DarkConcentrationPotion"), 1, if_then_else(random(2), 744, "DarkConcentrationPotion"), 2000); + IF (success) + THEN CALL set_var(MAGIC_FLAGS, 1, MFLAG_MADE_CONC_POTION_SHIFT, 1); CALL gain_xp(4); SPELL merge-concentration-potions : "#T16" = @@ -514,6 +522,9 @@ SPELL merge-concentration-potions : "#T16" = => EFFECT CALL adjust_spellpower(school); CALL default_effect(); CALL create_item("ConcentrationPotion", 1, 744, 1000); + message (caster, "success = " + success); + IF (success) + THEN CALL set_var(MAGIC_FLAGS, 1, MFLAG_MADE_CONC_POTION_SHIFT, 1); CALL gain_xp(4); @@ -1024,7 +1035,9 @@ SPELL debug : "debug" = + "cut=" + ((script_int(caster, "MAGIC_FLAGS") & 1024) > 0) + ", " + "Kdruidtree=" + ((script_int(caster, "MAGIC_FLAGS") & 2048) > 0) + ", " + "Kimp=" + ((script_int(caster, "MAGIC_FLAGS") & 4096) > 0) + ", " - + "Koldwiz=" + ((script_int(caster, "MAGIC_FLAGS") & 8192) > 0)); + + "Koldwiz=" + ((script_int(caster, "MAGIC_FLAGS") & 8192) > 0) + ", " + + "made-conc=" + ((script_int(caster, "MAGIC_FLAGS") & 16384) > 0) + ", " + + "elanore-omar=" + ((script_int(caster, "MAGIC_FLAGS") & 32768) > 0)); message (caster, "EXP: " + (script_int(caster, "MAGIC_EXPERIENCE") & 0xffff) + ", lastspell=" + ((script_int(caster, "MAGIC_EXPERIENCE") >> 16) & 0xff) + ", healexp=" + ((script_int(caster, "MAGIC_EXPERIENCE") >> 24) & 0xff)); @@ -1036,6 +1049,7 @@ SPELL debug : "debug" = + "swords:" + ((script_int(caster, "QUEST_MAGIC") >> 24) & 0xff) + ", " + "imp:" + ((script_int(caster, "QUEST_MAGIC2") >> 0) & 0xf) + ", " + "elanore:" + ((script_int(caster, "QUEST_MAGIC2") >> 4) & 0xf) + ", " + + "elanore-sub:" + ((script_int(caster, "QUEST_MAGIC2") >> 12) & 0xf) + ", " + "wyara:" + ((script_int(caster, "QUEST_MAGIC2") >> 8) & 0xf)); PROCEDURE debug_xmod(name, mask, shift, gain) = @@ -1064,6 +1078,8 @@ PROCEDURE debug_mod(name, delta) = ELSE IF (name = "Kdruidtree") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 11, delta); ELSE IF (name = "Kimp") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 12, delta); ELSE IF (name = "oldwiz") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 13, delta); + ELSE IF (name = "made-conc") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 14, delta); + ELSE IF (name = "elanore-omar") THEN CALL debug_xmod("MAGIC_FLAGS", 0x1, 15, delta); ELSE IF (name = "auldsbel") THEN CALL debug_xmod("QUEST_MAGIC", 0x1f, 0, delta); ELSE IF (name = "Qauldsbel") THEN CALL debug_xmod("QUEST_MAGIC", 0x7, 5, delta); ELSE IF (name = "dt") THEN CALL debug_xmod("QUEST_MAGIC", 0x3, 10, delta); @@ -1074,6 +1090,7 @@ PROCEDURE debug_mod(name, delta) = ELSE IF (name = "imp") THEN CALL debug_xmod("QUEST_MAGIC2", 0xf, 0, delta); ELSE IF (name = "elanore") THEN CALL debug_xmod("QUEST_MAGIC2", 0xf, 4, delta); ELSE IF (name = "wyara") THEN CALL debug_xmod("QUEST_MAGIC2", 0xf, 8, delta); + ELSE IF (name = "elanore-sub") THEN CALL debug_xmod("QUEST_MAGIC2", 0xf, 12, delta); ELSE message(caster, "Unknown"); SPELL debug-up1 (name : STRING) : "debug+1" = @@ -1092,6 +1109,14 @@ SPELL debug-down16 (name : STRING) : "debug-16" = REQUIRE DEBUG => EFFECT CALL debug_mod(name, 0 - 16); +SPELL debug-up256 (name : STRING) : "debug+256" = + REQUIRE DEBUG + => EFFECT CALL debug_mod(name, 256); + +SPELL debug-down256 (name : STRING) : "debug-256" = + REQUIRE DEBUG + => EFFECT CALL debug_mod(name, 0 - 256); + SPELL debug-reset : "debug-reset" = REQUIRE DEBUG => EFFECT set_script_variable(caster, "QUEST_MAGIC", 0); diff --git a/db/const.txt b/db/const.txt index b3895c97..3bdcb3b4 100644 --- a/db/const.txt +++ b/db/const.txt @@ -203,3 +203,5 @@ MFLAG_KNOWS_DRUIDTREE 2048 // Knows about the druid tree quest MFLAG_KNOWS_IMP 4096 // Knows about the imprisoned forest spirit MFLAG_KNOWS_OLD_WIZARD 8192 // Knows Bjorn's old wizard +MFLAG_MADE_CONC_POTION 16384 // Made a concentration potion with T15 and/or T16 +MFLAG_ELANORE_OMAR 32768 // Told Omar about Elanore's involvement diff --git a/db/item_db.txt b/db/item_db.txt index ea5a1cec..ea66cae6 100644 --- a/db/item_db.txt +++ b/db/item_db.txt @@ -227,6 +227,9 @@ 743,Acorn,Acorn,0,50,10,1,,,,,,2,,,0,,{ itemheal 3,0; },{}, 744,DilutedConcentrationPotion,Diluted Concentration Potion,0,250,100,10,,,,,,2,,,0,,{ sc_start 37,30, 20; },{} 745,DarkConcentrationPotion,Dark Concentration Potion,0,50,25,10,,,,,,2,,,0,,{ sc_start 37,10, 40; sc_start sc_poison, 1, 50;},{} +746,MopoxCurePotion,Mopox Cure Potion,3,0,0,5,,,,,,2,,,,,{},{},, +747,LacedChocolateCake,Laced Chocolate Cake,0,550,125,10,,,,,,2,,,0,,{ itemheal 11,0; },{}, +748,LacedOrangeCupcake,Laced Orange Cupcake,0,90,45,5,,,,,,2,,,0,,{ itemheal 100,0; },{}, 1198,JackOSoul,Jack O Soul,3,100000,1,1,,,,,,,,,,,{},{},, 1199,Arrow,Arrow,10,3,1,1,25,0,0,,0,2,32768,,,,{},{},, 1200,Bow,Bow,4,1000,500,200,20,,5,,0,2,34,1,4,11,{},{},, diff --git a/npc/001-1_Tulimshar/elanore.txt b/npc/001-1_Tulimshar/elanore.txt index f0781924..1402f044 100644 --- a/npc/001-1_Tulimshar/elanore.txt +++ b/npc/001-1_Tulimshar/elanore.txt @@ -14,6 +14,8 @@ set @STATUS_LEARNED_LIGHT_HEAL, 1; set @STATUS_MASTERED_LIGHT_HEAL, 2; set @STATUS_LEARNED_LAY_ON_HANDS, 3; + set @STATUS_WAITING_FOR_KADIYA, 4; + set @STATUS_READY_TO_LEARN_CURE_POISON, 5; if (sc_check(sc_poison)) goto L_CurePoison; @@ -114,19 +116,22 @@ L_Main: menu "Can you heal me?", L_NoHealMessage, "Can you teach me magic?", L_Teach, - "What do you know about...", L_Question; + "What do you know about...", L_Question, + "Goodbye!", L_bye; 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; + "What do you know about...", L_Question, + "Goodbye!", L_bye; if (!@has_magic) menu "Can you heal me?", L_NoHealMessage, - "What do you know about...", L_Question; + "What do you know about...", L_Question, + "Goodbye!", L_bye; close; OnPCKillEvent: @@ -220,7 +225,9 @@ 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. :-) + if (@Q_status == @STATUS_LEARNED_LAY_ON_HANDS) goto L_Teach_Explain3; + if (@Q_status == @STATUS_WAITING_FOR_KADIYA) goto L_Teach_CheckAdvanceTo3; + if (@Q_status == @STATUS_READY_TO_LEARN_CURE_POISON) goto L_Teach_CurePosion; 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.\""; @@ -354,6 +361,152 @@ L_Teach_LOH_advance_abort1: mes "\"I'm sorry, but I am not yet convinced that you are a good enough healer. Please continue in your endeavours.\""; close; +L_Teach_Explain3: + if (getskilllv(SKILL_MAGIC) < 3) + goto L_Teach_Explain3_abort; + if (@Q_heal_exp < 50) + goto L_Teach_Explain3_fail; + + mes "[Elanore the Healer]"; + mes "Elanore smiles."; + mes "\"You seem to be ready to advance as a healer. There is one favour I must ask of you first, though.\""; + set QUEST_MAGIC2, (QUEST_MAGIC2 & ~(NIBBLE_3_MASK)); // Initialise Kadiya quest + set @Q_status, @STATUS_WAITING_FOR_KADIYA; + callsub S_update_var; + next; + + mes "[Elanore the Healer]"; + mes "\"There is a man here in Tulimshar with a beautiful young daughter; his name is Omar, and his daughter's name is Kadiya.\""; + mes "\"Once, when I was a young apprentice, I made a mistake treating Omar. Ever since, he no longer trusts me.\""; + next; + + mes "[Elanore the Healer]"; + mes "\"But his daugher has contracted Mopox, so she needs help. He doesn't trust me, but perhaps he will trust you; you have been helping quite a few people, after all.\""; + next; + +L_3_menu: + menu + "What should I do?", L_3_what_to_do, + "Where can I find the sick girl?", L_3_where, + "How did you mess up?", L_3_messup, + "I will get started right away.", -, + "Maybe later.", -; + + goto L_Main; + +L_3_what_to_do: + mes "[Elanore the Healer]"; + mes "\"You will have to brew a Mopox cure potion and give it to her. You should ask Caul to help you, he knows the recipe.\""; + next; + + mes "[Elanore the Healer]"; + mes "\"First, you will need a concentration potion and an iron potion-- toghether, they will give her her strength back. You also need a lifestone, and a gamboge leaf against the toxins in her body.\""; + next; + + mes "[Elanore the Healer]"; + mes "\"You then have to add in roots, water, mauve leaves and sulphur powder until the brew is gooey and neither light nor dark. Caul will explain the details to you.\""; + next; + + mes "[Elanore the Healer]"; + mes "\"There is a transmutation spell to make sulphur powder. If you don't know the magic, perhaps you can ask a transmutation mage to help you with this part.\""; + next; + goto L_3_menu; + +L_3_messup: + mes "[Elanore the Healer]"; + mes "\"Ah... well, Omar is a trader, and a frequent traveler. One day he came back from a journey with fleas in his beard and asked me to get rid of them.\""; + next; + + mes "[Elanore the Healer]"; + mes "\"Unfortunately I used the wrong lotion on the fleas, so instead of being scared away, they grew to enormous proportions and ate up all of his beard.\""; + next; + + mes "[Elanore the Healer]"; + mes "Elanore blushes."; + mes "\"Ever since then he hasn't been very trusting towards my skills, and I suppose that I can't blame him. But I don't want poor Kadiya to suffer because of that.\""; + next; + goto L_3_menu; + +L_3_where: + mes "[Elanore the Healer]"; + mes "\"Kadiya and Omar live relatively close by. See this corner in the inner city wall east of here? Turn past it, then go north. It's the second house.\""; + next; + goto L_3_menu; + +L_Teach_Explain3_abort: + mes "[Elanore the Healer]"; + mes "\"I'm sorry, but you lack the magical power to advance.\""; + close; + +L_Teach_Explain3_fail: + mes "[Elanore the Healer]"; + if (@Q_heal_exp < 30) + mes "\"You seem to have regressed as a healer. This is worrisome; please mend your ways or I will not teach you any further.\""; + if ((@Q_heal_exp >= 30) && (@Q_heal_exp < 40)) + mes "\"You still need more practice in the art of healing.\""; + if ((@Q_heal_exp >= 40)) + mes "\"You are doing well, but you need some more practice as a healer first.\""; + close; + +L_Teach_CheckAdvanceTo3: + callfunc "KadiyaSubquestConsts"; + + if (@Q_kadiya_status >= @Q_STATUS_COMPLETED) + goto L_Teach_AdvanceTo3Ready; + + mes "[Elanore the Healer]"; + mes "\"Please help Kadiya.\""; + next; + + goto L_3_menu; + +L_Teach_AdvanceTo3Ready: + mes "[Elanore the Healer]"; + mes "\"I have heard of what you did. Hiding the potion in her favorite food-- that was clever.\""; + mes "She smiles at you."; + mes "\"Omar let me have a look at her earlier, and she seems to be recovering. You did very well."; + next; + + mes "[Elanore the Healer]"; + mes "Elanor turns towards you, rises up on her toes and kisses you on the forehead."; + next; + + set @xp, 30000; + if (@Q_kadiya_status == @Q_STATUS_COMPLETED_ELANORE) + set @xp, 50000; + + mes "[Elanore the Healer]"; + mes "You feel a strange, tingling kind of warmth spread through your body."; + mes "[" + @xp + " experience points]"; + mes "[Level 3 in Life Magic]"; + + set @Q_status, @STATUS_READY_TO_LEARN_CURE_POISON; + callsub S_update_var; + getexp @xp, 0; + if (getskilllv(SKILL_MAGIC_LIFE) < 3) + setskill SKILL_MAGIC_LIFE, 3; + next; + + + if (@Q_kadiya_status != @Q_STATUS_COMPLETED_ELANORE) + goto L_Main; + + mes "[Elanore the Healer]"; + mes "\"Overall I am impressed by your progress. If you continue as you are doing now, you might become a great healer.\""; + mes "She hands you a handful of lifestones."; + mes "\"Please come back soon; there is more that I would like to teach you.\""; + next; + set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_ELANORE_OMAR; + getitem "LifeStone", 20; + + goto L_Main; + +L_Teach_CurePosion: + mes "[Elanore the Healer]"; + mes "\"Hmm. I wanted to teach you something, but I've forgotten what it was... please come back later.\""; + next; + goto L_Main; + L_NoMagicNoTeach: mes "[Elanore the Healer]"; mes "Elanore shakes her head."; @@ -429,6 +582,11 @@ L_CurePoison: mes "\"There you are, right as rain! Now you take care, all right?\""; close; +L_bye: + mes "[Elanore the Healer]"; + mes "\"Goodbye!\""; + close; + S_update_var: set QUEST_MAGIC2, (QUEST_MAGIC2 & ~(@Q_MASK) diff --git a/npc/001-2_Tulimshar/omar.txt b/npc/001-2_Tulimshar/omar.txt index a495dd0a..2fd813ac 100644 --- a/npc/001-2_Tulimshar/omar.txt +++ b/npc/001-2_Tulimshar/omar.txt @@ -1,7 +1,346 @@ // +function script KadiyaSubquestConsts { + set @Q_kadiya_status, (QUEST_MAGIC2 & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT; + + set @Q_STATUS_NONE, 0; + set @Q_STATUS_KNOWS_MOPOX, 1; + set @Q_STATUS_MADE_MOPOX, 2; + set @Q_STATUS_DIDNT_DRINK, 3; + set @Q_STATUS_WANTS_CHOCOCAKE, 4; + set @Q_STATUS_WANTS_ORANGECUPCAKE, 5; + set @Q_STATUS_COMPLETED, 6; + set @Q_STATUS_COMPLETED_ELANORE, 7; + set @Q_STATUS_COMPLETED_NOELANORE, 8; + set @Q_STATUS_COMPLETED_POST_ELANORE, 9; + + if (((QUEST_MAGIC2 & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT) < 4) + set @Q_kadiya_status, @Q_STATUS_NONE; + + if (((QUEST_MAGIC2 & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT) > 4) + set @Q_kadiya_status, @Q_STATUS_COMPLETED_POST_ELANORE; + + return; +} + 001-2.gat,70,60,0 script Omar 162,{ + callfunc "KadiyaSubquestConsts"; + + set @Q_status, @Q_kadiya_status; + + if (@Q_status >= @Q_STATUS_COMPLETED) + goto L_cured; + + if (@Q_status == @Q_STATUS_DIDNT_DRINK) + goto L_didnt_drink; + + if (@Q_status > @Q_STATUS_DIDNT_DRINK) + goto L_make_food; + mes "[Omar]"; mes "\"Welcome to my humble abode.\""; + next; + + menu + "Well met! May I ask who you are?", L_omar, + "What's wrong with your daughter?", L_kadiya_sick, + "Thank you!", -; close; + +L_omar: + mes "[Omar]"; + mes "\"My name is Omar; I am a trader of oils and spices.\""; + close; + +L_kadiya_sick: + mes "[Omar]"; + mes "\"Kadiya has caught Ponderpox, I fear.\""; + mes "He sighs."; + mes "\"She's has been feverish for many days now. I wish there were something I could do.\""; + next; + + menu + "Have you asked Elanore the healer?", L_sick_elanore, + "How about the Hurnscald hospital?", L_sick_hospital, + "Can I help?", L_sick_self, + "I'm sorry to hear that.", -; + + mes "[Omar]"; + mes "\"Well, she is a strong girl. I am sure that she will get over it eventually.\""; + mes "He smiles, but you see doubt in his eyes."; + close; + +L_sick_elanore: + mes "[Omar]"; + mes "\"Elanore?\""; + mes "He frowns."; + mes "\"She knows nothing. I see no point in talking to her.\""; + close; + +L_sick_hospital: + mes "[Omar]"; + mes "\"Hurnscald is too far away. I don't think that it would be good for her to go on such a long trip.\""; + close; + +L_sick_self: + mes "[Omar]"; + mes "\"You are very kind, but I don't think there is anything you can do.\""; + close; + +L_didnt_drink: + mes "[Omar]"; + mes "\"So she has Mopox, not Ponderpox, you say? Hmm. That is much harder to cure, I think.\""; + mes "\"I am grateful for the effort you put into brewing a potion for her. But it does smell vile...\""; + next; + + mes "[Omar]"; + mes "\"I promised my dear wife that I would never make Kadiya eat or drink anything she doesn't like. So I won't force her to drink this.\""; + next; + + mes "[Omar]"; + set @Q_status, (@Q_STATUS_WANTS_CHOCOCAKE + rand(2)); + callsub S_update_var; + + if (@Q_status == @Q_STATUS_WANTS_ORANGECUPCAKE) + mes "\"If only we could make it smell and taste like orange cupcakes... she really loves those cupcakes.\""; + if (@Q_status == @Q_STATUS_WANTS_CHOCOCAKE) + mes "\"If only this were a chocolate cake and not a potion... she really loves chocolate cakes.\""; + close; + +L_make_food: + mes "[Omar]"; + mes "\"I should stay here to watch over her. I wish I could think of a way to convince her to drink the potion...\""; + if (@Q_status == @Q_STATUS_WANTS_ORANGECUPCAKE) + mes "\"Alas, it is not an orange cupcake.\""; + if (@Q_status == @Q_STATUS_WANTS_CHOCOCAKE) + mes "\"If only it were to smell and taste like her favourite chocolate cake...\""; + close; + +L_cured: + if (@Q_status == @Q_STATUS_COMPLETED) + goto L_cured_choice; + mes "[Omar]"; + mes "\"She is sleeping now, but she seems to be much better. I am sure that she will be up and running around again soon.\""; + close; + +L_cured_choice: + mes "[Omar]"; + mes "\"I am very grateful for your help. I really was sure that it was Ponderpox, not Mopox, that she had.\""; + next; + + menu + "Oh, it was nothing.", L_cured_nothing, + "I didn't do it alone; Elanore helped.", L_cured_elanore, + "That will be 5000 GP.", -; + + mes "[Omar]"; + mes "\"Ah, certainly.\""; + mes "He hands you a small bag of money."; + next; + + set @Q_status, @Q_STATUS_COMPLETED_NOELANORE; + callsub S_update_var; + + set zeny, zeny + 5000; + close; + +L_cured_nothing: + mes "[Omar]"; + mes "\"No, this wasn't nothing. She is everything to me. Here, you deserve a reward.\""; + mes "He hands you a bag of money containing 10,000 GP and two pearls."; + mes "\"And feel free to drop by again whenever you would like!\""; + + set @Q_status, @Q_STATUS_COMPLETED_NOELANORE; + callsub S_update_var; + + getitem "Pearl", 2; + set zeny, zeny + 10000; + close; + +L_cured_elanore: + mes "[Omar]"; + mes "Omar frowns."; + mes "\"That witch? You worked with her without telling me?\""; + mes "He looks over to his daughter, concern suddenly in his eyes."; + mes "\"She is looking better, though...\""; + next; + + mes "[Omar]"; + mes "Omar shakes his head."; + mes "\"I will have to think about this. Please leave me alone.\""; + next; + + set @Q_status, @Q_STATUS_COMPLETED_ELANORE; + callsub S_update_var; + + close; + +S_update_var: + set QUEST_MAGIC2, + (QUEST_MAGIC2 & ~(NIBBLE_3_MASK) + | (@Q_status << NIBBLE_3_SHIFT)); + return; +} + + +001-2.gat,76,59,0 script _______Kadiya 174,{ + set @Q_MASK, NIBBLE_3_MASK; + set @Q_SHIFT, NIBBLE_3_SHIFT; + + callfunc "KadiyaSubquestConsts"; + set @Q_status, @Q_kadiya_status; + + if (@Q_status >= @Q_STATUS_COMPLETED) + goto L_cured; + + mes "You see a young girl lying in bed. At first she doesn't seem to notice you approaching."; + mes "Finally, she turns her head towards you. Judging from the sweat on her forehead and look in her eyes, she is suffering from some kind of fever."; + next; + + mes "[Kadiya]"; + mes "\"Hello,\" she says in a tiny voice."; + next; + + set @M_NAME, 1; + set @M_CANDY, 2; + set @M_POTION, 3; + set @M_CHOCOCAKE, 4; + set @M_CUPCAKE, 5; + + setarray @choice$, "Hello! What's your name?", "Would you like some candy?", "", "", "", "", "", ""; + setarray @choice_idx, @M_NAME, @M_CANDY, 0, 0, 0, 0, 0, 0; + set @choices_nr, 2; + + if (countitem("MopoxCurePotion") == 0) + goto L_M_no_cure; + + set @choice_idx[@choices_nr], @M_POTION; + set @choice$[@choices_nr], "This potion will cure your illness!"; + set @choices_nr, @choices_nr + 1; + +L_M_no_cure: + + if ((countitem("LacedChocolateCake") == 0) || (@Q_status != @Q_STATUS_WANTS_CHOCOCAKE)) + goto L_M_no_chococake; + + set @choice_idx[@choices_nr], @M_CHOCOCAKE; + set @choice$[@choices_nr], "Would you like special chocolate cake?"; + set @choices_nr, @choices_nr + 1; + +L_M_no_chococake: + + if ((countitem("LacedOrangeCupcake") == 0) || (@Q_status != @Q_STATUS_WANTS_ORANGECUPCAKE)) + goto L_M_no_cupcake; + + set @choice_idx[@choices_nr], @M_CUPCAKE; + set @choice$[@choices_nr], "Would you like special orange cupcake?"; + set @choices_nr, @choices_nr + 1; + +L_M_no_cupcake: + + set @choice_idx[@choices_nr], 0; + set @choice$[@choices_nr], "Goodbye."; + set @choices_nr, @choices_nr + 1; + + menu + @choice$[0], -, + @choice$[1], -, + @choice$[2], -, + @choice$[3], -, + @choice$[4], -, + @choice$[5], -; + + set @choice, @choice_idx[@menu - 1]; + + if (@choice == @M_NAME) goto L_name; + if (@choice == @M_CANDY) goto L_no_candy; + if (@choice == @M_POTION) goto L_potion; + if (@choice == @M_CHOCOCAKE) goto L_chococake; + if (@choice == @M_CUPCAKE) goto L_cupcake; + + close; + +L_name: + mes "[Kadiya]"; + mes "She smiles a faint smile."; + mes "\"My name is Kadiya.\""; + + close; + +L_no_candy: + mes "[Kadiya]"; + mes "She hesitates for a moment."; + mes "\"No, thank you. I don't think I should.\""; + + close; + +L_potion: + mes "[Kadiya]"; + if (@Q_status < @Q_STATUS_DIDNT_DRINK) + set @Q_status, @Q_STATUS_DIDNT_DRINK; + callsub S_update_var; + + mes "Kadiya grimaces and pushes the bottle away."; + mes "\"That smells terrible!\""; + next; + + mes "[Kadiya]"; + mes "She pulls the sheets over her head."; + mes "\"I won't drink that!\""; + next; + + close; + +L_chococake: + delitem "LacedChocolateCake", 1; + goto L_do_cure; + +L_cupcake: + delitem "LacedOrangeCupcake", 1; + goto L_do_cure; + +L_do_cure: + if (@Q_status < @Q_STATUS_COMPLETED) + set @Q_status, @Q_STATUS_COMPLETED; + callsub S_update_var; + mes "[Kadiya]"; + mes "Kadiya's eyes widen."; + mes "\"Oh! Daddy, is it okay if I eat this?\""; + mes "Omar nods and smiles. \"You should eat a bit to regain your strength, sweetheart.\""; + next; + + mes "[Kadiya]"; + mes "Kadiya devours your gift in just a handful of bites."; + next; + + mes "[Kadiya]"; + mes "She smiles. \"Thank you! I feel better already!\"."; + next; + + mes "[Kadiya]"; + mes "She looks much healthier, too. Omar walks over and touches her forehead."; + mes "\"Now that is funny-- your fever has gone down quite a bit!\""; + mes "He smiles at you. \"Thank you for your help!\""; + next; + + mes "[Kadiya]"; + mes "\"You should get some sleep now, sweetheart. I'm sure that you will be better soon.\""; + close; + +L_goodbye: + mes "[Kadiya]"; + mes "Goodbye!"; + + close; + +L_cured: + mes "[Kadiya]"; + mes "Kadiya seems to be sleeping calmly. She looks much less sweaty than earlier; unless you are very much mistaken, her fever has disappeared."; + close; + +S_update_var: + set QUEST_MAGIC2, + (QUEST_MAGIC2 & ~(@Q_MASK) + | (@Q_status << @Q_SHIFT)); + return; } diff --git a/npc/010-2_Dimonds_Cove/_import.txt b/npc/010-2_Dimonds_Cove/_import.txt index 1a75f84a..a6d6af90 100644 --- a/npc/010-2_Dimonds_Cove/_import.txt +++ b/npc/010-2_Dimonds_Cove/_import.txt @@ -1,6 +1,7 @@ map: 010-2.gat npc: npc/010-2_Dimonds_Cove/_mobs.txt npc: npc/010-2_Dimonds_Cove/_warps.txt +npc: npc/010-2_Dimonds_Cove/chef.txt npc: npc/010-2_Dimonds_Cove/dimonds.txt npc: npc/010-2_Dimonds_Cove/doug.txt npc: npc/010-2_Dimonds_Cove/loratay.txt diff --git a/npc/010-2_Dimonds_Cove/chef.txt b/npc/010-2_Dimonds_Cove/chef.txt new file mode 100644 index 00000000..03149485 --- /dev/null +++ b/npc/010-2_Dimonds_Cove/chef.txt @@ -0,0 +1,111 @@ +010-2.gat,33,25,0 script Chef 148,{ + mes "[Chef]"; + mes "\"I'm too busy right now to talk.\""; + + callfunc "KadiyaSubquestConsts"; + if ((@Q_kadiya_status == @Q_STATUS_WANTS_CHOCOCAKE) && (countitem ("MopoxCurePotion") > 0)) + goto L_lace_chococake; + + if ((@Q_kadiya_status == @Q_STATUS_WANTS_ORANGECUPCAKE) && (countitem ("MopoxCurePotion") > 0)) + goto L_lace_cupcake; + close; + +L_lace_chococake: + next; + menu + "Sorry.", L_end, + "I need your help with a sick young girl!", -; + + mes "[Chef]"; + mes "You explain Kadiya's situation to him."; + mes "\"Hmrmf. I can't help you; I'm a chef, not a baker!\""; + close; + +L_lace_cupcake: + next; + menu + "Sorry.", L_end, + "I need your help with a sick young girl!", -; + + mes "[Chef]"; + mes "You explain Kadiya's situation to him."; + mes "\"Hmrmf. I was about to make another batch of orange cupcakes. Do you have that potion with you?\""; + next; + + menu + "No, sorry.", L_bringit, + "Yes, here you are.", -; + + if (countitem ("MopoxCurePotion") < 1) + goto L_bringit; + + mes "[Chef]"; + mes "He shudders as he smells the bottle."; + mes "\"That is disgusting! How do you expect me to mask this?\""; + mes "He ponders his own question for a moment."; + next; + + mes "[Chef]"; + mes "\"Ah yes. We need to bind the smell in gingerbread. Bring me three pieces of gingerbread, one orange, and 500 GP for the other ingredients, and I will make you your cupcake.\""; + next; + + menu + "I'll go and get it.", L_end, + "Here you are!", -, + "Not now.", L_end; + + if (countitem ("GingerBreadMan") < 3) goto L_no_gingerbread; + if (countitem ("Orange") < 1) goto L_no_orange; + if (countitem ("MopoxCurePotion") < 1) goto L_no_potion; + if (zeny < 500) goto L_no_zeny; + + set zeny, zeny - 500; + delitem "GingerBreadMan", 3; + delitem "Orange", 1; + delitem "MopoxCurePotion", 1; + + getitem "LacedOrangeCupcake", 1; + + mes "[Chef]"; + mes "\"Good, good. This should work.\""; + mes "He crumbles the gingerbread, mixes it with the potion and some spices, and finally adds some cupcake batter and the orange pieces."; + next; + + mes "[Chef]"; + mes "\"Take a seat.\""; + mes "He fills the mixture into a cupcake form and puts it into the oven. You watch the cupcake grow for a while."; + mes "Finally, he removes the form and carefully extracts the cupcake."; + next; + + mes "[Chef]"; + mes "\"Here you are. It's a bit bigger than a regular cupcake and will taste a bit like ginger, I think, but otherwise it should be fine.\""; + close; + +L_no_gingerbread: + mes "[Chef]"; + mes "\"I will need three pieces of gingerbread.\""; + close; + +L_no_orange: + mes "[Chef]"; + mes "\"Please bring me an orange for these cupcakes.\""; + close; + +L_no_zeny: + mes "[Chef]"; + mes "\"No. I need extra ingredients worth 500 GP, and I expect you to pay for those.\""; + close; + +L_no_potion: + mes "[Chef]"; + mes "\"Where did your Mopox potion go?\""; + close; + +L_bringit: + mes "[Chef]"; + mes "\"Bring it here when you do.\""; + next; + +L_end: + close; +} diff --git a/npc/010-2_Dimonds_Cove/dimonds.txt b/npc/010-2_Dimonds_Cove/dimonds.txt index 8f82fc97..d44a5303 100644 --- a/npc/010-2_Dimonds_Cove/dimonds.txt +++ b/npc/010-2_Dimonds_Cove/dimonds.txt @@ -123,8 +123,3 @@ callfunc "Inn"; } -010-2.gat,33,25,0 script Chef 148,{ - mes "[Chef]"; - mes "I'm too busy right now to talk."; - close; -} diff --git a/npc/011-1_Woodland/auldsbel.txt b/npc/011-1_Woodland/auldsbel.txt index b99bc814..142c96a5 100644 --- a/npc/011-1_Woodland/auldsbel.txt +++ b/npc/011-1_Woodland/auldsbel.txt @@ -14,8 +14,12 @@ set @Q_STATUS_STUDENT2, 6; set @Q_STATUS_STUDENT3, 7; set @Q_STATUS_STUDENT4, 8; + set @Q_STATUS_STUDENT5, 9; + set @Q_STATUS_STUDENT6, 10; + - set @wants_sulphur, (QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK)); + set @wants_sulphur, (QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK)) // war quest + || (((QUEST_MAGIC2 & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT) >= 4); // Elanore's heal-Kadiya quest set @wants_ironpowder, (((QUEST_MAGIC & (NIBBLE_6_MASK | NIBBLE_7_MASK)) >> NIBBLE_6_SHIFT) >= 7); set @Q_MASK, NIBBLE_0_MASK | NIBBLE_1_MASK; @@ -159,7 +163,7 @@ L_main_menu_magic: "Can you make sulphur powder?", L_sulphur, "Can you make iron powder?", L_ironpowder, "Goodbye.", -; - if (@wants_sulphur) + if (@wants_sulphur && !@wants_ironpowder) menu "How does magic work?", L_about_magic, "Can you teach me a spell?", L_learn_spell, "Where are you from?", L_about_auldsbel, @@ -922,6 +926,8 @@ L_learn_spell: if (@Q_main_status == @Q_STATUS_STUDENT2) goto LL_student_2; if (@Q_main_status == @Q_STATUS_STUDENT3) goto LL_student_3; if (@Q_main_status == @Q_STATUS_STUDENT4) goto LL_student_4; + if (@Q_main_status == @Q_STATUS_STUDENT5) goto LL_student_5; + if (@Q_main_status == @Q_STATUS_STUDENT6) goto LL_student_6; 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?\""; @@ -1178,7 +1184,90 @@ LL_student_2: goto L_main_menu; LL_student_3: - // Future extensions go here + if (getskilllv(SKILL_MAGIC) < 3) + goto LL_magic_skill_insufficient; + mes "[Auldsbel the Wizard]"; + mes "\"I believe that you may be ready for the next level of transmutation magic! Let me teach you one last spell that you can handle before your promotion, and if you can cast this one, I will advance you.\""; + next; + +LL_student_3_repeat: + mes "[Auldsbel the Wizard]"; + mes "\"This one has the invocation `" + getspellinvocation("make-concentration-potion") + "'. Put two cobalt leaves and two flower petals into a bottle of water, hold it up, and speak that phrase.\""; + next; + + mes "[Auldsbel the Wizard]"; + mes "\"It is a tricky spell, but if it works out, you will transform the bottle into a concentration potion.\""; + next; + + mes "[Auldsbel the Wizard]"; + mes "\"Hmm. That reminds me-- there was a similar spell, but I forgot what it was... anyway, try using this, and bring me the potion when you are done.\""; + next; + + set @Q_main_status, @Q_STATUS_STUDENT4; + callsub S_update_var; + goto L_main_menu; + +LL_student_4: + mes "[Auldsbel the Wizard]"; + mes "\"Did you manage to transmute into a concentration potion?\""; + next; + + menu + "What was the invocation again?", LL_student_3_repeat, + "No, still working on it...", L_main_menu, + "Yes.", -; + + if (countitem("ConcentrationPotion") < 1) + goto LL_student_4_no_potion; + + if (!(MAGIC_FLAGS & MFLAG_MADE_CONC_POTION)) + goto LL_student_4_wrong_potion; + + mes "[Auldsbel the Wizard]"; + mes "Auldsbel examines your potion and nods."; + mes "\"Good work! You are ready for a promotion!\""; + next; + + mes "[Auldsbel the Wizard]"; + mes "Auldsbel presses his index and middle finger against your forehead."; + mes "\"Accept my blessing!\""; + next; + + set @Q_main_status, @Q_STATUS_STUDENT5; + callsub S_update_var; + getexp 30000, 0; + if (getskilllv(SKILL_MAGIC_TRANSMUTE) < 3) + setskill SKILL_MAGIC_TRANSMUTE, 3; + + mes "[Auldsbel the Wizard]"; + mes "You feel new powers flowing into your body!"; + mes "[30000 experience points]"; + mes "[Level 3 in Transmutation Magic]"; + next; + + goto L_main_menu; + +LL_student_4_wrong_potion: + mes "[Auldsbel the Wizard]"; + mes "Auldsbell examines your potion, then shakes his head."; + mes "\"This doesn't look quite right, though I can't quite point at what the problem is. You will have to continue trying.\""; + next; + + goto L_main_menu; + +LL_student_4_no_potion: + mes "[Auldsbel the Wizard]"; + mes "\"You seem to be rather lacking the concentration potion you need to justify your claim, my dear fellow.\""; + next; + + goto L_main_menu; + +LL_student_5: + mes "[Auldsbel the Wizard]"; + mes "\"Hmm. Come back some other time, please; I still haven't figured out what to teach you next.\""; + close; + +LL_magic_skill_insufficient: mes "[Auldsbel the Wizard]"; mes "\"No, not at this time. You will have to advance in your overall magic skill before I can teach you more.\""; next; diff --git a/npc/012-3_Cave/mana-seed.txt b/npc/012-3_Cave/mana-seed.txt index 58c2e3cd..30f9776e 100644 --- a/npc/012-3_Cave/mana-seed.txt +++ b/npc/012-3_Cave/mana-seed.txt @@ -24,7 +24,7 @@ 65, 80; // level 5 - set @visions_nr, 13; + set @visions_nr, 12; 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...", diff --git a/npc/018-2_Woodland_mining_camp/caul.txt b/npc/018-2_Woodland_mining_camp/caul.txt index f03aeff5..fdc76b21 100644 --- a/npc/018-2_Woodland_mining_camp/caul.txt +++ b/npc/018-2_Woodland_mining_camp/caul.txt @@ -14,67 +14,88 @@ set @SETZER_FLAG_MADE_OIL, 4; set @MONSTER_OIL_XP, 100000; + set @MOPOX_CURE_XP, 30000; set @Q_MASK, NIBBLE_3_MASK; set @Q_SHIFT, NIBBLE_3_SHIFT; set @Q_status, (QUEST_Forestbow_state & @Q_MASK) >> @Q_SHIFT; + set @Q_knows_mopox_cure, ((QUEST_MAGIC2 & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT) >= 4; // Elanore's quest for curing Kadiya + + // Can the player get XP for brewing the cure? + set @Q_can_score_mopox_cure, (((QUEST_MAGIC2 & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT) == 4) // Elanore's quest for curing Kadiya + && (((QUEST_MAGIC2 & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT) < 2); // Haven't brewed it yet + mes "[Caul]"; mes "\"I can help you to brew healing potions out of mauve, cobalt, gamboge and alizarin herbs."; mes "How many potions do you want to brew?\""; next; + set @C_monster_oil, 20; + set @C_mopox_cure, 21; + set @C_nohmask, 22; + set @C_bye, 23; - if (@Q_status && Inspector == 10) - menu - "One", L_1, - "Five", L_5, - "Ten", L_10, - "Fifty", L_50, - "I would like to brew monster oil.", L_monster_oil_start, - "Actually...", L_NohMask, - "Never mind", L_close; - if (@Q_status && Inspector != 10) - menu - "One", L_1, - "Five", L_5, - "Ten", L_10, - "Fifty", L_50, - "I would like to brew monster oil.", L_monster_oil_start, - "Never mind", L_close; - if (!@Q_status && Inspector == 10) - menu - "One", L_1, - "Five", L_5, - "Ten", L_10, - "Fifty", L_50, - "Actually...", L_NohMask, - "Never mind", L_close; - if (!@Q_status && Inspector != 10) - menu - "One", L_1, - "Five", L_5, - "Ten", L_10, - "Fifty", L_50, - "Never mind", L_close; - -L_1: - set @num, 1; - goto L_brew; + setarray @choice$, "One", "Five", "Ten", "Fifty", "", "", "", ""; + setarray @choice_idx, 1, 5, 10, 50, 0, 0, 0, 0; + set @choices_nr, 4; + + + if !(@Q_status) + goto L_M_no_monster_oil; + + set @choice_idx[@choices_nr], @C_monster_oil; + set @choice$[@choices_nr], "I would like to brew monster oil."; + set @choices_nr, @choices_nr + 1; + +L_M_no_monster_oil: + + if (!@Q_knows_mopox_cure) + goto L_M_no_mopox_cure; + + set @choice_idx[@choices_nr], @C_mopox_cure; + set @choice$[@choices_nr], "I would like to brew a Mopox cure."; + set @choices_nr, @choices_nr + 1; + +L_M_no_mopox_cure: + + if (Inspector != 10) + goto L_M_no_inspector; -L_5: - set @num, 5; - goto L_brew; + set @choice_idx[@choices_nr], @C_nohmask; + set @choice$[@choices_nr], "Actually..."; + set @choices_nr, @choices_nr + 1; -L_10: - set @num, 10; - goto L_brew; +L_M_no_inspector: -L_50: - set @num, 50; - goto L_brew; + set @choice_idx[@choices_nr], @C_bye; + set @choice$[@choices_nr], "Never mind"; + set @choices_nr, @choices_nr + 1; + menu + @choice$[0], -, + @choice$[1], -, + @choice$[2], -, + @choice$[3], -, + @choice$[4], -, + @choice$[5], -, + @choice$[6], -, + @choice$[7], -; + + set @choice, @choice_idx[@menu - 1]; + + if (@choice == @C_monster_oil) + goto L_monster_oil_start; + if (@choice == @C_mopox_cure) + goto L_mopox_cure_start; + if (@choice == @C_nohmask) + goto L_NohMask; + if (@choice == @C_bye) + goto L_close; + + // otherwise the choice is the number of potions-to-brew + set @num, @choice; L_brew: mes "[Caul]"; @@ -450,9 +471,233 @@ L_monster_oil_no_gold_end: next; close; -L_close: +L_mopox_cure_start: + mes "[Caul]"; + mes "\"The mopox cure potion? Certainly, if you have all of the ingredients... oh, and make sure to bring water, roots, sulphur powder and Mauve leaves.\""; + mes "\"This is a very easy one, so I think I should let you do this yourself. It is very good exercise.\""; + next; + +L_mopox_cure_overview_menu: + menu + "I'm ready!", L_mopox_cure_setup, + "What are the ingredients?", L_mopox_cure_ingredients, + "How does this work?", L_mopox_cure_howto, + "I'd rather not try.", -; close; +L_mopox_cure_ingredients: + mes "[Caul]"; + mes "\"You will need one concentration potion, one iron potion, a lifestone, and one gamboge leaf.\""; + next; + goto L_mopox_cure_overview_menu; + +L_mopox_cure_howto: + mes "[Caul]"; + mes "\"When you start brewing, the liquid very rarely has the proper consistency and color. You need to make it gooey and medium dark.\""; + next; + + mes "[Caul]"; + mes "\"You can affect the consistency by adding ground roots and water, and you can change the color by adding mauve leaves (to darken it) and sulphur powder (to make it brighter).\""; + next; + + mes "[Caul]"; + mes "\"The ingredients have some side effects, though, so you will have to experiment a little.\""; + next; + + mes "[Caul]"; + mes "\"Oh, and be careful: water will evaporate over time, too.\""; + next; + goto L_mopox_cure_overview_menu; + +L_mopox_cure_no_lifestone: + mes "[Caul]"; + mes "\"You will need a lifestone.\""; + goto L_mopox_cure_overview_menu; + +L_mopox_cure_no_gamboge: + mes "[Caul]"; + mes "\"You will need a gamboge leaf.\""; + goto L_mopox_cure_overview_menu; + +L_mopox_cure_no_concentration: + mes "[Caul]"; + mes "\"You will need a concentration potion.\""; + goto L_mopox_cure_overview_menu; + +L_mopox_cure_no_iron: + mes "[Caul]"; + mes "\"You will need an iron potion.\""; + goto L_mopox_cure_overview_menu; + +L_mopox_cure_setup: + if (countitem("IronPotion") < 1) goto L_mopox_cure_no_iron; + if (countitem("ConcentrationPotion") < 1) goto L_mopox_cure_no_concentration; + if (countitem("GambogeHerb") < 1) goto L_mopox_cure_no_gamboge; + if (countitem("Lifestone") < 1) goto L_mopox_cure_no_lifestone; + + delitem "IronPotion", 1; + delitem "ConcentrationPotion", 1; + delitem "GambogeHerb", 1; + delitem "Lifestone", 1; + + mes "[Brewing Mopox Cure]"; + mes "You pour your two potions into the cauldron, then add a gamboge herb and a lifestone. Caul heats up the cauldron and you wait until it begins to boil."; + + setarray @colours$, "white", "almost white", "light", "medium-light", "dark", "very dark", "almost black", "black"; + setarray @stickinesses$, "watery", "very runny", "runny", "gooey", "sticky", "very sticky", "almost solid"; + set @stickiness, rand(7); + set @colour, 2 + rand(5); + + // Target: (@stickiness, @colour) = (3, 3) + + if (@stickiness == 3 && @colour == 3) + set @colour, 4; // don't allow insta-win; it's easy enough. + set @rounds, 0; + +L_mopox_cure_loop: + mes "[Brewing Mopox Cure]"; + mes "The brew is " + @colours$[@colour] + " and " + @stickinesses$[@stickiness] + "."; + + if (@colour == 3 && @stickiness == 3) + goto L_mopox_cure_win; + next; + + set @colour, @colour + 10; + set @stickiness, @stickiness + 10; + + menu + "Add root", L_mopox_B_root, + "Add water", L_mopox_B_water, + "Add sulphur powder", L_mopox_B_sulphur, + "Add mauve", L_mopox_B_mauve, + "...what should I do again?", L_mopox_reexplain, + "Wait", -; + +L_mopox_cure_next: + set @stickiness, @stickiness + @rounds; + set @rounds, 1 - @rounds; + + if (@stickiness < 10) + set @stickiness, 10; + if (@colour < 10) goto L_mopox_failed_badcolour; + if (@colour > 17) goto L_mopox_failed_badcolour; + if (@stickiness > 16) goto L_mopox_failed_hard; + if (@colour > 17) goto L_mopox_failed_badcolour; + + set @colour, @colour - 10; + set @stickiness, @stickiness - 10; + + goto L_mopox_cure_loop; + +L_mopox_reexplain: + mes "[Caul]"; + mes "\"Make this brew gooey and medium dark.\""; + mes "\"(Gooey is right between runny and sticky.)\""; + mes "\"You can add different items that will affect both color and stickiness.\""; + next; + mes "[Caul]"; + mes "\"Water and ground roots mostly affect stickiness.\""; + mes "\"Mauve and sulphur powder mostly affect color, with Mauve darkening the brew.\""; + next; + goto L_mopox_cure_next; + +L_mopox_B_none: + mes "[Brewing Mopox Cure]"; + mes "You don't have any left!"; + next; + goto L_mopox_cure_next; + +L_mopox_B_root: + if (countitem ("Root") < 1) goto L_mopox_B_none; + delitem "Root", 1; + + mes "[Brewing Mopox Cure]"; + mes "You grind a root and pour it into the brew."; + next; + set @colour, @colour + 1; + set @stickiness, @stickiness + 3; + goto L_mopox_cure_next; + +L_mopox_B_water: + if (countitem ("BottleOfWater") < 1) goto L_mopox_B_none; + delitem "BottleOfWater", 1; + getitem "EmptyBottle", 1; + + mes "[Brewing Mopox Cure]"; + mes "You pour a bottle of water into the brew."; + next; + set @colour, @colour; + set @stickiness, @stickiness - 2; + goto L_mopox_cure_next; + +L_mopox_B_sulphur: + if (countitem ("SulphurPowder") < 1) goto L_mopox_B_none; + delitem "SulphurPowder", 1; + + mes "[Brewing Mopox Cure]"; + mes "You mix some sulphur powder into the brew."; + next; + set @colour, @colour - 3; + set @stickiness, @stickiness + 1; + goto L_mopox_cure_next; + +L_mopox_B_mauve: + if (countitem ("MauveHerb") < 1) goto L_mopox_B_none; + delitem "MauveHerb", 1; + + mes "[Brewing Mopox Cure]"; + mes "You grind a mauve herb and toss it in."; + next; + set @colour, @colour + 2; + set @stickiness, @stickiness + 1; + goto L_mopox_cure_next; + +L_mopox_failed_badcolour: + mes "[Brewing Mopox Cure]"; + mes "The brew suddenly begins to bubble again, turning green."; + mes "\"Oh dear,\" Caul remarks, \"you let the color stray too much.\""; + next; + mes "[Caul]"; + mes "\"Better luck next time!\""; + close; + +L_mopox_failed_hard: + mes "[Brewing Mopox Cure]"; + mes "You find it almost impossible to stir the brew."; + mes "Suddenly, the thick mass bends outwards, a huge bubble bursting open right in your face!"; + next; + + if (rand(readparam(bVit)) < 40) + sc_start sc_poison, 1, 20; + + mes "[Brewing Mopox Cure]"; + mes "Yeech. That smelled bad."; + mes "\"Don't worry, I'll clean up the cauldron,\", interrupts Caul. \"You should wipe that off your face and make sure that you didn't get poisoned.\""; + next; + + mes "[Caul]"; + mes "\"Better luck next time!\""; + close; + +L_mopox_cure_win: + mes "Caul looks pleased. \"Well done! This looks very good to me.\""; + next; + + mes "[Caul]"; + mes "Caul picks a bottle from a shelf and fills it with your brew."; + mes "\"One potion of Mopox cure, here you are. Good luck!\""; + getitem "MopoxCurePotion", 1; + if (!@Q_can_score_mopox_cure) + goto L_mopox_cure_win_quick; + getexp @MOPOX_CURE_XP, 0; + mes "[" + @MOPOX_CURE_XP + " experience points]"; + set QUEST_MAGIC2, (QUEST_MAGIC2 & ~NIBBLE_3_MASK) | (2 << NIBBLE_3_SHIFT); // Make sure we can only get XP for brewing this once +L_mopox_cure_win_quick: + close; + +L_close: + close; + S_Update_Var: set QUEST_Forestbow_state, (QUEST_Forestbow_state & ~(@Q_MASK) diff --git a/npc/021-2_Tulimshar/bakery.txt b/npc/021-2_Tulimshar/bakery.txt index 7116503f..6458c781 100644 --- a/npc/021-2_Tulimshar/bakery.txt +++ b/npc/021-2_Tulimshar/bakery.txt @@ -4,7 +4,91 @@ 021-2.gat,95,21,0 script Riskim 148,{ mes "[Riskim]"; mes "\"Welcome to our bakery!\""; + + callfunc "KadiyaSubquestConsts"; + if ((@Q_kadiya_status == @Q_STATUS_WANTS_CHOCOCAKE) && (countitem ("MopoxCurePotion") > 0)) + goto L_lace_chococake; + + if ((@Q_kadiya_status == @Q_STATUS_WANTS_ORANGECUPCAKE) && (countitem ("MopoxCurePotion") > 0)) + goto L_lace_cupcake; + close; + +L_lace_chococake: + next; + + menu + "Thanks! Let me have a look around...", L_end, + "Can you put this potion into a chocolate cake?", -, + "Goodbye!", L_end; + + mes "[Riskim]"; + mes "As you show him the potion, Riskim leans back, away from it."; + mes "\"Ooooh, I remember that smell...\""; + mes "\"Elanore's Mopox potion, right? She made me drink that, too...\""; + mes "He chuckles."; + mes "\"Yes, well, you do want to hide that.\""; + next; + + mes "[Riskim]"; + mes "\"We'll need extra chocolate for that one. If you can give me ten pieces of chocolate and that potion, plus 400 GP, I will bake you a special chocolate cake that hides the taste.\""; + next; + + menu + "I will get them for you.", L_end, + "Here you are!", -, + "Maybe later.", L_end; + + if (countitem("ChocolateBar") < 10) + goto L_lacking_ingredients; + if (countitem("MopoxCurePotion") < 1) + goto L_lacking_ingredients; + if (zeny < 400) + goto L_lacking_zeny; + delitem "MopoxCurePotion", 1; + delitem "ChocolateBar", 10; + getitem "LacedChocolateCake", 1; + set zeny, zeny - 400; + + mes "[Riskim]"; + mes "\"Please have a seat.\""; + mes "You watch at Riskim melts the chocolate and stirs in the potion, then glazes a cake with it."; + mes "\"It's a bit more chocolaty than your average chocolate cake, of course...\""; + next; + + mes "[Riskim]"; + mes "Riskim hands you the cake."; + mes "\"Here you are. I hope that this works.\""; + close; + +L_lacking_zeny: + mes "[Riskim]"; + mes "\"I'm sorry, but I have to charge 400 GP.\""; + close; + +L_lacking_ingredients: + mes "[Riskim]"; + mes "\"Sorry, but I need ten chocolate bars AND your cure potion for this. Please come back later when you have everything.\""; + close; + +L_lace_cupcake: + next; + + menu + "Thanks! Let me have a look around...", L_end, + "Can you put this potion into an orange cupcake?", -, + "Goodbye!", L_end; + + mes "[Riskim]"; + mes "\"Orange cupcakes? Oh dear... I'm sorry, but I have a very bad orange allergy.\""; + next; + mes "[Riskim]"; + mes "\"Perhaps the Chef at Dimond's Cove can help you? We get all our cupcakes from him.\""; + next; + +L_end: + close; + } // Server? diff --git a/npc/024-1_Tulimshar_Canyon/ched.txt b/npc/024-1_Tulimshar_Canyon/ched.txt index 2f935364..43dd832e 100644 --- a/npc/024-1_Tulimshar_Canyon/ched.txt +++ b/npc/024-1_Tulimshar_Canyon/ched.txt @@ -5,9 +5,29 @@ if (isin("024-1.gat", 66, 43, 80, 54)) goto L_Canyon; mes "[Ched]"; - mes "\"I'm a student here.\""; + mes "\"I'm trying to get a spell to work. It's supposed to combine two potions, but I can't seem to figure out which two those are...\""; + next; + + menu + "Well, good luck with that!", L_Done, + "What spell is that?", -; + + + mes "[Ched]"; + mes "\"Well, I don't know what it's called... I took it out of `Timbleweed's Advanced Transmutations.' It seems awfully hard to cast, somehow.\""; + next; + + mes "[Ched]"; + mes "\"Well, the invocation is `" + getspellinvocation("merge-concentration-potions") + "'. You're supposed to just hold up the potions and cast it, and then they're supposed to merge.\""; close; + mes "[Ched]"; + mes "\"Maybe I should go back to `detect magic' until I can cast that one properly.\""; + close; + +L_Done: + close; + L_Garden: if (BaseLevel < 40) goto L_Warp; mes "[Ched]"; -- cgit v1.2.3-70-g09d2