// // NPC exchanges 10 Jellopy for 1 Red Potion or 3 Jellopy for 1 Sweet Potato // alberta.gat,190,173,4 script Phelix 85,{ if(Event_Jellopy == 1) goto EVENTJELLOPY; mes "[Phelix]"; mes "What do you want? There's no charity for you here. If you want something, go work for it like everyone else!"; next; mes "[Phelix]"; mes "On the other hand, if you want, you can bring me 10 jellopies and I'll give you a red potion. If you don't think you can manage 10, I'll give you a sweet potato for 3 jellopies."; next; mes "[Phelix]"; mes "If you're interested in my offer, drop by later."; set Event_Jellopy,1; close; EVENTJELLOPY: mes "[Phelix]"; mes "So, what will it be? Red potion or sweet potato?"; next; menu "Red Potion, please.",CONV1, "Sweet Potato, please.",CONV2; "Nothing, actually.",CLOSEOUT1; CONV1: mes "[Phelix]"; mes "Alright, let's see what you brought me."; next; mes "[Phelix]"; if(countitem(909) < 10) goto DENYJELLOPYRED; set T_ITEM0,909; set T_ITEM1,501; mes "Hohoho... Well done. How many potions are you looking for?"; next; set T_ITEM2,0; menu "As many as I can!",REDLOOP,"(Tell him how many)",REDNUM,"I changed my mind.",CLOSEOUT1; REDLOOP: if(countitem(909) < 10) goto REDLOOPB; goto REDLOOPA; REDLOOPA: delitem 909,10; set T_ITEM2,T_ITEM2 + 1; goto REDLOOP; REDLOOPB: if(T_ITEM2 == 0) goto REDLOOPFAILED; getitem T_ITEM1,T_ITEM2; goto REDRECEIVED; REDNUM: mes "(Enter a number no greater than 100. Enter 0 to cancel.)"; next; REDNUMREPEAT: input; mes "[Phelix]"; if(Script_flag_num <= 0) goto CLOSEOUT2; if(Script_flag_num > 100) goto REDNUMEXCEED; if(countitem(909) < Script_flag_num * 10) goto REDLOOPFAILED; delitem 909,Script_flag_num * 10; getitem 501,Script_flag_num; goto REDRECEIVED; REDLOOPFAILED: mes "You have big plans for my potions, eh? You can't afford what you asked for, sorry."; close; REDNUMEXCEED: mes "Sorry, I can't give you more than 100 at a time. Try again."; next; goto REDNUMREPEAT; REDRECEIVED: mes "Here are your potions! I hope they're useful to you."; close; DENYJELLOPYRED: mes "Hey, 10 jellopies for 1 red potion, remember? Sheesh."; close; CONV2: mes "[Phelix]"; mes "Alright, let's see what you brought me."; next; mes "[Phelix]"; if(countitem(909) < 3) goto DENYJELLOPYSWEET; set T_ITEM0,909; set T_ITEM1,516; mes "Hohoho... Well done. How many potatoes are you looking for?"; next; set T_ITEM2,0; menu "As many as I can!",SWEETLOOP,"(Tell him how many)",SWEETNUM,"I changed my mind.",CLOSEOUT1; SWEETLOOP: if(countitem(909) < 3) goto SWEETLOOPB; goto SWEETLOOPA; SWEETLOOPA: delitem T_ITEM0,3; set T_ITEM2,T_ITEM2 + 1; goto SWEETLOOP; SWEETLOOPB: if(T_ITEM1 == 0) goto SWEETLOOPFAILED; getitem T_ITEM1,T_ITEM2; goto SWEETRECEIVED; SWEETNUM: mes "(Enter a number no greater than 100. Enter 0 to cancel.)"; next; SWEETNUMREPEAT: input; mes "[Phelix]"; if(Script_flag_num <= 0) goto CLOSEOUT2; if(Script_flag_num > 100) goto SWEETEXCEED; if(countitem(909) < Script_flag_num * 3) goto SWEETLOOPFAILED; delitem 909,Script_flag_num * 3; getitem 516,Script_flag_num; goto SWEETRECEIVED; SWEETLOOPFAILED: mes "Sorry, potatoes are cheap, but they're not free. You can't afford what you asked for."; close; SWEETEXCEED: mes "Sorry, I can't give you more than 100 at a time. Try again."; next; goto SWEETNUMREPEAT; SWEETRECEIVED: mes "There you are, delicious sweet potatoes! I hope you enjoy them."; close; DENYJELLOPYSWEET: mes "Come on, do the math. 3 jellopies for 1 sweet potato. Sheesh!"; close; CLOSEOUT1: mes "[Phelix]"; mes "Ah, I see. See you later, then."; close; CLOSEOUT2: mes "Changed your mind, I see. Come again, okay?"; close; }