summaryrefslogtreecommitdiff
path: root/world/map/npc
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc')
-rw-r--r--world/map/npc/012-1/shops.txt44
-rw-r--r--world/map/npc/mobs/mob_kill_handler.txt49
2 files changed, 84 insertions, 9 deletions
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;
}