summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-21 17:12:52 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-21 17:12:52 +0000
commitb9b4409da9f557d7904af6439c41e6534639604a (patch)
treec21db4f38b329bac2ddec410977d6dac30c7669e /src/map/status.c
parentdbad79f525ce1b76933bc489743ae431f0d96da1 (diff)
downloadhercules-b9b4409da9f557d7904af6439c41e6534639604a.tar.gz
hercules-b9b4409da9f557d7904af6439c41e6534639604a.tar.bz2
hercules-b9b4409da9f557d7904af6439c41e6534639604a.tar.xz
hercules-b9b4409da9f557d7904af6439c41e6534639604a.zip
- Added status changes for netcafe premium items. Status Resist Potion and SP Reduction Potion.
* More Barricade stuff: - Changed the way "Dir" works. Now it's just like NPC dir definition (from 0 to 7). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12414 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/map/status.c b/src/map/status.c
index adcfc726d..7ba331591 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -507,6 +507,7 @@ void initChangeTables(void)
StatusChangeFlagTable[SC_MATKFOOD] |= SCB_MATK;
StatusChangeFlagTable[SC_ARMOR_ELEMENT] |= SCB_PC;
StatusChangeFlagTable[SC_ARMOR_RESIST] |= SCB_PC;
+ StatusChangeFlagTable[SC_SPCOST_RATE] |= SCB_PC;
if (!battle_config.display_hallucination) //Disable Hallucination.
StatusIconChangeTable[SC_HALLUCINATION] = SI_BLANK;
@@ -2289,6 +2290,9 @@ int status_calc_pc(struct map_session_data* sd,int first)
if(sc->data[SC_SERVICE4U])
sd->dsprate -= sc->data[SC_SERVICE4U]->val3;
+ if(sc->data[SC_SPCOST_RATE])
+ sd->dsprate -= sc->data[SC_SPCOST_RATE]->val1;
+
//Underflow protections.
if(sd->dsprate < 0)
sd->dsprate = 0;
@@ -4575,9 +4579,13 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti
rate -= rate*sc_def/100;
//Item resistance (only applies to rate%)
- if(sd && SC_COMMON_MIN<=type && type<=SC_COMMON_MAX
- && sd->reseff[type-SC_COMMON_MIN] > 0)
+ if(sd && SC_COMMON_MIN <= type && type <= SC_COMMON_MAX)
+ {
+ if( sd->reseff[type-SC_COMMON_MIN] > 0 )
rate -= rate*sd->reseff[type-SC_COMMON_MIN]/10000;
+ if( sd->sc.data[SC_COMMONSC_RESIST] )
+ rate -= rate*sd->sc.data[SC_COMMONSC_RESIST]->val1;
+ }
}
if (!(rand()%10000 < rate))
return 0;