From 04397d2bb53eb1054cf651a59ec44d914177a147 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 16 Jul 2021 23:47:39 -0300 Subject: Upgrade Pauline and import all spells --- npc/001-2/pauline.txt | 84 +++++++++++++++----------------------------- npc/functions/clear_vars.txt | 75 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 98 insertions(+), 61 deletions(-) diff --git a/npc/001-2/pauline.txt b/npc/001-2/pauline.txt index 992a371a..a7b9144d 100644 --- a/npc/001-2/pauline.txt +++ b/npc/001-2/pauline.txt @@ -1,18 +1,9 @@ 001-2,77,78,0 script Pauline NPC208,{ - - @Pauline_MASK = NIBBLE_4_MASK; - @Pauline_SHIFT = NIBBLE_4_SHIFT; - - @pauline_state = ((QUEST_MAGIC2 & @Pauline_MASK) >> @Pauline_SHIFT); - - - @pauline_REWARD = 10000; - - if (@pauline_state == 4) goto L_MoreMagic; - if (@pauline_state == 3) goto L_KnowIngredientsPinkie; - if (@pauline_state == 2) goto L_Ingredients; - if (@pauline_state == 1) goto L_Back; + if (getq(MagicQuest_Pauline) == 4) goto L_MoreMagic; + if (getq(MagicQuest_Pauline) == 3) goto L_KnowIngredientsPinkie; + if (getq(MagicQuest_Pauline) == 2) goto L_Ingredients; + if (getq(MagicQuest_Pauline) == 1) goto L_Back; if (getskilllv(SKILL_MAGIC_ASTRAL) > 0) goto L_Magic; @@ -20,7 +11,7 @@ mes "\"I've mastered several schools of magic and fought the Yeti in Kaizei.\""; next; mes "\"The path of magic is a long and difficult one.\""; - goto L_close; + close; L_Magic: mesn; @@ -56,8 +47,7 @@ L_Back: "No.", L_close; L_Spells: - @pauline_state = 1; - callsub S_Update_Mask; + setq(MagicQuest_Pauline, 1); mesn; mes "\"Okay.\""; mes "\"Not long ago I discovered some new caves near Tulimshar. In an abandond chamber I found some paintings on the wall.\""; @@ -83,9 +73,8 @@ L_Next1: mes "\"When you find the right ingredients, come back and bring them to me to try those spells out.\""; next; mesq l("Goodbye."); - @pauline_state = 2; - callsub S_Update_Mask; - goto L_close; + setq(MagicQuest_Pauline, 2); + close; L_Ingredients: mesn; @@ -96,7 +85,7 @@ L_Ingredients: L_Next2: mes "\"Okay. Come back as soon as you know.\""; - goto L_close; + close; L_KnowIngredientsMouboo: mes "\"Did you bring them?\""; @@ -134,17 +123,16 @@ L_Next4: mesc l("Nothing happens."); mesn; mesq l("It seems you did not tell me the correct ingredients. Come back when you find the correct ones."); - goto L_close; + close; L_TrySpellMouboo: mesc l("The Witch takes %s and %s and put them togheter calling %s.", getitemlink(.@it1), getitemlink(.@it2), b("kalboo")); monster "001-1", 55,68, "Good", Mouboo, 1; mesn; mesq l("It worked!"); - @pauline_state = 3; - callsub S_Update_Mask; - getexp @pauline_REWARD, 0; - goto L_close; + setq(MagicQuest_Pauline, 3); + getexp .reward, 0; + close; L_KnowIngredientsPinkie: mes "##B" + l("Drag and drop an item from your inventory.") + "##b"; @@ -175,7 +163,7 @@ L_Next5: mesc l("Nothing happens."); mesn; mesq l("It seems you did not tell me the correct ingredients. Come back when you find the correct ones."); - goto L_close; + close; L_TrySpellPinkie: @@ -183,73 +171,57 @@ L_TrySpellPinkie: monster "001-1", 54,68, "Good", Pinkie, 1; mesn; mesq l("It worked!"); - @pauline_state = 4; - callsub S_Update_Mask; - getexp @pauline_REWARD, 0; - goto L_close; + setq(MagicQuest_Pauline, 4); + getexp .reward, 0; + close; L_MoreMagic: mesn; mes "\"Thanks for telling me the ingredients. As soon as I find out more about those wall paintings I will let you know.\""; - goto L_close; + close; L_Wrong: mes "The Witch looks at you and snorts."; mesn; mes "\"You told me the wrong ingredients. Come back as soon as you know the correct ones.\""; - goto L_close; + close; L_NotEnough: mesn; mes "\"Hey, you don't have this with you!\""; mes "\"Come back when you have the right ingredients.\""; - goto L_close; + close; L_ComeBackLater: mesn; mes "\"Then come back later.\""; - goto L_close; + close; L_close: - @pauline_ingredient1$ = ""; - @pauline_ingredient2$ = ""; - cleararray @items$, "", getarraysize(@items$); - cleararray @item_names$, "", getarraysize(@item_names$); - @pauline_state = 0; - @pauline_REWARD = 0; + closeclientdialog; close; -S_Update_Mask: - QUEST_MAGIC2 = (QUEST_MAGIC2 & ~(@Pauline_MASK)) | (@pauline_state << @Pauline_SHIFT); - return; +OnInit: + .distance = 8; + .reward = 10000; + end; } 001-2,79,74,0 script PaulineDebug NPC208,{ - @Pauline_MASK = NIBBLE_4_MASK; - @Pauline_SHIFT = NIBBLE_4_SHIFT; - - @pauline_state = ((QUEST_MAGIC2 & @Pauline_MASK) >> @Pauline_SHIFT); - mes "Reset Quest State"; - mes @pauline_state; + mes getq(MagicQuest_Pauline); menu "Yes.", L_Next, "No.", L_close; L_Next: - @pauline_state = 0; - callsub S_Update_Mask; + setq(MagicQuest_Pauline, 0); mes "Done"; close; L_close: - @pauline_state = 0; close; -S_Update_Mask: - QUEST_MAGIC2 = (QUEST_MAGIC2 & ~(@Pauline_MASK)) | (@pauline_state << @Pauline_SHIFT); - return; - OnInit: if (!debug) disablenpc "PaulineDebug"; diff --git a/npc/functions/clear_vars.txt b/npc/functions/clear_vars.txt index 9670134b..76f75054 100644 --- a/npc/functions/clear_vars.txt +++ b/npc/functions/clear_vars.txt @@ -38,14 +38,16 @@ function script ClearVariables { MAGIC_EXP = (MAGIC_EXPERIENCE & 65535); MAGIC_EXPERIENCE = 0; /* Convert the old magic system to new magic system */ + setq1(MagicQuest_DarkMage, + OrumQuest); setq1(MagicQuest_Healing, (QUEST_MAGIC2 & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT); //setq1(MagicQuest_Wyara, // (QUEST_MAGIC2 & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT); //setq1(MagicQuest_Kadiya, // (QUEST_MAGIC2 & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT); - //setq1(MagicQuest_Pauline, - // (QUEST_MAGIC2 & NIBBLE_4_MASK) >> NIBBLE_4_SHIFT); + setq1(MagicQuest_Pauline, + (QUEST_MAGIC2 & NIBBLE_4_MASK) >> NIBBLE_4_SHIFT); //setq1(MagicQuest_BrotherSword, // (QUEST_MAGIC2 & NIBBLE_6_MASK) >> NIBBLE_6_SHIFT); //setq1(MagicQuest_SisterSword, @@ -57,15 +59,78 @@ function script ClearVariables { //SAGATHA_ST = (QUEST_MAGIC & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT; // Unhappy //Saggy - 4+5 //Alchemist - 6+7 (War Quest - Swords again?) + + /* Update skill list */ + // Orum if (OrumQuest >= 37) learnskill SKILL_HELORP; if (OrumQuest >= 38) learnskill SKILL_PHLEX; if (OrumQuest >= 41) learnskill SKILL_HALHISS; - setq(MagicQuest_DarkMage, OrumQuest); - QUEST_MAGIC = 0; - QUEST_MAGIC2 = 0; + + // Pauline + if (getq(MagicQuest_Pauline) >= 3) + learnskill SKILL_KALBOO; + if (getq(MagicQuest_Pauline) >= 4) + learnskill SKILL_KALGINA; + + // Auldsbel + .@i=((QUEST_MAGIC & (NIBBLE_0_MASK | NIBBLE_1_MASK)) >> NIBBLE_0_SHIFT); + if ((.@i >> 5) >= 5) + learnskill SKILL_GOLE; + .@i = .@i & 31; + if (.@i >= 2) + learnskill SKILL_PARUM; + if (.@i >= 4) + learnskill SKILL_PATVILOREE; + if (.@i >= 5) + learnskill SKILL_PATLOREE; + if (.@i >= 6) + learnskill SKILL_PATMUPLOO; + if (.@i >= 7) + learnskill SKILL_KULARZUFRILL; + + // War Mage + .@i = (QUEST_MAGIC & NIBBLE_6_MASK) >> NIBBLE_6_SHIFT; + if (.@i >= 1) + learnskill SKILL_FLAR; + if (.@i >= 2) + learnskill SKILL_CHIZA; + if (.@i == 4) + learnskill SKILL_FRILLYAR; + if (.@i == 5) + learnskill SKILL_UPMARMU; + if (.@i >= 6) { + learnskill SKILL_FRILLYAR; + learnskill SKILL_UPMARMU; + } + if (.@i >= 7) + learnskill SKILL_INGRAV; + + // Healing magic + if (getq(MagicQuest_Healing) >= 1) + learnskill SKILL_LUM; + if (getq(MagicQuest_Healing) >= 3) + learnskill SKILL_INMA; + + // Light Mage + .@i=((QUEST_MAGIC & (NIBBLE_4_MASK | NIBBLE_5_MASK)) >> NIBBLE_4_SHIFT); + if (.@i >= 2) + learnskill SKILL_CHIPCHIP; + if (.@i >= 3) + learnskill ALL_INCCARRY; + if (.@i >= 4) + learnskill SKILL_ASORM; + if (.@i >= 5) + learnskill SKILL_KALRENK; + if (.@i >= 6) + learnskill SKILL_KALAKARENK; + if (.@i >= 7) + learnskill SKILL_BETSANC; + + //QUEST_MAGIC = 0; + //QUEST_MAGIC2 = 0; OrumQuest = 0; } return; -- cgit v1.2.3-60-g2f50