summaryrefslogtreecommitdiff
path: root/src/emap/pc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap/pc.c')
-rw-r--r--src/emap/pc.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/emap/pc.c b/src/emap/pc.c
index 011743e..b2acafe 100644
--- a/src/emap/pc.c
+++ b/src/emap/pc.c
@@ -39,6 +39,10 @@
int langScriptId;
int mountScriptId;
+int bHomunculusAtk = -1;
+int bHomunculusDef = -1;
+int bHomunculusMaxHP = -1;
+
int64 epc_readparam_pre(const TBL_PC **sdPtr,
int *type)
{
@@ -1097,3 +1101,53 @@ bool epc_read_skill_job_skip_pre(short *skill_idPtr __attribute__ ((unused)),
hookStop();
return false;
}
+
+// TMW2 Custom
+int epc_bonus_preHook(struct map_session_data **sd, int *type, int *val)
+{
+
+ // int bHomunculusAtk = -1;
+ if (*type == bHomunculusAtk) {
+ struct s_homunculus_atk *data;
+
+ if ((data = getFromMSD(*sd, 0)) == NULL) { /* don't have, create */
+ CREATE(data, struct s_homunculus_atk, 1); /* alloc */
+ data->rate = 0; /* default */
+ addToMSD(*sd, data, 0, true); /* link to sd */
+ }
+ data->rate += *val;
+
+ hookStop(); /* don't need to run the original */
+ }
+
+ // int bHomunculusDef = -1;
+ if (*type == bHomunculusDef) {
+ struct s_homunculus_def *data;
+
+ if ((data = getFromMSD(*sd, 0)) == NULL) {
+ CREATE(data, struct s_homunculus_def, 1);
+ data->rate = 0;
+ addToMSD(*sd, data, 0, true);
+ }
+ data->rate += *val;
+
+ hookStop();
+ }
+
+ // int bHomunculusMaxHP = -1;
+ if (*type == bHomunculusMaxHP) {
+ struct s_homunculus_maxhp *data;
+
+ if ((data = getFromMSD(*sd, 0)) == NULL) {
+ CREATE(data, struct s_homunculus_maxhp, 1);
+ data->rate = 0;
+ addToMSD(*sd, data, 0, true);
+ }
+ data->rate += *val;
+
+ hookStop();
+ }
+
+ return 0;
+}
+