summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorMysterious <mysteriousragnarok@hotmail.com>2013-02-05 17:08:29 -0800
committerMysterious <mysteriousragnarok@hotmail.com>2013-02-05 17:08:29 -0800
commit5e76d9a1a0ab36af5d8ad072ea4dcbf6122b0ae9 (patch)
treea938a98c1d3b856dd37cc989ac0d39d2de58abe1 /src/map/pc.c
parent9909d3bf4f4ad0acad48fbe5f1cfe69e44109da9 (diff)
parent2eb3e450d53a450d2493fae0ede3632802de6dd6 (diff)
downloadhercules-5e76d9a1a0ab36af5d8ad072ea4dcbf6122b0ae9.tar.gz
hercules-5e76d9a1a0ab36af5d8ad072ea4dcbf6122b0ae9.tar.bz2
hercules-5e76d9a1a0ab36af5d8ad072ea4dcbf6122b0ae9.tar.xz
hercules-5e76d9a1a0ab36af5d8ad072ea4dcbf6122b0ae9.zip
Merge pull request #2 from HerculesWS/master
Merging Hercules Commits from Feb 3 - 5 2013.
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 6f608cd49..6e24d7d49 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2591,11 +2591,22 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
if(sd->state.lr_flag != 2)
sd->bonus.fixcastrate -= val;
break;
+ case SP_ADD_FIXEDCAST:
+ if(sd->state.lr_flag != 2)
+ sd->bonus.add_fixcast += val;
+
+ break;
#ifdef RENEWAL_CAST
case SP_VARCASTRATE:
if(sd->state.lr_flag != 2)
sd->bonus.varcastrate -= val;
break;
+ case SP_ADD_VARIABLECAST:
+ if(sd->state.lr_flag != 2)
+
+ sd->bonus.add_varcast += val;
+
+ break;
#endif
default:
ShowWarning("pc_bonus: unknown type %d %d !\n",type,val);
@@ -2953,7 +2964,15 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
ARR_FIND(0, ARRAYLENGTH(sd->skillcast), i, sd->skillcast[i].id == 0 || sd->skillcast[i].id == type2);
if (i == ARRAYLENGTH(sd->skillcast))
{ //Better mention this so the array length can be updated. [Skotlex]
- ShowDebug("run_script: bonus2 bCastRate reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillcast), type2, val);
+ ShowDebug("run_script: bonus2 %s reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n",
+
+#ifndef RENEWAL_CAST
+ "bCastRate",
+#else
+ "bVariableCastrate",
+#endif
+
+ ARRAYLENGTH(sd->skillcast), type2, val);
break;
}
if(sd->skillcast[i].id == type2)
@@ -2964,6 +2983,30 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
}
break;
+ case SP_FIXCASTRATE:
+ if(sd->state.lr_flag == 2)
+ break;
+
+ ARR_FIND(0, ARRAYLENGTH(sd->skillfixcastrate), i, sd->skillfixcastrate[i].id == 0 || sd->skillfixcastrate[i].id == type2);
+
+ if (i == ARRAYLENGTH(sd->skillfixcastrate))
+
+ {
+
+ ShowDebug("run_script: bonus2 bFixedCastrate reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillfixcastrate), type2, val);
+ break;
+ }
+
+ if(sd->skillfixcastrate[i].id == type2)
+ sd->skillfixcastrate[i].val += val;
+
+ else {
+ sd->skillfixcastrate[i].id = type2;
+ sd->skillfixcastrate[i].val = val;
+ }
+
+ break;
+
case SP_HP_LOSS_RATE:
if(sd->state.lr_flag != 2) {
sd->hp_loss.value = type2;
@@ -8194,6 +8237,10 @@ int pc_removecombo(struct map_session_data *sd, struct item_data *data ) {
cursor++;
}
+
+ /* check if combo requirements still fit */
+ if( pc_checkcombo( sd, data ) )
+ continue;
/* it's empty, we can clear all the memory */
if( (sd->combos.count = cursor) == 0 ) {