summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-26 23:07:43 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-27 01:40:12 +0300
commit6d424ee1d72de60873187e1046d4a3be36fc9bab (patch)
treeb93513f729941caa37ecd4bac3e698f5938ade8e /src
parent38070a46cc00379fce10ee3983f892a2df33dbe6 (diff)
downloadhercules-6d424ee1d72de60873187e1046d4a3be36fc9bab.tar.gz
hercules-6d424ee1d72de60873187e1046d4a3be36fc9bab.tar.bz2
hercules-6d424ee1d72de60873187e1046d4a3be36fc9bab.tar.xz
hercules-6d424ee1d72de60873187e1046d4a3be36fc9bab.zip
Move getting val_flag based on type from status_change_start into separate function.
Diffstat (limited to 'src')
-rw-r--r--src/map/status.c270
-rw-r--r--src/map/status.h1
2 files changed, 143 insertions, 128 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 1b85e164a..d26c10e40 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -9529,133 +9529,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
}
/* values that must be set regardless of SCFLAG_LOADED e.g. val_flag */
- switch(type) {
- case SC_FIGHTINGSPIRIT:
- val_flag |= 1|2;
- break;
- case SC_VENOMIMPRESS:
- val_flag |= 1|2;
- break;
- case SC_POISONINGWEAPON:
- val_flag |= 1|2|4;
- break;
- case SC_WEAPONBLOCKING:
- val_flag |= 1|2;
- break;
- case SC_ROLLINGCUTTER:
- val_flag |= 1;
- break;
- case SC_CLOAKINGEXCEED:
- val_flag |= 1|2|4;
- break;
- case SC_HALLUCINATIONWALK:
- val_flag |= 1|2|4;
- break;
- case SC_SUMMON1:
- case SC_SUMMON2:
- case SC_SUMMON3:
- case SC_SUMMON4:
- case SC_SUMMON5:
- val_flag |= 1;
- break;
- case SC__SHADOWFORM:
- val_flag |= 1|2|4;
- break;
- case SC__INVISIBILITY:
- val_flag |= 1|2;
- break;
- case SC__ENERVATION:
- val_flag |= 1|2;
- break;
- case SC__GROOMY:
- val_flag |= 1|2|4;
- break;
- case SC__LAZINESS:
- val_flag |= 1|2|4;
- break;
- case SC__UNLUCKY:
- val_flag |= 1|2|4;
- break;
- case SC__WEAKNESS:
- val_flag |= 1|2;
- break;
- case SC_PROPERTYWALK:
- val_flag |= 1|2;
- break;
- case SC_FORCEOFVANGUARD:
- val_flag |= 1|2|4;
- break;
- case SC_PRESTIGE:
- val_flag |= 1|2;
- break;
- case SC_BANDING:
- val_flag |= 1;
- break;
- case SC_SHIELDSPELL_DEF:
- case SC_SHIELDSPELL_MDEF:
- case SC_SHIELDSPELL_REF:
- val_flag |= 1|2;
- break;
- case SC_SPELLFIST:
- case SC_CURSEDCIRCLE_ATKER:
- val_flag |= 1|2|4;
- break;
- case SC_CRESCENTELBOW:
- val_flag |= 1|2;
- break;
- case SC_LIGHTNINGWALK:
- val_flag |= 1;
- break;
- case SC_PYROTECHNIC_OPTION:
- val_flag |= 1|2|4;
- break;
- case SC_HEATER_OPTION:
- val_flag |= 1|2|4;
- break;
- case SC_AQUAPLAY_OPTION:
- val_flag |= 1|2|4;
- break;
- case SC_COOLER_OPTION:
- val_flag |= 1|2|4;
- break;
- case SC_CHILLY_AIR_OPTION:
- val_flag |= 1|2;
- break;
- case SC_GUST_OPTION:
- val_flag |= 1|2;
- break;
- case SC_BLAST_OPTION:
- val_flag |= 1|2|4;
- break;
- case SC_WILD_STORM_OPTION:
- val_flag |= 1|2;
- break;
- case SC_PETROLOGY_OPTION:
- val_flag |= 1|2|4;
- break;
- case SC_CURSED_SOIL_OPTION:
- val_flag |= 1|2|4;
- break;
- case SC_UPHEAVAL_OPTION:
- val_flag |= 1|2;
- break;
- case SC_CIRCLE_OF_FIRE_OPTION:
- val_flag |= 1|2;
- break;
- case SC_WATER_BARRIER:
- val_flag |= 1|2|4;
- break;
- case SC_KYOUGAKU:
- val_flag |= 1;
- break;
- case SC_CASH_PLUSEXP:
- case SC_CASH_PLUSONLYJOBEXP:
- case SC_MONSTER_TRANSFORM:
- case SC_CASH_RECEIVEITEM:
- case SC_OVERLAPEXPUP:
- val_flag |= 1;
- break;
- }
+ val_flag = status->get_val_flag(type);
/* [Ind/Hercules] */
if( sd && status->dbs->DisplayType[type] ) {
@@ -9677,7 +9551,6 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
// Set option as needed.
opt_flag = status->change_start_set_option(bl, sc, type, val1, val2, val3, val4);
-
//On Aegis, when turning on a status change, first goes the option packet, then the sc packet.
if(opt_flag) {
clif->changeoption(bl);
@@ -9841,6 +9714,146 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
}
/**
+ * Return val_flag based on sc type.
+ *
+ * @param type Status change type.
+ *
+ * @retval val_flag.
+ */
+int status_get_val_flag(enum sc_type type)
+{
+ int val_flag = 0;
+ switch (type) {
+ case SC_FIGHTINGSPIRIT:
+ val_flag |= 1 | 2;
+ break;
+ case SC_VENOMIMPRESS:
+ val_flag |= 1 | 2;
+ break;
+ case SC_POISONINGWEAPON:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_WEAPONBLOCKING:
+ val_flag |= 1 | 2;
+ break;
+ case SC_ROLLINGCUTTER:
+ val_flag |= 1;
+ break;
+ case SC_CLOAKINGEXCEED:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_HALLUCINATIONWALK:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_SUMMON1:
+ case SC_SUMMON2:
+ case SC_SUMMON3:
+ case SC_SUMMON4:
+ case SC_SUMMON5:
+ val_flag |= 1;
+ break;
+ case SC__SHADOWFORM:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC__INVISIBILITY:
+ val_flag |= 1 | 2;
+ break;
+ case SC__ENERVATION:
+ val_flag |= 1 | 2;
+ break;
+ case SC__GROOMY:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC__LAZINESS:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC__UNLUCKY:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC__WEAKNESS:
+ val_flag |= 1 | 2;
+ break;
+ case SC_PROPERTYWALK:
+ val_flag |= 1 | 2;
+ break;
+ case SC_FORCEOFVANGUARD:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_PRESTIGE:
+ val_flag |= 1 | 2;
+ break;
+ case SC_BANDING:
+ val_flag |= 1;
+ break;
+ case SC_SHIELDSPELL_DEF:
+ case SC_SHIELDSPELL_MDEF:
+ case SC_SHIELDSPELL_REF:
+ val_flag |= 1 | 2;
+ break;
+ case SC_SPELLFIST:
+ case SC_CURSEDCIRCLE_ATKER:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_CRESCENTELBOW:
+ val_flag |= 1 | 2;
+ break;
+ case SC_LIGHTNINGWALK:
+ val_flag |= 1;
+ break;
+ case SC_PYROTECHNIC_OPTION:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_HEATER_OPTION:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_AQUAPLAY_OPTION:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_COOLER_OPTION:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_CHILLY_AIR_OPTION:
+ val_flag |= 1 | 2;
+ break;
+ case SC_GUST_OPTION:
+ val_flag |= 1 | 2;
+ break;
+ case SC_BLAST_OPTION:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_WILD_STORM_OPTION:
+ val_flag |= 1 | 2;
+ break;
+ case SC_PETROLOGY_OPTION:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_CURSED_SOIL_OPTION:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_UPHEAVAL_OPTION:
+ val_flag |= 1 | 2;
+ break;
+ case SC_CIRCLE_OF_FIRE_OPTION:
+ val_flag |= 1 | 2;
+ break;
+ case SC_WATER_BARRIER:
+ val_flag |= 1 | 2 | 4;
+ break;
+ case SC_KYOUGAKU:
+ val_flag |= 1;
+ break;
+ case SC_CASH_PLUSEXP:
+ case SC_CASH_PLUSONLYJOBEXP:
+ case SC_MONSTER_TRANSFORM:
+ case SC_CASH_RECEIVEITEM:
+ case SC_OVERLAPEXPUP:
+ val_flag |= 1;
+ break;
+ }
+ return val_flag;
+}
+
+/**
* Set new status values.
*
* @param bl Status change target bl.
@@ -13580,6 +13593,7 @@ void status_defaults(void)
status->end_sc_before_start = status_end_sc_before_start;
status->change_start_stop_action = status_change_start_stop_action;
status->change_start_set_option = status_change_start_set_option;
+ status->get_val_flag = status_get_val_flag;
status->calc_bl_ = status_calc_bl_;
status->calc_mob_ = status_calc_mob_;
status->calc_pet_ = status_calc_pet_;
diff --git a/src/map/status.h b/src/map/status.h
index 161f66f43..2ab665495 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -2336,6 +2336,7 @@ struct status_interface {
bool (*end_sc_before_start) (struct block_list *bl, struct status_data *st, struct status_change* sc, enum sc_type type, int undead_flag, int val1, int val2, int val3, int val4);
void (*change_start_stop_action) (struct block_list *bl, enum sc_type type);
int (*change_start_set_option) (struct block_list *bl, struct status_change* sc, enum sc_type type, int val1, int val2, int val3, int val4);
+ int (*get_val_flag) (enum sc_type type);
int (*kaahi_heal_timer) (int tid, int64 tick, int id, intptr_t data);
int (*change_timer) (int tid, int64 tick, int id, intptr_t data);
int (*change_timer_sub) (struct block_list* bl, va_list ap);