summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-07-02 04:16:29 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-07-02 04:33:06 +0200
commit7888d7144db4c4e71542b786eb7e143dbd066230 (patch)
tree3e008d3c2225af164b60541b9fa41630a35f4f64 /src/map/pc.c
parent1dfebbd4966310387357cbddae600418a56df658 (diff)
downloadhercules-7888d7144db4c4e71542b786eb7e143dbd066230.tar.gz
hercules-7888d7144db4c4e71542b786eb7e143dbd066230.tar.bz2
hercules-7888d7144db4c4e71542b786eb7e143dbd066230.tar.xz
hercules-7888d7144db4c4e71542b786eb7e143dbd066230.zip
Add bSubDefEle item bonus
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 64e52848f..2d3115d68 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4031,6 +4031,29 @@ static int pc_bonus3(struct map_session_data *sd, int type, int type2, int type3
sd->bonus.sp_vanish_trigger = val;
}
break;
+ case SP_SUB_DEF_ELE:
+ if ((type2 >= ELE_MAX && type2 != ELE_ALL) || type2 < ELE_NEUTRAL) {
+ ShowError("pc_bonus3: SP_SUB_DEF_ELE: Invalid element %d\n", type2);
+ break;
+ }
+
+ if (type2 == ELE_ALL) {
+ for (int j = ELE_NEUTRAL; j < ELE_MAX; j++) {
+ if ((val & 1) != 0)
+ sd->sub_def_ele[j].rate_mob += type3;
+
+ if ((val & 2) != 0)
+ sd->sub_def_ele[j].rate_pc += type3;
+ }
+ } else {
+ if ((val & 1) != 0)
+ sd->sub_def_ele[type2].rate_mob += type3;
+
+ if ((val & 2) != 0)
+ sd->sub_def_ele[type2].rate_pc += type3;
+ }
+
+ break;
default:
ShowWarning("pc_bonus3: unknown type %d %d %d %d!\n",type,type2,type3,val);