From 3d25518cf10f72d280ed9c6bf79956919a484d02 Mon Sep 17 00:00:00 2001
From: Jesusaves <cpntb1@ymail.com>
Date: Tue, 2 Jun 2020 20:13:08 -0300
Subject: Prevent a few false-positives on status reset

---
 npc/001-11/Soren.txt          |  2 +-
 npc/005-6/zitoni.txt          |  4 ++--
 npc/functions/resetstatus.txt | 12 +++++++++---
 3 files changed, 12 insertions(+), 6 deletions(-)

(limited to 'npc')

diff --git a/npc/001-11/Soren.txt b/npc/001-11/Soren.txt
index c4f393131..c840d92c5 100644
--- a/npc/001-11/Soren.txt
+++ b/npc/001-11/Soren.txt
@@ -48,7 +48,7 @@ L_Purpose:
     mes "";
     switch (@menu) {
         case 2:
-            ConfirmStatusReset(1);
+            ConfirmStatusReset(1, false);
             break;
         case 3:
             goto L_Swap;
diff --git a/npc/005-6/zitoni.txt b/npc/005-6/zitoni.txt
index 35b51f225..9d232f3d7 100644
--- a/npc/005-6/zitoni.txt
+++ b/npc/005-6/zitoni.txt
@@ -85,9 +85,9 @@ L_ResetStats:
 
 L_ConfirmReset:
     if (BaseLevel <= 10)
-        ConfirmStatusReset(0);
+        ConfirmStatusReset(0, false);
     else
-        ConfirmStatusReset();
+        ConfirmStatusReset(-1, false);
     goto L_Quit;
 
 L_OtherPotion:
diff --git a/npc/functions/resetstatus.txt b/npc/functions/resetstatus.txt
index eb5d0cfc5..fca8a43a8 100644
--- a/npc/functions/resetstatus.txt
+++ b/npc/functions/resetstatus.txt
@@ -47,7 +47,7 @@ function	script	StatusResetReinvest	{
 }
 
 // Return wasSP on success, 0 on failure
-// ConfirmReset( {price} )
+// ConfirmReset( {price, town=True} )
 function	script	ConfirmStatusReset	{
     if (BaseLevel >= 15)
         .@plush_count=(1000-BaseLevel*10+(BaseLevel*18));
@@ -59,7 +59,10 @@ function	script	ConfirmStatusReset	{
     if (getarg(0,-1) >= 0)
         .@plush_count=getarg(0,-1);
 
-	.@plush_count=POL_AdjustPrice(.@plush_count);
+    if (getarg(1, true))
+    	.@plush_count=POL_AdjustPrice(.@plush_count);
+    else
+    	.@plush_count=.@plush_count;
 
     mesc l("WARNING: Permanent boosts will return to their fruit form."), 1;
 
@@ -95,7 +98,10 @@ function	script	ConfirmStatusReset	{
                     l("It seems that you have no status points to reset!"),
                     l("Come back when you will really need me.");
             } else {
-				POL_PlayerMoney(.@plush_count);
+                if (getarg(1, true))
+    				POL_PlayerMoney(.@plush_count);
+                else
+                    Zeny-=.@plush_count;
                 speech S_LAST_NEXT,
                     l("Let's see... @@ of your status points have just been reset!", StatusPoint - .@wasSP),
                     l("Spend it wisely this time."),
-- 
cgit v1.2.3-70-g09d2