From 1eae638873c560d985e92d265ceb534365c6ec41 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 2 Jul 2023 23:23:59 -0300 Subject: Add a stat reset and fix a bug in party creation --- npc/006-2-1/lune.txt | 201 ------------------------------------------ npc/033-2/_import.txt | 1 + npc/033-2/lune.txt | 48 ++++++++++ npc/functions/main.txt | 4 +- npc/functions/resetstatus.txt | 15 +--- 5 files changed, 52 insertions(+), 217 deletions(-) delete mode 100644 npc/006-2-1/lune.txt create mode 100644 npc/033-2/lune.txt diff --git a/npc/006-2-1/lune.txt b/npc/006-2-1/lune.txt deleted file mode 100644 index 486ac01..0000000 --- a/npc/006-2-1/lune.txt +++ /dev/null @@ -1,201 +0,0 @@ -// TMW2 Script -// Author: -// Saulc -// Vasily_Makarov (original from Evol) -// Jesusalva -// seeds -// Description: -// Status Reset and Agility Potions - -006-2-1,34,66,0 script Lune NPC_PIOU_ALCHEMIST,{ - - speech S_LAST_NEXT, - l("I am %s, a piou alchemist specializing in reset and agility potions.", .name$); - -L_Menu: - .@plush_count = BaseLevel*210-(9*210); - // Lv 10: 210 GP - // Lv 90: 1.890 GP - if (BaseLevel > 10) - .@plush_count = .@plush_count/(BaseLevel/10); - - select - l("Can you reset my stats please?"), - l("Can you mix me an agility potion?"), - lg("I'm allergic to piou potions, goodbye."); - mes ""; - - switch (@menu) - { - case 1: - goto L_ResetStats; - case 2: - goto L_PotionList; - default: - goto L_Quit; - break; - } - close; - -L_ResetStats: - mesn; - mesq l("Status point reset can't be undone. Do you really want this?"); - -L_ConfirmReset: - ConfirmStatusReset(); - goto L_Quit; - -L_PotionList: - mes ""; - mesn; - mesq l("I can make three types of Agility Potions, which would you like?"); - next; - select - rif(BaseLevel > 20, l("I want an Agi Potion.")), - rif(BaseLevel > 30, l("I want an Agi+ Potion.")), - rif(BaseLevel > 40, l("I want an Agi++ Potion.")), - l("I changed my mind, goodbye."); - mes ""; - switch (@menu) { - case 1: - goto L_AgiPotionA; - break; - case 2: - goto L_AgiPotionB; - break; - case 3: - goto L_AgiPotionC; - break; - default: - goto L_Quit; - break; - } - close; - -L_AgiPotionA: - .@price=POL_AdjustPrice(1000); - mes ""; - mesn; - mesq l("To make an %s I need a %s, an %s, and %s GP for commission.", getitemlink(AgiPotionA), getitemlink(TopazPowder), getitemlink(HerbalTea), fnum(.@price)); - next; - select - l("I have the ingredients here."), - l("I'll come back later."), - l("I don't need anything after all, goodbye!"); - if (@menu == 2) - goto L_Menu; - - if (@menu == 3) - goto L_Quit; - - if ( - countitem(TopazPowder) && - countitem(HerbalTea) && - Zeny >= .@price) { - - inventoryplace AgiPotionA, 3; - delitem TopazPowder, 1; - delitem HerbalTea, 1; - POL_PlayerMoney(.@price); - getitem AgiPotionA, any(2,3); - getexp rand2(6,18), rand2(6,18); - - mesn; - mesq l("Here you go. Perhaps you need another one?"); - next; - goto L_PotionList; - } else { - mesn; - mesq l("Sorry, but I need the ingredients and %d GP.", .@price); - next; - } - goto L_Menu; - -L_AgiPotionB: - .@price=POL_AdjustPrice(1250); - mes ""; - mesn; - mesq l("To make an %s I need a %s, two %s, and %s GP for commission.", getitemlink(AgiPotionB), getitemlink(Topaz), getitemlink(HerbalTea), fnum(.@price)); - next; - select - l("I have the ingredients here."), - l("I'll come back later."), - l("I don't need anything after all, goodbye!"); - if (@menu == 2) - goto L_Menu; - - if (@menu == 3) - goto L_Quit; - - if ( - countitem(Topaz) && - countitem(HerbalTea) >= 2 && - Zeny >= .@price) { - - inventoryplace AgiPotionB, 3; - delitem Topaz, 1; - delitem HerbalTea, 2; - POL_PlayerMoney(.@price); - getitem AgiPotionB, any(2,3); - getexp rand2(6,18), rand2(6,18); - - mesn; - mesq l("Here you go. Perhaps you need another one?"); - next; - goto L_PotionList; - } else { - mesn; - mesq l("Sorry, but I need the ingredients and %d GP.", .@price); - next; - } - goto L_Menu; - -L_AgiPotionC: - .@price=POL_AdjustPrice(1500); - mes ""; - mesn; - mesq l("To make an %s I need a %s, three %s, and %s GP for commission.", getitemlink(AgiPotionC), getitemlink(PolishedTopaz), getitemlink(HerbalTea), fnum(.@price)); - next; - select - l("I have the ingredients here."), - l("I'll come back later."), - l("I don't need anything after all, goodbye!"); - if (@menu == 2) - goto L_Menu; - - if (@menu == 3) - goto L_Quit; - - if ( - countitem(PolishedTopaz) && - countitem(HerbalTea) >= 3 && - Zeny >= .@price) { - - inventoryplace AgiPotionC, 3; - delitem PolishedTopaz, 1; - delitem HerbalTea, 3; - POL_PlayerMoney(.@price); - getitem AgiPotionC, any(2,3); - getexp rand2(6,18), rand2(6,18); - - mesn; - mesq l("Here you go. Perhaps you need another one?"); - next; - goto L_PotionList; - } else { - mesn; - mesq l("Sorry, but I need the ingredients and %d GP.", .@price); - next; - } - goto L_Menu; - -L_Quit: - closeclientdialog; - goodbye; - close; - -OnInit: - .sex = G_OTHER; - .distance = 4; - end; -} diff --git a/npc/033-2/_import.txt b/npc/033-2/_import.txt index 7f4b3ac..7c11dc2 100644 --- a/npc/033-2/_import.txt +++ b/npc/033-2/_import.txt @@ -1,4 +1,5 @@ // Map 033-2: Building 1 // This file is generated automatically. All manually added changes will be removed when running the Converter. "npc/033-2/_warps.txt", +"npc/033-2/lune.txt", "npc/033-2/magic.txt", diff --git a/npc/033-2/lune.txt b/npc/033-2/lune.txt new file mode 100644 index 0000000..6668960 --- /dev/null +++ b/npc/033-2/lune.txt @@ -0,0 +1,48 @@ +// TMW2 Script +// Author: +// Saulc +// Vasily_Makarov (original from Evol) +// Jesusalva +// seeds +// Description: +// Status Reset + +033-2,26,24,0 script Lune NPC_PIOU_ALCHEMIST,{ + + speech S_LAST_NEXT, + l("I am %s, a piou alchemist specializing in reset and agility potions.", .name$); + +L_Menu: + select + l("Can you reset my stats please?"), + lg("I'm allergic to piou potions, goodbye."); + mes ""; + + switch (@menu) + { + case 1: + goto L_ResetStats; + default: + goto L_Quit; + break; + } + close; + +L_ResetStats: + mesn; + mesq l("Status point reset can't be undone. Do you really want this?"); + +L_ConfirmReset: + ConfirmStatusReset(); + goto L_Quit; + +L_Quit: + closeclientdialog; + goodbye; + close; + +OnInit: + .sex = G_OTHER; + .distance = 4; + end; +} diff --git a/npc/functions/main.txt b/npc/functions/main.txt index a099916..b2a7a78 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -81,8 +81,8 @@ function script col { } function script adddefaultskills { - if (getskilllv(NV_BASIC) < 6) { - skill NV_BASIC, 6, 0; + if (getskilllv(NV_BASIC) < 7) { + skill NV_BASIC, 7, 0; } if (getskilllv(TMW2_FAKESKILL) < 1) { skill TMW2_FAKESKILL, 1, 0; diff --git a/npc/functions/resetstatus.txt b/npc/functions/resetstatus.txt index c0a31e2..8b3ee1b 100644 --- a/npc/functions/resetstatus.txt +++ b/npc/functions/resetstatus.txt @@ -49,20 +49,7 @@ function script StatusResetReinvest { // Return wasSP on success, 0 on failure // ConfirmReset( {price, town=True} ) function script ConfirmStatusReset { - if (BaseLevel >= 15) - .@raw_price=(1000-BaseLevel*10+(BaseLevel*18)); - else if (BaseLevel >= 10) - .@raw_price=(BaseLevel*210-(10*210))/(BaseLevel/10); - else - .@raw_price=1; - - if (getarg(0,-1) >= 0) - .@raw_price=getarg(0,-1); - - if (getarg(1, true)) - .@raw_price=POL_AdjustPrice(.@raw_price); - else - .@raw_price=.@raw_price; + .@raw_price=1; mesc l("WARNING: Permanent boosts will return to their fruit form."), 1; -- cgit v1.2.3-60-g2f50