From b7220816487ded7d73bc0eadf53d7abf55af29cd Mon Sep 17 00:00:00 2001 From: Jessica Tölke Date: Mon, 31 Oct 2011 18:31:57 +0100 Subject: Christmas Event 2011 --- world/map/npc/xmas/2011/deliverPresentsHelper.txt | 275 ++++++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 world/map/npc/xmas/2011/deliverPresentsHelper.txt (limited to 'world/map/npc/xmas/2011/deliverPresentsHelper.txt') diff --git a/world/map/npc/xmas/2011/deliverPresentsHelper.txt b/world/map/npc/xmas/2011/deliverPresentsHelper.txt new file mode 100644 index 00000000..8bf4d9ed --- /dev/null +++ b/world/map/npc/xmas/2011/deliverPresentsHelper.txt @@ -0,0 +1,275 @@ +// author: Jenalya +// Aaron collects the finished toys +// good way: give toy + open box + wrapping +// bad way: give closed box prepared at the bad guy + wrapping + +030-2.gat,127,41,0|script|Aaron|328,{ + + if (!(gettime(7) == $@xmas2011_year && gettime(6) == 12 && gettime(5) >= $@xmas2011_start_day)) + goto L_NoEvent; + if ((gettime(7) == $@xmas2011_year && gettime(6) == 12 && gettime(5) >= $@xmas2011_reward_start_day)) + goto L_RewardTime; + + set @plushmouboo, (xmas11 & $@xmas11_PlushMoubooMask) >> $@xmas11_PlushMoubooShift; + set @stickreinboo, (xmas11 & $@xmas11_StickReinbooMask) >> $@xmas11_StickReinbooShift; + set @ball, (xmas11 & $@xmas11_BallMask) >> $@xmas11_BallShift; + set @doll, (xmas11 & $@xmas11_DollMask) >> $@xmas11_DollShift; + + if (xmas11 & $@xmas11_talkedToChief) goto L_Helping; + + mes "[Busy Helper]"; + mes "\"This is a disaster!\""; + goto L_Close; + +L_Helping: + mes "[Aaron]"; + mes "\"Hello there! Do you have any finished toys ready for being packed and wrapped?"; + mes "We also need an empty box and wrapping paper.\""; + + cleararray @choice_idx, 0, 9; + cleararray @choice$, "", 9; + + set @C_plushmouboo, 1; + set @C_plushmouboobox, 2; + set @C_stickreinboo, 3; + set @C_stickreinboobox, 4; + set @C_ball, 5; + set @C_ballbox, 6; + set @C_doll, 7; + set @C_dollbox, 8; + set @C_nevermind, 9; + + // counter of available answers + set @choices_nr, 0; + + if (@plushmouboo != 3) + goto L_NoPlushMouboo; + set @choice_idx[@choices_nr], @C_plushmouboo; + set @choice$[@choices_nr], "This Plush Mouboo needs to be packed."; + set @choices_nr, @choices_nr + 1; + +L_NoPlushMouboo: + if (@plushmouboo != 4) + goto L_NoPlushMoubooBox; + set @choice_idx[@choices_nr], @C_plushmouboobox; + set @choice$[@choices_nr], "I already packed this Plush Mouboo..."; + set @choices_nr, @choices_nr + 1; + +L_NoPlushMoubooBox: + if (@stickreinboo != 3) + goto L_NoStickReinboo; + set @choice_idx[@choices_nr], @C_stickreinboo; + set @choice$[@choices_nr], "This Stick Reinboo needs to be packed."; + set @choices_nr, @choices_nr + 1; + +L_NoStickReinboo: + if (@stickreinboo != 4) + goto L_NoStickReinbooBox; + set @choice_idx[@choices_nr], @C_stickreinboobox; + set @choice$[@choices_nr], "I already packed this Stick Reinboo..."; + set @choices_nr, @choices_nr + 1; + +L_NoStickReinbooBox: + if (@ball != 3) + goto L_NoBall; + set @choice_idx[@choices_nr], @C_ball; + set @choice$[@choices_nr], "This Leather Ball needs to be packed."; + set @choices_nr, @choices_nr + 1; + +L_NoBall: + if (@stickreinboo != 4) + goto L_NoBallBox; + set @choice_idx[@choices_nr], @C_ballbox; + set @choice$[@choices_nr], "I already packed this Leather Ball..."; + set @choices_nr, @choices_nr + 1; + +L_NoBallBox: + if (@doll != 3) + goto L_NoDoll; + set @choice_idx[@choices_nr], @C_doll; + set @choice$[@choices_nr], "This Doll needs to be packed."; + set @choices_nr, @choices_nr + 1; + +L_NoDoll: + if (@doll != 4) + goto L_NoDollBox; + set @choice_idx[@choices_nr], @C_dollbox; + set @choice$[@choices_nr], "I already packed this Doll..."; + set @choices_nr, @choices_nr + 1; + +L_NoDollBox: + set @choice_idx[@choices_nr], @C_nevermind; + set @choice$[@choices_nr], "I'll be back later."; + + menu + @choice$[0],-, + @choice$[1],-, + @choice$[2],-, + @choice$[3],-, + @choice$[4],-, + @choice$[5],-, + @choice$[6],-, + @choice$[7],-, + @choice$[8],-; + + set @menu, @menu - 1; + if (@choice_idx[@menu] == 0) + goto L_Close; + + if ((@choice_idx[@menu] == @C_plushmouboo)|| (@choice_idx[@menu] == @C_plushmouboobox)) + set @toy$, "PlushMouboo"; + if (@choice_idx[@menu] == @C_plushmouboo) + goto L_Pack; + if (@choice_idx[@menu] == @C_plushmouboobox) + goto L_Wrap; + + if ((@choice_idx[@menu] == @C_stickreinboo) || (@choice_idx[@menu] == @C_stickreinboobox)) + set @toy$, "StickReinboo"; + if (@choice_idx[@menu] == @C_stickreinboo) + goto L_Pack; + if (@choice_idx[@menu] == @C_stickreinboobox) + goto L_Wrap; + + if ((@choice_idx[@menu] == @C_ball) || (@choice_idx[@menu] == @C_ballbox)) + set @toy$, "LeatherBall"; + if (@choice_idx[@menu] == @C_ball) + goto L_Pack; + if (@choice_idx[@menu] == @C_ballbox) + goto L_Wrap; + + if ((@choice_idx[@menu] == @C_doll) || (@choice_idx[@menu] == @C_dollbox)) + set @toy$, "Doll"; + if (@choice_idx[@menu] == @C_doll) + goto L_Pack; + if (@choice_idx[@menu] == @C_dollbox) + goto L_Wrap; + + if ((@choice_idx[@menu] == @C_nevermind)) + goto L_Close; + goto L_Close; + +L_Pack: + mes "[Aaron]"; + mes "\"Very well, do you also have a box and wrapping paper?\""; + + callsub S_WrappingColor; + + if ((countitem("OpenPresentBox") < 1) || (countitem(@wrappingColor$) < 1) || (countitem(@toy$) < 1)) + goto L_NoItems; + delitem "OpenPresentBox", 1; + delitem @wrappingColor$, 1; + delitem @toy$, 1; + mes "[Aaron]"; + mes "\"Excellent! Give it to me!\""; + mes "He takes the box, puts the toy into it and wraps it skillfully with the paper you gave him."; + mes "Then he writes something on a paper next to him."; + goto L_Deliver; + +L_Wrap: + mes "[Aaron]"; + mes "\"Ah, even better! Do you also have some wrapping paper?\""; + + callsub S_WrappingColor; + + if ((countitem("ClosedChristmasBox") < 1) || (countitem(@wrappingColor$) < 1)) + goto L_NoItems; + delitem "ClosedChristmasBox", 1; + delitem @wrappingColor$, 1; + mes "[Aaron]"; + mes "\"Alright. Give it to me.\""; + mes "He takes the box and wraps it elaborately with the paper you gave him."; + mes "Then he writes something on a paper next to him."; + goto L_Deliver; + +L_Deliver: + if ((@toy$ == "PlushMouboo") && (@plushmouboo == 3)) + set @plushmouboo, 5; + if ((@toy$ == "PlushMouboo") && (@plushmouboo == 4)) + set @plushmouboo, 6; + if (@toy$ == "PlushMouboo") + set xmas11, (xmas11 & ~($@xmas11_PlushMoubooMask) | (@plushmouboo << $@xmas11_PlushMoubooShift)); + + if ((@toy$ == "StickReinboo") && (@stickreinboo == 3)) + set @stickreinboo, 5; + if ((@toy$ == "StickReinboo") && (@stickreinboo == 4)) + set @stickreinboo, 6; + if (@toy$ == "StickReinboo") + set xmas11, (xmas11 & ~($@xmas11_StickReinbooMask) | (@stickreinboo << $@xmas11_StickReinbooShift)); + + if ((@toy$ == "LeatherBall") && (@ball == 3)) + set @ball, 5; + if ((@toy$ == "LeatherBall") && (@ball == 4)) + set @ball, 6; + if (@toy$ == "LeatherBall") + set xmas11, (xmas11 & ~($@xmas11_BallMask) | (@ball << $@xmas11_BallShift)); + + if ((@toy$ == "Doll") && (@doll == 3)) + set @doll, 5; + if ((@toy$ == "Doll") && (@doll == 4)) + set @doll, 6; + if (@toy$ == "Doll") + set xmas11, (xmas11 & ~($@xmas11_DollMask) | (@doll << $@xmas11_DollShift)); + + goto L_Close; + +L_NoEvent: + mes "[Aaron]"; + mes "\"How did you come in? At this time of the year the door should be locked!\""; + warp "030-1.gat", 99, 55; + goto L_Close; + +L_RewardTime: + mes "[Aaron]"; + mes "\"This was a lot of hard work this year.\""; + goto L_Close; + +L_NoItems: + mes "[Aaron]"; + mes "\"Don't be silly. Where are the items?\""; + goto L_Close; + +L_Close: + set @plushmouboo, 0; + set @stickreinboo, 0; + set @ball, 0; + set @doll, 0; + set @C_plushmouboo, 0; + set @C_plushmouboobox, 0; + set @C_stickreinboo, 0; + set @C_stickreinboobox, 0; + set @C_ball, 0; + set @C_ballbox, 0; + set @C_doll, 0; + set @C_dollbox, 0; + set @C_nevermind, 0; + set @choices_nr, 0; + cleararray @choice_idx, 0, 9; + cleararray @choice$, "", 9; + set @menu, 0; + set @toy$, ""; + set @wrappingColor$, ""; + close; + +S_WrappingColor: + menu + "Yeah, I have this red dotted.",-, + "Sure, see this yellow dotted.",-, + "Yes, what about this blue dotted?",-, + "Here, I have this purple striped.",-, + "Isn't this red golden striped one wonderful?",-, + "Here is this green red striped.",-, + "No, I'll get it.",L_Close; + if (@menu == 1) + set @wrappingColor$, "RedDottedWrap"; + if (@menu == 2) + set @wrappingColor$, "YellowDottedWrap"; + if (@menu == 3) + set @wrappingColor$, "BlueDottedWrap"; + if (@menu == 4) + set @wrappingColor$, "PurpleStripedWrap"; + if (@menu == 5) + set @wrappingColor$, "RedGoldenStripedWrap"; + if (@menu == 6) + set @wrappingColor$, "GreenRedStripedWrap"; + return; +} -- cgit v1.2.3-60-g2f50