From 93fd0fff03385a7d7e2e9d72adbeddb219ad5146 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 27 May 2021 04:16:26 -0300 Subject: Rewrite Cindy Quest to quest system, with ID 140 --- db/quest_db.conf | 4 ++++ npc/009-1/milly.txt | 6 +++--- npc/031-1/angelaOutside.txt | 50 +++++++++++++++++++-------------------------- npc/031-1/house.txt | 12 +++++------ npc/031-2/angelaHouse.txt | 9 ++++---- npc/031-2/cindyHouse.txt | 2 +- npc/031-4/cindyCave.txt | 49 +++++++++++++++++++++----------------------- 7 files changed, 62 insertions(+), 70 deletions(-) diff --git a/db/quest_db.conf b/db/quest_db.conf index 18e0818c..f2c17956 100644 --- a/db/quest_db.conf +++ b/db/quest_db.conf @@ -53,6 +53,10 @@ quest_db: ( // Argaes Quests (100~139) // Kaizei Quests (140~179) +{ + Id: 140 + Name: "KaizeiQuest_Cindy" +}, // Magic Quests (180~219) { diff --git a/npc/009-1/milly.txt b/npc/009-1/milly.txt index b0c88c7a..38bf8b36 100644 --- a/npc/009-1/milly.txt +++ b/npc/009-1/milly.txt @@ -5,7 +5,7 @@ @got_boneknife = ((QUEST_Forestbow_state & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT) >= 4; @got_setzer = ((QUEST_Forestbow_state & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT) >= 8; @saved_rossy = (FLAGS & FLAG_ROSSI_COMPLETED); - @saved_cindy = QL_CINDY == 4; + @saved_cindy = (getq(KaizeiQuest_Cindy) > 4); if (FLAGS & FLAG_GOT_BEANIEHAT) goto L_FinishedGood; if (FLAGS & FLAG_DECLINED_BEANIEHAT) goto L_FinishedBad; @@ -407,7 +407,7 @@ L_DRossy: close; L_DCindy: - QL_CINDY = 4; + setq(KaizeiQuest_Cindy, 5); mes "Cindy quest set to completed."; close; @@ -433,7 +433,7 @@ L_NRossy: close; L_NCindy: - QL_CINDY = 0; + setq(KaizeiQuest_Cindy, 0); mes "Cindy quest set to not completed."; close; diff --git a/npc/031-1/angelaOutside.txt b/npc/031-1/angelaOutside.txt index 92bb502a..dbacd7c3 100644 --- a/npc/031-1/angelaOutside.txt +++ b/npc/031-1/angelaOutside.txt @@ -1,26 +1,22 @@ 031-1,81,24,0 script Debug#Angela NPC195,{ - mes "Current state: " + QL_CINDY; + mes "Current state: " + getq(KaizeiQuest_Cindy); mes "---"; mes "Available states:"; - mes "0 - can not do the quest."; - mes "5 - does not have the quest."; - mes "6 - got the quest."; - mes "1 - can go rescue cindy."; - mes "2 - rescued cindy."; - mes "3 - got reward from cindy."; - mes "4 - got reward from angela."; + mes "0 - can not do the quest or does not have the quest."; + mes "1 - got the quest."; + mes "2 - can go rescue cindy."; + mes "3 - rescued cindy."; + mes "4 - got reward from cindy."; + mes "5 - got reward from angela."; menu "set state", L_Set, - "close", L_close; + "close", -; + close; L_Set: - input @state; - if(@state < 0 || @state > 6) set @state, 0; - QL_CINDY = @state; - goto L_close; - -L_close: + input .@state, 0, 6; + setq(KaizeiQuest_Cindy, .@state); close; OnInit: @@ -29,27 +25,23 @@ OnInit: } 031-1,79,24,0 script Angela NPC195,15,15,{ - if (QL_CINDY == 3) goto L_Please_Visit_Again; - if (QL_CINDY > 1 && QL_CINDY < 5) goto L_Please_Visit; - if (QL_CINDY == 1) goto L_Please_Help; + .@q = getq(KaizeiQuest_Cindy); + if (.@q == 4) goto L_Please_Visit_Again; + if (.@q > 2 && .@q < 6) goto L_Please_Visit; + if (.@q == 2) goto L_Please_Help; mes "[Angela]"; mes "\"Please, I need help! My little daughter!\""; next; mes "\"It's terrible, oh my dear child!\""; next; - if (countitem("ConcentrationPotion") > 0 && BaseLevel >= .minlevel && QL_CINDY == 6) + if (countitem("ConcentrationPotion") > 0 && BaseLevel >= .minlevel && .@q == 1) goto L_Menu_Potion; menu "\"Please calm down and tell me what happened.\"", L_Whining, "Leave", L_close; -OnTouch: - if(BaseLevel >= .minlevel && QL_CINDY < 1) - QL_CINDY = 5; - end; - L_Whining: mes "[Angela]"; mes "\"My poor little daughter, please! Oh no, oh no...\""; @@ -76,8 +68,8 @@ L_Whining: L_GetQuest: next; - QL_CINDY = 6; - mes "Perhaps you could give her something to help concentrate ?"; + setq(KaizeiQuest_Cindy, 1); + mes "Perhaps you could give her something to help concentrate?"; goto L_close; L_Menu_Potion: @@ -87,9 +79,9 @@ L_Menu_Potion: "Leave", L_close; L_Calm_Down: - if (countitem("ConcentrationPotion") == 0) + if (countitem(ConcentrationPotion) == 0) goto L_No_Potion; - delitem "ConcentrationPotion", 1; + delitem ConcentrationPotion, 1; mes "She drinks the concentration potions and calms down."; mes "[Angela]"; mes "\"Thank you, this was helpful.\""; @@ -103,7 +95,7 @@ L_Calm_Down: mes "\"Oh my poor little girl. I'm so worried - what might they do with her? Oh no!\""; next; mes "\"You look like an adventurer! Please, can you go in that cave and rescue my little Cindy? I beg you for help!\""; - QL_CINDY = 1; + setq(KaizeiQuest_Cindy, 2); goto L_close; L_No_Potion: diff --git a/npc/031-1/house.txt b/npc/031-1/house.txt index 690d6da0..642be608 100644 --- a/npc/031-1/house.txt +++ b/npc/031-1/house.txt @@ -1,11 +1,9 @@ 031-1,95,80,0 script #Door NPC45,0,0,{ - if (QL_CINDY == 3 || QL_CINDY == 4) - goto L_Warp; - message strcharinfo(0), "Door : ##BThe door is locked."; - end; - -L_Warp: - warp "031-2", 23, 28; + if (getq(KaizeiQuest_Cindy) > 3) + warp "031-2", 23, 28; + else + message strcharinfo(0), l("Door : ##BThe door is locked."); end; } + diff --git a/npc/031-2/angelaHouse.txt b/npc/031-2/angelaHouse.txt index 37cb82cc..55c2c7df 100644 --- a/npc/031-2/angelaHouse.txt +++ b/npc/031-2/angelaHouse.txt @@ -1,7 +1,8 @@ 031-2,29,28,0 script Angela#house NPC196,{ - if (QL_CINDY == 4) goto L_Hello_Again; - if (QL_CINDY == 3) goto L_Reward; + .@q= getq(KaizeiQuest_Cindy); + if (.@q > 4) goto L_Hello_Again; + if (.@q == 4) goto L_Reward; mes "..."; goto L_close; @@ -19,8 +20,8 @@ L_Reward: getinventorylist; if (@inventorylist_count == 100) goto L_Full_Inv; - getitem "RockKnife", 1; - QL_CINDY = 4; + getitem RockKnife, 1; + setq(KaizeiQuest_Cindy, 5); next; mes "\"I hope this will be useful for you.\""; diff --git a/npc/031-2/cindyHouse.txt b/npc/031-2/cindyHouse.txt index dcda8cd2..798d4037 100644 --- a/npc/031-2/cindyHouse.txt +++ b/npc/031-2/cindyHouse.txt @@ -1,6 +1,6 @@ 031-2,27,26,0 script Cindy#house NPC197,{ - if (QL_CINDY == 3 || QL_CINDY == 4) goto L_Happy_Random; + if (getq(KaizeiQuest_Cindy) > 3) goto L_Happy_Random; mes "..."; goto L_close; diff --git a/npc/031-4/cindyCave.txt b/npc/031-4/cindyCave.txt index d30b7281..39ff62e4 100644 --- a/npc/031-4/cindyCave.txt +++ b/npc/031-4/cindyCave.txt @@ -1,13 +1,11 @@ 031-4,42,42,0 script Cindy NPC198,{ + .@q = getq(KaizeiQuest_Cindy); if ($@FIGHT_YETI_STATUS != 0) goto L_Yeti; - @KEYS_AMOUNT = 10; - @minLevel = 70; - - if (QL_CINDY == 4) goto L_Please_Visit; - if (QL_CINDY == 2) goto L_Reward; - if (QL_CINDY == 1) goto L_Please_Help; + if (.@q > 4) goto L_Please_Visit; + if (.@q == 3) goto L_Reward; + if (.@q == 2) goto L_Please_Help; mes "There is a little girl in a cage. As you come near, she starts to shiver and back off from you as far as she can in that small cage."; next; @@ -34,11 +32,11 @@ L_Next: "Leave", L_close; L_Try_Cage: - if (BaseLevel < @minLevel) + if (BaseLevel < .minLevel) goto L_To_Weak; - if (countitem(TreasureKey) < @KEYS_AMOUNT) + if (countitem(TreasureKey) < .KEYS_AMOUNT) goto L_Not_Enough_Keys; - delitem TreasureKey, @KEYS_AMOUNT; + delitem TreasureKey, .KEYS_AMOUNT; mes "As you try to open the door of the cage, there is a loud squeaking noise."; next; mes "You get an uncomfortable feeling and Cindy starts to shiver."; @@ -71,18 +69,17 @@ L_Reward: if (@inventorylist_count == 100) goto L_Full_Inv; - @reward = rand(15); - if (@reward < 10) + .@reward = rand2(15); + if (.@reward < 10) goto L_Wizard_Hat; - getitem "WoodenStaff", 1; - QL_CINDY = 3; + getitem WoodenStaff, 1; + setq(KaizeiQuest_Cindy, 4); goto L_Visit; L_Wizard_Hat: // get a wizard hat in one of the ten colors - no white - setarray @wizardhats[0], 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209; - getitem @wizardhats[@reward], 1; - QL_CINDY = 3; + getitem any(2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209), 1; + setq(KaizeiQuest_Cindy, 4); goto L_Visit; L_Visit: @@ -95,16 +92,16 @@ L_Please_Visit: mesn; mes "\"Thank you, thank you! You're a hero! Please come home with me to our house at the beach!\""; next; - mesc l("You can relive the memories for %d %s, however, the rewards cannot be obtained again.", @KEYS_AMOUNT*2, getitemlink(TreasureKey)); - if (countitem(TreasureKey) < @KEYS_AMOUNT*2) + mesc l("You can relive the memories for %d %s, however, the rewards cannot be obtained again.", .KEYS_AMOUNT*2, getitemlink(TreasureKey)); + if (countitem(TreasureKey) < .KEYS_AMOUNT*2) goto L_close; mesc l("Do you want to?"); next; if (askyesno() == ASK_YES && !$@FIGHT_YETI_STATUS && - BaseLevel >= @minLevel) + BaseLevel >= .minLevel) { - delitem TreasureKey, @KEYS_AMOUNT; + delitem TreasureKey, .KEYS_AMOUNT; goto L_Try_Cage; } goto L_close; @@ -122,11 +119,7 @@ L_Full_Inv: goto L_close; L_close: - @KEYS_AMOUNT = 0; - @minLevel = 0; @inventorylist_count = 0; - cleararray @wizardhats, 0, 10; - @reward = 0; close; OnTimer5000: @@ -207,9 +200,9 @@ OnReward: @bonus = (BaseLevel/2); DailyQuestBonus = DailyQuestBonus + @bonus; message strcharinfo(0), "You feel a temporary rush of power and zest for action. " + @bonus + " daily bonus gained." ; - if (QL_CINDY != 1 ) + if (getq(KaizeiQuest_Cindy) != 2) goto L_End; - QL_CINDY = 2; + setq(KaizeiQuest_Cindy, 3); message strcharinfo(0), "Cindy looks relieved and as if she wants to talk with you."; BOSS_POINTS = BOSS_POINTS + 70; message strcharinfo(0), "You gain 70 Boss Points giving you a total of " + BOSS_POINTS + "."; @@ -233,5 +226,9 @@ OnInit: "Cindy : There are coming more and more!", "Cindy : Watch your back! There are so many of them!", "Cindy : This seems to be their final attack! I believe in you!"; + + .KEYS_AMOUNT = 10; + .minLevel = 70; + .distance = 5; end; } -- cgit v1.2.3-60-g2f50