summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2025-03-29 18:23:34 -0300
committerJesusaves <cpntb1@ymail.com>2025-03-29 18:23:34 -0300
commitc937e90cad43b489c89a3cd1d0939bc47edcc7a4 (patch)
treee85796519bc94fbc517181e7cd422430d754d62b
parent868b00768b3a94a2fb87bbcc90e9a1442e85fc0f (diff)
downloadevol-hercules-c937e90cad43b489c89a3cd1d0939bc47edcc7a4.tar.gz
evol-hercules-c937e90cad43b489c89a3cd1d0939bc47edcc7a4.tar.bz2
evol-hercules-c937e90cad43b489c89a3cd1d0939bc47edcc7a4.tar.xz
evol-hercules-c937e90cad43b489c89a3cd1d0939bc47edcc7a4.zip
Several status conditions I'll need for the Showdown. All debuffs.
-rw-r--r--src/ecommon/init.c2
-rw-r--r--src/emap/enum/esctype.h6
-rw-r--r--src/emap/enum/esitype.h6
-rw-r--r--src/emap/init.c15
-rw-r--r--src/emap/skill_const.c6
-rw-r--r--src/emap/status.c217
-rw-r--r--src/emap/status.h71
-rwxr-xr-xtools/vars.sh6
8 files changed, 323 insertions, 6 deletions
diff --git a/src/ecommon/init.c b/src/ecommon/init.c
index ddf88bb..414eb07 100644
--- a/src/ecommon/init.c
+++ b/src/ecommon/init.c
@@ -48,7 +48,7 @@ void common_online(void)
checkVar(MAX_INVENTORY, 120);
checkVar(MAX_SKILL_DB, 1660);
checkVar(MAX_SKILL_ID, 20150);
- checkVar(SC_MAX, 658);
+ checkVar(SC_MAX, 675);
checkVar(SI_MAX, 991);
checkVar(OLD_MAX_SKILL_DB, 1510);
checkVar(MAX_EVOL_SKILLS, 150);
diff --git a/src/emap/enum/esctype.h b/src/emap/enum/esctype.h
index b6d4334..d35b2c3 100644
--- a/src/emap/enum/esctype.h
+++ b/src/emap/enum/esctype.h
@@ -9,6 +9,12 @@ typedef enum esc_type
SC_PHYSICAL_SHIELD = 654,
SC_HALT_REGENERATION,
SC_BOTTER_SYNDROME,
+ SC_ALL_DOWN,
+ SC_ATK_DOWN,
+ SC_VULNERABLE,
+ SC_IMPRECISE,
+ SC_DUMBHEAD,
+ SC_SLOWPOKE,
} esc_type;
#endif // EVOL_MAP_ENUM_ESCTYPE
diff --git a/src/emap/enum/esitype.h b/src/emap/enum/esitype.h
index 701eec4..4671486 100644
--- a/src/emap/enum/esitype.h
+++ b/src/emap/enum/esitype.h
@@ -20,6 +20,12 @@ enum esi_type
SI_TMW2_WALKSPEED = 978,
SI_TMW2_INCMHPRATE = 979,
SI_TMW2_INCMSPRATE = 980,
+ SI_ALL_DOWN = 981,
+ SI_ATK_DOWN = 982,
+ SI_VULNERABLE = 983,
+ SI_IMPRECISE = 984,
+ SI_DUMBHEAD = 985,
+ SI_SLOWPOKE = 986,
};
#endif // EVOL_MAP_ENUM_ESITYPE
diff --git a/src/emap/init.c b/src/emap/init.c
index f71cca1..b6b2285 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -420,9 +420,22 @@ HPExport void plugin_init (void)
addHookPost(status, set_viewdata, estatus_set_viewdata_post);
addHookPost(status, read_job_db_sub, estatus_read_job_db_sub_post);
addHookPost(status, calc_pc_, estatus_calc_pc__post);
+ addHookPost(status, calc_str, estatus_calc_str_post);
+ addHookPost(status, calc_agi, estatus_calc_agi_post);
+ addHookPost(status, calc_vit, estatus_calc_vit_post);
+ addHookPost(status, calc_int, estatus_calc_int_post);
+ addHookPost(status, calc_dex, estatus_calc_dex_post);
+ addHookPost(status, calc_luk, estatus_calc_luk_post);
+ addHookPost(status, calc_batk, estatus_calc_batk_post);
+ addHookPost(status, calc_watk, estatus_calc_watk_post);
+ addHookPost(status, calc_critical, estatus_calc_critical_post);
+ addHookPost(status, calc_hit, estatus_calc_hit_post);
+ addHookPost(status, calc_flee, estatus_calc_flee_post);
+ addHookPost(status, calc_maxhp, estatus_calc_maxhp_post);
+ addHookPost(status, calc_maxsp, estatus_calc_maxsp_post);
addHookPost(status, calc_speed, estatus_calc_speed_post);
addHookPost(status, calc_def, estatus_calc_def_post);
- addHookPost(status, calc_fix_aspd, estatus_calc_fix_aspd_post);
+ addHookPost(status, calc_fix_aspd, estatus_calc_fix_aspd_post); // in ms
addHookPost(status, change_start, estatus_change_start_post);
addHookPost(status, change_end_, estatus_change_end__post);
addHookPost(status, calc_regen_rate, estatus_calc_regen_rate_post);
diff --git a/src/emap/skill_const.c b/src/emap/skill_const.c
index e4f7aa2..533f266 100644
--- a/src/emap/skill_const.c
+++ b/src/emap/skill_const.c
@@ -25,5 +25,11 @@ void eskill_addskill_conststants(void)
script->set_constant("SC_PHYSICAL_SHIELD", SC_PHYSICAL_SHIELD, false, false);
script->set_constant("SC_HALT_REGENERATION", SC_HALT_REGENERATION, false, false);
script->set_constant("SC_BOTTER_SYNDROME", SC_BOTTER_SYNDROME, false, false);
+ script->set_constant("SC_ALL_DOWN", SC_ALL_DOWN, false, false);
+ script->set_constant("SC_ATK_DOWN", SC_ATK_DOWN, false, false);
+ script->set_constant("SC_VULNERABLE", SC_VULNERABLE, false, false);
+ script->set_constant("SC_IMPRECISE", SC_IMPRECISE, false, false);
+ script->set_constant("SC_DUMBHEAD", SC_DUMBHEAD, false, false);
+ script->set_constant("SC_SLOWPOKE", SC_SLOWPOKE, false, false);
script->constdb_comment(NULL);
}
diff --git a/src/emap/status.c b/src/emap/status.c
index 85362ab..f2ded90 100644
--- a/src/emap/status.c
+++ b/src/emap/status.c
@@ -63,6 +63,12 @@ void eInitChangeTables(void)
status->dbs->IconChangeTable[SC_HALT_REGENERATION] = SI_HALT_REGEN;
status->dbs->IconChangeTable[SC_BOTTER_SYNDROME] = SI_BOTTER_SYNDROME;
+ status->dbs->IconChangeTable[SC_ALL_DOWN] = SI_ALL_DOWN;
+ status->dbs->IconChangeTable[SC_ATK_DOWN] = SI_ATK_DOWN;
+ status->dbs->IconChangeTable[SC_VULNERABLE] = SI_VULNERABLE;
+ status->dbs->IconChangeTable[SC_IMPRECISE] = SI_IMPRECISE;
+ status->dbs->IconChangeTable[SC_DUMBHEAD] = SI_DUMBHEAD;
+ status->dbs->IconChangeTable[SC_SLOWPOKE] = SI_BOTTER_SYNDROME;
// status->dbs->DisplayType[SC_PHYSICAL_SHIELD] = true;
}
@@ -192,12 +198,213 @@ void estatus_calc_pc_additional_pre(struct map_session_data **sdPtr,
unsigned short estatus_calc_speed_post(unsigned short retVal,
struct block_list *bl,
- struct status_change *sc __attribute__ ((unused)),
+ struct status_change *sc,
int speed __attribute__ ((unused)))
{
+ if (!sc)
+ return horse_add_speed_bonus(BL_CAST(BL_PC, bl), retVal);
+
+ if (sc->data[SC_SLOWPOKE])
+ retVal += sc->data[SC_SLOWPOKE]->val1;
+
return horse_add_speed_bonus(BL_CAST(BL_PC, bl), retVal);
}
+unsigned short estatus_calc_str_post(unsigned short retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ int str __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_ALL_DOWN])
+ retVal -= sc->data[SC_ALL_DOWN]->val1;
+
+ return (unsigned short)cap_value(retVal,0,USHRT_MAX);
+}
+
+unsigned short estatus_calc_agi_post(unsigned short retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ int agi __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_ALL_DOWN])
+ retVal -= sc->data[SC_ALL_DOWN]->val1;
+
+ return (unsigned short)cap_value(retVal,0,USHRT_MAX);
+}
+
+unsigned short estatus_calc_vit_post(unsigned short retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ int vit __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_ALL_DOWN])
+ retVal -= sc->data[SC_ALL_DOWN]->val1;
+
+ return (unsigned short)cap_value(retVal,0,USHRT_MAX);
+}
+
+unsigned short estatus_calc_int_post(unsigned short retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ int int_ __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_ALL_DOWN])
+ retVal -= sc->data[SC_ALL_DOWN]->val1;
+ if (sc->data[SC_DUMBHEAD])
+ retVal -= sc->data[SC_DUMBHEAD]->val1;
+
+ return (unsigned short)cap_value(retVal,0,USHRT_MAX);
+}
+
+unsigned short estatus_calc_dex_post(unsigned short retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ int dex __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_ALL_DOWN])
+ retVal -= sc->data[SC_ALL_DOWN]->val1;
+
+ return (unsigned short)cap_value(retVal,0,USHRT_MAX);
+}
+
+unsigned short estatus_calc_luk_post(unsigned short retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ int luk __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_ALL_DOWN])
+ retVal -= sc->data[SC_ALL_DOWN]->val1;
+
+ return (unsigned short)cap_value(retVal,0,USHRT_MAX);
+}
+
+int estatus_calc_batk_post(int retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ int batk __attribute__ ((unused)),
+ bool viewable __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_ATK_DOWN])
+ retVal -= sc->data[SC_ATK_DOWN]->val1;
+
+ return cap_value(retVal, 0, USHRT_MAX);
+}
+
+int estatus_calc_watk_post(int retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ int watk __attribute__ ((unused)),
+ bool viewable __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_ATK_DOWN])
+ retVal -= sc->data[SC_ATK_DOWN]->val1;
+
+ return cap_value(retVal, 0, USHRT_MAX);
+}
+
+int estatus_calc_critical_post(int retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ int critical __attribute__ ((unused)),
+ bool viewable __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_IMPRECISE])
+ retVal -= sc->data[SC_IMPRECISE]->val1;
+
+ return cap_value(retVal, 10, 32767);
+}
+
+int estatus_calc_hit_post(int retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ int hit __attribute__ ((unused)),
+ bool viewable __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_IMPRECISE])
+ retVal -= sc->data[SC_IMPRECISE]->val1;
+
+ return cap_value(retVal, 1, 32767);
+}
+
+int estatus_calc_flee_post(int retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ int flee __attribute__ ((unused)),
+ bool viewable __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_VULNERABLE])
+ retVal -= sc->data[SC_VULNERABLE]->val1;
+ if (sc->data[SC_DUMBHEAD])
+ retVal -= sc->data[SC_DUMBHEAD]->val1;
+
+ return cap_value(retVal, 1, 32767);
+}
+
+unsigned int estatus_calc_maxhp_post(unsigned int retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ uint64 maxhp __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_VULNERABLE])
+ retVal -= sc->data[SC_VULNERABLE]->val1 * 10;
+ if (sc->data[SC_ALL_DOWN])
+ retVal -= sc->data[SC_ALL_DOWN]->val1 * 5;
+
+ return (unsigned int)cap_value(retVal, 1, UINT_MAX);
+}
+
+unsigned int estatus_calc_maxsp_post(unsigned int retVal,
+ struct block_list *bl __attribute__ ((unused)),
+ struct status_change *sc,
+ unsigned int maxsp __attribute__ ((unused)))
+{
+ if (!sc)
+ return retVal;
+
+ if (sc->data[SC_DUMBHEAD])
+ retVal -= sc->data[SC_DUMBHEAD]->val1 * 5;
+ if (sc->data[SC_ALL_DOWN])
+ retVal -= sc->data[SC_ALL_DOWN]->val1 * 2;
+
+ return (unsigned int)cap_value(retVal, 1, UINT_MAX);
+}
+
defType estatus_calc_def_post(defType retVal,
struct block_list *bl __attribute__ ((unused)),
struct status_change *sc,
@@ -209,6 +416,8 @@ defType estatus_calc_def_post(defType retVal,
if (sc->data[SC_PHYSICAL_SHIELD])
retVal += sc->data[SC_PHYSICAL_SHIELD]->val1;
+ if (sc->data[SC_VULNERABLE])
+ retVal -= sc->data[SC_VULNERABLE]->val1;
return (defType)cap_value(retVal, DEFTYPE_MIN, DEFTYPE_MAX);
}
@@ -223,6 +432,12 @@ short estatus_calc_fix_aspd_post(short retVal,
if (sc->data[SC_PHYSICAL_SHIELD])
retVal -= sc->data[SC_PHYSICAL_SHIELD]->val2;
+ if (sc->data[SC_ATK_DOWN])
+ retVal += 100;
+ if (sc->data[SC_IMPRECISE])
+ retVal += sc->data[SC_IMPRECISE]->val1;
+ if (sc->data[SC_SLOWPOKE])
+ retVal += sc->data[SC_SLOWPOKE]->val1 * 10;
return (short)cap_value(retVal, 0, 2000);
}
diff --git a/src/emap/status.h b/src/emap/status.h
index 4df4975..407c883 100644
--- a/src/emap/status.h
+++ b/src/emap/status.h
@@ -15,11 +15,82 @@ int estatus_calc_pc__post(int retVal,
enum e_status_calc_opt opt);
void estatus_calc_pc_additional_pre(struct map_session_data **sdPtr,
enum e_status_calc_opt *optPtr);
+
unsigned short estatus_calc_speed_post(unsigned short retVal,
struct block_list *bl,
struct status_change *sc,
int speed);
+unsigned short estatus_calc_str_post(unsigned short retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ int str);
+
+unsigned short estatus_calc_agi_post(unsigned short retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ int agi);
+
+unsigned short estatus_calc_vit_post(unsigned short retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ int vit);
+
+unsigned short estatus_calc_int_post(unsigned short retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ int int_);
+
+unsigned short estatus_calc_dex_post(unsigned short retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ int dex);
+
+unsigned short estatus_calc_luk_post(unsigned short retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ int luk);
+
+int estatus_calc_batk_post(int retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ int batk,
+ bool viewable);
+
+int estatus_calc_watk_post(int retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ int watk,
+ bool viewable);
+
+int estatus_calc_critical_post(int retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ int critical,
+ bool viewable);
+
+int estatus_calc_hit_post(int retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ int hit,
+ bool viewable);
+
+int estatus_calc_flee_post(int retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ int flee,
+ bool viewable);
+
+unsigned int estatus_calc_maxhp_post(unsigned int retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ uint64 maxhp);
+
+unsigned int estatus_calc_maxsp_post(unsigned int retVal,
+ struct block_list *bl,
+ struct status_change *sc,
+ unsigned int maxsp);
+
defType estatus_calc_def_post(defType retVal,
struct block_list *bl,
struct status_change *sc,
diff --git a/tools/vars.sh b/tools/vars.sh
index b4bc3f8..0e67a37 100755
--- a/tools/vars.sh
+++ b/tools/vars.sh
@@ -2,8 +2,8 @@
# MAX_SKILL_DB 1510 + 150 = 1660
# MAX_SKILL_ID 10015 + 150 + 9963 = 20150
-# SC_MAX 653 + 5 = 658
-# SI_MAX 966 + 5 = 971
+# SC_MAX 653 + 22 = 675
+# SI_MAX 966 + 35 = 991
# MAX_EVOL_SKILLS 150
# EVOL_FIRST_SKILL 20000
# OLD_MAX_SKILL_DB 1510
@@ -12,5 +12,5 @@
# can be used for custom skill id: 10016 - 10036+20
-export VARS=" -DMAX_LEVEL=200 -DOLD_MAX_SKILL_DB=1510 -DMAX_STORAGE=500 -DMAX_INVENTORY=120 -DMAX_CART=25 -DMAX_AMOUNT=32500 -DMAX_SKILL_DB=1660 -DMAX_SKILL_ID=20150 -DMAX_EVOL_SKILLS=150 -DEVOL_FIRST_SKILL=20000 -DMAX_SKILL_TREE=200 -DMAX_HOMUNSKILL=63 -DSC_MAX=658 -DSI_MAX=991 -DMAX_PETLOOT_STACK_WEIGHT=18000 -DMIN_PACKET_DB=0x63 -DMAX_PACKET_DB=0x7531 -DTCP_THIN_DUPACK=1 -DTCP_THIN_LINEAR_TIMEOUTS=1 -DPYTHON_LOGS=1"
+export VARS=" -DMAX_LEVEL=200 -DOLD_MAX_SKILL_DB=1510 -DMAX_STORAGE=500 -DMAX_INVENTORY=120 -DMAX_CART=25 -DMAX_AMOUNT=32500 -DMAX_SKILL_DB=1660 -DMAX_SKILL_ID=20150 -DMAX_EVOL_SKILLS=150 -DEVOL_FIRST_SKILL=20000 -DMAX_SKILL_TREE=200 -DMAX_HOMUNSKILL=63 -DSC_MAX=675 -DSI_MAX=991 -DMAX_PETLOOT_STACK_WEIGHT=18000 -DMIN_PACKET_DB=0x63 -DMAX_PACKET_DB=0x7531 -DTCP_THIN_DUPACK=1 -DTCP_THIN_LINEAR_TIMEOUTS=1 -DPYTHON_LOGS=1"
export CPPFLAGS="${VARS}"