diff options
Diffstat (limited to 'npc')
-rw-r--r-- | npc/00000SAVE/cindy/angelaHouse.txt | 104 | ||||
-rw-r--r-- | npc/00000SAVE/cindy/cindyCave.txt | 251 | ||||
-rw-r--r-- | npc/00000SAVE/cindy/cindyHouse.txt | 51 | ||||
-rw-r--r-- | npc/021-4/_import.txt | 1 | ||||
-rw-r--r-- | npc/021-4/main.txt | 15 |
5 files changed, 422 insertions, 0 deletions
diff --git a/npc/00000SAVE/cindy/angelaHouse.txt b/npc/00000SAVE/cindy/angelaHouse.txt new file mode 100644 index 000000000..a4e04f61d --- /dev/null +++ b/npc/00000SAVE/cindy/angelaHouse.txt @@ -0,0 +1,104 @@ + +031-2,29,28,0 script Angela#house NPC196,{ + @Q_Nivalis_state_MASK = NIBBLE_5_MASK; + @Q_Nivalis_state_SHIFT = NIBBLE_5_SHIFT; + + @rescue_Cindy = ((QUEST_Nivalis_state & @Q_Nivalis_state_MASK) >> @Q_Nivalis_state_SHIFT); + + if (@rescue_Cindy == 4) goto L_Hello_Again; + if (@rescue_Cindy == 3) goto L_Reward; + + mes "..."; + goto L_close; + +L_Reward: + mes "[Angela]"; + mes "\"Hello " + strcharinfo(0) + ", thank you again. I'm so glad Cindy is back home safe.\""; + next; + mes "\"As I told you, my husband is an adventurer. He is on one of his travels, so he couldn't rescue Cindy himself.\""; + next; + mes "\"I want to give you one of his treasures. Beside all the junk he brings, there are some very valuable things.\""; + next; + mes "\"This item is called the Rock Knife. When you wield it, you feel as robust as a rock.\""; + + getinventorylist; + if (@inventorylist_count == 100) + goto L_Full_Inv; + getitem "RockKnife", 1; + @rescue_Cindy = 4; + callsub S_Update_Mask; + + next; + mes "\"I hope this will be useful for you.\""; + next; + mes "\"I am so glad Cindy is safe. But there is still another problem. The Yetis took away all the white and yellow present boxes we wanted to bring to Santa!\""; + next; + mes "\"Usually, Yetis are very shy - I wonder why they did that. There is something strange going on.\""; + next; + mes "\"May I ask you for help again? I'll give you a small reward for every 3 boxes of one color you bring me.\""; + goto L_close; + +L_Full_Inv: + mes "\"Oh, it seems you carry so much stuff - I will keep it for you until you can take it.\""; + goto L_close; + +L_Hello_Again: + mes "[Angela]"; + mes "\"Hello! Good to see you again. Please warm yourself.\""; + next; + menu + "I just wanted to say hello.",L_close, + "I have some yellow present boxes.",L_Yellow, + "I have some white present boxes.",L_White; + +L_Yellow: + @dq_level = 70; + @dq_cost = 32; + @dq_count = 3; + @dq_name$ = "YellowPresentBox"; + @dq_friendly_name$ = "yellow present box"; + @dq_money = 5300; + @dq_exp = 1300; + + callfunc "DailyQuest"; + next; + if (@dq_return == 4) + mes "\"Santa will be glad to have them back.\""; + goto L_close; + +L_White: + @dq_level = 80; + @dq_cost = 64; + @dq_count = 3; + @dq_name$ = "WhitePresentBox"; + @dq_friendly_name$ = "white present box"; + @dq_money = 10800; + @dq_exp = 2800; + + callfunc "DailyQuest"; + next; + if (@dq_return == 4) + mes "\"You are a great help!\""; + goto L_close; + +L_close: + @Q_Nivalis_state_MASK = 0; + @Q_Nivalis_state_SHIFT = 0; + @rescue_Cindy = 0; + + @dq_level = 0; + @dq_cost = 0; + @dq_count = 0; + @dq_name$ = ""; + @dq_friendly_name$ = ""; + @dq_money = 0; + @dq_exp = 0; + @dq_return = 0; + close; + +S_Update_Mask: + set QUEST_Nivalis_state, + (QUEST_Nivalis_state & ~(@Q_Nivalis_state_MASK)) + | (@rescue_Cindy << @Q_Nivalis_state_SHIFT); + return; +} diff --git a/npc/00000SAVE/cindy/cindyCave.txt b/npc/00000SAVE/cindy/cindyCave.txt new file mode 100644 index 000000000..018d34759 --- /dev/null +++ b/npc/00000SAVE/cindy/cindyCave.txt @@ -0,0 +1,251 @@ + +031-4,42,42,0 script Cindy NPC198,{ + if ($@FIGHT_YETI_STATUS != 0) goto L_Yeti; + + @KEYS_AMOUNT = 10; + @minLevel = 70; + + @Q_Nivalis_state_MASK = NIBBLE_5_MASK; + @Q_Nivalis_state_SHIFT = NIBBLE_5_SHIFT; + + @rescue_Cindy = ((QUEST_Nivalis_state & @Q_Nivalis_state_MASK) >> @Q_Nivalis_state_SHIFT); + + if (Sex == 0) set @title$, "Misses"; + if (Sex == 1) set @title$, "Mister"; + + if (@rescue_Cindy >= 3) goto L_Please_Visit; + if (@rescue_Cindy == 2) goto L_Reward; + if (@rescue_Cindy == 1) 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; + mes "You don't know what to do."; + goto L_close; + +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; + menu + "Hello Cindy, I'm here to save you.", L_Next; + +L_Next: + mes "Cindy doesn't look so scared anymore."; + next; + mes "[Cindy]"; + mes "\"Hello, dear " + @title$ + " adventurer. Did my mother send you?\""; + next; + mes "\"It's so cold in here! Can you please open the cage?\""; + next; + mes "\"But be careful. If the Yetis hear you, they will come!\""; + menu + "Try to open the cage", L_Try_Cage, + "Leave", L_close; + +L_Try_Cage: + if (BaseLevel < @minLevel) + goto L_To_Weak; + if (countitem("TreasureKey") < @KEYS_AMOUNT) + goto L_Not_Enough_Keys; + 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."; + if ($@FIGHT_YETI_STATUS != 0) + goto L_Yeti; + npctalk strnpcinfo(0), "Oh no, the Yetis..."; + + // initialize fight + $@FIGHT_YETI_STATUS = 1; + $@FIGHT_YETI_WAVE = 0; + $@YETI_COUNT = 1; + $@FIGHT_YETI_PLAYER_COUNT = getmapusers("031-4"); + areamonster "031-4", 0, 0, 95, 91, "", 1072, 1, "Cindy::OnPetDeath"; + + initnpctimer; + goto L_close; + +L_Yeti: + mes "[Cindy]"; + mes "\"Watch out, the Yetis!\""; + goto L_close; + +L_Reward: + mes "[Cindy]"; + mes "\"You are a hero! All these strong monsters!\""; + next; + mes "\"I've found this thing in the cave - it looks valuable. I want you to have it.\""; + next; + getinventorylist; + if (@inventorylist_count == 100) + goto L_Full_Inv; + + @reward = rand(15); + if (@reward < 10) + goto L_Wizard_Hat; + getitem "WoodenStaff", 1; + @rescue_Cindy = 3; + callsub S_Update_Mask; + goto L_Visit; + +L_Wizard_Hat: + // get a wizard hat in one of the ten colors - no white + setarray @wizardhats, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209; + getitem @wizardhats[@reward], 1; + @rescue_Cindy = 3; + callsub S_Update_Mask; + goto L_Visit; + +L_Visit: + mes "\"Thank you so much; please come to my home. It's the house at the beach.\""; + next; + mes "\"I'm sure my mother wants to thank you as well.\""; + goto L_close; + +L_Please_Visit: + mes "[Cindy]"; + mes "\"Thank you, thank you! You're a hero! Please come home with me to our house at the beach!\""; + goto L_close; + +L_To_Weak: + mes "You try to open the cage, but it's stuck. It seems you're too weak!"; + goto L_close; + +L_Not_Enough_Keys: + mes "You don't have enough keys to open the cage."; + goto L_close; + +L_Full_Inv: + mes "\"Oh, it seems you carry so much stuff - I will keep it for you until you can take it.\""; + goto L_close; + +L_close: + @KEYS_AMOUNT = 0; + @Q_Nivalis_state_MASK = 0; + @Q_Nivalis_state_SHIFT = 0; + @rescue_Cindy = 0; + @title$ = ""; + @minLevel = 0; + @inventorylist_count = 0; + cleararray @wizardhats, 0, 10; + @reward = 0; + close; + +OnTimer5000: + setnpctimer 0; + if ($@FIGHT_YETI_STATUS != 0) + goto L_CaveLogic; + goto L_Return_1; + +L_Return_1: + $@FIGHT_YETI_PLAYER_COUNT = 0; + areatimer "031-4", 0, 0, 95, 91, 10, "Cindy::OnTick"; + end; + +L_CaveLogic: + $@FIGHT_YETI_ROUND_PEN = $@FIGHT_YETI_PLAYER_COUNT; + if ($@FIGHT_YETI_ROUND_PEN > 60) + $@FIGHT_YETI_ROUND_PEN = 60; + if ($@FIGHT_YETI_PLAYER_COUNT <= 0) + goto L_CleanUp; + set $@FIGHT_YETI_ROUND_TIMER, $@FIGHT_YETI_ROUND_TIMER + 5; // Advance 5 seconds + if (mobcount("031-4", "Cindy::OnPetDeath") < 0) + goto L_NextWave; + if ($@FIGHT_YETI_ROUND_TIMER + $@FIGHT_YETI_ROUND_PEN >= 120) + goto L_NextWave; + goto L_Return_1; + +L_NextWave: + $@FIGHT_YETI_ROUND_TIMER = 0; + $@FIGHT_YETI_WAVE = $@FIGHT_YETI_WAVE + 1; + if ($@FIGHT_YETI_WAVE > 10 + && $@YETI_COUNT == 0) + goto L_CleanUp; + if ($@FIGHT_YETI_WAVE > 10 + && $@FIGHT_YETI_WAVE < 22) + goto L_Return_1; + if ($@FIGHT_YETI_WAVE > 22) + areamonster "031-4", 0, 0, 95, 91, "", 1072, $@FIGHT_YETI_WAVE*2 + $@FIGHT_YETI_PLAYER_COUNT*5, "Cindy::OnPetDeath"; + if ($@FIGHT_YETI_WAVE > 22) + $@YETI_COUNT = $@YETI_COUNT + $@FIGHT_YETI_WAVE*2 + $@FIGHT_YETI_PLAYER_COUNT*5; + $@FIGHT_YETI_NUMBER = (5 + (1 * $@FIGHT_YETI_WAVE) + (2 * $@FIGHT_YETI_PLAYER_COUNT))/4; + $@YETI_COUNT = $@YETI_COUNT + $@FIGHT_YETI_NUMBER; + + areamonster "031-4", 0, 0, 95, 91, "", 1072, $@FIGHT_YETI_NUMBER, "Cindy::OnPetDeath"; + + $@msg$ = $@FIGHT_YETI_MESSAGES$[$@FIGHT_YETI_WAVE]; + if ($@msg$ == "") + goto L_Return_1; + mapannounce "031-4", $@msg$, 0; + mapannounce "031-3", $@msg$, 0; + $@msg$ = ""; + goto L_Return_1; + +OnTick: + if (ispcdead()) end; + $@FIGHT_YETI_PLAYER_COUNT = $@FIGHT_YETI_PLAYER_COUNT + 1; + end; + +OnPetDeath: + $@YETI_COUNT = $@YETI_COUNT - 1; + end; + +L_CleanUp: + areatimer "031-4", 0, 0, 95, 91, 10, "Cindy::OnReward"; + $@FIGHT_YETI_STATUS = 0; + $@FIGHT_YETI_PLAYER_COUNT = 0; + $@FIGHT_YETI_WAVE = 0; + $@FIGHT_YETI_ROUND_TIMER = 0; + $@YETI_COUNT = 0; + $@FIGHT_YETI_ROUND_PEN = 0; + $@FIGHT_YETI_NUMBER = 0; + killmonster "031-4", "Cindy::OnPetDeath"; + stopnpctimer; + setnpctimer 0; + end; + +OnReward: + if (ispcdead()) end; + @bonus = (BaseLevel/2); + DailyQuestBonus = DailyQuestBonus + @bonus; + message strcharinfo(0), "You feel a temporary rush of power and zest for action. " + @bonus + " daily bonus gained." ; + @Q_Nivalis_state_MASK = NIBBLE_5_MASK; + @Q_Nivalis_state_SHIFT = NIBBLE_5_SHIFT; + @rescue_Cindy = ((QUEST_Nivalis_state & @Q_Nivalis_state_MASK) >> @Q_Nivalis_state_SHIFT); + if (@rescue_Cindy != 1 ) + goto L_End; + @rescue_Cindy = 2; + callsub S_Update_Mask; + 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 + "."; + goto L_End; + +L_End: + @bonus = 0; + @Q_Nivalis_state_MASK = 0; + @Q_Nivalis_state_SHIFT = 0; + @rescue_Cindy = 0; + end; + +OnInit: + setarray $@FIGHT_YETI_MESSAGES$, + "", // unused + // " : " is magic so that it says "global announcement from" + "Cindy : Yetis!", + "Cindy : Watch out!", + "Cindy : More of them are coming!", + "Cindy : Be careful! More of them!", + "Cindy : Attention! There is another bunch of them!", + "Cindy : Hang on! More of them!", + "Cindy : More Yetis! Will this never end?", + "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!"; + end; + +S_Update_Mask: + set QUEST_Nivalis_state, + (QUEST_Nivalis_state & ~(@Q_Nivalis_state_MASK)) + | (@rescue_Cindy << @Q_Nivalis_state_SHIFT); + return; +} diff --git a/npc/00000SAVE/cindy/cindyHouse.txt b/npc/00000SAVE/cindy/cindyHouse.txt new file mode 100644 index 000000000..76a1b3a14 --- /dev/null +++ b/npc/00000SAVE/cindy/cindyHouse.txt @@ -0,0 +1,51 @@ + +031-2,27,26,0 script Cindy#house NPC197,{ + @Q_Nivalis_state_MASK = NIBBLE_5_MASK; + @Q_Nivalis_state_SHIFT = NIBBLE_5_SHIFT; + + @rescue_Cindy = ((QUEST_Nivalis_state & @Q_Nivalis_state_MASK) >> @Q_Nivalis_state_SHIFT); + + if (@rescue_Cindy > 2) goto L_Happy_Random; + + mes "..."; + goto L_close; + +L_Happy_Random: + getinventorylist; + @candy = rand(50); + if (@inventorylist_count < 100 && @candy == 42) + goto L_Candy; + + setarray @quote_Cindy$, "Thank you so much for rescuing me!", + "My mother made really tasty cookies yesterday. But I already ate them all...", + "I want to go ice skating tomorrow. That will be fun!", + "I wonder when Daddy will come home next time. He always brings exciting stuff!", + strcharinfo(0) + "! You're my hero!", + "My mother is so upset about the Yetis - they are very very shy usually. You have to be lucky to see one. I wonder what's wrong with them.", + "When I'm a little older, I want to travel like you and my father. I want to see every place on the world!", + "Did you ever meet Santa? He's very kind! He always gives me some candy when we go to see him.", + strcharinfo(0) + ", you are sooo strong! Amazing! But my dad is strong too!"; + @random = rand(9); + if (@random != 5) + emotion EMOTE_HAPPY; + @quote$ = "\"" + @quote_Cindy$[@random] + "\""; + mes "[Cindy]"; + mes @quote$; + goto L_close; + +L_Candy: + mes "[Cindy]"; + mes "\"Santa gave me some candy! Please, take that!\""; + getitem "Candy", 1; + goto L_close; + +L_close: + @Q_Nivalis_state_MASK = 0; + @Q_Nivalis_state_SHIFT = 0; + @rescue_Cindy = 0; + @candy = 0; + @inventorylist_count = 0; + @random = 0; + @quote$ = ""; + close; +} diff --git a/npc/021-4/_import.txt b/npc/021-4/_import.txt index fbe0e9684..e8ce88ab9 100644 --- a/npc/021-4/_import.txt +++ b/npc/021-4/_import.txt @@ -1,3 +1,4 @@ // Map 021-4: Cindy Cave // This file is generated automatically. All manually added changes will be removed when running the Converter. +"npc/021-3/main.txt", "npc/021-4/mapflags.txt", diff --git a/npc/021-4/main.txt b/npc/021-4/main.txt new file mode 100644 index 000000000..04efb6d28 --- /dev/null +++ b/npc/021-4/main.txt @@ -0,0 +1,15 @@ +// TMW2 scripts. +// Authors: +// The Mana World Team +// Jesusalva +// Description: +// Cindy Cave core logic. You must flip 5 switches to free Cindy, and kill every +// Yeti to leave the Yeti's King Throne Room. Each passing minute, a new Yeti will +// spawn. Amount relies on how long this has been dragging on. +// Flipping switches creates yetis on the other switches. +// You must try flip all 5 switches at once. Once all switches are flipped, there'll +// be various waves of Yetis. More time passing = more penalty Yetis, with a safety +// check to abort script after a hour. If this happen, everyone inside the cave +// will be banned for cheating. This should not be possible without @monsterignore anyway :< + + |