From f6531ec393f2de67142d357ddf58d3aa634962ef Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 7 Jun 2019 11:48:30 -0300 Subject: Prevent bugs of skill going above max level. --- npc/024-16/craftsman.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/npc/024-16/craftsman.txt b/npc/024-16/craftsman.txt index d3e14ab81..477ce4069 100644 --- a/npc/024-16/craftsman.txt +++ b/npc/024-16/craftsman.txt @@ -28,7 +28,7 @@ mes ""; select rif(!CRAFTING_SCORE, l("How can I complete a craft?")), - rif(calcRequisites(), l("Learn crafting for @@ GP", format_number(calcPrices())) ), + rif(CRAFTING_SCORE >= calcRequisites(), l("Learn crafting for @@ GP", format_number(calcPrices())) ), l("Nothing for now, thanks."); mes ""; switch (@menu) { @@ -42,7 +42,7 @@ mesq l("There you go. Craft hard, mwhahahahaha!"); } else { mesn; - mesq l("You don't have met all requisites, like money and successful crafts."); + mesq l("You don't have met all requisites, like money and successful crafts, or you already reached the maximum level for this skill."); } break; } @@ -67,7 +67,7 @@ function calcRequisites { case 6: return 32; } - return false; + return -1; } // Calc how much GP the skill will cost you @@ -101,6 +101,8 @@ function calcUpgrade { return false; if (CRAFTING_SCORE < .@cf) return false; + if (.@cf < 0) + return false; Zeny-=.@gp; skill TMW2_CRAFT, getskilllv(TMW2_CRAFT)+1, 0; -- cgit v1.2.3-60-g2f50