diff options
Diffstat (limited to 'src/map/pc.h')
-rw-r--r-- | src/map/pc.h | 249 |
1 files changed, 122 insertions, 127 deletions
diff --git a/src/map/pc.h b/src/map/pc.h index d384e0145..fadb922b5 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -22,10 +22,13 @@ #include "unit.h" // unit_stop_attack(), unit_stop_walking() #include "vending.h" // struct s_vending - +/** + * Defines + **/ #define MAX_PC_BONUS 10 #define MAX_PC_SKILL_REQUIRE 5 #define MAX_PC_FEELHATE 3 +#define PVP_CALCRANK_INTERVAL 1000 // PVP calculation interval //Equip indexes constants. (eg: sd->equip_index[EQI_AMMO] returns the index //where the arrows are equipped) @@ -521,58 +524,6 @@ struct map_session_data { }; -struct eri *pc_sc_display_ers; - -//Total number of classes (for data storage) -#define CLASS_COUNT (JOB_MAX - JOB_NOVICE_HIGH + JOB_MAX_BASIC) - -enum weapon_type { - W_FIST, //Bare hands - W_DAGGER, //1 - W_1HSWORD, //2 - W_2HSWORD, //3 - W_1HSPEAR, //4 - W_2HSPEAR, //5 - W_1HAXE, //6 - W_2HAXE, //7 - W_MACE, //8 - W_2HMACE, //9 (unused) - W_STAFF, //10 - W_BOW, //11 - W_KNUCKLE, //12 - W_MUSICAL, //13 - W_WHIP, //14 - W_BOOK, //15 - W_KATAR, //16 - W_REVOLVER, //17 - W_RIFLE, //18 - W_GATLING, //19 - W_SHOTGUN, //20 - W_GRENADE, //21 - W_HUUMA, //22 - W_2HSTAFF, //23 - MAX_WEAPON_TYPE, - // dual-wield constants - W_DOUBLE_DD, // 2 daggers - W_DOUBLE_SS, // 2 swords - W_DOUBLE_AA, // 2 axes - W_DOUBLE_DS, // dagger + sword - W_DOUBLE_DA, // dagger + axe - W_DOUBLE_SA, // sword + axe -}; - -enum ammo_type { - A_ARROW = 1, - A_DAGGER, //2 - A_BULLET, //3 - A_SHELL, //4 - A_GRENADE, //5 - A_SHURIKEN, //6 - A_KUNAI, //7 - A_CANNONBALL, //8 - A_THROWWEAPON //9 -}; - //Equip position constants enum equip_pos { EQP_HEAD_LOW = 0x0001, @@ -634,7 +585,7 @@ enum equip_pos { #define pc_isinvisible(sd) ( (sd)->sc.option&OPTION_INVISIBLE ) #define pc_is50overweight(sd) ( (sd)->weight*100 >= (sd)->max_weight*battle_config.natural_heal_weight_rate ) #define pc_is90overweight(sd) ( (sd)->weight*10 >= (sd)->max_weight*9 ) -#define pc_maxparameter(sd) ( ((((sd)->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO) || (sd)->class_&JOBL_THIRD ? ((sd)->class_&JOBL_BABY ? battle_config.max_baby_third_parameter : battle_config.max_third_parameter) : ((sd)->class_&JOBL_BABY ? battle_config.max_baby_parameter : battle_config.max_parameter)) ) +#define pc_maxparameter(sd) ( ((((sd)->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO) || (((sd)->class_&MAPID_UPPERMASK) == MAPID_REBELLION) || (sd)->class_&JOBL_THIRD ? ((sd)->class_&JOBL_BABY ? battle_config.max_baby_third_parameter : battle_config.max_third_parameter) : ((sd)->class_&JOBL_BABY ? battle_config.max_baby_parameter : battle_config.max_parameter)) ) /** * Ranger **/ @@ -660,7 +611,8 @@ enum equip_pos { || ( (class_) >= JOB_RUNE_KNIGHT && (class_) <= JOB_MECHANIC_T2 ) \ || ( (class_) >= JOB_BABY_RUNE && (class_) <= JOB_BABY_MECHANIC2 ) \ || ( (class_) >= JOB_SUPER_NOVICE_E && (class_) <= JOB_SUPER_BABY_E ) \ -|| ( (class_) >= JOB_KAGEROU && (class_) < JOB_MAX ) \ +|| ( (class_) >= JOB_KAGEROU && (class_) <= JOB_OBORO ) \ +|| ( (class_) >= JOB_REBELLION && (class_) < JOB_MAX ) \ ) #define pcdb_checkid(class_) pcdb_checkid_sub((unsigned int)class_) @@ -725,8 +677,6 @@ struct skill_tree_entry { } need[MAX_PC_SKILL_REQUIRE]; }; // Celest -extern struct skill_tree_entry skill_tree[CLASS_COUNT][MAX_SKILL_TREE]; - struct sg_data { short anger_id; short bless_id; @@ -736,16 +686,19 @@ struct sg_data { int (*day_func)(void); }; -extern const struct sg_data sg_info[MAX_PC_FEELHATE]; - -extern struct fame_list smith_fame_list[MAX_FAME_LIST]; -extern struct fame_list chemist_fame_list[MAX_FAME_LIST]; -extern struct fame_list taekwon_fame_list[MAX_FAME_LIST]; +enum { ADDITEM_EXIST , ADDITEM_NEW , ADDITEM_OVERAMOUNT }; -enum {ADDITEM_EXIST,ADDITEM_NEW,ADDITEM_OVERAMOUNT}; +/** + * Item Cool Down Delay Saving + * Struct item_cd is not a member of struct map_session_data + * to keep cooldowns in memory between player log-ins. + * All cooldowns are reset when server is restarted. + **/ +struct item_cd { + unsigned int tick[MAX_ITEMDELAYS];//tick + short nameid[MAX_ITEMDELAYS];//skill id +}; -#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) -#endif /*===================================== * Interface : pc.h * Generated by HerculesInterfaceMaker @@ -753,12 +706,30 @@ enum {ADDITEM_EXIST,ADDITEM_NEW,ADDITEM_OVERAMOUNT}; *-------------------------------------*/ struct pc_interface { - /* vars */ - // timer for night.day + /* */ + DBMap* itemcd_db; + /* */ int day_timer_tid; int night_timer_tid; - + /* */ + unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL]; + unsigned int max_level[CLASS_COUNT][2]; + unsigned int statp[MAX_LEVEL+1]; +#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) + unsigned int level_penalty[3][RC_MAX][MAX_LEVEL*2+1]; +#endif + unsigned short equip_pos[EQI_MAX]; + /* */ + struct skill_tree_entry skill_tree[CLASS_COUNT][MAX_SKILL_TREE]; + struct fame_list smith_fame_list[MAX_FAME_LIST]; + struct fame_list chemist_fame_list[MAX_FAME_LIST]; + struct fame_list taekwon_fame_list[MAX_FAME_LIST]; + struct sg_data sg_info[MAX_PC_FEELHATE]; + /* */ + struct eri *sc_display_ers; /* funcs */ + void (*init) (void); + void (*final) (void); struct map_session_data* (*get_dummy_sd) (void); int (*class2idx) (int class_); @@ -772,11 +743,11 @@ struct pc_interface { bool (*should_log_commands) (struct map_session_data *sd); int (*setrestartvalue) (struct map_session_data *sd,int type); - int (*makesavestatus) (struct map_session_data *); + int (*makesavestatus) (struct map_session_data *sd); void (*respawn) (struct map_session_data* sd, clr_type clrtype); - int (*setnewpc) (struct map_session_data*,int,int,int,unsigned int,int,int); + int (*setnewpc) (struct map_session_data *sd, int account_id, int char_id, int login_id1, unsigned int client_tick, int sex, int fd); bool (*authok) (struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers); - void (*authfail) (struct map_session_data *); + void (*authfail) (struct map_session_data *sd); int (*reg_received) (struct map_session_data *sd); int (*isequip) (struct map_session_data *sd,int n); @@ -793,17 +764,17 @@ struct pc_interface { int (*clean_skilltree) (struct map_session_data *sd); int (*setpos) (struct map_session_data* sd, unsigned short mapindex, int x, int y, clr_type clrtype); - int (*setsavepoint) (struct map_session_data*,short,int,int); + int (*setsavepoint) (struct map_session_data *sd, short mapindex,int x,int y); int (*randomwarp) (struct map_session_data *sd,clr_type type); int (*memo) (struct map_session_data* sd, int pos); - int (*checkadditem) (struct map_session_data*,int,int); - int (*inventoryblank) (struct map_session_data*); + int (*checkadditem) (struct map_session_data *sd,int nameid,int amount); + int (*inventoryblank) (struct map_session_data *sd); int (*search_inventory) (struct map_session_data *sd,int item_id); - int (*payzeny) (struct map_session_data*,int, enum e_log_pick_type type, struct map_session_data*); - int (*additem) (struct map_session_data*,struct item*,int,e_log_pick_type); - int (*getzeny) (struct map_session_data*,int, enum e_log_pick_type, struct map_session_data*); - int (*delitem) (struct map_session_data*,int,int,int,short,e_log_pick_type); + int (*payzeny) (struct map_session_data *sd,int zeny, enum e_log_pick_type type, struct map_session_data *tsd); + int (*additem) (struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type); + int (*getzeny) (struct map_session_data *sd,int zeny, enum e_log_pick_type type, struct map_session_data *tsd); + int (*delitem) (struct map_session_data *sd,int n,int amount,int type, short reason, e_log_pick_type log_type); // Special Shop System int (*paycash) (struct map_session_data *sd, int price, int points); int (*getcash) (struct map_session_data *sd, int cash, int points); @@ -814,8 +785,8 @@ struct pc_interface { int (*getitemfromcart) (struct map_session_data *sd,int idx,int amount); int (*cartitem_amount) (struct map_session_data *sd,int idx,int amount); - int (*takeitem) (struct map_session_data*,struct flooritem_data*); - int (*dropitem) (struct map_session_data*,int,int); + int (*takeitem) (struct map_session_data *sd,struct flooritem_data *fitem); + int (*dropitem) (struct map_session_data *sd,int n,int amount); bool (*isequipped) (struct map_session_data *sd, int nameid); bool (*can_Adopt) (struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd); @@ -828,48 +799,48 @@ struct pc_interface { int (*endautobonus) (int tid, unsigned int tick, int id, intptr_t data); int (*delautobonus) (struct map_session_data* sd,struct s_autobonus *bonus,char max,bool restore); - int (*bonus) (struct map_session_data*,int,int); - int (*bonus2) (struct map_session_data *sd,int,int,int); - int (*bonus3) (struct map_session_data *sd,int,int,int,int); - int (*bonus4) (struct map_session_data *sd,int,int,int,int,int); - int (*bonus5) (struct map_session_data *sd,int,int,int,int,int,int); - int (*skill) (struct map_session_data* sd, int id, int level, int flag); + int (*bonus) (struct map_session_data *sd,int type,int val); + int (*bonus2) (struct map_session_data *sd,int type,int type2,int val); + int (*bonus3) (struct map_session_data *sd,int type,int type2,int type3,int val); + int (*bonus4) (struct map_session_data *sd,int type,int type2,int type3,int type4,int val); + int (*bonus5) (struct map_session_data *sd,int type,int type2,int type3,int type4,int type5,int val); + int (*skill) (struct map_session_data *sd, int id, int level, int flag); int (*insert_card) (struct map_session_data *sd,int idx_card,int idx_equip); int (*steal_item) (struct map_session_data *sd,struct block_list *bl, uint16 skill_lv); int (*steal_coin) (struct map_session_data *sd,struct block_list *bl); - int (*modifybuyvalue) (struct map_session_data*,int); - int (*modifysellvalue) (struct map_session_data*,int); + int (*modifybuyvalue) (struct map_session_data *sd,int orig_value); + int (*modifysellvalue) (struct map_session_data *sd,int orig_value); - int (*follow) (struct map_session_data*, int); // [MouseJstr] - int (*stop_following) (struct map_session_data*); + int (*follow) (struct map_session_data *sd, int target_id); // [MouseJstr] + int (*stop_following) (struct map_session_data *sd); unsigned int (*maxbaselv) (struct map_session_data *sd); unsigned int (*maxjoblv) (struct map_session_data *sd); int (*checkbaselevelup) (struct map_session_data *sd); int (*checkjoblevelup) (struct map_session_data *sd); int (*gainexp) (struct map_session_data *sd, struct block_list *src, unsigned int base_exp, unsigned int job_exp, bool is_quest); - unsigned int (*nextbaseexp) (struct map_session_data *); - unsigned int (*thisbaseexp) (struct map_session_data *); - unsigned int (*nextjobexp) (struct map_session_data *); - unsigned int (*thisjobexp) (struct map_session_data *); - int (*gets_status_point) (int); - int (*need_status_point) (struct map_session_data *,int,int); - int (*statusup) (struct map_session_data*,int); - int (*statusup2) (struct map_session_data*,int,int); - int (*skillup) (struct map_session_data*,uint16 skill_id); - int (*allskillup) (struct map_session_data*); - int (*resetlvl) (struct map_session_data*,int type); - int (*resetstate) (struct map_session_data*); - int (*resetskill) (struct map_session_data*, int); - int (*resetfeel) (struct map_session_data*); - int (*resethate) (struct map_session_data*); - int (*equipitem) (struct map_session_data*,int,int); - int (*unequipitem) (struct map_session_data*,int,int); - int (*checkitem) (struct map_session_data*); - int (*useitem) (struct map_session_data*,int); + unsigned int (*nextbaseexp) (struct map_session_data *sd); + unsigned int (*thisbaseexp) (struct map_session_data *sd); + unsigned int (*nextjobexp) (struct map_session_data *sd); + unsigned int (*thisjobexp) (struct map_session_data *sd); + int (*gets_status_point) (int level); + int (*need_status_point) (struct map_session_data *sd,int type,int val); + int (*statusup) (struct map_session_data *sd,int type); + int (*statusup2) (struct map_session_data *sd,int type,int val); + int (*skillup) (struct map_session_data *sd,uint16 skill_id); + int (*allskillup) (struct map_session_data *sd); + int (*resetlvl) (struct map_session_data *sd,int type); + int (*resetstate) (struct map_session_data *sd); + int (*resetskill) (struct map_session_data *sd, int flag); + int (*resetfeel) (struct map_session_data *sd); + int (*resethate) (struct map_session_data *sd); + int (*equipitem) (struct map_session_data *sd,int n,int req_pos); + int (*unequipitem) (struct map_session_data *sd,int n,int flag); + int (*checkitem) (struct map_session_data *sd); + int (*useitem) (struct map_session_data *sd,int n); int (*skillatk_bonus) (struct map_session_data *sd, uint16 skill_id); int (*skillheal_bonus) (struct map_session_data *sd, uint16 skill_id); @@ -880,26 +851,26 @@ struct pc_interface { void (*revive) (struct map_session_data *sd,unsigned int hp, unsigned int sp); void (*heal) (struct map_session_data *sd,unsigned int hp,unsigned int sp, int type); int (*itemheal) (struct map_session_data *sd,int itemid, int hp,int sp); - int (*percentheal) (struct map_session_data *sd,int,int); - int (*jobchange) (struct map_session_data *,int, int); - int (*setoption) (struct map_session_data *,int); + int (*percentheal) (struct map_session_data *sd,int hp,int sp); + int (*jobchange) (struct map_session_data *sd,int job, int upper); + int (*setoption) (struct map_session_data *sd,int type); int (*setcart) (struct map_session_data* sd, int type); int (*setfalcon) (struct map_session_data* sd, int flag); int (*setriding) (struct map_session_data* sd, int flag); int (*setmadogear) (struct map_session_data* sd, int flag); - int (*changelook) (struct map_session_data *,int,int); + int (*changelook) (struct map_session_data *sd,int type,int val); int (*equiplookall) (struct map_session_data *sd); - int (*readparam) (struct map_session_data*,int); - int (*setparam) (struct map_session_data*,int,int); - int (*readreg) (struct map_session_data*,int); - int (*setreg) (struct map_session_data*,int,int); + int (*readparam) (struct map_session_data *sd,int type); + int (*setparam) (struct map_session_data *sd,int type,int val); + int (*readreg) (struct map_session_data *sd,int reg); + int (*setreg) (struct map_session_data *sd,int reg,int val); char * (*readregstr) (struct map_session_data *sd,int reg); int (*setregstr) (struct map_session_data *sd,int reg,const char *str); - int (*readregistry) (struct map_session_data*,const char*,int); - int (*setregistry) (struct map_session_data*,const char*,int,int); - char * (*readregistry_str) (struct map_session_data*,const char*,int); - int (*setregistry_str) (struct map_session_data*,const char*,const char*,int); + int (*readregistry) (struct map_session_data *sd,const char *reg,int type); + int (*setregistry) (struct map_session_data *sd,const char *reg,int val,int type); + char * (*readregistry_str) (struct map_session_data *sd,const char *reg,int type); + int (*setregistry_str) (struct map_session_data *sd,const char *reg,const char *val,int type); int (*addeventtimer) (struct map_session_data *sd,int tick,const char *name); int (*deleventtimer) (struct map_session_data *sd,const char *name); @@ -931,15 +902,13 @@ struct pc_interface { void (*setinvincibletimer) (struct map_session_data* sd, int val); void (*delinvincibletimer) (struct map_session_data* sd); - int (*addspiritball) (struct map_session_data *sd,int,int); - int (*delspiritball) (struct map_session_data *sd,int,int); + int (*addspiritball) (struct map_session_data *sd,int interval,int max); + int (*delspiritball) (struct map_session_data *sd,int count,int type); void (*addfame) (struct map_session_data *sd,int count); unsigned char (*famerank) (int char_id, int job); int (*set_hate_mob) (struct map_session_data *sd, int pos, struct block_list *bl); int (*readdb) (void); - int (*do_init_pc) (void); - void (*do_final_pc) (void); int (*map_day_timer) (int tid, unsigned int tick, int id, intptr_t data); // by [yor] int (*map_night_timer) (int tid, unsigned int tick, int id, intptr_t data); // by [yor] // Rental System @@ -962,10 +931,36 @@ struct pc_interface { int (*del_charm) (struct map_session_data *sd,int count,int type); void (*baselevelchanged) (struct map_session_data *sd); -#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) int (*level_penalty_mod) (int diff, unsigned char race, unsigned short mode, int type); -#endif int (*calc_skillpoint) (struct map_session_data* sd); + + int (*invincible_timer) (int tid, unsigned int tick, int id, intptr_t data); + int (*spiritball_timer) (int tid, unsigned int tick, int id, intptr_t data); + int (*check_banding) ( struct block_list *bl, va_list ap ); + int (*inventory_rental_end) (int tid, unsigned int tick, int id, intptr_t data); + void (*check_skilltree) (struct map_session_data *sd, int skill_id); + int (*bonus_autospell) (struct s_autospell *spell, int max, short id, short lv, short rate, short flag, short card_id); + int (*bonus_autospell_onskill) (struct s_autospell *spell, int max, short src_skill, short id, short lv, short rate, short card_id); + int (*bonus_addeff) (struct s_addeffect* effect, int max, enum sc_type id, short rate, short arrow_rate, unsigned char flag); + int (*bonus_addeff_onskill) (struct s_addeffectonskill* effect, int max, enum sc_type id, short rate, short skill_id, unsigned char target); + int (*bonus_item_drop) (struct s_add_drop *drop, const short max, short id, short group, int race, int rate); + void (*calcexp) (struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src); + int (*respawn_timer) (int tid, unsigned int tick, int id, intptr_t data); + int (*jobchange_killclone) (struct block_list *bl, va_list ap); + int (*getstat) (struct map_session_data* sd, int type); + int (*setstat) (struct map_session_data* sd, int type, int val); + int (*eventtimer) (int tid, unsigned int tick, int id, intptr_t data); + int (*daynight_timer_sub) (struct map_session_data *sd,va_list ap); + int (*charm_timer) (int tid, unsigned int tick, int id, intptr_t data); + bool (*readdb_levelpenalty) (char* fields[], int columns, int current); + int (*autosave) (int tid, unsigned int tick, int id, intptr_t data); + int (*follow_timer) (int tid, unsigned int tick, int id, intptr_t data); + void (*read_skill_tree) (void); + int (*isUseitem) (struct map_session_data *sd,int n); + int (*show_steal) (struct block_list *bl,va_list ap); + int (*checkcombo) (struct map_session_data *sd, struct item_data *data ); + int (*calcweapontype) (struct map_session_data *sd); + int (*removecombo) (struct map_session_data *sd, struct item_data *data ); }; struct pc_interface *pc; |