From 8390525373e25258fe5a7e8593ba12b9bebde6a9 Mon Sep 17 00:00:00 2001 From: HoraK-FDF Date: Mon, 27 Nov 2023 17:54:30 +0000 Subject: Petal shop --- world/map/db/const-quest.txt | 37 +++++++++++++++---------- world/map/db/item_db.conf | 1 - world/map/db/item_db_generic.txt | 2 +- world/map/db/mob_skill_db.txt | 1 - world/map/npc/012-1/shops.txt | 44 ++++++++++++++++++++++++++++- world/map/npc/mobs/mob_kill_handler.txt | 49 +++++++++++++++++++++++++++------ 6 files changed, 108 insertions(+), 26 deletions(-) diff --git a/world/map/db/const-quest.txt b/world/map/db/const-quest.txt index 6f3f7148..1bea162b 100644 --- a/world/map/db/const-quest.txt +++ b/world/map/db/const-quest.txt @@ -115,20 +115,20 @@ MFLAG_KNOWS_UNFOCUS_RECIPE 65536 // Has been told about unfocus by Luca. MFLAG_GOT_MANA_PEARL 131072 // Had enough magic exp to get the Mana Pearl. // Flags set in the FLAGS variable: -FLAG_HAS_BOWLER_BURNSDAY 1 // every year's poem at burns day, shannon gives you a bowler hat -FLAG_OPENED_UNDERGROUND 2 // this flag is a replacement for variable Open_Underground_Palace_Barrier, which was used only as bool -FLAG_GOT_NAEM_GLOVES 4 // this replaces Naem_Quest_Done, which was used as a bool variable -FLAG_GOT_GRADUATIONCAP 8 // this is a bit which was to be found in Tut_var second bit -FLAG_TOWEL_HELPED 16 // gave the towel npc the stuff he wants -FLAG_TOWEL_COMPLETED 32 // got the towel from the towel npc -FLAG_ANDRA_HELPED 64 // Knows Andra and agreed to help her -FLAG_ROSSI_COMPLETED 128 // Completed the Rossi Quest -FLAG_TUTORIAL_DONE 256 // player completed tutorial (or entered the tutorial area from outside after it was added) -FLAG_SNOWMAN 512 // player gave candy to the snowman -FLAG_SANTAS_HELPER 1024 // player gave presents to Santa's helper -FLAG_HURNSMINE_CHEST 2048 // player opened the chest with the short sword in Hurnscald mines -FLAG_GOT_BEANIEHAT 4096 // player got Beanie Copter Hat from Milly -FLAG_DECLINED_BEANIEHAT 8192 // player declined Beanie Copter Hat from Milly +FLAG_HAS_BOWLER_BURNSDAY 1 // every year's poem at burns day, shannon gives you a bowler hat +FLAG_OPENED_UNDERGROUND 2 // this flag is a replacement for variable Open_Underground_Palace_Barrier, which was used only as bool +FLAG_GOT_NAEM_GLOVES 4 // this replaces Naem_Quest_Done, which was used as a bool variable +FLAG_GOT_GRADUATIONCAP 8 // this is a bit which was to be found in Tut_var second bit +FLAG_TOWEL_HELPED 16 // gave the towel npc the stuff he wants +FLAG_TOWEL_COMPLETED 32 // got the towel from the towel npc +FLAG_ANDRA_HELPED 64 // Knows Andra and agreed to help her +FLAG_ROSSI_COMPLETED 128 // Completed the Rossi Quest +FLAG_TUTORIAL_DONE 256 // player completed tutorial (or entered the tutorial area from outside after it was added) +FLAG_SNOWMAN 512 // player gave candy to the snowman +FLAG_SANTAS_HELPER 1024 // player gave presents to Santa's helper +FLAG_HURNSMINE_CHEST 2048 // player opened the chest with the short sword in Hurnscald mines +FLAG_GOT_BEANIEHAT 4096 // player got Beanie Copter Hat from Milly +FLAG_DECLINED_BEANIEHAT 8192 // player declined Beanie Copter Hat from Milly //FLAG_ 16384 // not used at the moment //FLAG_ 32768 // not used at the moment FLAG_BEHEADER_MASK 65536 // traded with The Beheader @@ -141,6 +141,15 @@ FLAG_LUCA_FIX 4194304 // fixed a bug FLAG_XMAS21 8388608 // Christmas 2021 Rewards FLAG_KESHLAM_REPACKED 16777216 // Moved FLAG_KESHLAM_FLAWEDLENS (16384) and FLAG_KESHLAM_RAREDROP (32768) to KESHLAM_STATE +// Flags set in the HURNS1_STATE variable: +// Pink Petal Shop Quest is using bits 1-8 (BYTE_0_SHIFT, BYTE_0_MASK) +// Constants Related to Blossom +PINK_FLOWER_SEEDS_NEEDED 250 // 1-253 possible, PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS and PINK_PETAL_SHOP_DELIVERED_FLOWER_SEEDS need to be adjusted to this +PINK_FLOWER_SEEDS_CHANCE 50 +PINK_PETAL_SHOP_ASKED_FOR_PETALS 1 // player asked Blossom if she sells petals +PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS 251 // player found the needed amount of Pink Flower Seeds +PINK_PETAL_SHOP_DELIVERED_FLOWER_SEEDS 252 // player delivered the needed amount of Pink Flower Seeds + // Flags set in the KESHLAM_STATE variable: FLAG_KESHLAM_FLAWEDLENS 65536 // player got the Flawed Lens from Keshlam's Chest FLAG_KESHLAM_RAREDROP 131072 // player got the super rare from Keshlam's Chest diff --git a/world/map/db/item_db.conf b/world/map/db/item_db.conf index 9ee50411..00294852 100644 --- a/world/map/db/item_db.conf +++ b/world/map/db/item_db.conf @@ -5273,7 +5273,6 @@ item_db: ( noauction: true noselltonpc: true } - //Disabled: true // @TMWA }, { Id: 5296 diff --git a/world/map/db/item_db_generic.txt b/world/map/db/item_db_generic.txt index d9bc9567..13f24527 100644 --- a/world/map/db/item_db_generic.txt +++ b/world/map/db/item_db_generic.txt @@ -266,7 +266,7 @@ 5288, Naftalin, 3, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, {}, {} 5292, SilverOre, 3, 1600, 800, 40, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, {}, {} //5293, CrystallizedDragonBlood,3, 0, 0, 1111, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 7, {}, {} -//5295, PinkFlowerSeed, 3, 0, 0, 10, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 7, {}, {} +5295, PinkFlowerSeed, 3, 0, 0, 10, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 7, {}, {} //5296, SilverIngot, 3, 20000, 2200, 1000, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 7, {}, {} 5297, GoldenTooth, 3, 20000, 2000, 40, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, {}, {} //5298, CloverDrawing, 3, 0, 0, 10, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 7, {}, {} diff --git a/world/map/db/mob_skill_db.txt b/world/map/db/mob_skill_db.txt index 23d85820..82964f89 100644 --- a/world/map/db/mob_skill_db.txt +++ b/world/map/db/mob_skill_db.txt @@ -54,7 +54,6 @@ 1014,PinkFlower@NPC_SUMMONSLAVE,any,198,1,10000,1000,60000,no,self,slavelt,4,1049,0,0,0,0, 1095,WhiteBell@NPC_SUMMONSLAVE,any,198,1,10000,1000,60000,no,self,slavelt,4,1093,0,0,0,0, 1049,Bee@NPC_POISON,attack,178,20,1000,0,500,yes,target,always,0,0,10,0,0,0, -1049,Bee@NPC_SELFDESTRUCTION,attack,175,1,1000,0,500,yes,self,notintown,0,30,0,0,0,0, 1139,Virus@NPC_POISON,attack,178,50,1500,1000,600,yes,target,always,0,0,10,0,0,0, // The Lost Abilities 1073,TheLost@NPC_SUMMONSLAVE_DMUSHX2X,any,198,1,8000,1000,5000,no,self,slavelt,2,1106,0,0,0,0, diff --git a/world/map/npc/012-1/shops.txt b/world/map/npc/012-1/shops.txt index 3620b2c9..fe4a8ac5 100644 --- a/world/map/npc/012-1/shops.txt +++ b/world/map/npc/012-1/shops.txt @@ -1,20 +1,62 @@ // 012-1,36,99,0|shop|#FlowerShop|32767,RedRose:*1,PinkRose:*1,YellowRose:*1,WhiteRose:*1,OrangeRose:*1,DarkRedRose:*1,RedTulip:*1,PinkTulip:*1,YellowTulip:*1,WhiteTulip:*1,OrangeTulip:*1 +012-1,36,99,0|shop|#FlowerPetalShop|32767,PinkPetal:*1,RedRose:*1,PinkRose:*1,YellowRose:*1,WhiteRose:*1,OrangeRose:*1,DarkRedRose:*1,RedTulip:*1,PinkTulip:*1,YellowTulip:*1,WhiteTulip:*1,OrangeTulip:*1 012-1,36,99,0|script|Blossom|163 { + goto L_Start; + +L_Start: + set @shopopt$, ""; + if ( (HURNS1_STATE & BYTE_0_MASK) < PINK_PETAL_SHOP_ASKED_FOR_PETALS ) set @shopopt$, "Do you sell Pink Petals?"; + if ( (HURNS1_STATE & BYTE_0_MASK) >= PINK_PETAL_SHOP_ASKED_FOR_PETALS && (HURNS1_STATE & BYTE_0_MASK) < PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) set @shopopt$, "How many Pink Flower Seeds do I need again?"; + if ( (HURNS1_STATE & BYTE_0_MASK) == PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) set @shopopt$, "I want to deliver the Pink Flower Seeds."; + mes "[Blossom]"; mes "\"Hello, would you like to buy some flowers?\""; menu "Sure.", L_Shop, "Not right now.", L_Close, - "Can I trade this Rose Hat for a differently colored one?", L_RoseHat; + "Can I trade this Rose Hat for a differently colored one?", L_RoseHat, + @shopopt$, L_Petals; L_Shop: + if ( (HURNS1_STATE & BYTE_0_MASK) == PINK_PETAL_SHOP_DELIVERED_FLOWER_SEEDS ) goto L_ShopPetals; close2; shop "#FlowerShop"; +L_ShopPetals: + close2; + shop "#FlowerPetalShop"; + +L_Petals: + if ( (HURNS1_STATE & BYTE_0_MASK) >= PINK_PETAL_SHOP_ASKED_FOR_PETALS && (HURNS1_STATE & BYTE_0_MASK) < PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) goto L_HowMany; + if ( (HURNS1_STATE & BYTE_0_MASK) == PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) goto L_Deliver; + + set HURNS1_STATE, (HURNS1_STATE & ~BYTE_0_MASK) | PINK_PETAL_SHOP_ASKED_FOR_PETALS; + + mes "[Blossom]"; + mes "\"Not at the moment but I could grow some if you bring me " + PINK_FLOWER_SEEDS_NEEDED + " [@@"+ PinkFlowerSeed + "|Pink Flower Seeds@@].\""; + goto L_Close; + +L_HowMany: + mes "[Blossom]"; + mes "\"You need " + PINK_FLOWER_SEEDS_NEEDED + " [@@"+ PinkFlowerSeed + "|Pink Flower Seeds@@].\""; + goto L_Close; + +L_Deliver: + if ( countitem(PinkFlowerSeed) < PINK_FLOWER_SEEDS_NEEDED ) goto L_HowMany; + + set HURNS1_STATE, (HURNS1_STATE & ~BYTE_0_MASK) | PINK_PETAL_SHOP_DELIVERED_FLOWER_SEEDS; + delitem PinkFlowerSeed, PINK_FLOWER_SEEDS_NEEDED; + + mes "[Blossom]"; + mes "\"Wonderful you found all the [@@"+ PinkFlowerSeed + "|Pink Flower Seeds@@]."; + mes "I found some myself while you where away and so I already have some [@@" + PinkPetal +"|Pink Petals@@] on stock since that flowers grow real fast."; + mes "But with all your seeds I can establish a liftime supply for you now.\""; + goto L_Close; + L_RoseHat: set @base_id, 897; mes "[Blossom]"; diff --git a/world/map/npc/mobs/mob_kill_handler.txt b/world/map/npc/mobs/mob_kill_handler.txt index 5542dcdb..069c01f4 100644 --- a/world/map/npc/mobs/mob_kill_handler.txt +++ b/world/map/npc/mobs/mob_kill_handler.txt @@ -5,7 +5,8 @@ OnInit: setarray $@QuestMobs, Maggot, Scorpion, RedScorpion, BlackScorpion, Pinkie, Fluffy, EasterFluffy, Mouboo, Squirrel, TameScorpion, HouseMaggot, AngryScorpion, - Terranite, Yeti, Reinboo, DemonicMouboo, ViciousSquirrel, WickedMushroom, Bluepar, Santaboo, Pollett; + Terranite, Yeti, Reinboo, DemonicMouboo, ViciousSquirrel, WickedMushroom, Bluepar, Santaboo, Pollett, PinkFlower; + setarray $@NatureKarmaGood, Scorpion, RedScorpion, BlackScorpion, AngryScorpion, DemonicMouboo, ViciousSquirrel, WickedMushroom, Bluepar; setarray $@NatureKarmaBad, Pinkie, Fluffy, EasterFluffy, Mouboo, Squirrel, Reinboo, Santaboo, Pollett; setarray $@NatureKarmaBadVal, 3, 3, 3, 4, 2, 3, 3, 3; @@ -22,11 +23,11 @@ function|script|MobKillHandler callfunc "ValonCount"; if (((QL_VALON >= 2) && (QL_VALON < 6)) && (@mobID == $@ValonMob[@valon_mob])) goto L_ValonMobKill; - goto L_NatureKarma; + goto L_NatureKarma; // no return here since NatureKarma shares a mob with Valon L_ValonMobKill: callfunc "AddValonCntMask"; - goto L_NatureKarma; + goto L_NatureKarma; // no return here since NatureKarma shares a mob with Valon L_NatureKarma: set .@find, array_search(@mobID, $@NatureKarmaGood); @@ -40,27 +41,59 @@ L_NatureKarma: L_Bad: set @value, $@NatureKarmaBadVal[.@find]; callfunc "QuestSagathaAnnoy"; - goto L_Celestia; + goto L_Return; L_Good: set @value, 1; callfunc "QuestSagathaHappy"; - goto L_Celestia; + goto L_Return; L_Celestia: - if (QL_CELESTIA < 5 || QL_CELESTIA >= 205 || @mobID != Yeti) goto L_Terranite; + if ( @mobID != Yeti ) goto L_Terranite; + if (QL_CELESTIA < 5 || QL_CELESTIA >= 205) goto L_Return; set QL_CELESTIA, QL_CELESTIA + 1; if (QL_CELESTIA == 205) message strcharinfo(0), "Yeti : ##3This should be enough yetis killed to please Celestia."; - goto L_Terranite; + goto L_Return; L_Terranite: - if (TERRAC < 1 || TERRAC > 1500 || @mobID != Terranite) goto L_Return; + if ( @mobID != Terranite ) goto L_Pink_Flower; + if (TERRAC < 1 || TERRAC > 1500) goto L_Return; if (TERRAC % 100 == 0) message strcharinfo(0), "Terranite : ##3Total Terranites Slain: "+TERRAC; set TERRAC, TERRAC + 1; goto L_Return; +L_Pink_Flower: + if ( @mobID != PinkFlower ) goto L_Return; // next mob label here + if ( ((HURNS1_STATE & BYTE_0_MASK) < PINK_PETAL_SHOP_ASKED_FOR_PETALS) || ((HURNS1_STATE & BYTE_0_MASK) >= PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS) ) + goto L_Return; + + if (rand(PINK_FLOWER_SEEDS_CHANCE) < 1) goto L_Get_Seed; + goto L_Return; + +L_Get_Seed: + getinventorylist; + set .@free_slots, (100 - @inventorylist_count); + if (countitem(PinkFlowerSeed) >= 1 && countitem(PinkFlowerSeed) < 30000 ) + set .@free_slots, .@free_slots + 1; + if (.@free_slots < 1 || checkweight(PinkFlowerSeed, 1) == 0) + goto L_Pink_Flower_Seeds_Inv_Full; + + set HURNS1_STATE, (HURNS1_STATE & ~BYTE_0_MASK) | ((HURNS1_STATE & BYTE_0_MASK) + 1); + getitem PinkFlowerSeed, 1; + if ( (HURNS1_STATE & BYTE_0_MASK) >= PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS) + goto L_Pink_Flower_Seeds_Full; + goto L_Return; + +L_Pink_Flower_Seeds_Full: + message strcharinfo(0), "Pink Flower : ##3You found enough [@@"+ PinkFlowerSeed + "|Pink Flower Seeds@@] for Blossom."; + goto L_Return; + +L_Pink_Flower_Seeds_Inv_Full: + message strcharinfo(0), "Pink Flower : ##3Your Inventory is full you can't pickup the [@@"+ PinkFlowerSeed + "|@@]."; + goto L_Return; + L_Return: return; } -- cgit v1.2.3-60-g2f50