From 9e0741ad32ec71fb66a04f90d3d2818972bd45ee Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 17 Dec 2018 04:55:50 -0200 Subject: Partial Rewrite (Tolchi). Start fixing Arrows prices. --- npc/005-4/tolchi.txt | 103 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 40 deletions(-) (limited to 'npc/005-4/tolchi.txt') diff --git a/npc/005-4/tolchi.txt b/npc/005-4/tolchi.txt index c7114b95e..39ef66ab1 100644 --- a/npc/005-4/tolchi.txt +++ b/npc/005-4/tolchi.txt @@ -7,29 +7,27 @@ // Description: // Tolchi crafts weapons at Rosen & Tolchi shop // Values: -// 0 Default. -// 1 BlackSmith quest ask for 1 iron oore -// 2 BlackSmith quest ask for 3 coal -// 3 BlackSmith quest ask for 1 iron ingot -// 4 Quest is Complete +// 0 BlackSmith quest ask for 1 iron oore +// 1 BlackSmith quest ask for 3 coal +// 2 BlackSmith quest ask for 1 iron ingot +// 3 Quest is Complete 005-4,42,37,0 script Tolchi NPC_RAIJIN_FEMALE_LEGION_ARTIS,{ - .Item1 = IronOre; - .Item2 = Coal; - .Item3 = IronIngot; - function quest_close { - speech S_FIRST_BLANK_LINE, - l("Maybe next time, then."); + if (@q < 3) { + mesn; + mesq l("Maybe next time, then."); + next; + } close2; goodbye; } function quest_giveitem { - .@tolchi = getq(CandorQuest_Tolchi); - if (.@tolchi == 2) + @q = getq(CandorQuest_Tolchi); + if (@q == 2) { if (countitem("Iron Ingot") == 0) { @@ -45,7 +43,7 @@ speech S_FIRST_BLANK_LINE, l("Thanks mate, that is everything I need! Have a good day!"); } - if (.@tolchi == 1) + if (@q == 1) { if (countitem("Coal") <= 2) { @@ -59,7 +57,7 @@ getexp 105,0; setq CandorQuest_Tolchi, 2; } - if (.@tolchi == 0) + if (@q == 0) { if (countitem("Iron Ore") == 0) { @@ -145,47 +143,67 @@ } while (@menu != 2); } - .@tolchi = getq(CandorQuest_Tolchi); - - if (BaseLevel < 5 || BaseLevel < 10 && .@tolchi == 1 || BaseLevel < 15 && .@tolchi == 2) - { - speech 0x0, - l("I need help, but you aren't strong enough. Please come back later."); - close2; - goodbye; + function tolchi_arrows { + // Price: 120~200, with 25 GP discount per task done (max. 3 tasks atm) + .@price=min(120, 200-(@q*25)); + mesn; + mesq l("Well, I can sell you a random box with almost 100 @@ for just @@ GP.", getitemlink(TolchiArrow), .@price); + next; + if (Zeny < .@price || askyesno() == ASK_NO) { + close2; + goodbye; + } else { + mes ""; + inventoryplace TolchiArrow, 110; + Zeny=Zeny-.@price; + getitem TolchiArrow, rand(96,102); + mesn; + mesq l("Here you go. Uhm, I really prefer if you buy with Rosen, though."); // I just don't want to add loops or inputs + close; + } + close; } - if (.@tolchi == 3) - { - speech 0x0, - l("Hey! How are you today? Thanks again for your help."); - close2; - goodbye; + ///////////////////////////////////////////////////////////////////////////// + @q = getq(CandorQuest_Tolchi); + + if (@q == 3) { + mesn; + mesq l("Hey! How are you today? Thanks again for your help."); + } else if (BaseLevel < 5 || BaseLevel < 10 && @q == 1 || BaseLevel < 15 && @q == 2) { + mesn; + mesq l("I need help, but you aren't strong enough. Please come back later."); + next; + } else { + mesn; + mesq l("Hello! You seem strong enough, could take a request from me? Of course, not for free."); + next; } - speech S_LAST_NEXT, - l("Hello! You seem strong enough, could take a request from me? Of course, not for free."); - do { select - rif(.@tolchi == 0, l("Yes.")), - rif(.@tolchi == 1, l("Yes.")), - rif(.@tolchi == 2, l("Yes.")), - l("No."); - + l("I'm interested in your arrows, they're too expensive with Rosen."), + rif(@q == 0 && BaseLevel >= 5, l("Yes. What do you need help with?")), + rif(@q == 1 && BaseLevel >= 10, l("Yes. What do you need help with?")), + rif(@q == 2 && BaseLevel >= 15, l("Yes. What do you need help with?")), + l("I have other things to do at the moment."); + mes ""; switch (@menu) { case 1: - quest_first; + tolchi_arrows; break; case 2: - quest_second; + quest_first; break; case 3: - quest_third; + quest_second; break; case 4: + quest_third; + break; + default: quest_close; goodbye; break; @@ -228,4 +246,9 @@ OnInit: initialmove; initnpctimer; .distance = 5; + + // I don't really like this system but oh well + .Item1 = IronOre; + .Item2 = Coal; + .Item3 = IronIngot; } -- cgit v1.2.3-60-g2f50