diff options
author | shennetsind <ind@henn.et> | 2013-09-29 15:42:33 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-09-29 15:42:33 -0300 |
commit | 4de6b8e083f5e14ebc5a453af7efce341852be7a (patch) | |
tree | 5e0ad74b3570299a301dc25c8a6228ef1c448036 /src/map/status.h | |
parent | dbd0dce80cdc7ea02391d5e096b6561f0b598259 (diff) | |
download | hercules-4de6b8e083f5e14ebc5a453af7efce341852be7a.tar.gz hercules-4de6b8e083f5e14ebc5a453af7efce341852be7a.tar.bz2 hercules-4de6b8e083f5e14ebc5a453af7efce341852be7a.tar.xz hercules-4de6b8e083f5e14ebc5a453af7efce341852be7a.zip |
HPM: Status.c Completed
Fully Interfaced.
Moved missing vars and declarations of interest into the interface.
Removed a couple things from pc.h into mmo.h due to circular dependence.
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/status.h')
-rw-r--r-- | src/map/status.h | 139 |
1 files changed, 103 insertions, 36 deletions
diff --git a/src/map/status.h b/src/map/status.h index 16a9be081..d1e78b0b7 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1,8 +1,12 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena Dev Teams + #ifndef _STATUS_H_ #define _STATUS_H_ +#include "../common/mmo.h" + struct block_list; struct mob_data; struct pet_data; @@ -1580,6 +1584,14 @@ enum scb_flag SCB_ALL = 0x3FFFFFFF }; +//Regen related flags. +enum e_regen { + RGN_HP = 0x01, + RGN_SP = 0x02, + RGN_SHP = 0x04, + RGN_SSP = 0x08, +}; + //Define to determine who gets HP/SP consumed on doing skills/etc. [Skotlex] #define BL_CONSUME (BL_PC|BL_HOM|BL_MER|BL_ELEM) //Define to determine who has regen @@ -1598,15 +1610,7 @@ typedef struct weapon_atk { unsigned short matk; unsigned char wlv; #endif -}weapon_atk; - -sc_type SkillStatusChangeTable[MAX_SKILL]; // skill -> status -int StatusIconChangeTable[SC_MAX]; // status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated) -unsigned int StatusChangeFlagTable[SC_MAX]; // status -> flags -int StatusSkillChangeTable[SC_MAX]; // status -> skill -int StatusRelevantBLTypes[SI_MAX]; // "icon" -> enum bl_type (for clif->status_change to identify for which bl types to send packets) -bool StatusDisplayType[SC_MAX]; - +} weapon_atk; //For holding basic status (which can be modified by status changes) struct status_data { @@ -1780,6 +1784,13 @@ struct status_change { #define status_calc_elemental(ed, first) status->calc_bl_(&(ed)->bl, SCB_ALL, first) #define status_calc_npc(nd, first) status->calc_bl_(&(nd)->bl, SCB_ALL, first) +// bonus values and upgrade chances for refining equipment +struct s_refine_info { + int chance[MAX_REFINE]; // success chance + int bonus[MAX_REFINE]; // cumulative fixed bonus damage + int randombonus_max[MAX_REFINE]; // cumulative maximum random bonus damage +}; + /*===================================== * Interface : status.h * Generated by HerculesInterfaceMaker @@ -1788,12 +1799,38 @@ struct status_change { struct status_interface { /* vars */ - int current_equip_item_index; int current_equip_card_id; - + /* */ + int max_weight_base[CLASS_COUNT]; + int hp_coefficient[CLASS_COUNT]; + int hp_coefficient2[CLASS_COUNT]; + int hp_sigma_val[CLASS_COUNT][MAX_LEVEL+1]; + int sp_coefficient[CLASS_COUNT]; +#ifdef RENEWAL_ASPD + int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; +#else + int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE]; //[blackhole89] +#endif + sc_type Skill2SCTable[MAX_SKILL]; // skill -> status + int IconChangeTable[SC_MAX]; // status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated) + unsigned int ChangeFlagTable[SC_MAX]; // status -> flags + int SkillChangeTable[SC_MAX]; // status -> skill + int RelevantBLTypes[SI_MAX]; // "icon" -> enum bl_type (for clif->status_change to identify for which bl types to send packets) + bool DisplayType[SC_MAX]; + /* */ + struct s_refine_info refine_info[REFINE_TYPE_MAX]; + /* */ + int atkmods[3][MAX_WEAPON_TYPE];//ATK weapon modification for size (size_fix.txt) + char job_bonus[CLASS_COUNT][MAX_LEVEL]; + sc_conf_type sc_conf[SC_MAX]; + struct eri *data_ers; //For sc_data entries + struct status_data dummy; + unsigned int natural_heal_prev_tick,natural_heal_diff_tick; + /* */ + int (*init) (void); + void (*final) (void); /* funcs */ - int (*get_refine_chance) (enum refine_type wlv, int refine); // for looking up associated data sc_type (*skill2sc) (int skill_id); @@ -1801,7 +1838,6 @@ struct status_interface { unsigned int (*sc2scb_flag) (sc_type sc); int (*type2relevant_bl_types) (int type); int (*get_sc_type) (sc_type idx); - int (*damage) (struct block_list *src,struct block_list *target,int64 hp,int64 sp, int walkdelay, int flag); //Define for standard HP/SP skill-related cost triggers (mobs require no HP/SP to use skills) int (*charge) (struct block_list* bl, int64 hp, int64 sp); @@ -1811,7 +1847,6 @@ struct status_interface { int (*set_sp) (struct block_list *bl, unsigned int sp, int flag); int (*heal) (struct block_list *bl,int64 hp,int64 sp, int flag); int (*revive) (struct block_list *bl, unsigned char per_hp, unsigned char per_sp); - struct regen_data * (*get_regen_data) (struct block_list *bl); struct status_data * (*get_status_data) (struct block_list *bl); struct status_data * (*get_base_status) (struct block_list *bl); @@ -1826,17 +1861,13 @@ struct status_interface { int (*get_emblem_id) (struct block_list *bl); int (*get_mexp) (struct block_list *bl); int (*get_race2) (struct block_list *bl); - struct view_data * (*get_viewdata) (struct block_list *bl); void (*set_viewdata) (struct block_list *bl, int class_); void (*change_init) (struct block_list *bl); struct status_change * (*get_sc) (struct block_list *bl); - int (*isdead) (struct block_list *bl); int (*isimmune) (struct block_list *bl); - int (*get_sc_def) (struct block_list *bl, enum sc_type type, int rate, int tick, int flag); - int (*change_start) (struct block_list* bl,enum sc_type type,int rate,int val1,int val2,int val3,int val4,int tick,int flag); int (*change_end_) (struct block_list* bl, enum sc_type type, int tid, const char* file, int line); int (*kaahi_heal_timer) (int tid, unsigned int tick, int id, intptr_t data); @@ -1844,7 +1875,6 @@ struct status_interface { int (*change_timer_sub) (struct block_list* bl, va_list ap); int (*change_clear) (struct block_list* bl, int type); int (*change_clear_buffs) (struct block_list* bl, int type); - void (*calc_bl_) (struct block_list *bl, enum scb_flag flag, bool first); int (*calc_mob_) (struct mob_data* md, bool first); int (*calc_pet_) (struct pet_data* pd, bool first); @@ -1852,35 +1882,72 @@ struct status_interface { int (*calc_homunculus_) (struct homun_data *hd, bool first); int (*calc_mercenary_) (struct mercenary_data *md, bool first); int (*calc_elemental_) (struct elemental_data *ed, bool first); - void (*calc_misc) (struct block_list *bl, struct status_data *status, int level); void (*calc_regen) (struct block_list *bl, struct status_data *st, struct regen_data *regen); void (*calc_regen_rate) (struct block_list *bl, struct regen_data *regen, struct status_change *sc); - int (*check_skilluse) (struct block_list *src, struct block_list *target, uint16 skill_id, int flag); // [Skotlex] int (*check_visibility) (struct block_list *src, struct block_list *target); //[Skotlex] - int (*change_spread) (struct block_list *src, struct block_list *bl); - - defType (*calc_def) (struct block_list *bl, struct status_change *sc, int, bool); - short (*calc_def2) (struct block_list *, struct status_change *, int, bool); - defType (*calc_mdef) (struct block_list *bl, struct status_change *sc, int, bool); - short (*calc_mdef2) (struct block_list *, struct status_change *, int, bool); - unsigned short (*calc_batk) (struct block_list *, struct status_change *, int, bool); - + defType (*calc_def) (struct block_list *bl, struct status_change *sc, int def, bool viewable); + 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); #ifdef RENEWAL unsigned short (*base_matk) (const struct status_data *st, int level); int (*get_weapon_atk) (struct block_list *src, struct weapon_atk *watk, int flag); #endif int (*get_total_mdef) (struct block_list *src); int (*get_total_def) (struct block_list *src); - int (*get_matk) (struct block_list *src, int flag); - int (*readdb) (void); - int (*init) (void); - void (*final) (void); -} status_s; + + 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); + void (*calc_sigma) (void); + unsigned int (*base_pc_maxhp) (struct map_session_data *sd, struct status_data *st); + unsigned int (*base_pc_maxsp) (struct map_session_data *sd, struct status_data *st); + int (*calc_npc_) (struct npc_data *nd, bool first); + unsigned short (*calc_str) (struct block_list *bl, struct status_change *sc, int str); + unsigned short (*calc_agi) (struct block_list *bl, struct status_change *sc, int agi); + unsigned short (*calc_vit) (struct block_list *bl, struct status_change *sc, int vit); + 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 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); +#ifdef RENEWAL_ASPD + short (*calc_aspd) (struct block_list *bl, struct status_change *sc, short flag); +#endif + short (*calc_fix_aspd) (struct block_list *bl, struct status_change *sc, int aspd); + unsigned int (*calc_maxhp) (struct block_list *bl, struct status_change *sc, uint64 maxhp); + unsigned int (*calc_maxsp) (struct block_list *bl, struct status_change *sc, unsigned int maxsp); + 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); + unsigned short (*calc_mode) (struct block_list *bl, struct status_change *sc, int mode); +#ifdef RENEWAL + unsigned short (*calc_ematk) (struct block_list *bl, struct status_change *sc, int matk); +#endif + 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); + int (*natural_heal) (struct block_list *bl, va_list args); + int (*natural_heal_timer) (int tid, unsigned int tick, int id, intptr_t data); + bool (*readdb_job1) (char *fields[], int columns, int current); + bool (*readdb_job2) (char *fields[], int columns, int current); + bool (*readdb_sizefix) (char *fields[], int columns, int current); + bool (*readdb_refine) (char *fields[], int columns, int current); + bool (*readdb_scconfig) (char *fields[], int columns, int current); +}; struct status_interface *status; |