summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-02 03:38:24 +0000
committerParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-02 03:38:24 +0000
commit1e87d8276dd8a5535b311299d5666430b61898c4 (patch)
treeeecc6e0f127360dd09cc116e24578aed4a6157c7 /src
parente82b308d7ac09cbcaf178654d7005aa15e2ca5d5 (diff)
downloadhercules-1e87d8276dd8a5535b311299d5666430b61898c4.tar.gz
hercules-1e87d8276dd8a5535b311299d5666430b61898c4.tar.bz2
hercules-1e87d8276dd8a5535b311299d5666430b61898c4.tar.xz
hercules-1e87d8276dd8a5535b311299d5666430b61898c4.zip
Changed Normal and Cash Food statuses so they do not stack and overwrite the other if the level (val1) is the same or higher. (bugreport:4519)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14437 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/status.c96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 91e742323..b8767fde0 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -4913,6 +4913,54 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
if( bl->type != BL_MER )
return 0; // Stats only for Mercenaries
break;
+ case SC_STRFOOD:
+ if (sc->data[SC_FOOD_STR_CASH] && sc->data[SC_FOOD_STR_CASH]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
+ case SC_AGIFOOD:
+ if (sc->data[SC_FOOD_AGI_CASH] && sc->data[SC_FOOD_AGI_CASH]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
+ case SC_VITFOOD:
+ if (sc->data[SC_FOOD_VIT_CASH] && sc->data[SC_FOOD_VIT_CASH]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
+ case SC_INTFOOD:
+ if (sc->data[SC_FOOD_INT_CASH] && sc->data[SC_FOOD_INT_CASH]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
+ case SC_DEXFOOD:
+ if (sc->data[SC_FOOD_DEX_CASH] && sc->data[SC_FOOD_DEX_CASH]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
+ case SC_LUKFOOD:
+ if (sc->data[SC_FOOD_LUK_CASH] && sc->data[SC_FOOD_LUK_CASH]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
+ case SC_FOOD_STR_CASH:
+ if (sc->data[SC_STRFOOD] && sc->data[SC_STRFOOD]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
+ case SC_FOOD_AGI_CASH:
+ if (sc->data[SC_AGIFOOD] && sc->data[SC_AGIFOOD]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
+ case SC_FOOD_VIT_CASH:
+ if (sc->data[SC_VITFOOD] && sc->data[SC_VITFOOD]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
+ case SC_FOOD_INT_CASH:
+ if (sc->data[SC_INTFOOD] && sc->data[SC_INTFOOD]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
+ case SC_FOOD_DEX_CASH:
+ if (sc->data[SC_DEXFOOD] && sc->data[SC_DEXFOOD]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
+ case SC_FOOD_LUK_CASH:
+ if (sc->data[SC_LUKFOOD] && sc->data[SC_LUKFOOD]->val1 > sc->data[type]->val1)
+ return 0;
+ break;
}
//Check for BOSS resistances
@@ -5034,6 +5082,54 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
status_change_end(bl,SC_BLESSING,-1);
status_change_end(bl,SC_INCREASEAGI,-1);
break;
+ case SC_STRFOOD:
+ if (sc->data[SC_FOOD_STR_CASH] && sc->data[SC_FOOD_STR_CASH]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_FOOD_STR_CASH,-1);
+ break;
+ case SC_AGIFOOD:
+ if (sc->data[SC_FOOD_AGI_CASH] && sc->data[SC_FOOD_AGI_CASH]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_FOOD_AGI_CASH,-1);
+ break;
+ case SC_VITFOOD:
+ if (sc->data[SC_FOOD_VIT_CASH] && sc->data[SC_FOOD_VIT_CASH]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_FOOD_VIT_CASH,-1);
+ break;
+ case SC_INTFOOD:
+ if (sc->data[SC_FOOD_INT_CASH] && sc->data[SC_FOOD_INT_CASH]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_FOOD_INT_CASH,-1);
+ break;
+ case SC_DEXFOOD:
+ if (sc->data[SC_FOOD_DEX_CASH] && sc->data[SC_FOOD_DEX_CASH]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_FOOD_DEX_CASH,-1);
+ break;
+ case SC_LUKFOOD:
+ if (sc->data[SC_FOOD_LUK_CASH] && sc->data[SC_FOOD_LUK_CASH]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_FOOD_LUK_CASH,-1);
+ break;
+ case SC_FOOD_STR_CASH:
+ if (sc->data[SC_STRFOOD] && sc->data[SC_STRFOOD]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_STRFOOD,-1);
+ break;
+ case SC_FOOD_AGI_CASH:
+ if (sc->data[SC_AGIFOOD] && sc->data[SC_AGIFOOD]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_AGIFOOD,-1);
+ break;
+ case SC_FOOD_VIT_CASH:
+ if (sc->data[SC_VITFOOD] && sc->data[SC_VITFOOD]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_VITFOOD,-1);
+ break;
+ case SC_FOOD_INT_CASH:
+ if (sc->data[SC_INTFOOD] && sc->data[SC_INTFOOD]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_INTFOOD,-1);
+ break;
+ case SC_FOOD_DEX_CASH:
+ if (sc->data[SC_DEXFOOD] && sc->data[SC_DEXFOOD]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_DEXFOOD,-1);
+ break;
+ case SC_FOOD_LUK_CASH:
+ if (sc->data[SC_LUKFOOD] && sc->data[SC_LUKFOOD]->val1 <= sc->data[type]->val1)
+ status_change_end(bl,SC_LUKFOOD,-1);
+ break;
}
//Check for overlapping fails