From 9f7a47eb136c45adab54fa56517e5352cd801091 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 1 Apr 2019 00:56:19 +0300 Subject: Change most field sizes from short to int in status_data struct. --- src/map/status.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/map/status.h b/src/map/status.h index 79aaca95f..aec451c72 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -2045,28 +2045,26 @@ enum e_status_calc_opt { //Required because players have two of these, one in status_data //and another for their left hand weapon. typedef struct weapon_atk { - unsigned short atk, atk2; + unsigned int atk, atk2; unsigned short range; unsigned char ele; #ifdef RENEWAL - unsigned short matk; + unsigned int matk; unsigned char wlv; #endif } weapon_atk; //For holding basic status (which can be modified by status changes) struct status_data { - unsigned int + uint32 hp, sp, // see status_cpy before adding members before hp and sp - max_hp, max_sp; - unsigned short + max_hp, max_sp, str, agi, vit, int_, dex, luk, batk, matk_min, matk_max, speed, - amotion, adelay, dmotion; - uint32 mode; - short + amotion, adelay, dmotion, + mode, hit, flee, cri, flee2, def2, mdef2, #ifdef RENEWAL_ASPD -- cgit v1.2.3-60-g2f50 From b0e01cb8cf99f0017b620454c2ad2f813bd779b8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 1 Apr 2019 01:22:04 +0300 Subject: Change attack related status functions to return int variable --- src/map/status.c | 82 +++++++++++++++++++++++++++++--------------------------- src/map/status.h | 24 ++++++++--------- 2 files changed, 55 insertions(+), 51 deletions(-) diff --git a/src/map/status.c b/src/map/status.c index 5300f65c4..f0f412375 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4449,7 +4449,7 @@ static int status_base_amotion_pc(struct map_session_data *sd, struct status_dat return amotion; } -static unsigned short status_base_atk(const struct block_list *bl, const struct status_data *st) +static unsigned int status_base_atk(const struct block_list *bl, const struct status_data *st) { int flag = 0, str, dex, dstr; @@ -4509,39 +4509,43 @@ static unsigned short status_base_atk(const struct block_list *bl, const struct return cap_value(str, 0, USHRT_MAX); } -static unsigned short status_base_matk_min(const struct status_data *st) +static unsigned int status_base_matk_min(const struct status_data *st) { nullpo_ret(st); #ifdef RENEWAL Assert_ret(0); return 0; #else // not RENEWAL - return st->int_ + (st->int_ / 7) * (st->int_ / 7); + int matk = st->int_ + (st->int_ / 7) * (st->int_ / 7) + return cap_value(matk, 0, USHRT_MAX); #endif // RENEWAL } -static unsigned short status_base_matk_max(const struct status_data *st) +static unsigned int status_base_matk_max(const struct status_data *st) { nullpo_ret(st); - return st->int_ + (st->int_ / 5)*(st->int_ / 5); + int matk = st->int_ + (st->int_ / 5) * (st->int_ / 5); + return cap_value(matk, 0, USHRT_MAX); } -static unsigned short status_base_matk(struct block_list *bl, const struct status_data *st, int level) +static unsigned int status_base_matk(struct block_list *bl, const struct status_data *st, int level) { #ifdef RENEWAL nullpo_ret(bl); nullpo_ret(st); - switch ( bl->type ) { + int matk = 0; + switch (bl->type) { case BL_MOB: - return st->int_ + level; + matk = st->int_ + level; case BL_HOM: - return status_get_homint(st, BL_UCCAST(BL_HOM, bl)) + level; + matk = status_get_homint(st, BL_UCCAST(BL_HOM, bl)) + level; case BL_MER: - return st->int_ + st->int_ / 5 * st->int_ / 5; + matk = st->int_ + st->int_ / 5 * st->int_ / 5; case BL_PC: default: // temporary until all are formulated - return st->int_ + (st->int_ / 2) + (st->dex / 5) + (st->luk / 3) + (level / 4); + matk = st->int_ + (st->int_ / 2) + (st->dex / 5) + (st->luk / 3) + (level / 4); } + return cap_value(matk, 0, USHRT_MAX); #else Assert_ret(0); return 0; @@ -4995,7 +4999,7 @@ static unsigned short status_calc_luk(struct block_list *bl, struct status_chang return (unsigned short)cap_value(luk, 0, USHRT_MAX); } -static unsigned short status_calc_batk(struct block_list *bl, struct status_change *sc, int batk, bool viewable) +static unsigned int status_calc_batk(struct block_list *bl, struct status_change *sc, int batk, bool viewable) { nullpo_ret(bl); if(!sc || !sc->count) @@ -5005,7 +5009,7 @@ static unsigned short status_calc_batk(struct block_list *bl, struct status_chan /* some statuses that are hidden in the status window */ if(sc->data[SC_PLUSATTACKPOWER]) batk += sc->data[SC_PLUSATTACKPOWER]->val1; - return (unsigned short)cap_value(batk,0,USHRT_MAX); + return (unsigned int)cap_value(batk, 0, USHRT_MAX); } #ifndef RENEWAL if(sc->data[SC_PLUSATTACKPOWER]) @@ -5088,14 +5092,14 @@ static unsigned short status_calc_batk(struct block_list *bl, struct status_chan if (sc->data[SC_SHRIMP]) batk += batk * sc->data[SC_SHRIMP]->val2 / 100; - return (unsigned short)cap_value(batk,0,USHRT_MAX); + return (unsigned int)cap_value(batk, 0, USHRT_MAX); } -static unsigned short status_calc_watk(struct block_list *bl, struct status_change *sc, int watk, bool viewable) +static unsigned int status_calc_watk(struct block_list *bl, struct status_change *sc, int watk, bool viewable) { nullpo_ret(bl); if(!sc || !sc->count) - return cap_value(watk,0,USHRT_MAX); + return cap_value(watk, 0, USHRT_MAX); if( !viewable ){ /* some statuses that are hidden in the status window */ @@ -5103,7 +5107,7 @@ static unsigned short status_calc_watk(struct block_list *bl, struct status_chan watk -= sc->data[SC_WATER_BARRIER]->val3; if(sc->data[SC_GENTLETOUCH_CHANGE] && sc->data[SC_GENTLETOUCH_CHANGE]->val2) watk += sc->data[SC_GENTLETOUCH_CHANGE]->val2; - return (unsigned short)cap_value(watk,0,USHRT_MAX); + return (unsigned int)cap_value(watk, 0, USHRT_MAX); } #ifndef RENEWAL if(sc->data[SC_IMPOSITIO]) @@ -5181,14 +5185,14 @@ static unsigned short status_calc_watk(struct block_list *bl, struct status_chan if (sc->data[SC_CATNIPPOWDER]) watk -= watk * sc->data[SC_CATNIPPOWDER]->val2 / 100; - return (unsigned short)cap_value(watk,0,USHRT_MAX); + return (unsigned int)cap_value(watk, 0, USHRT_MAX); } -static unsigned short status_calc_ematk(struct block_list *bl, struct status_change *sc, int matk) +static unsigned int status_calc_ematk(struct block_list *bl, struct status_change *sc, int matk) { #ifdef RENEWAL if (!sc || !sc->count) - return cap_value(matk,0,USHRT_MAX); + return (unsigned int)cap_value(matk, 0, USHRT_MAX); if (sc->data[SC_PLUSMAGICPOWER]) matk += sc->data[SC_PLUSMAGICPOWER]->val1; if (sc->data[SC_MATKFOOD]) @@ -5209,22 +5213,22 @@ static unsigned short status_calc_ematk(struct block_list *bl, struct status_cha matk += 25 * sc->data[SC_IZAYOI]->val1; if (sc->data[SC_SHRIMP]) matk += matk * sc->data[SC_SHRIMP]->val2 / 100; - return (unsigned short)cap_value(matk,0,USHRT_MAX); + return (unsigned int)cap_value(matk, 0, USHRT_MAX); #else return 0; #endif } -static unsigned short status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable) +static unsigned int status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable) { if (!sc || !sc->count) - return cap_value(matk,0,USHRT_MAX); + return cap_value(matk, 0, USHRT_MAX); if (!viewable) { /* some statuses that are hidden in the status window */ if (sc->data[SC_MINDBREAKER]) matk += matk * sc->data[SC_MINDBREAKER]->val2 / 100; - return (unsigned short)cap_value(matk, 0, USHRT_MAX); + return (unsigned int)cap_value(matk, 0, USHRT_MAX); } #ifndef RENEWAL @@ -5282,10 +5286,10 @@ static unsigned short status_calc_matk(struct block_list *bl, struct status_chan if (sc->data[SC_MAGIC_CANDY]) matk += sc->data[SC_MAGIC_CANDY]->val1; - return (unsigned short)cap_value(matk, 0, USHRT_MAX); + return (unsigned int)cap_value(matk, 0, USHRT_MAX); } -static signed short status_calc_critical(struct block_list *bl, struct status_change *sc, int critical, bool viewable) +static signed int status_calc_critical(struct block_list *bl, struct status_change *sc, int critical, bool viewable) { if (!sc || !sc->count) return cap_value(critical, 10, SHRT_MAX); @@ -5323,10 +5327,10 @@ static signed short status_calc_critical(struct block_list *bl, struct status_ch if (sc->data[SC_BUCHEDENOEL]) critical += sc->data[SC_BUCHEDENOEL]->val4 * 10; - return (short)cap_value(critical, 10, SHRT_MAX); + return (int)cap_value(critical, 10, SHRT_MAX); } -static signed short status_calc_hit(struct block_list *bl, struct status_change *sc, int hit, bool viewable) +static signed int status_calc_hit(struct block_list *bl, struct status_change *sc, int hit, bool viewable) { if (!sc || !sc->count) @@ -5336,7 +5340,7 @@ static signed short status_calc_hit(struct block_list *bl, struct status_change /* some statuses that are hidden in the status window */ if (sc->data[SC_MTF_ASPD]) hit += sc->data[SC_MTF_ASPD]->val2; - return (short)cap_value(hit, 1, SHRT_MAX); + return (signed int)cap_value(hit, 1, SHRT_MAX); } if (sc->data[SC_INCHIT]) @@ -5378,26 +5382,26 @@ static signed short status_calc_hit(struct block_list *bl, struct status_change if (sc->data[SC_BUCHEDENOEL]) hit += sc->data[SC_BUCHEDENOEL]->val3; - return (short)cap_value(hit, 1, SHRT_MAX); + return (signed int)cap_value(hit, 1, SHRT_MAX); } -static signed short status_calc_flee(struct block_list *bl, struct status_change *sc, int flee, bool viewable) +static signed int status_calc_flee(struct block_list *bl, struct status_change *sc, int flee, bool viewable) { nullpo_retr(1, bl); if (bl->type == BL_PC) { if (map_flag_gvg2(bl->m)) flee -= flee * battle_config.gvg_flee_penalty / 100; - else if( map->list[bl->m].flag.battleground ) + else if (map->list[bl->m].flag.battleground) flee -= flee * battle_config.bg_flee_penalty / 100; } if (!sc || !sc->count) - return cap_value(flee, 1, SHRT_MAX); + return (signed int)cap_value(flee, 1, SHRT_MAX); if (!viewable) { /* some statuses that are hidden in the status window */ - return (short)cap_value(flee, 1, SHRT_MAX); + return (signed int)cap_value(flee, 1, SHRT_MAX); } if (sc->data[SC_INCFLEE]) @@ -5475,17 +5479,17 @@ static signed short status_calc_flee(struct block_list *bl, struct status_change if (sc->data[SC_MYSTICPOWDER]) flee += sc->data[SC_MYSTICPOWDER]->val2; - return (short)cap_value(flee, 1, SHRT_MAX); + return (signed int)cap_value(flee, 1, SHRT_MAX); } -static signed short status_calc_flee2(struct block_list *bl, struct status_change *sc, int flee2, bool viewable) +static signed int status_calc_flee2(struct block_list *bl, struct status_change *sc, int flee2, bool viewable) { if(!sc || !sc->count) - return cap_value(flee2,10,SHRT_MAX); + return (signed int)cap_value(flee2, 10, SHRT_MAX); if( !viewable ){ /* some statuses that are hidden in the status window */ - return (short)cap_value(flee2,10,SHRT_MAX); + return (signed int)cap_value(flee2, 10, SHRT_MAX); } if(sc->data[SC_PLUSAVOIDVALUE]) @@ -5497,7 +5501,7 @@ static signed short status_calc_flee2(struct block_list *bl, struct status_chang if (sc->data[SC_FREYJASCROLL]) flee2 += sc->data[SC_FREYJASCROLL]->val2; - return (short)cap_value(flee2,10,SHRT_MAX); + return (signed int)cap_value(flee2, 10, SHRT_MAX); } static defType status_calc_def(struct block_list *bl, struct status_change *sc, int def, bool viewable) diff --git a/src/map/status.h b/src/map/status.h index aec451c72..d5877f11f 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -2338,8 +2338,8 @@ struct status_interface { short (*calc_def2) (struct block_list *bl, struct status_change *sc, int def2, bool viewable); defType (*calc_mdef) (struct block_list *bl, struct status_change *sc, int mdef, bool viewable); short (*calc_mdef2) (struct block_list *bl, struct status_change *sc, int mdef2, bool viewable); - unsigned short (*calc_batk)(struct block_list *bl, struct status_change *sc, int batk, bool viewable); - unsigned short(*base_matk) (struct block_list *bl, const struct status_data *st, int level); + unsigned int (*calc_batk)(struct block_list *bl, struct status_change *sc, int batk, bool viewable); + unsigned int (*base_matk) (struct block_list *bl, const struct status_data *st, int level); int (*get_weapon_atk) (struct block_list *src, struct weapon_atk *watk, int flag); int (*get_total_mdef) (struct block_list *src); int (*get_total_def) (struct block_list *src); @@ -2350,7 +2350,7 @@ struct status_interface { void (*initChangeTables) (void); void (*initDummyData) (void); int (*base_amotion_pc) (struct map_session_data *sd, struct status_data *st); - unsigned short (*base_atk) (const struct block_list *bl, const struct status_data *st); + unsigned int (*base_atk) (const struct block_list *bl, const struct status_data *st); unsigned int (*get_base_maxhp) (const struct map_session_data *sd, const struct status_data *st); unsigned int (*get_base_maxsp) (const struct map_session_data *sd, const struct status_data *st); unsigned int (*get_restart_hp) (const struct map_session_data *sd, const struct status_data *st); @@ -2362,12 +2362,12 @@ struct status_interface { unsigned short (*calc_int) (struct block_list *bl, struct status_change *sc, int int_); unsigned short (*calc_dex) (struct block_list *bl, struct status_change *sc, int dex); unsigned short (*calc_luk) (struct block_list *bl, struct status_change *sc, int luk); - unsigned short (*calc_watk) (struct block_list *bl, struct status_change *sc, int watk, bool viewable); - unsigned short (*calc_matk) (struct block_list *bl, struct status_change *sc, int matk, bool viewable); - signed short (*calc_hit) (struct block_list *bl, struct status_change *sc, int hit, bool viewable); - signed short (*calc_critical) (struct block_list *bl, struct status_change *sc, int critical, bool viewable); - signed short (*calc_flee) (struct block_list *bl, struct status_change *sc, int flee, bool viewable); - signed short (*calc_flee2) (struct block_list *bl, struct status_change *sc, int flee2, bool viewable); + unsigned int (*calc_watk) (struct block_list *bl, struct status_change *sc, int watk, bool viewable); + unsigned int (*calc_matk) (struct block_list *bl, struct status_change *sc, int matk, bool viewable); + signed int (*calc_hit) (struct block_list *bl, struct status_change *sc, int hit, bool viewable); + signed int (*calc_critical) (struct block_list *bl, struct status_change *sc, int critical, bool viewable); + signed int (*calc_flee) (struct block_list *bl, struct status_change *sc, int flee, bool viewable); + signed int (*calc_flee2) (struct block_list *bl, struct status_change *sc, int flee2, bool viewable); unsigned short (*calc_speed) (struct block_list *bl, struct status_change *sc, int speed); short (*calc_aspd_rate) (struct block_list *bl, struct status_change *sc, int aspd_rate); unsigned short (*calc_dmotion) (struct block_list *bl, struct status_change *sc, int dmotion); @@ -2378,7 +2378,7 @@ struct status_interface { unsigned char (*calc_element) (struct block_list *bl, struct status_change *sc, int element); unsigned char (*calc_element_lv) (struct block_list *bl, struct status_change *sc, int lv); uint32 (*calc_mode) (const struct block_list *bl, const struct status_change *sc, uint32 mode); - unsigned short (*calc_ematk) (struct block_list *bl, struct status_change *sc, int matk); + unsigned int (*calc_ematk) (struct block_list *bl, struct status_change *sc, int matk); void (*calc_bl_main) (struct block_list *bl, int flag); void (*display_add) (struct map_session_data *sd, enum sc_type type, int dval1, int dval2, int dval3); void (*display_remove) (struct map_session_data *sd, enum sc_type type); @@ -2391,8 +2391,8 @@ struct status_interface { void (*read_job_db_sub) (int idx, const char *name, struct config_setting_t *jdb); void (*set_sc) (uint16 skill_id, sc_type sc, int icon, unsigned int flag); void (*copy) (struct status_data *a, const struct status_data *b); - unsigned short (*base_matk_min) (const struct status_data *st); - unsigned short (*base_matk_max) (const struct status_data *st); + unsigned int (*base_matk_min) (const struct status_data *st); + unsigned int (*base_matk_max) (const struct status_data *st); }; #ifdef HERCULES_CORE -- cgit v1.2.3-60-g2f50 From 7cc71c4b4ecdbf32bbfda88bd0abfdcce1bdf5de Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 1 Apr 2019 21:24:11 +0300 Subject: Add configurable limits for attack related functions --- conf/map/battle.conf | 3 +++ conf/map/battle/limits.conf | 57 ++++++++++++++++++++++++++++++++++++++++++ src/map/battle.c | 18 ++++++++++++-- src/map/battle.h | 15 ++++++++++++ src/map/status.c | 60 ++++++++++++++++++++++----------------------- 5 files changed, 121 insertions(+), 32 deletions(-) create mode 100644 conf/map/battle/limits.conf diff --git a/conf/map/battle.conf b/conf/map/battle.conf index 4bb60dab4..dd47db755 100644 --- a/conf/map/battle.conf +++ b/conf/map/battle.conf @@ -76,6 +76,9 @@ battle_configuration: { // Feature control (on/off) settings @include "conf/map/battle/feature.conf" + // Different calculation limits + @include "conf/map/battle/limits.conf" + // Anything else that didn't fit anywhere else. // Includes duel, day/night, mute/manner, log settings. @include "conf/map/battle/misc.conf" diff --git a/conf/map/battle/limits.conf b/conf/map/battle/limits.conf new file mode 100644 index 000000000..78498219e --- /dev/null +++ b/conf/map/battle/limits.conf @@ -0,0 +1,57 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2019 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see . +//========================================================================= +// Battle (Limits) Configuration File +//========================================================================= + +// basic attack limits +batk_min_limit: 0 +batk_max_limit: 65535 + +// magic attack limits + +matk_min_limit: 0 +matk_max_limit: 65535 + +// weapon attack limits +watk_min_limit: 0 +watk_max_limit: 65535 + +// flee limits +flee_min_limit: 1 +flee_max_limit: 32767 + +// flee2 limits +flee2_min_limit: 10 +flee2_max_limit: 32767 + +// critical attack limits +critical_min_limit: 10 +critical_max_limit: 32767 + +// hit limits +hit_min_limit: 1 +hit_max_limit: 32767 diff --git a/src/map/battle.c b/src/map/battle.c index 2f33e2ea9..4ee1791ba 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7419,8 +7419,22 @@ static const struct battle_data { { "ping_time", &battle_config.ping_time, 20, 0, 99999999, }, { "option_drop_max_loop", &battle_config.option_drop_max_loop, 10, 1, 100000, }, { "drop_connection_on_quit", &battle_config.drop_connection_on_quit, 0, 0, 1, }, - {"features/enable_refinery_ui", &battle_config.enable_refinery_ui, 1, 0, 1, }, - {"features/replace_refine_npcs", &battle_config.replace_refine_npcs, 1, 0, 1, }, + { "features/enable_refinery_ui", &battle_config.enable_refinery_ui, 1, 0, 1, }, + { "features/replace_refine_npcs", &battle_config.replace_refine_npcs, 1, 0, 1, }, + { "batk_min_limit", &battle_config.batk_min, 0, 0, INT_MAX, }, + { "batk_max_limit", &battle_config.batk_max, USHRT_MAX, 1, INT_MAX, }, + { "matk_min_limit", &battle_config.matk_min, 0, 0, INT_MAX, }, + { "matk_max_limit", &battle_config.matk_max, USHRT_MAX, 1, INT_MAX, }, + { "watk_min_limit", &battle_config.watk_min, 0, 0, INT_MAX, }, + { "watk_max_limit", &battle_config.watk_max, USHRT_MAX, 1, INT_MAX, }, + { "flee_min_limit", &battle_config.flee_min, 1, 1, INT_MAX, }, + { "flee_max_limit", &battle_config.flee_max, SHRT_MAX, 1, INT_MAX, }, + { "flee2_min_limit", &battle_config.flee2_min, 10, 1, INT_MAX, }, + { "flee2_max_limit", &battle_config.flee2_max, SHRT_MAX, 1, INT_MAX, }, + { "critical_min_limit", &battle_config.critical_min, 10, 1, INT_MAX, }, + { "critical_max_limit", &battle_config.critical_max, SHRT_MAX, 1, INT_MAX, }, + { "hit_min_limit", &battle_config.hit_min, 1, 1, INT_MAX, }, + { "hit_max_limit", &battle_config.hit_max, SHRT_MAX, 1, INT_MAX, }, }; static bool battle_set_value_sub(int index, int value) diff --git a/src/map/battle.h b/src/map/battle.h index 1640a4e7f..2e52a63a6 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -589,6 +589,21 @@ struct Battle_Config { int drop_connection_on_quit; int enable_refinery_ui; int replace_refine_npcs; + + int batk_min; + int batk_max; + int matk_min; + int matk_max; + int watk_min; + int watk_max; + int flee_min; + int flee_max; + int flee2_min; + int flee2_max; + int critical_min; + int critical_max; + int hit_min; + int hit_max; }; /* criteria for battle_config.idletime_critera */ diff --git a/src/map/status.c b/src/map/status.c index f0f412375..4c5df639f 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3854,7 +3854,7 @@ static void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag temp = bst->batk - status->base_atk(bl,bst); if (temp) { temp += st->batk; - st->batk = cap_value(temp, 0, USHRT_MAX); + st->batk = cap_value(temp, battle_config.batk_min, battle_config.batk_max); } st->batk = status->calc_batk(bl, sc, st->batk, true); } @@ -4506,7 +4506,7 @@ static unsigned int status_base_atk(const struct block_list *bl, const struct st if (bl->type == BL_PC) str += dex / 5 + st->luk / 5; #endif // RENEWAL - return cap_value(str, 0, USHRT_MAX); + return cap_value(str, battle_config.batk_min, battle_config.batk_max); } static unsigned int status_base_matk_min(const struct status_data *st) @@ -4516,8 +4516,8 @@ static unsigned int status_base_matk_min(const struct status_data *st) Assert_ret(0); return 0; #else // not RENEWAL - int matk = st->int_ + (st->int_ / 7) * (st->int_ / 7) - return cap_value(matk, 0, USHRT_MAX); + int matk = st->int_ + (st->int_ / 7) * (st->int_ / 7); + return cap_value(matk, battle_config.matk_min, battle_config.matk_max); #endif // RENEWAL } @@ -4525,7 +4525,7 @@ static unsigned int status_base_matk_max(const struct status_data *st) { nullpo_ret(st); int matk = st->int_ + (st->int_ / 5) * (st->int_ / 5); - return cap_value(matk, 0, USHRT_MAX); + return cap_value(matk, battle_config.matk_min, battle_config.matk_max); } static unsigned int status_base_matk(struct block_list *bl, const struct status_data *st, int level) @@ -4545,7 +4545,7 @@ static unsigned int status_base_matk(struct block_list *bl, const struct status_ default: // temporary until all are formulated matk = st->int_ + (st->int_ / 2) + (st->dex / 5) + (st->luk / 3) + (level / 4); } - return cap_value(matk, 0, USHRT_MAX); + return cap_value(matk, battle_config.matk_min, battle_config.matk_max); #else Assert_ret(0); return 0; @@ -4602,7 +4602,7 @@ static void status_calc_misc(struct block_list *bl, struct status_data *st, int if ( st->batk ) { int temp = st->batk + status->base_atk(bl, st); - st->batk = cap_value(temp, 0, USHRT_MAX); + st->batk = cap_value(temp, battle_config.batk_min, battle_config.batk_max); } else st->batk = status->base_atk(bl, st); if ( st->cri ) { @@ -5003,13 +5003,13 @@ static unsigned int status_calc_batk(struct block_list *bl, struct status_change { nullpo_ret(bl); if(!sc || !sc->count) - return cap_value(batk,0,USHRT_MAX); + return cap_value(batk, battle_config.batk_min, battle_config.batk_max); if( !viewable ){ /* some statuses that are hidden in the status window */ if(sc->data[SC_PLUSATTACKPOWER]) batk += sc->data[SC_PLUSATTACKPOWER]->val1; - return (unsigned int)cap_value(batk, 0, USHRT_MAX); + return cap_value(batk, battle_config.batk_min, battle_config.batk_max); } #ifndef RENEWAL if(sc->data[SC_PLUSATTACKPOWER]) @@ -5092,14 +5092,14 @@ static unsigned int status_calc_batk(struct block_list *bl, struct status_change if (sc->data[SC_SHRIMP]) batk += batk * sc->data[SC_SHRIMP]->val2 / 100; - return (unsigned int)cap_value(batk, 0, USHRT_MAX); + return (unsigned int)cap_value(batk, battle_config.batk_min, battle_config.batk_max); } static unsigned int status_calc_watk(struct block_list *bl, struct status_change *sc, int watk, bool viewable) { nullpo_ret(bl); if(!sc || !sc->count) - return cap_value(watk, 0, USHRT_MAX); + return cap_value(watk, battle_config.watk_min, battle_config.watk_max); if( !viewable ){ /* some statuses that are hidden in the status window */ @@ -5107,7 +5107,7 @@ static unsigned int status_calc_watk(struct block_list *bl, struct status_change watk -= sc->data[SC_WATER_BARRIER]->val3; if(sc->data[SC_GENTLETOUCH_CHANGE] && sc->data[SC_GENTLETOUCH_CHANGE]->val2) watk += sc->data[SC_GENTLETOUCH_CHANGE]->val2; - return (unsigned int)cap_value(watk, 0, USHRT_MAX); + return (unsigned int)cap_value(watk, battle_config.watk_min, battle_config.watk_max); } #ifndef RENEWAL if(sc->data[SC_IMPOSITIO]) @@ -5185,14 +5185,14 @@ static unsigned int status_calc_watk(struct block_list *bl, struct status_change if (sc->data[SC_CATNIPPOWDER]) watk -= watk * sc->data[SC_CATNIPPOWDER]->val2 / 100; - return (unsigned int)cap_value(watk, 0, USHRT_MAX); + return (unsigned int)cap_value(watk, battle_config.watk_min, battle_config.watk_max); } static unsigned int status_calc_ematk(struct block_list *bl, struct status_change *sc, int matk) { #ifdef RENEWAL if (!sc || !sc->count) - return (unsigned int)cap_value(matk, 0, USHRT_MAX); + return (unsigned int)cap_value(matk, battle_config.matk_min, battle_config.matk_max); if (sc->data[SC_PLUSMAGICPOWER]) matk += sc->data[SC_PLUSMAGICPOWER]->val1; if (sc->data[SC_MATKFOOD]) @@ -5213,7 +5213,7 @@ static unsigned int status_calc_ematk(struct block_list *bl, struct status_chang matk += 25 * sc->data[SC_IZAYOI]->val1; if (sc->data[SC_SHRIMP]) matk += matk * sc->data[SC_SHRIMP]->val2 / 100; - return (unsigned int)cap_value(matk, 0, USHRT_MAX); + return (unsigned int)cap_value(matk, battle_config.matk_min, battle_config.matk_max); #else return 0; #endif @@ -5222,13 +5222,13 @@ static unsigned int status_calc_ematk(struct block_list *bl, struct status_chang static unsigned int status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable) { if (!sc || !sc->count) - return cap_value(matk, 0, USHRT_MAX); + return (unsigned int)cap_value(matk, battle_config.matk_min, battle_config.matk_max); if (!viewable) { /* some statuses that are hidden in the status window */ if (sc->data[SC_MINDBREAKER]) matk += matk * sc->data[SC_MINDBREAKER]->val2 / 100; - return (unsigned int)cap_value(matk, 0, USHRT_MAX); + return (unsigned int)cap_value(matk, battle_config.matk_min, battle_config.matk_max); } #ifndef RENEWAL @@ -5286,17 +5286,17 @@ static unsigned int status_calc_matk(struct block_list *bl, struct status_change if (sc->data[SC_MAGIC_CANDY]) matk += sc->data[SC_MAGIC_CANDY]->val1; - return (unsigned int)cap_value(matk, 0, USHRT_MAX); + return (unsigned int)cap_value(matk, battle_config.matk_min, battle_config.matk_max); } static signed int status_calc_critical(struct block_list *bl, struct status_change *sc, int critical, bool viewable) { if (!sc || !sc->count) - return cap_value(critical, 10, SHRT_MAX); + return (signed int)cap_value(critical, battle_config.critical_min, battle_config.critical_max); if (!viewable) { /* some statuses that are hidden in the status window */ - return (short)cap_value(critical, 10, SHRT_MAX); + return (signed int)cap_value(critical, battle_config.critical_min, battle_config.critical_max); } if (sc->data[SC_CRITICALPERCENT]) @@ -5327,20 +5327,20 @@ static signed int status_calc_critical(struct block_list *bl, struct status_chan if (sc->data[SC_BUCHEDENOEL]) critical += sc->data[SC_BUCHEDENOEL]->val4 * 10; - return (int)cap_value(critical, 10, SHRT_MAX); + return (signed int)cap_value(critical, battle_config.critical_min, battle_config.critical_max); } static signed int status_calc_hit(struct block_list *bl, struct status_change *sc, int hit, bool viewable) { if (!sc || !sc->count) - return cap_value(hit, 1, SHRT_MAX); + return (signed int)cap_value(hit, battle_config.hit_min, battle_config.hit_max); if (!viewable) { /* some statuses that are hidden in the status window */ if (sc->data[SC_MTF_ASPD]) hit += sc->data[SC_MTF_ASPD]->val2; - return (signed int)cap_value(hit, 1, SHRT_MAX); + return (signed int)cap_value(hit, battle_config.hit_min, battle_config.hit_max); } if (sc->data[SC_INCHIT]) @@ -5382,7 +5382,7 @@ static signed int status_calc_hit(struct block_list *bl, struct status_change *s if (sc->data[SC_BUCHEDENOEL]) hit += sc->data[SC_BUCHEDENOEL]->val3; - return (signed int)cap_value(hit, 1, SHRT_MAX); + return (signed int)cap_value(hit, battle_config.hit_min, battle_config.hit_max); } static signed int status_calc_flee(struct block_list *bl, struct status_change *sc, int flee, bool viewable) @@ -5397,11 +5397,11 @@ static signed int status_calc_flee(struct block_list *bl, struct status_change * } if (!sc || !sc->count) - return (signed int)cap_value(flee, 1, SHRT_MAX); + return (signed int)cap_value(flee, battle_config.flee_min, battle_config.flee_max); if (!viewable) { /* some statuses that are hidden in the status window */ - return (signed int)cap_value(flee, 1, SHRT_MAX); + return (signed int)cap_value(flee, battle_config.flee_min, battle_config.flee_max); } if (sc->data[SC_INCFLEE]) @@ -5479,17 +5479,17 @@ static signed int status_calc_flee(struct block_list *bl, struct status_change * if (sc->data[SC_MYSTICPOWDER]) flee += sc->data[SC_MYSTICPOWDER]->val2; - return (signed int)cap_value(flee, 1, SHRT_MAX); + return (signed int)cap_value(flee, battle_config.flee_min, battle_config.flee_max); } static signed int status_calc_flee2(struct block_list *bl, struct status_change *sc, int flee2, bool viewable) { if(!sc || !sc->count) - return (signed int)cap_value(flee2, 10, SHRT_MAX); + return (signed int)cap_value(flee2, battle_config.flee2_min, battle_config.flee2_max); if( !viewable ){ /* some statuses that are hidden in the status window */ - return (signed int)cap_value(flee2, 10, SHRT_MAX); + return (signed int)cap_value(flee2, battle_config.flee2_min, battle_config.flee2_max); } if(sc->data[SC_PLUSAVOIDVALUE]) @@ -5501,7 +5501,7 @@ static signed int status_calc_flee2(struct block_list *bl, struct status_change if (sc->data[SC_FREYJASCROLL]) flee2 += sc->data[SC_FREYJASCROLL]->val2; - return (signed int)cap_value(flee2, 10, SHRT_MAX); + return (signed int)cap_value(flee2, battle_config.flee2_min, battle_config.flee2_max); } static defType status_calc_def(struct block_list *bl, struct status_change *sc, int def, bool viewable) -- cgit v1.2.3-60-g2f50 From e28cd1d53916ef1471da20abdf7c2d78e4e0f5a7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 1 Apr 2019 22:10:49 +0300 Subject: Fix warnings after last changes --- src/map/status.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/map/status.c b/src/map/status.c index 4c5df639f..ec7a908a8 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4537,13 +4537,17 @@ static unsigned int status_base_matk(struct block_list *bl, const struct status_ switch (bl->type) { case BL_MOB: matk = st->int_ + level; + break; case BL_HOM: matk = status_get_homint(st, BL_UCCAST(BL_HOM, bl)) + level; + break; case BL_MER: matk = st->int_ + st->int_ / 5 * st->int_ / 5; + break; case BL_PC: default: // temporary until all are formulated matk = st->int_ + (st->int_ / 2) + (st->dex / 5) + (st->luk / 3) + (level / 4); + break; } return cap_value(matk, battle_config.matk_min, battle_config.matk_max); #else @@ -8479,12 +8483,12 @@ static int status_change_start(struct block_list *src, struct block_list *bl, en val3 = 0; val4 = 0; max_stat = (status->get_lv(bl)-10<50)?status->get_lv(bl)-10:50; - stat = max(0, max_stat - status2->str ); val3 |= cap_value(stat,0,0xFF)<<16; - stat = max(0, max_stat - status2->agi ); val3 |= cap_value(stat,0,0xFF)<<8; - stat = max(0, max_stat - status2->vit ); val3 |= cap_value(stat,0,0xFF); - stat = max(0, max_stat - status2->int_); val4 |= cap_value(stat,0,0xFF)<<16; - stat = max(0, max_stat - status2->dex ); val4 |= cap_value(stat,0,0xFF)<<8; - stat = max(0, max_stat - status2->luk ); val4 |= cap_value(stat,0,0xFF); + stat = max(0, max_stat - (int)status2->str ); val3 |= cap_value(stat,0,0xFF)<<16; + stat = max(0, max_stat - (int)status2->agi ); val3 |= cap_value(stat,0,0xFF)<<8; + stat = max(0, max_stat - (int)status2->vit ); val3 |= cap_value(stat,0,0xFF); + stat = max(0, max_stat - (int)status2->int_); val4 |= cap_value(stat,0,0xFF)<<16; + stat = max(0, max_stat - (int)status2->dex ); val4 |= cap_value(stat,0,0xFF)<<8; + stat = max(0, max_stat - (int)status2->luk ); val4 |= cap_value(stat,0,0xFF); } break; case SC_SWORDREJECT: -- cgit v1.2.3-60-g2f50 From 12ed74f45f25ba30758992816d0aa16013d86f2f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 8 Apr 2019 03:14:51 +0300 Subject: Change return type of attack related functions from unsigned int to int --- src/map/status.c | 64 ++++++++++++++++++++++++++++---------------------------- src/map/status.h | 16 +++++++------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/map/status.c b/src/map/status.c index ec7a908a8..63e71c9dc 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4449,7 +4449,7 @@ static int status_base_amotion_pc(struct map_session_data *sd, struct status_dat return amotion; } -static unsigned int status_base_atk(const struct block_list *bl, const struct status_data *st) +static int status_base_atk(const struct block_list *bl, const struct status_data *st) { int flag = 0, str, dex, dstr; @@ -4509,7 +4509,7 @@ static unsigned int status_base_atk(const struct block_list *bl, const struct st return cap_value(str, battle_config.batk_min, battle_config.batk_max); } -static unsigned int status_base_matk_min(const struct status_data *st) +static int status_base_matk_min(const struct status_data *st) { nullpo_ret(st); #ifdef RENEWAL @@ -4521,14 +4521,14 @@ static unsigned int status_base_matk_min(const struct status_data *st) #endif // RENEWAL } -static unsigned int status_base_matk_max(const struct status_data *st) +static int status_base_matk_max(const struct status_data *st) { nullpo_ret(st); int matk = st->int_ + (st->int_ / 5) * (st->int_ / 5); return cap_value(matk, battle_config.matk_min, battle_config.matk_max); } -static unsigned int status_base_matk(struct block_list *bl, const struct status_data *st, int level) +static int status_base_matk(struct block_list *bl, const struct status_data *st, int level) { #ifdef RENEWAL nullpo_ret(bl); @@ -5003,7 +5003,7 @@ static unsigned short status_calc_luk(struct block_list *bl, struct status_chang return (unsigned short)cap_value(luk, 0, USHRT_MAX); } -static unsigned int status_calc_batk(struct block_list *bl, struct status_change *sc, int batk, bool viewable) +static int status_calc_batk(struct block_list *bl, struct status_change *sc, int batk, bool viewable) { nullpo_ret(bl); if(!sc || !sc->count) @@ -5096,10 +5096,10 @@ static unsigned int status_calc_batk(struct block_list *bl, struct status_change if (sc->data[SC_SHRIMP]) batk += batk * sc->data[SC_SHRIMP]->val2 / 100; - return (unsigned int)cap_value(batk, battle_config.batk_min, battle_config.batk_max); + return cap_value(batk, battle_config.batk_min, battle_config.batk_max); } -static unsigned int status_calc_watk(struct block_list *bl, struct status_change *sc, int watk, bool viewable) +static int status_calc_watk(struct block_list *bl, struct status_change *sc, int watk, bool viewable) { nullpo_ret(bl); if(!sc || !sc->count) @@ -5111,7 +5111,7 @@ static unsigned int status_calc_watk(struct block_list *bl, struct status_change watk -= sc->data[SC_WATER_BARRIER]->val3; if(sc->data[SC_GENTLETOUCH_CHANGE] && sc->data[SC_GENTLETOUCH_CHANGE]->val2) watk += sc->data[SC_GENTLETOUCH_CHANGE]->val2; - return (unsigned int)cap_value(watk, battle_config.watk_min, battle_config.watk_max); + return cap_value(watk, battle_config.watk_min, battle_config.watk_max); } #ifndef RENEWAL if(sc->data[SC_IMPOSITIO]) @@ -5189,14 +5189,14 @@ static unsigned int status_calc_watk(struct block_list *bl, struct status_change if (sc->data[SC_CATNIPPOWDER]) watk -= watk * sc->data[SC_CATNIPPOWDER]->val2 / 100; - return (unsigned int)cap_value(watk, battle_config.watk_min, battle_config.watk_max); + return cap_value(watk, battle_config.watk_min, battle_config.watk_max); } -static unsigned int status_calc_ematk(struct block_list *bl, struct status_change *sc, int matk) +static int status_calc_ematk(struct block_list *bl, struct status_change *sc, int matk) { #ifdef RENEWAL if (!sc || !sc->count) - return (unsigned int)cap_value(matk, battle_config.matk_min, battle_config.matk_max); + return cap_value(matk, battle_config.matk_min, battle_config.matk_max); if (sc->data[SC_PLUSMAGICPOWER]) matk += sc->data[SC_PLUSMAGICPOWER]->val1; if (sc->data[SC_MATKFOOD]) @@ -5217,22 +5217,22 @@ static unsigned int status_calc_ematk(struct block_list *bl, struct status_chang matk += 25 * sc->data[SC_IZAYOI]->val1; if (sc->data[SC_SHRIMP]) matk += matk * sc->data[SC_SHRIMP]->val2 / 100; - return (unsigned int)cap_value(matk, battle_config.matk_min, battle_config.matk_max); + return cap_value(matk, battle_config.matk_min, battle_config.matk_max); #else return 0; #endif } -static unsigned int status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable) +static int status_calc_matk(struct block_list *bl, struct status_change *sc, int matk, bool viewable) { if (!sc || !sc->count) - return (unsigned int)cap_value(matk, battle_config.matk_min, battle_config.matk_max); + return cap_value(matk, battle_config.matk_min, battle_config.matk_max); if (!viewable) { /* some statuses that are hidden in the status window */ if (sc->data[SC_MINDBREAKER]) matk += matk * sc->data[SC_MINDBREAKER]->val2 / 100; - return (unsigned int)cap_value(matk, battle_config.matk_min, battle_config.matk_max); + return cap_value(matk, battle_config.matk_min, battle_config.matk_max); } #ifndef RENEWAL @@ -5290,17 +5290,17 @@ static unsigned int status_calc_matk(struct block_list *bl, struct status_change if (sc->data[SC_MAGIC_CANDY]) matk += sc->data[SC_MAGIC_CANDY]->val1; - return (unsigned int)cap_value(matk, battle_config.matk_min, battle_config.matk_max); + return cap_value(matk, battle_config.matk_min, battle_config.matk_max); } -static signed int status_calc_critical(struct block_list *bl, struct status_change *sc, int critical, bool viewable) +static int status_calc_critical(struct block_list *bl, struct status_change *sc, int critical, bool viewable) { if (!sc || !sc->count) - return (signed int)cap_value(critical, battle_config.critical_min, battle_config.critical_max); + return cap_value(critical, battle_config.critical_min, battle_config.critical_max); if (!viewable) { /* some statuses that are hidden in the status window */ - return (signed int)cap_value(critical, battle_config.critical_min, battle_config.critical_max); + return cap_value(critical, battle_config.critical_min, battle_config.critical_max); } if (sc->data[SC_CRITICALPERCENT]) @@ -5331,20 +5331,20 @@ static signed int status_calc_critical(struct block_list *bl, struct status_chan if (sc->data[SC_BUCHEDENOEL]) critical += sc->data[SC_BUCHEDENOEL]->val4 * 10; - return (signed int)cap_value(critical, battle_config.critical_min, battle_config.critical_max); + return cap_value(critical, battle_config.critical_min, battle_config.critical_max); } -static signed int status_calc_hit(struct block_list *bl, struct status_change *sc, int hit, bool viewable) +static int status_calc_hit(struct block_list *bl, struct status_change *sc, int hit, bool viewable) { if (!sc || !sc->count) - return (signed int)cap_value(hit, battle_config.hit_min, battle_config.hit_max); + return cap_value(hit, battle_config.hit_min, battle_config.hit_max); if (!viewable) { /* some statuses that are hidden in the status window */ if (sc->data[SC_MTF_ASPD]) hit += sc->data[SC_MTF_ASPD]->val2; - return (signed int)cap_value(hit, battle_config.hit_min, battle_config.hit_max); + return cap_value(hit, battle_config.hit_min, battle_config.hit_max); } if (sc->data[SC_INCHIT]) @@ -5386,10 +5386,10 @@ static signed int status_calc_hit(struct block_list *bl, struct status_change *s if (sc->data[SC_BUCHEDENOEL]) hit += sc->data[SC_BUCHEDENOEL]->val3; - return (signed int)cap_value(hit, battle_config.hit_min, battle_config.hit_max); + return cap_value(hit, battle_config.hit_min, battle_config.hit_max); } -static signed int status_calc_flee(struct block_list *bl, struct status_change *sc, int flee, bool viewable) +static int status_calc_flee(struct block_list *bl, struct status_change *sc, int flee, bool viewable) { nullpo_retr(1, bl); @@ -5401,11 +5401,11 @@ static signed int status_calc_flee(struct block_list *bl, struct status_change * } if (!sc || !sc->count) - return (signed int)cap_value(flee, battle_config.flee_min, battle_config.flee_max); + return cap_value(flee, battle_config.flee_min, battle_config.flee_max); if (!viewable) { /* some statuses that are hidden in the status window */ - return (signed int)cap_value(flee, battle_config.flee_min, battle_config.flee_max); + return cap_value(flee, battle_config.flee_min, battle_config.flee_max); } if (sc->data[SC_INCFLEE]) @@ -5483,17 +5483,17 @@ static signed int status_calc_flee(struct block_list *bl, struct status_change * if (sc->data[SC_MYSTICPOWDER]) flee += sc->data[SC_MYSTICPOWDER]->val2; - return (signed int)cap_value(flee, battle_config.flee_min, battle_config.flee_max); + return cap_value(flee, battle_config.flee_min, battle_config.flee_max); } -static signed int status_calc_flee2(struct block_list *bl, struct status_change *sc, int flee2, bool viewable) +static int status_calc_flee2(struct block_list *bl, struct status_change *sc, int flee2, bool viewable) { if(!sc || !sc->count) - return (signed int)cap_value(flee2, battle_config.flee2_min, battle_config.flee2_max); + return cap_value(flee2, battle_config.flee2_min, battle_config.flee2_max); if( !viewable ){ /* some statuses that are hidden in the status window */ - return (signed int)cap_value(flee2, battle_config.flee2_min, battle_config.flee2_max); + return cap_value(flee2, battle_config.flee2_min, battle_config.flee2_max); } if(sc->data[SC_PLUSAVOIDVALUE]) @@ -5505,7 +5505,7 @@ static signed int status_calc_flee2(struct block_list *bl, struct status_change if (sc->data[SC_FREYJASCROLL]) flee2 += sc->data[SC_FREYJASCROLL]->val2; - return (signed int)cap_value(flee2, battle_config.flee2_min, battle_config.flee2_max); + return cap_value(flee2, battle_config.flee2_min, battle_config.flee2_max); } static defType status_calc_def(struct block_list *bl, struct status_change *sc, int def, bool viewable) diff --git a/src/map/status.h b/src/map/status.h index d5877f11f..a70687b67 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -2338,8 +2338,8 @@ struct status_interface { short (*calc_def2) (struct block_list *bl, struct status_change *sc, int def2, bool viewable); defType (*calc_mdef) (struct block_list *bl, struct status_change *sc, int mdef, bool viewable); short (*calc_mdef2) (struct block_list *bl, struct status_change *sc, int mdef2, bool viewable); - unsigned int (*calc_batk)(struct block_list *bl, struct status_change *sc, int batk, bool viewable); - unsigned int (*base_matk) (struct block_list *bl, const struct status_data *st, int level); + int (*calc_batk)(struct block_list *bl, struct status_change *sc, int batk, bool viewable); + int (*base_matk) (struct block_list *bl, const struct status_data *st, int level); int (*get_weapon_atk) (struct block_list *src, struct weapon_atk *watk, int flag); int (*get_total_mdef) (struct block_list *src); int (*get_total_def) (struct block_list *src); @@ -2350,7 +2350,7 @@ struct status_interface { void (*initChangeTables) (void); void (*initDummyData) (void); int (*base_amotion_pc) (struct map_session_data *sd, struct status_data *st); - unsigned int (*base_atk) (const struct block_list *bl, const struct status_data *st); + int (*base_atk) (const struct block_list *bl, const struct status_data *st); unsigned int (*get_base_maxhp) (const struct map_session_data *sd, const struct status_data *st); unsigned int (*get_base_maxsp) (const struct map_session_data *sd, const struct status_data *st); unsigned int (*get_restart_hp) (const struct map_session_data *sd, const struct status_data *st); @@ -2362,8 +2362,8 @@ struct status_interface { unsigned short (*calc_int) (struct block_list *bl, struct status_change *sc, int int_); unsigned short (*calc_dex) (struct block_list *bl, struct status_change *sc, int dex); unsigned short (*calc_luk) (struct block_list *bl, struct status_change *sc, int luk); - unsigned int (*calc_watk) (struct block_list *bl, struct status_change *sc, int watk, bool viewable); - unsigned int (*calc_matk) (struct block_list *bl, struct status_change *sc, int matk, bool viewable); + int (*calc_watk) (struct block_list *bl, struct status_change *sc, int watk, bool viewable); + int (*calc_matk) (struct block_list *bl, struct status_change *sc, int matk, bool viewable); signed int (*calc_hit) (struct block_list *bl, struct status_change *sc, int hit, bool viewable); signed int (*calc_critical) (struct block_list *bl, struct status_change *sc, int critical, bool viewable); signed int (*calc_flee) (struct block_list *bl, struct status_change *sc, int flee, bool viewable); @@ -2378,7 +2378,7 @@ struct status_interface { unsigned char (*calc_element) (struct block_list *bl, struct status_change *sc, int element); unsigned char (*calc_element_lv) (struct block_list *bl, struct status_change *sc, int lv); uint32 (*calc_mode) (const struct block_list *bl, const struct status_change *sc, uint32 mode); - unsigned int (*calc_ematk) (struct block_list *bl, struct status_change *sc, int matk); + int (*calc_ematk) (struct block_list *bl, struct status_change *sc, int matk); void (*calc_bl_main) (struct block_list *bl, int flag); void (*display_add) (struct map_session_data *sd, enum sc_type type, int dval1, int dval2, int dval3); void (*display_remove) (struct map_session_data *sd, enum sc_type type); @@ -2391,8 +2391,8 @@ struct status_interface { void (*read_job_db_sub) (int idx, const char *name, struct config_setting_t *jdb); void (*set_sc) (uint16 skill_id, sc_type sc, int icon, unsigned int flag); void (*copy) (struct status_data *a, const struct status_data *b); - unsigned int (*base_matk_min) (const struct status_data *st); - unsigned int (*base_matk_max) (const struct status_data *st); + int (*base_matk_min) (const struct status_data *st); + int (*base_matk_max) (const struct status_data *st); }; #ifdef HERCULES_CORE -- cgit v1.2.3-60-g2f50