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.c23
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);