summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZido <Zido@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-12 23:09:55 +0000
committerZido <Zido@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-12 23:09:55 +0000
commit67f9690315ec4d42f397a234ffe509fbf9d23ced (patch)
tree13dbe2dcf271be045885bc7c02803ec4a8342c2f /src
parent79870f8e41c5fa8d5475a355600c40113e37e2db (diff)
downloadhercules-67f9690315ec4d42f397a234ffe509fbf9d23ced.tar.gz
hercules-67f9690315ec4d42f397a234ffe509fbf9d23ced.tar.bz2
hercules-67f9690315ec4d42f397a234ffe509fbf9d23ced.tar.xz
hercules-67f9690315ec4d42f397a234ffe509fbf9d23ced.zip
- Added negative value in bonus exploit fix for more stat bonuses
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7648 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/pc.c66
1 files changed, 44 insertions, 22 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 53c953a2c..e08c4242a 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1266,16 +1266,24 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
sd->param_bonus[type-SP_STR]+=val;
break;
case SP_ATK1:
- if(!sd->state.lr_flag)
- status->rhw.atk+=val;
- else if(sd->state.lr_flag == 1)
- status->lhw->atk+=val;
+ if(!sd->state.lr_flag) {
+ if(!(val<0 && ((val-val-val)>status->rhw.atk)))
+ status->rhw.atk+=val;
+ }
+ else if(sd->state.lr_flag == 1) {
+ if(!(val<0 && ((val-val-val)>status->lhw.atk)))
+ status->lhw->atk+=val;
+ }
break;
case SP_ATK2:
- if(!sd->state.lr_flag)
- status->rhw.atk2+=val;
- else if(sd->state.lr_flag == 1)
- status->lhw->atk2+=val;
+ if(!sd->state.lr_flag) {
+ if(!(val<0 && ((val-val-val)>status->rhw.atk2)))
+ status->rhw.atk2+=val;
+ }
+ else if(sd->state.lr_flag == 1) {
+ if(!(val<0 && ((val-val-val)>status->lhw.atk2)))
+ status->lhw->atk2+=val;
+ }
break;
case SP_BASE_ATK:
if(sd->state.lr_flag != 2) {
@@ -1284,41 +1292,55 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
}
break;
case SP_MATK1:
- if(sd->state.lr_flag != 2)
- status->matk_max += val;
+ if(sd->state.lr_flag != 2) {
+ if(!(val<0 && ((val-val-val)>status->matk_max)))
+ status->matk_max += val;
+ }
break;
case SP_MATK2:
- if(sd->state.lr_flag != 2)
- status->matk_min += val;
+ if(sd->state.lr_flag != 2) {
+ if(!(val<0 && ((val-val-val)>status->matk_min)))
+ status->matk_min += val;
+ }
break;
case SP_MATK:
if(sd->state.lr_flag != 2) {
- status->matk_max += val;
- status->matk_min += val;
+ if(!(val<0 && ((val-val-val)>status->matk_max)))
+ status->matk_max += val;
+ if(!(val<0 && ((val-val-val)>status->matk_min)))
+ status->matk_min += val;
}
break;
case SP_DEF1:
if(sd->state.lr_flag != 2) {
- bonus = status->def + val;
- status->def = cap_value(bonus, CHAR_MIN, CHAR_MAX);
+ if(!(val<0 && ((val-val-val)>status->def))) {
+ bonus = status->def + val;
+ status->def = cap_value(bonus, CHAR_MIN, CHAR_MAX);
+ }
}
break;
case SP_DEF2:
if(sd->state.lr_flag != 2) {
- bonus = status->def2 + val;
- status->def2 = cap_value(bonus, SHRT_MIN, SHRT_MAX);
+ if(!(val<0 && ((val-val-val)>status->def2))) {
+ bonus = status->def2 + val;
+ status->def2 = cap_value(bonus, SHRT_MIN, SHRT_MAX);
+ }
}
break;
case SP_MDEF1:
if(sd->state.lr_flag != 2) {
- bonus = status->mdef + val;
- status->mdef = cap_value(bonus, CHAR_MIN, CHAR_MAX);
+ if(!(val<0 && ((val-val-val)>status->matk_mdef))) {
+ bonus = status->mdef + val;
+ status->mdef = cap_value(bonus, CHAR_MIN, CHAR_MAX);
+ }
}
break;
case SP_MDEF2:
if(sd->state.lr_flag != 2) {
- bonus = status->mdef2 + val;
- status->mdef2 = cap_value(bonus, SHRT_MIN, SHRT_MAX);
+ if(!(val<0 && ((val-val-val)>status->matk_mdef2))) {
+ bonus = status->mdef2 + val;
+ status->mdef2 = cap_value(bonus, SHRT_MIN, SHRT_MAX);
+ }
}
break;
case SP_HIT: