summaryrefslogtreecommitdiff
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
parent6f622b30127710caf6b4dfcfb9aed5e17643013f (diff)
downloadserverdata-0ef56764dc2796cb43e90f10c5eb380c9f94406a.tar.gz
serverdata-0ef56764dc2796cb43e90f10c5eb380c9f94406a.tar.bz2
serverdata-0ef56764dc2796cb43e90f10c5eb380c9f94406a.tar.xz
serverdata-0ef56764dc2796cb43e90f10c5eb380c9f94406a.zip
Implement Status Fruits
-rw-r--r--db/re/item_db.conf85
-rw-r--r--npc/functions/resetstatus.txt43
2 files changed, 125 insertions, 3 deletions
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index b99dd358e..953e2c0b5 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -14699,6 +14699,91 @@ item_db: (
getitem MercBoxA, 1;
">
},
+// Additional usable items
+{
+ Id: 8000
+ AegisName: "StrengthFruit"
+ Name: "Strength Fruit"
+ Type: "IT_USABLE"
+ Buy: 500000
+ Sell: 1500
+ Weight: 10
+ Delay: 500
+ Script: <"
+ statusup2(bStr, 1);
+ STATUSUP_STR+=1;
+ ">
+},
+{
+ Id: 8001
+ AegisName: "AgilityFruit"
+ Name: "Agility Fruit"
+ Type: "IT_USABLE"
+ Buy: 500000
+ Sell: 1500
+ Weight: 10
+ Delay: 500
+ Script: <"
+ statusup2(bAgi, 1);
+ STATUSUP_AGI+=1;
+ ">
+},
+{
+ Id: 8002
+ AegisName: "VitalityFruit"
+ Name: "Vitality Fruit"
+ Type: "IT_USABLE"
+ Buy: 500000
+ Sell: 1500
+ Weight: 10
+ Delay: 500
+ Script: <"
+ statusup2(bVit, 1);
+ STATUSUP_VIT+=1;
+ ">
+},
+{
+ Id: 8003
+ AegisName: "IntelligenceFruit"
+ Name: "Intelligence Fruit"
+ Type: "IT_USABLE"
+ Buy: 500000
+ Sell: 1500
+ Weight: 10
+ Delay: 500
+ Script: <"
+ statusup2(bInt, 1);
+ STATUSUP_INT+=1;
+ ">
+},
+{
+ Id: 8004
+ AegisName: "DexterityFruit"
+ Name: "Dexterity Fruit"
+ Type: "IT_USABLE"
+ Buy: 500000
+ Sell: 1500
+ Weight: 10
+ Delay: 500
+ Script: <"
+ statusup2(bDex, 1);
+ STATUSUP_DEX+=1;
+ ">
+},
+{
+ Id: 8005
+ AegisName: "LuckFruit"
+ Name: "Luck Fruit"
+ Type: "IT_USABLE"
+ Buy: 500000
+ Sell: 1500
+ Weight: 10
+ Delay: 500
+ Script: <"
+ statusup2(bLuk, 1);
+ STATUSUP_LUK+=1;
+ ">
+},
)
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!"),