diff options
author | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-07-02 04:26:09 +0200 |
---|---|---|
committer | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-07-02 04:33:17 +0200 |
commit | 98064d23a7231816d2c04e1e95c90b18d5636b30 (patch) | |
tree | 54fe2c63d025b2ea55e0d95a69bcee4a04ad982f /src/map/pc.c | |
parent | 7888d7144db4c4e71542b786eb7e143dbd066230 (diff) | |
download | hercules-98064d23a7231816d2c04e1e95c90b18d5636b30.tar.gz hercules-98064d23a7231816d2c04e1e95c90b18d5636b30.tar.bz2 hercules-98064d23a7231816d2c04e1e95c90b18d5636b30.tar.xz hercules-98064d23a7231816d2c04e1e95c90b18d5636b30.zip |
Add bMagicSubDefEle item bonus
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 2d3115d68..242c43ba3 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4054,6 +4054,29 @@ static int pc_bonus3(struct map_session_data *sd, int type, int type2, int type3 } break; + case SP_MAGIC_SUB_DEF_ELE: + if ((type2 >= ELE_MAX && type2 != ELE_ALL) || type2 < ELE_NEUTRAL) { + ShowError("pc_bonus3: SP_MAGIC_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->magic_sub_def_ele[j].rate_mob += type3; + + if ((val & 2) != 0) + sd->magic_sub_def_ele[j].rate_pc += type3; + } + } else { + if ((val & 1) != 0) + sd->magic_sub_def_ele[type2].rate_mob += type3; + + if ((val & 2) != 0) + sd->magic_sub_def_ele[type2].rate_pc += type3; + } + + break; default: ShowWarning("pc_bonus3: unknown type %d %d %d %d!\n",type,type2,type3,val); |