summaryrefslogtreecommitdiff
path: root/src/map/pc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/pc.h')
-rw-r--r--src/map/pc.h194
1 files changed, 121 insertions, 73 deletions
diff --git a/src/map/pc.h b/src/map/pc.h
index 69bcdea8d..d2866b9a9 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,8 +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)
@@ -726,8 +727,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;
@@ -737,16 +736,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
@@ -754,12 +756,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_);
@@ -773,11 +793,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);
@@ -794,17 +814,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);
@@ -815,8 +835,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);
@@ -829,48 +849,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);
@@ -881,26 +901,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);
@@ -932,15 +952,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
@@ -967,6 +985,36 @@ struct pc_interface {
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);
+#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
+ bool (*readdb_levelpenalty) (char* fields[], int columns, int current);
+#endif
+ 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;