diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-01-25 14:23:01 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-01-25 14:23:01 -0300 |
commit | 904c2f1449661a7cd08f1f4d6d2457d3daa198c0 (patch) | |
tree | b0a366e1822c0deb465ffb721758f0dade5a4a28 /npc | |
parent | ecac046002bd922086ff693f8e2ad9115f89ec85 (diff) | |
download | serverdata-904c2f1449661a7cd08f1f4d6d2457d3daa198c0.tar.gz serverdata-904c2f1449661a7cd08f1f4d6d2457d3daa198c0.tar.bz2 serverdata-904c2f1449661a7cd08f1f4d6d2457d3daa198c0.tar.xz serverdata-904c2f1449661a7cd08f1f4d6d2457d3daa198c0.zip |
Rewrite Tolchi script for better clarity
Diffstat (limited to 'npc')
-rw-r--r-- | npc/005-4/tolchi.txt | 317 |
1 files changed, 163 insertions, 154 deletions
diff --git a/npc/005-4/tolchi.txt b/npc/005-4/tolchi.txt index cdcf65cc2..be168a1dc 100644 --- a/npc/005-4/tolchi.txt +++ b/npc/005-4/tolchi.txt @@ -14,155 +14,12 @@ 005-4,42,37,0 script Tolchi NPC_RAIJIN_FEMALE_LEGION_ARTIS,{ - - function quest_close { - if (@q < 3) { - mesn; - mesq l("Maybe next time, then."); - next; - } - close2; - goodbye; - } - - function quest_giveitem { - @q = getq(CandorQuest_Tolchi); - if (@q == 2) - { - if (countitem("Iron Ingot") == 0) - { - speech S_FIRST_BLANK_LINE, - l("You don't have the Iron Ingot."); - close2; - goodbye; - } - delitem .Item3, 1; - Zeny = Zeny + 8000; // Real worth: 2820 GP + 2400 (ship fee) = 5220 gp poll (the plus is net profit) - getexp 1575,0; - setq CandorQuest_Tolchi, 3; - speech S_FIRST_BLANK_LINE, - l("Thanks mate, that is everything I need! Have a good day!"); - } - if (@q == 1) - { - if (countitem("Coal") <= 2) - { - speech S_FIRST_BLANK_LINE, - l("You don't have the three Coal lumps."); - close2; - goodbye; - } - delitem .Item2, 3; - Zeny = Zeny + 825; - getexp 105,0; - setq CandorQuest_Tolchi, 2; - } - if (@q == 0) - { - if (countitem("Iron Ore") == 0) - { - speech S_FIRST_BLANK_LINE, - l("You don't have the Iron Ore."); - close2; - goodbye; - } - delitem .Item1, 1; - Zeny = Zeny + 225; - getexp 52,0; - setq CandorQuest_Tolchi, 1; - } - close; - } - - function quest_first { - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Well, it is terrible! How can I make armours if I ran out of Iron? Shall the citizens of Candor Island perish in a monster attack?!"), // NOTE: I really prefer EN_US (eg. armor vs armour) - l("They shouldn't. Could you perhaps, kindly bring me 1 @@?", getitemlink(.Item1)); - do - { - //l("Do not worry, I'll seek and bring it to you."), - select - l("Do not worry, I have them right here."), - l("I am not a citizen of Candor."); - - switch (@menu) - { - case 1: - quest_giveitem; - break; - case 2: - quest_close; - break; - } - } while (@menu != 2); - } - - function quest_second { - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Thanks for helping my shop earlier. I forge weapons, but unfortunately, I need more than just iron to forge them."), - l("Can you bring me 3 @@? Of course, you'll be rewarded.", getitemlink(.Item2)); - do - { - // l("Hey, I like rewards. Wait me, I'll be back!"), - select - l("You better have it ready, because I have the Coal with me!"), - l("Eh, that seems too problematic. Sorry."); - - switch (@menu) - { - case 1: - quest_giveitem; - break; - case 2: - quest_close; - break; - } - } while (@menu != 2); - } - - function quest_third { - speech S_FIRST_BLANK_LINE | S_LAST_NEXT, - l("Ok, this will be my last request. The Trainer asked me for a fine weapon, to protect our village."), - l("Problem is, I do not have the knowledge to make it without @@. If you bring me one, I'll reward you with one quarter of my commission.", getitemlink(.Item3)); - do - { - // l("Do not worry, I'll be back in a jiffy."), - select - l("No problem is too big for me. I have them right here!"), - l("Sorry, I am busy..."); - - switch (@menu) - { - case 1: - quest_giveitem; - break; - case 2: - quest_close; - break; - } - } while (@menu != 2); - } - - function tolchi_arrows { - // Price: 120~200, with 25 GP discount per task done (max. 3 tasks atm) - .@price=max(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; - } + function quest_close; + function quest_giveitem; + function quest_first; + function quest_second; + function quest_third; + function tolchi_arrows; ///////////////////////////////////////////////////////////////////////////// @q = getq(CandorQuest_Tolchi); @@ -187,6 +44,7 @@ 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("Do you accept special requests?"), l("I have other things to do at the moment."); mes ""; switch (@menu) @@ -214,6 +72,161 @@ goodbye; close; +// Close and talk about quest +function quest_close { + if (@q < 3) { + mesn; + mesq l("Maybe next time, then."); + next; + } + close2; + goodbye; +} + +// Item delivery core +function quest_giveitem { +@q = getq(CandorQuest_Tolchi); + if (@q == 2) + { + if (countitem("Iron Ingot") == 0) + { + speech S_FIRST_BLANK_LINE, + l("You don't have the Iron Ingot."); + close2; + goodbye; + } + delitem IronIngot, 1; + Zeny = Zeny + 8000; // Real worth: 2820 GP + 2400 (ship fee) = 5220 gp poll (the plus is net profit) + getexp 1575,0; + setq CandorQuest_Tolchi, 3; + speech S_FIRST_BLANK_LINE, + l("Thanks mate, that is everything I need! Have a good day!"); + } + if (@q == 1) + { + if (countitem("Coal") <= 2) + { + speech S_FIRST_BLANK_LINE, + l("You don't have the three Coal lumps."); + close2; + goodbye; + } + delitem Coal, 3; + Zeny = Zeny + 825; + getexp 105,0; + setq CandorQuest_Tolchi, 2; + } + if (@q == 0) + { + if (countitem("Iron Ore") == 0) + { + speech S_FIRST_BLANK_LINE, + l("You don't have the Iron Ore."); + close2; + goodbye; + } + delitem IronOre, 1; + Zeny = Zeny + 225; + getexp 52,0; + setq CandorQuest_Tolchi, 1; + } + close; +} + +// First quest description +function quest_first { + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Well, it is terrible! How can I make armours if I ran out of Iron? Shall the citizens of Candor Island perish in a monster attack?!"), // NOTE: I really prefer EN_US (eg. armor vs armour) + l("They shouldn't. Could you perhaps, kindly bring me 1 @@?", getitemlink(IronOre)); + do + { + //l("Do not worry, I'll seek and bring it to you."), + select + l("Do not worry, I have them right here."), + l("I am not a citizen of Candor."); + + switch (@menu) + { + case 1: + quest_giveitem; + break; + case 2: + quest_close; + break; + } + } while (@menu != 2); +} + +// Second quest description +function quest_second { + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Thanks for helping my shop earlier. I forge weapons, but unfortunately, I need more than just iron to forge them."), + l("Can you bring me 3 @@? Of course, you'll be rewarded.", getitemlink(Coal)); + do + { + // l("Hey, I like rewards. Wait me, I'll be back!"), + select + l("You better have it ready, because I have the Coal with me!"), + l("Eh, that seems too problematic. Sorry."); + + switch (@menu) + { + case 1: + quest_giveitem; + break; + case 2: + quest_close; + break; + } + } while (@menu != 2); +} + +// Third quest description +function quest_third { + speech S_FIRST_BLANK_LINE | S_LAST_NEXT, + l("Ok, this will be my last request. The Trainer asked me for a fine weapon, to protect our village."), + l("Problem is, I do not have the knowledge to make it without @@. If you bring me one, I'll reward you with one quarter of my commission.", getitemlink(IronIngot)); + do + { + // l("Do not worry, I'll be back in a jiffy."), + select + l("No problem is too big for me. I have them right here!"), + l("Sorry, I am busy..."); + + switch (@menu) + { + case 1: + quest_giveitem; + break; + case 2: + quest_close; + break; + } + } while (@menu != 2); +} + +// Make Tolchi Arrows (not cost-effective) +function tolchi_arrows { + // Price: 120~200, with 25 GP discount per task done (max. 3 tasks atm) + .@price=max(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, rand2(102,106); + 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; +} + OnTimer1000: domovestep; @@ -246,9 +259,5 @@ OnInit: initialmove; initnpctimer; .distance = 5; - - // I don't really like this system but oh well - .Item1 = IronOre; - .Item2 = Coal; - .Item3 = IronIngot; + end; } |