summaryrefslogtreecommitdiff
path: root/npc/functions/resetstatus.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-08-26 21:43:51 -0300
committerJesusaves <cpntb1@ymail.com>2019-08-26 21:43:51 -0300
commit0ef56764dc2796cb43e90f10c5eb380c9f94406a (patch)
tree154fde292c224859f9782fd1daae40bb37d544e9 /npc/functions/resetstatus.txt
parent6f622b30127710caf6b4dfcfb9aed5e17643013f (diff)
downloadserverdata-0ef56764dc2796cb43e90f10c5eb380c9f94406a.tar.gz
serverdata-0ef56764dc2796cb43e90f10c5eb380c9f94406a.tar.bz2
serverdata-0ef56764dc2796cb43e90f10c5eb380c9f94406a.tar.xz
serverdata-0ef56764dc2796cb43e90f10c5eb380c9f94406a.zip
Implement Status Fruits
Diffstat (limited to 'npc/functions/resetstatus.txt')
-rw-r--r--npc/functions/resetstatus.txt43
1 files changed, 40 insertions, 3 deletions
diff --git a/npc/functions/resetstatus.txt b/npc/functions/resetstatus.txt
index c9744d901..4d7d9e09a 100644
--- a/npc/functions/resetstatus.txt
+++ b/npc/functions/resetstatus.txt
@@ -5,6 +5,41 @@
// Description:
// Status Reset NPC utils
+// Reset status and return permanent bonuses
+// StatusResetReinvest( - )
+function script StatusResetReinvest {
+ // Compulsory check
+ inventoryplace NPCEyes, 6;
+
+ // Permanent boosts were now lost, return the fruits
+ if (STATUSUP_STR) {
+ getitem StrengthFruit, STATUSUP_STR;
+ STATUSUP_STR=0;
+ }
+ if (STATUSUP_AGI) {
+ getitem AgilityFruit, STATUSUP_AGI;
+ STATUSUP_AGI=0;
+ }
+ if (STATUSUP_VIT) {
+ getitem VitalityFruit, STATUSUP_VIT;
+ STATUSUP_VIT=0;
+ }
+ if (STATUSUP_INT) {
+ getitem IntelligenceFruit, STATUSUP_INT;
+ STATUSUP_INT=0;
+ }
+ if (STATUSUP_DEX) {
+ getitem DexterityFruit, STATUSUP_DEX;
+ STATUSUP_DEX=0;
+ }
+ if (STATUSUP_LUK) {
+ getitem LuckFruit, STATUSUP_LUK;
+ STATUSUP_LUK=0;
+ }
+ resetstatus();
+ return true;
+}
+
// Return wasSP on success, 0 on failure
// ConfirmReset( {price} )
function script ConfirmStatusReset {
@@ -16,6 +51,8 @@ function script ConfirmStatusReset {
if (getarg(0,-1) >= 0)
.@plush_count=getarg(0,-1);
+ mesc l("WARNING: Permanent boosts will return to their fruit form."), 1;
+
switch (select(lg("Yes, I am sure."),
lg("I need to think about it..."),
lg("I won't need it, thank you.")))
@@ -38,10 +75,10 @@ function script ConfirmStatusReset {
l("Thank you."),
l("Now stand still... It should not take much time...");
- // Delete the GP and THEN reset the status
- Zeny-=.@plush_count;
+ // Reset status have an inventorycheck, so we charge later.
.@wasSP = StatusPoint;
- resetstatus();
+ StatusResetReinvest();
+ Zeny-=.@plush_count;
if (StatusPoint == .@wasSP) {
speech S_LAST_NEXT,
l("It seems that you have no status points to reset!"),