summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2013-02-05 19:12:39 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2013-02-05 19:13:18 +0800
commitc69e4b6cf853d31f18ef9c2f04d2bc965f4ad158 (patch)
tree7e881232e12e393e6b8ad26119221d35655b9e42 /src/map/pc.c
parentf9d5d4fccc25a4309dc714a3c57ad82da8b31d6c (diff)
downloadhercules-c69e4b6cf853d31f18ef9c2f04d2bc965f4ad158.tar.gz
hercules-c69e4b6cf853d31f18ef9c2f04d2bc965f4ad158.tar.bz2
hercules-c69e4b6cf853d31f18ef9c2f04d2bc965f4ad158.tar.xz
hercules-c69e4b6cf853d31f18ef9c2f04d2bc965f4ad158.zip
Fix Bug # 7049
Added new item bonuses bFixedCast, bVariableCast & bFixedCastrate. (see 'doc/item_bonus.txt' for info) Added new conf for max walk path.(Bug Report # 7042) http://hercules.ws/board/tracker/issue-7049-do-we-need-new-bonus/?gopid=16578#entry16578
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 4fb555d0f..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;