From bf9e067bf1e5c6bc15d313e0a197fd8f4b2ec131 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 19 Oct 2014 00:47:39 +0200 Subject: Removed use of 'menu' from official (non-custom) scripts - Some scripts were partly refactored/rewritten to use a more modern coding style (and to fix some issues) - Note: the 'menu' command will be deprecated soon in favor of 'select' and 'prompt'. Signed-off-by: Haru --- npc/events/dumplingfestival.txt | 72 +++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 42 deletions(-) (limited to 'npc/events/dumplingfestival.txt') diff --git a/npc/events/dumplingfestival.txt b/npc/events/dumplingfestival.txt index 6c5a3b6b5..23a085eb8 100644 --- a/npc/events/dumplingfestival.txt +++ b/npc/events/dumplingfestival.txt @@ -21,60 +21,48 @@ payon,93,81,4 script Exorcist Master Fahae 4_M_BUDDHIST,{ mes "I feel it is time I let another warrior try to complete"; mes "my quest. I have some items to assist you in my quest."; next; - menu "I wish to buy",-, "No thanks",M_FIN; - + if (select("I wish to buy","No thanks") != 1) { + mes "[Exorcist Master Fahae]"; + mes "The path of fully venquishing evil is far, help me in the way of God."; + close; + } mes "[Exorcist Master Fahae]"; mes "I have 2 items which might become useful to you."; next; - menu "Realgar Wine",-, "Exorcize Herb",M_HERB; - + switch (select("Realgar Wine","Exorcize Herb")) { + case 1: + .@itemid = Realgar_Wine; // 682 + .@price = 20000; + break; + case 2: + .@itemid = Exorcize_Herb; // 683 + .@price = 10000; + break; + } mes "[Exorcist Master Fahae]"; mes "How many do you require?"; mes "You may only buy 5 at one time."; - mes "Each costs 20000z."; + mes "Each costs "+ .@price +"z."; mes "(Type in 0 to cancel)"; next; input @input; - if(@input==0) close; - if(@input>5) goto L_SORRY; - if(Zeny< @input*20000) goto L_NoZeny; - Zeny -= 20000*@input; - getitem 682,@input; + if (@input == 0) + close; + if (@input > 5) { + mes "[Exorcist Master Fahae]"; + mes "You must not be stingy, it is the path of God to be honest."; + close; + } + if (Zeny < @input * .@price) { + mes "[Exorcist Master Fahae]"; + mes "Money doesn't bring joy to everyone, but we need it to support the temple and myself. Please, try to kill some monsters and take their drops."; + close; + } + Zeny -= @input * .@price; + getitem .@itemid, @input; mes "[Exorcist Master Fahae]"; mes "Here you go, I hope you may succeed in my quest."; close; - -L_SORRY: - mes "[Exorcist Master Fahae]"; - mes "You must not be stingy, it is the path of God to be honest."; - close; - -M_FIN: - mes "[Exorcist Master Fahae]"; - mes "The path of fully venquishing evil is far, help me in the way of God."; - close; - -M_HERB: - mes "[Exorcist Master Fahae]"; - mes "How many do you require?"; - mes "You may only buy 5 at one time."; - mes "Each costs 10000z."; - mes "(Type in 0 to cancel)"; - next; - input @input; - if(@input==0) close; - if(@input>5) goto L_SORRY; - if(Zeny< @input*10000) goto L_NoZeny; - Zeny -= 10000*@input; - getitem 683,@input; - mes "[Exorcist Master Fahae]"; - mes "Here you go, I hope you may succeed in my quest."; - close; - -L_NoZeny: - mes "[Exorcist Master Fahae]"; - mes "Money doesn't bring joy to everyone, but we need it to support the temple and myself. Please, try to kill some monsters and take their drops."; - close; } // Monsters -- cgit v1.2.3-60-g2f50