summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index bea5b5c0a..82e650111 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2599,11 +2599,11 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
break;
case SP_FIXCASTRATE:
if(sd->state.lr_flag != 2)
- sd->fixcastrate+=val;
+ sd->bonus.fixcastrate -= val;
break;
case SP_VARCASTRATE:
if(sd->state.lr_flag != 2)
- sd->varcastrate+=val;
+ sd->bonus.varcastrate -= val;
break;
default:
ShowWarning("pc_bonus: unknown type %d %d !\n",type,val);
@@ -3135,6 +3135,22 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
sd->skillvarcast[i].val = val;
}
break;
+ case SP_VARCASTRATE:
+ if(sd->state.lr_flag == 2)
+ break;
+ ARR_FIND(0, ARRAYLENGTH(sd->skillcast), i, sd->skillcast[i].id == 0 || sd->skillcast[i].id == type2);
+ if (i == ARRAYLENGTH(sd->skillcast))
+ {
+ ShowDebug("run_script: bonus2 bVariableCastrate reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n",ARRAYLENGTH(sd->skillcast), type2, val);
+ break;
+ }
+ if(sd->skillcast[i].id == type2)
+ sd->skillcast[i].val -= val;
+ else {
+ sd->skillcast[i].id = type2;
+ sd->skillcast[i].val -= val;
+ }
+ break;
case SP_SKILL_USE_SP: //bonus2 bSkillUseSP,n,x;
if(sd->state.lr_flag == 2)
break;