diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-06-07 11:47:09 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-06-07 11:47:09 -0300 |
commit | 645955dc68ba01f89d31ee2b40d60074700b883c (patch) | |
tree | 7c1fdb36ef250ba257733750f8f39083d0fd21b3 /npc/024-16/craftsman.txt | |
parent | ea77d8d37a7f389c31da632f6301ad96356918d8 (diff) | |
download | serverdata-645955dc68ba01f89d31ee2b40d60074700b883c.tar.gz serverdata-645955dc68ba01f89d31ee2b40d60074700b883c.tar.bz2 serverdata-645955dc68ba01f89d31ee2b40d60074700b883c.tar.xz serverdata-645955dc68ba01f89d31ee2b40d60074700b883c.zip |
It's officially possible to craft now
Diffstat (limited to 'npc/024-16/craftsman.txt')
-rw-r--r-- | npc/024-16/craftsman.txt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/npc/024-16/craftsman.txt b/npc/024-16/craftsman.txt index 3f8ba548a..d3e14ab81 100644 --- a/npc/024-16/craftsman.txt +++ b/npc/024-16/craftsman.txt @@ -7,6 +7,7 @@ 024-16,27,42,0 script Dwarf Craftsmaster NPC_DWARF_CRAFTMASTER,{ function calcRequisites; function calcPrices; + function calcUpgrade; if (.@q < 13) { hello; end; @@ -26,8 +27,25 @@ mesc l("Money: @@ GP", format_number(Zeny)), 3; mes ""; select + rif(!CRAFTING_SCORE, l("How can I complete a craft?")), rif(calcRequisites(), l("Learn crafting for @@ GP", format_number(calcPrices())) ), l("Nothing for now, thanks."); + mes ""; + switch (@menu) { + case 1: + mesn; + mesq l("I dunno."); + break; + case 2: + if (calcUpgrade()) { + mesn; + mesq l("There you go. Craft hard, mwhahahahaha!"); + } else { + mesn; + mesq l("You don't have met all requisites, like money and successful crafts."); + } + break; + } close; // Calc successful crafts required to learn crafting @@ -74,6 +92,21 @@ function calcPrices { return false; } +// calcUpgrade() returns true if skill +// can be leveled up. And levels it up. +function calcUpgrade { + .@gp=calcPrices(); + .@cf=calcRequisites(); + if (Zeny < .@gp) + return false; + if (CRAFTING_SCORE < .@cf) + return false; + + Zeny-=.@gp; + skill TMW2_CRAFT, getskilllv(TMW2_CRAFT)+1, 0; + return true; +} + OnInit: .distance=5; end; |