From a675e06c38ec4e31a2758435a582b58a2199cfc4 Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 28 Jun 2018 03:17:32 +0200 Subject: Change functions to static where possible (Part 4 - map) This fixes issues with plugins defining symbols with the same names Signed-off-by: Haru --- src/map/pc.c | 610 +++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 346 insertions(+), 264 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index c7807a5f0..cd49a6dbf 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -76,15 +76,15 @@ #include #include -struct pc_interface pc_s; +static struct pc_interface pc_s; struct pc_interface *pc; -struct class_exp_tables exptables; +static struct class_exp_tables exptables; //Converts a class to its array index for CLASS_COUNT defined arrays. //Note that it does not do a validity check for speed purposes, where parsing //player input make sure to use a pc->db_checkid first! -int pc_class2idx(int class) +static int pc_class2idx(int class) { if (class >= JOB_NOVICE_HIGH) { class += - JOB_NOVICE_HIGH + JOB_MAX_BASIC; @@ -99,7 +99,7 @@ int pc_class2idx(int class) * required to provide a session. * Caller must release dummy on its own when it's no longer needed. */ -struct map_session_data* pc_get_dummy_sd(void) +static struct map_session_data *pc_get_dummy_sd(void) { struct map_session_data *dummy_sd; CREATE(dummy_sd, struct map_session_data, 1); @@ -113,7 +113,7 @@ struct map_session_data* pc_get_dummy_sd(void) * @param group_id Group ID * @return 1 on error, 0 on success */ -int pc_set_group(struct map_session_data *sd, int group_id) +static int pc_set_group(struct map_session_data *sd, int group_id) { GroupSettings *group = pcg->id2group(group_id); nullpo_retr(1, sd); @@ -127,13 +127,13 @@ int pc_set_group(struct map_session_data *sd, int group_id) /** * Checks if commands used by player should be logged. */ -bool pc_should_log_commands(struct map_session_data *sd) +static bool pc_should_log_commands(struct map_session_data *sd) { nullpo_retr(true, sd); return pcg->should_log_commands(sd->group); } -int pc_invincible_timer(int tid, int64 tick, int id, intptr_t data) +static int pc_invincible_timer(int tid, int64 tick, int id, intptr_t data) { struct map_session_data *sd = map->id2sd(id); @@ -150,7 +150,7 @@ int pc_invincible_timer(int tid, int64 tick, int id, intptr_t data) return 0; } -void pc_setinvincibletimer(struct map_session_data* sd, int val) +static void pc_setinvincibletimer(struct map_session_data *sd, int val) { nullpo_retv(sd); @@ -161,7 +161,7 @@ void pc_setinvincibletimer(struct map_session_data* sd, int val) sd->invincible_timer = timer->add(timer->gettick()+val,pc->invincible_timer,sd->bl.id,0); } -void pc_delinvincibletimer(struct map_session_data* sd) +static void pc_delinvincibletimer(struct map_session_data *sd) { nullpo_retv(sd); @@ -173,7 +173,8 @@ void pc_delinvincibletimer(struct map_session_data* sd) } } -int pc_spiritball_timer(int tid, int64 tick, int id, intptr_t data) { +static int pc_spiritball_timer(int tid, int64 tick, int id, intptr_t data) +{ struct map_session_data *sd = map->id2sd(id); int i; @@ -205,12 +206,13 @@ int pc_spiritball_timer(int tid, int64 tick, int id, intptr_t data) { } /** -* Get the possible number of spiritball that a player can call. -* @param sd the affected player structure -* @param min the minimum number of spiritball regardless the level of MO_CALLSPIRITS -* @retval total number of spiritball -**/ -int pc_getmaxspiritball(struct map_session_data *sd, int min) { + * Get the possible number of spiritball that a player can call. + * @param sd the affected player structure + * @param min the minimum number of spiritball regardless the level of MO_CALLSPIRITS + * @retval total number of spiritball + */ +static int pc_getmaxspiritball(struct map_session_data *sd, int min) +{ int result; nullpo_ret(sd); @@ -226,7 +228,7 @@ int pc_getmaxspiritball(struct map_session_data *sd, int min) { return result; } -int pc_addspiritball(struct map_session_data *sd,int interval,int max) +static int pc_addspiritball(struct map_session_data *sd, int interval, int max) { int tid, i; @@ -257,7 +259,7 @@ int pc_addspiritball(struct map_session_data *sd,int interval,int max) return 0; } -int pc_addspiritball_sub(struct map_session_data *sd) +static int pc_addspiritball_sub(struct map_session_data *sd) { nullpo_ret(sd); if ((sd->job & MAPID_THIRDMASK) == MAPID_ROYAL_GUARD) @@ -267,7 +269,7 @@ int pc_addspiritball_sub(struct map_session_data *sd) return 0; } -int pc_delspiritball(struct map_session_data *sd,int count,int type) +static int pc_delspiritball(struct map_session_data *sd, int count, int type) { int i; @@ -303,7 +305,7 @@ int pc_delspiritball(struct map_session_data *sd,int count,int type) return 0; } -int pc_delspiritball_sub(struct map_session_data *sd) +static int pc_delspiritball_sub(struct map_session_data *sd) { nullpo_ret(sd); if ((sd->job & MAPID_THIRDMASK) == MAPID_ROYAL_GUARD) @@ -313,7 +315,7 @@ int pc_delspiritball_sub(struct map_session_data *sd) return 0; } -int pc_check_banding(struct block_list *bl, va_list ap) +static int pc_check_banding(struct block_list *bl, va_list ap) { int *c, *b_sd; struct block_list *src; @@ -341,7 +343,8 @@ int pc_check_banding(struct block_list *bl, va_list ap) return 0; } -int pc_banding(struct map_session_data *sd, uint16 skill_lv) { +static int pc_banding(struct map_session_data *sd, uint16 skill_lv) +{ int c; int b_sd[MAX_PARTY]; // In case of a full Royal Guard party. int i, j, hp, extra_hp = 0, tmp_qty = 0; @@ -416,7 +419,7 @@ int pc_banding(struct map_session_data *sd, uint16 skill_lv) { * @param type The fame list type (@see enum fame_list_type). * @param count The amount of points to add. */ -void pc_addfame(struct map_session_data *sd, int ranktype, int count) +static void pc_addfame(struct map_session_data *sd, int ranktype, int count) { nullpo_retv(sd); @@ -456,7 +459,7 @@ void pc_addfame(struct map_session_data *sd, int ranktype, int count) * @return The rank position (1-based index) * @retval 0 if the character isn't in the specified list. */ -int pc_fame_rank(int char_id, int ranktype) +static int pc_fame_rank(int char_id, int ranktype) { int i; @@ -495,7 +498,8 @@ int pc_fame_rank(int char_id, int ranktype) * @return the appropriate fame list type (@see enum fame_list_type). * @retval RANKTYPE_UNKNOWN if no appropriate type exists. */ -int pc_famelist_type(uint16 job_mapid) { +static int pc_famelist_type(uint16 job_mapid) +{ switch (job_mapid & MAPID_UPPERMASK) { case MAPID_BLACKSMITH: return RANKTYPE_BLACKSMITH; @@ -508,7 +512,8 @@ int pc_famelist_type(uint16 job_mapid) { } } -int pc_setrestartvalue(struct map_session_data *sd,int type) { +static int pc_setrestartvalue(struct map_session_data *sd, int type) +{ struct status_data *st, *bst; nullpo_ret(sd); @@ -531,7 +536,8 @@ int pc_setrestartvalue(struct map_session_data *sd,int type) { /*========================================== Rental System *------------------------------------------*/ -int pc_inventory_rental_end(int tid, int64 tick, int id, intptr_t data) { +static int pc_inventory_rental_end(int tid, int64 tick, int id, intptr_t data) +{ struct map_session_data *sd = map->id2sd(id); if( sd == NULL ) return 0; @@ -545,7 +551,7 @@ int pc_inventory_rental_end(int tid, int64 tick, int id, intptr_t data) { return 1; } -int pc_inventory_rental_clear(struct map_session_data *sd) +static int pc_inventory_rental_clear(struct map_session_data *sd) { nullpo_ret(sd); if( sd->rental_timer != INVALID_TIMER ) @@ -557,7 +563,8 @@ int pc_inventory_rental_clear(struct map_session_data *sd) return 1; } /* assumes i is valid (from default areas where it is called, it is) */ -void pc_rental_expire(struct map_session_data *sd, int i) { +static void pc_rental_expire(struct map_session_data *sd, int i) +{ short nameid; nullpo_retv(sd); @@ -628,7 +635,7 @@ void pc_rental_expire(struct map_session_data *sd, int i) { clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid); pc->delitem(sd, i, sd->status.inventory[i].amount, 0, DELITEM_NORMAL, LOG_TYPE_RENTAL); } -void pc_inventory_rentals(struct map_session_data *sd) +static void pc_inventory_rentals(struct map_session_data *sd) { int i, c = 0; int64 expire_tick, next_tick = INT64_MAX; @@ -657,7 +664,7 @@ void pc_inventory_rentals(struct map_session_data *sd) sd->rental_timer = INVALID_TIMER; } -void pc_inventory_rental_add(struct map_session_data *sd, int seconds) +static void pc_inventory_rental_add(struct map_session_data *sd, int seconds) { int tick = seconds * 1000; @@ -681,7 +688,7 @@ void pc_inventory_rental_add(struct map_session_data *sd, int seconds) /*========================================== * prepares character for saving. *------------------------------------------*/ -int pc_makesavestatus(struct map_session_data *sd) +static int pc_makesavestatus(struct map_session_data *sd) { nullpo_ret(sd); @@ -747,7 +754,7 @@ int pc_makesavestatus(struct map_session_data *sd) /*========================================== * Off init ? Connection? *------------------------------------------*/ -int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int login_id1, unsigned int client_tick, int sex, int fd) +static int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int login_id1, unsigned int client_tick, int sex, int fd) { nullpo_ret(sd); @@ -770,7 +777,7 @@ int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int lo } // [4144] probably pc_equippoint should be replaced to pc_item_equippoint -int pc_equippoint(struct map_session_data *sd,int n) +static int pc_equippoint(struct map_session_data *sd, int n) { int ep = 0; @@ -802,7 +809,7 @@ int pc_equippoint(struct map_session_data *sd,int n) return ep; } -int pc_item_equippoint(struct map_session_data *sd, struct item_data* id) +static int pc_item_equippoint(struct map_session_data *sd, struct item_data *id) { int ep = 0; @@ -829,7 +836,7 @@ int pc_item_equippoint(struct map_session_data *sd, struct item_data* id) return ep; } -int pc_setinventorydata(struct map_session_data *sd) +static int pc_setinventorydata(struct map_session_data *sd) { int i; @@ -842,7 +849,7 @@ int pc_setinventorydata(struct map_session_data *sd) return 0; } -int pc_calcweapontype(struct map_session_data *sd) +static int pc_calcweapontype(struct map_session_data *sd) { nullpo_ret(sd); @@ -886,7 +893,7 @@ int pc_calcweapontype(struct map_session_data *sd) return 2; } -int pc_setequipindex(struct map_session_data *sd) +static int pc_setequipindex(struct map_session_data *sd) { int i,j; @@ -935,7 +942,7 @@ int pc_setequipindex(struct map_session_data *sd) return 0; } -bool pc_isequipped(struct map_session_data *sd, int nameid) +static bool pc_isequipped(struct map_session_data *sd, int nameid) { int i, j; @@ -961,7 +968,7 @@ bool pc_isequipped(struct map_session_data *sd, int nameid) return false; } -bool pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd ) +static bool pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd) { if( !p1_sd || !p2_sd || !b_sd ) return false; @@ -1011,7 +1018,7 @@ bool pc_can_Adopt(struct map_session_data *p1_sd, struct map_session_data *p2_sd /*========================================== * Adoption Process *------------------------------------------*/ -bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd) +static bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd, struct map_session_data *b_sd) { int class, joblevel; uint64 jobexp; @@ -1056,7 +1063,7 @@ bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd, * Checks if the player can equip the item at index n in inventory. * Returns 0 (no) or 1 (yes). *------------------------------------------------*/ -int pc_isequip(struct map_session_data *sd,int n) +static int pc_isequip(struct map_session_data *sd, int n) { struct item_data *item; @@ -1183,7 +1190,7 @@ int pc_isequip(struct map_session_data *sd,int n) * No problem with the session id * set the status that has been sent from char server *------------------------------------------*/ -bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, const struct mmo_charstatus *st, bool changing_mapservers) +static bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, const struct mmo_charstatus *st, bool changing_mapservers) { int i; int64 tick = timer->gettick(); @@ -1425,7 +1432,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim /*========================================== * Closes a connection because it failed to be authenticated from the char server. *------------------------------------------*/ -void pc_authfail(struct map_session_data *sd) +static void pc_authfail(struct map_session_data *sd) { nullpo_retv(sd); clif->authfail_fd(sd->fd, 0); @@ -1433,7 +1440,7 @@ void pc_authfail(struct map_session_data *sd) } //Attempts to set a mob. -int pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl) +static int pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl) { int class_; if (!sd || !bl || pos < 0 || pos >= MAX_PC_FEELHATE) @@ -1461,7 +1468,7 @@ int pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl) /*========================================== * Invoked once after the char/account/account2 registry variables are received. [Skotlex] *------------------------------------------*/ -int pc_reg_received(struct map_session_data *sd) +static int pc_reg_received(struct map_session_data *sd) { int i, idx = 0; @@ -1589,7 +1596,8 @@ int pc_reg_received(struct map_session_data *sd) return 1; } -int pc_calc_skillpoint(struct map_session_data* sd) { +static int pc_calc_skillpoint(struct map_session_data *sd) +{ int i,inf2,skill_point=0; nullpo_ret(sd); @@ -1612,7 +1620,7 @@ int pc_calc_skillpoint(struct map_session_data* sd) { return skill_point; } -void pc_calc_skilltree_clear(struct map_session_data *sd) +static void pc_calc_skilltree_clear(struct map_session_data *sd) { int i; @@ -1639,7 +1647,7 @@ void pc_calc_skilltree_clear(struct map_session_data *sd) /*========================================== * Calculation of skill level. *------------------------------------------*/ -int pc_calc_skilltree(struct map_session_data *sd) +static int pc_calc_skilltree(struct map_session_data *sd) { int i,id=0,flag; int class = 0, classidx = 0; @@ -1786,7 +1794,7 @@ int pc_calc_skilltree(struct map_session_data *sd) return 0; } -void pc_calc_skilltree_bonus(struct map_session_data *sd, int classidx) +static void pc_calc_skilltree_bonus(struct map_session_data *sd, int classidx) { int i; int id = 0; @@ -1822,7 +1830,7 @@ void pc_calc_skilltree_bonus(struct map_session_data *sd, int classidx) } //Checks if you can learn a new skill after having leveled up a skill. -void pc_check_skilltree(struct map_session_data *sd, int skill_id) +static void pc_check_skilltree(struct map_session_data *sd, int skill_id) { int i,id=0,flag; int c=0; @@ -1893,7 +1901,7 @@ void pc_check_skilltree(struct map_session_data *sd, int skill_id) // Make sure all the skills are in the correct condition // before persisting to the backend.. [MouseJstr] -int pc_clean_skilltree(struct map_session_data *sd) +static int pc_clean_skilltree(struct map_session_data *sd) { int i; nullpo_ret(sd); @@ -1911,7 +1919,7 @@ int pc_clean_skilltree(struct map_session_data *sd) return 0; } -int pc_calc_skilltree_normalize_job(struct map_session_data *sd) +static int pc_calc_skilltree_normalize_job(struct map_session_data *sd) { int skill_point, novice_skills; uint16 job; @@ -1987,7 +1995,7 @@ int pc_calc_skilltree_normalize_job(struct map_session_data *sd) * 2: overweight 90% * It's assumed that SC_WEIGHTOVER50 and SC_WEIGHTOVER90 are only started/stopped here. */ -int pc_updateweightstatus(struct map_session_data *sd) +static int pc_updateweightstatus(struct map_session_data *sd) { int old_overweight; int new_overweight; @@ -2018,7 +2026,7 @@ int pc_updateweightstatus(struct map_session_data *sd) return 0; } -int pc_disguise(struct map_session_data *sd, int class) +static int pc_disguise(struct map_session_data *sd, int class) { nullpo_ret(sd); if (class == -1 && sd->disguise == -1) @@ -2074,7 +2082,7 @@ int pc_disguise(struct map_session_data *sd, int class) return 1; } -int pc_bonus_autospell(struct s_autospell *spell, int max, short id, short lv, short rate, short flag, short card_id) +static int pc_bonus_autospell(struct s_autospell *spell, int max, short id, short lv, short rate, short flag, short card_id) { int i; @@ -2112,7 +2120,7 @@ int pc_bonus_autospell(struct s_autospell *spell, int max, short id, short lv, s return 1; } -int pc_bonus_autospell_onskill(struct s_autospell *spell, int max, short src_skill, short id, short lv, short rate, short card_id) +static int pc_bonus_autospell_onskill(struct s_autospell *spell, int max, short src_skill, short id, short lv, short rate, short card_id) { int i; @@ -2153,7 +2161,7 @@ int pc_bonus_autospell_onskill(struct s_autospell *spell, int max, short src_ski * @retval 1 on success. * @retval 0 on failure. */ -int pc_bonus_addeff(struct s_addeffect* effect, int max, enum sc_type id, int16 rate, int16 arrow_rate, uint8 flag, uint16 duration) +static int pc_bonus_addeff(struct s_addeffect *effect, int max, enum sc_type id, int16 rate, int16 arrow_rate, uint8 flag, uint16 duration) { int i; @@ -2185,7 +2193,8 @@ int pc_bonus_addeff(struct s_addeffect* effect, int max, enum sc_type id, int16 return 1; } -int pc_bonus_addeff_onskill(struct s_addeffectonskill* effect, int max, enum sc_type id, short rate, short skill_id, unsigned char target) { +static int pc_bonus_addeff_onskill(struct s_addeffectonskill *effect, int max, enum sc_type id, short rate, short skill_id, unsigned char target) +{ int i; nullpo_ret(effect); @@ -2206,7 +2215,8 @@ int pc_bonus_addeff_onskill(struct s_addeffectonskill* effect, int max, enum sc_ return 1; } -int pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id, short group, int race_mask, int rate) { +static int pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id, short group, int race_mask, int rate) +{ int i; nullpo_ret(drop); @@ -2254,7 +2264,8 @@ int pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id, short return 1; } -int pc_addautobonus(struct s_autobonus *bonus,char max,const char *bonus_script,short rate,unsigned int dur,short flag,const char *other_script,unsigned short pos,bool onskill) { +static int pc_addautobonus(struct s_autobonus *bonus, char max, const char *bonus_script, short rate, unsigned int dur, short flag, const char *other_script, unsigned short pos, bool onskill) +{ int i; nullpo_ret(bonus); @@ -2291,7 +2302,7 @@ int pc_addautobonus(struct s_autobonus *bonus,char max,const char *bonus_script, return 1; } -int pc_delautobonus(struct map_session_data* sd, struct s_autobonus *autobonus,char max,bool restore) +static int pc_delautobonus(struct map_session_data *sd, struct s_autobonus *autobonus, char max, bool restore) { int i; nullpo_ret(sd); @@ -2329,7 +2340,7 @@ int pc_delautobonus(struct map_session_data* sd, struct s_autobonus *autobonus,c return 0; } -int pc_exeautobonus(struct map_session_data *sd,struct s_autobonus *autobonus) +static int pc_exeautobonus(struct map_session_data *sd, struct s_autobonus *autobonus) { nullpo_ret(sd); nullpo_ret(autobonus); @@ -2349,7 +2360,8 @@ int pc_exeautobonus(struct map_session_data *sd,struct s_autobonus *autobonus) return 0; } -int pc_endautobonus(int tid, int64 tick, int id, intptr_t data) { +static int pc_endautobonus(int tid, int64 tick, int id, intptr_t data) +{ struct map_session_data *sd = map->id2sd(id); struct s_autobonus *autobonus = (struct s_autobonus *)data; @@ -2362,7 +2374,7 @@ int pc_endautobonus(int tid, int64 tick, int id, intptr_t data) { return 0; } -int pc_bonus_addele(struct map_session_data* sd, unsigned char ele, short rate, short flag) +static int pc_bonus_addele(struct map_session_data *sd, unsigned char ele, short rate, short flag) { int i; struct weapon_data* wd; @@ -2397,7 +2409,7 @@ int pc_bonus_addele(struct map_session_data* sd, unsigned char ele, short rate, return 0; } -int pc_bonus_subele(struct map_session_data* sd, unsigned char ele, short rate, short flag) +static int pc_bonus_subele(struct map_session_data *sd, unsigned char ele, short rate, short flag) { int i; @@ -2443,7 +2455,8 @@ int pc_bonus_subele(struct map_session_data* sd, unsigned char ele, short rate, /*========================================== * Add a bonus(type) to player sd *------------------------------------------*/ -int pc_bonus(struct map_session_data *sd,int type,int val) { +static int pc_bonus(struct map_session_data *sd, int type, int val) +{ struct status_data *bst; int bonus; int i; @@ -3109,7 +3122,7 @@ int pc_bonus(struct map_session_data *sd,int type,int val) { /*========================================== * Player bonus (type) with args type2 and val, called trough bonus2 (npc) *------------------------------------------*/ -int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) +static int pc_bonus2(struct map_session_data *sd, int type, int type2, int val) { int i; @@ -3899,7 +3912,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) return 0; } -int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val) +static int pc_bonus3(struct map_session_data *sd, int type, int type2, int type3, int val) { int i; nullpo_ret(sd); @@ -4073,7 +4086,8 @@ int pc_bonus3(struct map_session_data *sd,int type,int type2,int type3,int val) return 0; } -int pc_bonus4(struct map_session_data *sd,int type,int type2,int type3,int type4,int val) { +static int pc_bonus4(struct map_session_data *sd, int type, int type2, int type3, int type4, int val) +{ int i; nullpo_ret(sd); @@ -4168,7 +4182,8 @@ int pc_bonus4(struct map_session_data *sd,int type,int type2,int type3,int type4 return 0; } -int pc_bonus5(struct map_session_data *sd,int type,int type2,int type3,int type4,int type5,int val) { +static int pc_bonus5(struct map_session_data *sd, int type, int type2, int type3, int type4, int type5, int val) +{ nullpo_ret(sd); switch(type){ @@ -4202,7 +4217,7 @@ int pc_bonus5(struct map_session_data *sd,int type,int type2,int type3,int type4 * Grants a player a given skill. * Flag values: @see enum pc_skill_flag *------------------------------------------*/ -int pc_skill(struct map_session_data *sd, int id, int level, int flag) +static int pc_skill(struct map_session_data *sd, int id, int level, int flag) { int index = 0; nullpo_ret(sd); @@ -4281,7 +4296,7 @@ int pc_skill(struct map_session_data *sd, int id, int level, int flag) * @param idx_equip The target equipment's inventory index. * @retval true if the card can be inserted. */ -bool pc_can_insert_card_into(struct map_session_data* sd, int idx_card, int idx_equip) +static bool pc_can_insert_card_into(struct map_session_data *sd, int idx_card, int idx_equip) { int i; @@ -4317,7 +4332,7 @@ bool pc_can_insert_card_into(struct map_session_data* sd, int idx_card, int idx_ * @param idx_card The card's inventory index. * @retval true if the card can be inserted. */ -bool pc_can_insert_card(struct map_session_data* sd, int idx_card) +static bool pc_can_insert_card(struct map_session_data *sd, int idx_card) { nullpo_ret(sd); @@ -4336,7 +4351,7 @@ bool pc_can_insert_card(struct map_session_data* sd, int idx_card) * 0 = fail * 1 = success *------------------------------------------*/ -int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip) +static int pc_insert_card(struct map_session_data *sd, int idx_card, int idx_equip) { int nameid; @@ -4378,7 +4393,7 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip) /*========================================== * Update buying value by skills *------------------------------------------*/ -int pc_modifybuyvalue(struct map_session_data *sd, int orig_value) +static int pc_modifybuyvalue(struct map_session_data *sd, int orig_value) { int skill_lv, rate1 = 0, rate2 = 0; if (orig_value <= 0) @@ -4399,7 +4414,7 @@ int pc_modifybuyvalue(struct map_session_data *sd, int orig_value) /*========================================== * Update selling value by skills *------------------------------------------*/ -int pc_modifysellvalue(struct map_session_data *sd, int orig_value) +static int pc_modifysellvalue(struct map_session_data *sd, int orig_value) { int skill_lv, rate = 0; if (orig_value <= 0) @@ -4417,7 +4432,7 @@ int pc_modifysellvalue(struct map_session_data *sd, int orig_value) * Checking if we have enough place on inventory for new item * Make sure to take 30k as limit (for client I guess) *------------------------------------------*/ -int pc_checkadditem(struct map_session_data *sd,int nameid,int amount) +static int pc_checkadditem(struct map_session_data *sd, int nameid, int amount) { int i; struct item_data* data; @@ -4451,7 +4466,7 @@ int pc_checkadditem(struct map_session_data *sd,int nameid,int amount) * Return number of available place in inventory * Each non stackable item will reduce place by 1 *------------------------------------------*/ -int pc_inventoryblank(struct map_session_data *sd) +static int pc_inventoryblank(struct map_session_data *sd) { int i,b; @@ -4468,7 +4483,7 @@ int pc_inventoryblank(struct map_session_data *sd) /*========================================== * attempts to remove zeny from player (sd) *------------------------------------------*/ -int pc_payzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type, struct map_session_data *tsd) +static int pc_payzeny(struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd) { nullpo_retr(-1,sd); @@ -4505,7 +4520,7 @@ int pc_payzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type, * @return points Leftover kafra points. */ //Changed Kafrapoints calculation. [Normynator] -int pc_paycash(struct map_session_data *sd, int price, int points) +static int pc_paycash(struct map_session_data *sd, int price, int points) { int cash; int mempoints; @@ -4545,7 +4560,7 @@ int pc_paycash(struct map_session_data *sd, int price, int points) return points; } -int pc_getcash(struct map_session_data *sd, int cash, int points) +static int pc_getcash(struct map_session_data *sd, int cash, int points) { char output[128]; nullpo_retr(-1,sd); @@ -4604,7 +4619,7 @@ int pc_getcash(struct map_session_data *sd, int cash, int points) * Attempts to give zeny to player (sd) * tsd (optional) from who for log (if null take sd) *------------------------------------------*/ -int pc_getzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type, struct map_session_data *tsd) +static int pc_getzeny(struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd) { nullpo_retr(-1,sd); @@ -4643,7 +4658,8 @@ int pc_getzeny(struct map_session_data *sd,int zeny, enum e_log_pick_type type, * @return the inventory index of the first instance of the requested item. * @retval INDEX_NOT_FOUND if the item wasn't found. */ -int pc_search_inventory(struct map_session_data *sd, int item_id) { +static int pc_search_inventory(struct map_session_data *sd, int item_id) +{ int i; nullpo_retr(INDEX_NOT_FOUND, sd); @@ -4663,7 +4679,7 @@ int pc_search_inventory(struct map_session_data *sd, int item_id) { * 6 = ? * 7 = stack limitation *------------------------------------------*/ -int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type) +static int pc_additem(struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type) { struct item_data *data; int i; @@ -4782,7 +4798,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l * 0 = success * 1 = invalid itemid or negative amount *------------------------------------------*/ -int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reason, e_log_pick_type log_type) +static int pc_delitem(struct map_session_data *sd, int n, int amount, int type, short reason, e_log_pick_type log_type) { nullpo_retr(1, sd); Assert_retr(1, n >= 0 && n < MAX_INVENTORY); @@ -4814,7 +4830,7 @@ int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reas * 0 = fail * 1 = success *------------------------------------------*/ -int pc_dropitem(struct map_session_data *sd,int n,int amount) +static int pc_dropitem(struct map_session_data *sd, int n, int amount) { nullpo_retr(1, sd); @@ -4857,7 +4873,7 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount) * 0 = fail * 1 = success *------------------------------------------*/ -int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem) +static int pc_takeitem(struct map_session_data *sd, struct flooritem_data *fitem) { int flag=0; int64 tick = timer->gettick(); @@ -4923,7 +4939,7 @@ int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem) * 0 = no * 1 = yes *------------------------------------------*/ -int pc_isUseitem(struct map_session_data *sd,int n) +static int pc_isUseitem(struct map_session_data *sd, int n) { struct item_data *item; int nameid; @@ -5158,7 +5174,8 @@ int pc_isUseitem(struct map_session_data *sd,int n) * 0 = fail * 1 = success *------------------------------------------*/ -int pc_useitem(struct map_session_data *sd,int n) { +static int pc_useitem(struct map_session_data *sd, int n) +{ int64 tick = timer->gettick(); int amount, nameid, i; bool removeItem = false; @@ -5328,7 +5345,7 @@ int pc_useitem(struct map_session_data *sd,int n) { * 0 = success * 1 = fail *------------------------------------------*/ -int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type) +static int pc_cart_additem(struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type) { struct item_data *data; int i,w; @@ -5397,7 +5414,8 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun * 0 = success * 1 = fail *------------------------------------------*/ -int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_pick_type log_type) { +static int pc_cart_delitem(struct map_session_data *sd, int n, int amount, int type, e_log_pick_type log_type) +{ struct item_data * data; nullpo_retr(1, sd); Assert_retr(1, n >= 0 && n < MAX_INVENTORY); @@ -5427,7 +5445,7 @@ int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_ * 0 = fail * 1 = succes *------------------------------------------*/ -int pc_putitemtocart(struct map_session_data *sd,int idx,int amount) +static int pc_putitemtocart(struct map_session_data *sd, int idx, int amount) { struct item *item_data; int flag; @@ -5454,7 +5472,7 @@ int pc_putitemtocart(struct map_session_data *sd,int idx,int amount) * -1 = itemid not found or no amount found * x = remaining itemid on cart after get *------------------------------------------*/ -int pc_cartitem_amount(struct map_session_data* sd, int idx, int amount) +static int pc_cartitem_amount(struct map_session_data *sd, int idx, int amount) { struct item* item_data; @@ -5474,7 +5492,7 @@ int pc_cartitem_amount(struct map_session_data* sd, int idx, int amount) * 0 = player not found or (FIXME) succes (from pc->cart_delitem) * 1 = failure *------------------------------------------*/ -int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount) +static int pc_getitemfromcart(struct map_session_data *sd, int idx, int amount) { struct item *item_data; int flag; @@ -5495,7 +5513,7 @@ int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount) return flag; } -void pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type) +static void pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type) { int i; @@ -5532,7 +5550,7 @@ void pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type) /*========================================== * Display item stolen msg to player sd *------------------------------------------*/ -int pc_show_steal(struct block_list *bl,va_list ap) +static int pc_show_steal(struct block_list *bl, va_list ap) { struct map_session_data *sd = NULL, *tsd = NULL; int itemid; @@ -5562,7 +5580,7 @@ int pc_show_steal(struct block_list *bl,va_list ap) * 0 = fail * 1 = succes *------------------------------------------*/ -int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skill_lv) +static int pc_steal_item(struct map_session_data *sd, struct block_list *bl, uint16 skill_lv) { int i,itemid,flag; int rate; @@ -5641,7 +5659,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil * * @return Amount of stolen zeny (0 in case of failure) */ -int pc_steal_coin(struct map_session_data *sd, struct block_list *target, uint16 skill_lv) +static int pc_steal_coin(struct map_session_data *sd, struct block_list *target, uint16 skill_lv) { int rate; struct mob_data *md = BL_CAST(BL_MOB, target); @@ -5673,7 +5691,8 @@ int pc_steal_coin(struct map_session_data *sd, struct block_list *target, uint16 * 1 - Invalid map index. * 2 - Map not in this map-server, and failed to locate alternate map-server. *------------------------------------------*/ -int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int y, clr_type clrtype) { +static int pc_setpos(struct map_session_data *sd, unsigned short map_index, int x, int y, clr_type clrtype) +{ int16 m; nullpo_ret(sd); @@ -5909,7 +5928,8 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int * 0 = fail or FIXME success (from pc->setpos) * x(1|2) = fail *------------------------------------------*/ -int pc_randomwarp(struct map_session_data *sd, clr_type type) { +static int pc_randomwarp(struct map_session_data *sd, clr_type type) +{ int x,y,i=0; int16 m; @@ -5935,7 +5955,8 @@ int pc_randomwarp(struct map_session_data *sd, clr_type type) { * Records a memo point at sd's current position * pos - entry to replace, (-1: shift oldest entry out) *------------------------------------------*/ -int pc_memo(struct map_session_data* sd, int pos) { +static int pc_memo(struct map_session_data *sd, int pos) +{ int skill_lv; nullpo_ret(sd); @@ -5985,7 +6006,8 @@ int pc_memo(struct map_session_data* sd, int pos) { /*========================================== * Return player sd skill_lv learned for given skill *------------------------------------------*/ -int pc_checkskill(struct map_session_data *sd,uint16 skill_id) { +static int pc_checkskill(struct map_session_data *sd, uint16 skill_id) +{ int index = 0; if(sd == NULL) return 0; if( skill_id >= GD_SKILLBASE && skill_id < GD_MAX ) { @@ -6004,7 +6026,8 @@ int pc_checkskill(struct map_session_data *sd,uint16 skill_id) { return 0; } -int pc_checkskill2(struct map_session_data *sd,uint16 index) { +static int pc_checkskill2(struct map_session_data *sd, uint16 index) +{ if (sd == NULL) return 0; if (index >= MAX_SKILL_DB) { @@ -6030,7 +6053,7 @@ int pc_checkskill2(struct map_session_data *sd,uint16 index) { * Return * 0 - No status found or all done *------------------------------------------*/ -int pc_checkallowskill(struct map_session_data *sd) +static int pc_checkallowskill(struct map_session_data *sd) { const enum sc_type scw_list[] = { SC_TWOHANDQUICKEN, @@ -6088,7 +6111,7 @@ int pc_checkallowskill(struct map_session_data *sd) * -1 : mean nothing equiped * idx : (this index could be used in inventory to found item_data) *------------------------------------------*/ -int pc_checkequip(struct map_session_data *sd,int pos) +static int pc_checkequip(struct map_session_data *sd, int pos) { int i; @@ -6106,7 +6129,7 @@ int pc_checkequip(struct map_session_data *sd,int pos) * Convert's from the client's lame Job ID system * to the map server's 'makes sense' system. [Skotlex] *------------------------------------------*/ -int pc_jobid2mapid(int16 class) +static int pc_jobid2mapid(int16 class) { switch (class) { //Novice And 1-1 Jobs @@ -6248,7 +6271,7 @@ int pc_jobid2mapid(int16 class) } //Reverts the map-style class id to the client-style one. -int pc_mapid2jobid(uint16 job, int sex) +static int pc_mapid2jobid(uint16 job, int sex) { switch (job) { //Novice And 1-1 Jobs @@ -6385,7 +6408,7 @@ int pc_mapid2jobid(uint16 job, int sex) /*==================================================== * This function return the name of the job (by [Yor]) *----------------------------------------------------*/ -const char *job_name(int class) +static const char *job_name(int class) { switch (class) { case JOB_NOVICE: // 550 @@ -6614,7 +6637,8 @@ const char *job_name(int class) } } -int pc_check_job_name(const char *name) { +static int pc_check_job_name(const char *name) +{ int i, len; struct { const char *name; @@ -6748,7 +6772,8 @@ int pc_check_job_name(const char *name) { return names[i].id; } -int pc_follow_timer(int tid, int64 tick, int id, intptr_t data) { +static int pc_follow_timer(int tid, int64 tick, int id, intptr_t data) +{ struct map_session_data *sd; struct block_list *tbl; @@ -6786,7 +6811,7 @@ int pc_follow_timer(int tid, int64 tick, int id, intptr_t data) { return 0; } -int pc_stop_following (struct map_session_data *sd) +static int pc_stop_following(struct map_session_data *sd) { nullpo_ret(sd); @@ -6802,7 +6827,8 @@ int pc_stop_following (struct map_session_data *sd) return 0; } -int pc_follow(struct map_session_data *sd,int target_id) { +static int pc_follow(struct map_session_data *sd, int target_id) +{ struct block_list *bl = map->id2bl(target_id); nullpo_retr(1, sd); if (bl == NULL /*|| bl->type != BL_PC*/) @@ -6816,7 +6842,7 @@ int pc_follow(struct map_session_data *sd,int target_id) { return 0; } -int pc_checkbaselevelup(struct map_session_data *sd) +static int pc_checkbaselevelup(struct map_session_data *sd) { uint64 next = pc->nextbaseexp(sd); @@ -6858,7 +6884,7 @@ int pc_checkbaselevelup(struct map_session_data *sd) return 1; } -void pc_checkbaselevelup_sc(struct map_session_data *sd) +static void pc_checkbaselevelup_sc(struct map_session_data *sd) { nullpo_retv(sd); @@ -6876,7 +6902,8 @@ void pc_checkbaselevelup_sc(struct map_session_data *sd) } } -void pc_baselevelchanged(struct map_session_data *sd) { +static void pc_baselevelchanged(struct map_session_data *sd) +{ int i; nullpo_retv(sd); for( i = 0; i < EQI_MAX; i++ ) { @@ -6887,7 +6914,7 @@ void pc_baselevelchanged(struct map_session_data *sd) { } } -int pc_checkjoblevelup(struct map_session_data *sd) +static int pc_checkjoblevelup(struct map_session_data *sd) { uint64 next = pc->nextjobexp(sd); @@ -6922,7 +6949,8 @@ int pc_checkjoblevelup(struct map_session_data *sd) /** * Alters EXP based on self bonuses that do not get shared with the party **/ -void pc_calcexp(struct map_session_data *sd, uint64 *base_exp, uint64 *job_exp, struct block_list *src) { +static void pc_calcexp(struct map_session_data *sd, uint64 *base_exp, uint64 *job_exp, struct block_list *src) +{ int buff_ratio = 0, buff_job_ratio = 0, race_ratio = 0, pk_ratio = 0; int64 jexp, bexp; @@ -6997,7 +7025,7 @@ void pc_calcexp(struct map_session_data *sd, uint64 *base_exp, uint64 *job_exp, * @param is_quest Used to let client know that the EXP was from a quest (clif->displayexp) PACKETVER >= 20091027 * @retval true success **/ -bool pc_gainexp(struct map_session_data *sd, struct block_list *src, uint64 base_exp, uint64 job_exp, bool is_quest) +static bool pc_gainexp(struct map_session_data *sd, struct block_list *src, uint64 base_exp, uint64 job_exp, bool is_quest) { float nextbp = 0, nextjp = 0; uint64 nextb = 0, nextj = 0; @@ -7086,14 +7114,14 @@ bool pc_gainexp(struct map_session_data *sd, struct block_list *src, uint64 base /*========================================== * Returns max level for this character. *------------------------------------------*/ -int pc_maxbaselv(const struct map_session_data *sd) +static int pc_maxbaselv(const struct map_session_data *sd) { nullpo_ret(sd); return pc->dbs->class_exp_table[pc->class2idx(sd->status.class)][CLASS_EXP_TABLE_BASE]->max_level; } -int pc_maxjoblv(const struct map_session_data *sd) +static int pc_maxjoblv(const struct map_session_data *sd) { nullpo_ret(sd); @@ -7105,7 +7133,7 @@ int pc_maxjoblv(const struct map_session_data *sd) *------------------------------------------*/ //Base exp needed for next level. -uint64 pc_nextbaseexp(const struct map_session_data *sd) +static uint64 pc_nextbaseexp(const struct map_session_data *sd) { const struct class_exp_group *exp_group = NULL; @@ -7122,7 +7150,7 @@ uint64 pc_nextbaseexp(const struct map_session_data *sd) } //Base exp needed for this level. -uint64 pc_thisbaseexp(const struct map_session_data *sd) +static uint64 pc_thisbaseexp(const struct map_session_data *sd) { const struct class_exp_group *exp_group = NULL; @@ -7146,7 +7174,7 @@ uint64 pc_thisbaseexp(const struct map_session_data *sd) *------------------------------------------*/ //Job exp needed for next level. -uint64 pc_nextjobexp(const struct map_session_data *sd) +static uint64 pc_nextjobexp(const struct map_session_data *sd) { const struct class_exp_group *exp_group = NULL; @@ -7163,7 +7191,7 @@ uint64 pc_nextjobexp(const struct map_session_data *sd) } //Job exp needed for this level. -uint64 pc_thisjobexp(const struct map_session_data *sd) +static uint64 pc_thisjobexp(const struct map_session_data *sd) { const struct class_exp_group *exp_group = NULL; @@ -7178,7 +7206,7 @@ uint64 pc_thisjobexp(const struct map_session_data *sd) } /// Returns the value of the specified stat. -int pc_getstat(struct map_session_data* sd, int type) +static int pc_getstat(struct map_session_data *sd, int type) { nullpo_retr(-1, sd); @@ -7196,7 +7224,7 @@ int pc_getstat(struct map_session_data* sd, int type) /// Sets the specified stat to the specified value. /// Returns the new value. -int pc_setstat(struct map_session_data* sd, int type, int val) +static int pc_setstat(struct map_session_data *sd, int type, int val) { nullpo_retr(-1, sd); @@ -7215,7 +7243,7 @@ int pc_setstat(struct map_session_data* sd, int type, int val) } // Calculates the number of status points PC gets when leveling up (from level to level+1) -int pc_gets_status_point(int level) +static int pc_gets_status_point(int level) { if (battle_config.use_statpoint_table) //Use values from "db/statpoint.txt" return (pc->statp[level+1] - pc->statp[level]); @@ -7226,7 +7254,7 @@ int pc_gets_status_point(int level) /// Returns the number of stat points needed to change the specified stat by val. /// If val is negative, returns the number of stat points that would be needed to /// raise the specified stat from (current value - val) to current value. -int pc_need_status_point(struct map_session_data* sd, int type, int val) +static int pc_need_status_point(struct map_session_data *sd, int type, int val) { int low, high, sp = 0; @@ -7261,7 +7289,8 @@ int pc_need_status_point(struct map_session_data* sd, int type, int val) * @param type Stat to verify. * @return Maximum value the stat could grow by. */ -int pc_maxparameterincrease(struct map_session_data* sd, int type) { +static int pc_maxparameterincrease(struct map_session_data *sd, int type) +{ int base, final, status_points = sd->status.status_point; base = final = pc->getstat(sd, type); @@ -7291,7 +7320,8 @@ int pc_maxparameterincrease(struct map_session_data* sd, int type) { * @retval true if the stat was increased by any amount. * @retval false if there were no changes. */ -bool pc_statusup(struct map_session_data* sd, int type, int increase) { +static bool pc_statusup(struct map_session_data *sd, int type, int increase) +{ int max_increase = 0, current = 0, needed_points = 0, final_value = 0; nullpo_ret(sd); @@ -7350,7 +7380,7 @@ bool pc_statusup(struct map_session_data* sd, int type, int increase) { * @return the stat increase amount. * @retval 0 if no changes were made. */ -int pc_statusup2(struct map_session_data* sd, int type, int val) +static int pc_statusup2(struct map_session_data *sd, int type, int val) { int max, need; nullpo_ret(sd); @@ -7385,7 +7415,7 @@ int pc_statusup2(struct map_session_data* sd, int type, int val) * Update skill_lv for player sd * Skill point allocation *------------------------------------------*/ -int pc_skillup(struct map_session_data *sd,uint16 skill_id) +static int pc_skillup(struct map_session_data *sd, uint16 skill_id) { int index = 0; nullpo_ret(sd); @@ -7443,7 +7473,7 @@ int pc_skillup(struct map_session_data *sd,uint16 skill_id) /*========================================== * /allskill *------------------------------------------*/ -int pc_allskillup(struct map_session_data *sd) +static int pc_allskillup(struct map_session_data *sd) { int i; @@ -7498,7 +7528,7 @@ int pc_allskillup(struct map_session_data *sd) /*========================================== * /resetlvl *------------------------------------------*/ -int pc_resetlvl(struct map_session_data* sd,int type) +static int pc_resetlvl(struct map_session_data *sd, int type) { int i; @@ -7586,7 +7616,7 @@ int pc_resetlvl(struct map_session_data* sd,int type) /*========================================== * /resetstate *------------------------------------------*/ -int pc_resetstate(struct map_session_data* sd) +static int pc_resetstate(struct map_session_data *sd) { nullpo_ret(sd); @@ -7652,7 +7682,7 @@ int pc_resetstate(struct map_session_data* sd) * /resetskill * @param flag: @see enum pc_resetskill_flag *------------------------------------------*/ -int pc_resetskill(struct map_session_data* sd, int flag) +static int pc_resetskill(struct map_session_data *sd, int flag) { int i, inf2, skill_point=0; nullpo_ret(sd); @@ -7764,7 +7794,7 @@ int pc_resetskill(struct map_session_data* sd, int flag) return skill_point; } -bool pc_resetskill_job(struct map_session_data* sd, int index) +static bool pc_resetskill_job(struct map_session_data *sd, int index) { uint16 skill_id; @@ -7791,7 +7821,7 @@ bool pc_resetskill_job(struct map_session_data* sd, int index) /*========================================== * /resetfeel [Komurka] *------------------------------------------*/ -int pc_resetfeel(struct map_session_data* sd) +static int pc_resetfeel(struct map_session_data *sd) { int i; nullpo_ret(sd); @@ -7806,7 +7836,7 @@ int pc_resetfeel(struct map_session_data* sd) return 0; } -int pc_resethate(struct map_session_data* sd) +static int pc_resethate(struct map_session_data *sd) { int i; nullpo_ret(sd); @@ -7818,7 +7848,7 @@ int pc_resethate(struct map_session_data* sd) return 0; } -int pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id) +static int pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id) { int i, bonus = 0; nullpo_ret(sd); @@ -7832,7 +7862,7 @@ int pc_skillatk_bonus(struct map_session_data *sd, uint16 skill_id) return bonus; } -int pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id) +static int pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id) { int i, bonus = sd->bonus.add_heal_rate; @@ -7873,7 +7903,8 @@ int pc_skillheal_bonus(struct map_session_data *sd, uint16 skill_id) return bonus; } -int pc_skillheal2_bonus(struct map_session_data *sd, uint16 skill_id) { +static int pc_skillheal2_bonus(struct map_session_data *sd, uint16 skill_id) +{ int i, bonus = sd->bonus.add_heal2_rate; ARR_FIND(0, ARRAYLENGTH(sd->skillheal2), i, sd->skillheal2[i].id == skill_id); @@ -7884,7 +7915,7 @@ int pc_skillheal2_bonus(struct map_session_data *sd, uint16 skill_id) { return bonus; } -void pc_respawn(struct map_session_data* sd, clr_type clrtype) +static void pc_respawn(struct map_session_data *sd, clr_type clrtype) { if( !pc_isdead(sd) ) return; // not applicable @@ -7897,7 +7928,8 @@ void pc_respawn(struct map_session_data* sd, clr_type clrtype) clif->resurrection(&sd->bl, 1); //If warping fails, send a normal stand up packet. } -int pc_respawn_timer(int tid, int64 tick, int id, intptr_t data) { +static int pc_respawn_timer(int tid, int64 tick, int id, intptr_t data) +{ struct map_session_data *sd = map->id2sd(id); if( sd != NULL ) { @@ -7911,7 +7943,7 @@ int pc_respawn_timer(int tid, int64 tick, int id, intptr_t data) { /*========================================== * Invoked when a player has received damage *------------------------------------------*/ -void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp) +static void pc_damage(struct map_session_data *sd, struct block_list *src, unsigned int hp, unsigned int sp) { if (sp) clif->updatestatus(sd,SP_SP); if (hp) clif->updatestatus(sd,SP_HP); @@ -7943,7 +7975,8 @@ void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int h /*========================================== * Invoked when a player has negative current hp *------------------------------------------*/ -int pc_dead(struct map_session_data *sd,struct block_list *src) { +static int pc_dead(struct map_session_data *sd, struct block_list *src) +{ int i=0,j=0; int64 tick = timer->gettick(); @@ -8299,12 +8332,13 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { return 1; } -bool pc_isDeathPenaltyJob(uint16 job) +static bool pc_isDeathPenaltyJob(uint16 job) { return (job & MAPID_UPPERMASK) != MAPID_NOVICE; // only novices will receive no penalty } -void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp) { +static void pc_revive(struct map_session_data *sd, unsigned int hp, unsigned int sp) +{ nullpo_retv(sd); if(hp) clif->updatestatus(sd,SP_HP); if(sp) clif->updatestatus(sd,SP_SP); @@ -8325,7 +8359,7 @@ void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp) { /*========================================== * script reading pc status registry *------------------------------------------*/ -int64 pc_readparam(const struct map_session_data *sd, int type) +static int64 pc_readparam(const struct map_session_data *sd, int type) { int64 val = 0; @@ -8478,7 +8512,7 @@ int64 pc_readparam(const struct map_session_data *sd, int type) /*========================================== * script set pc status registry *------------------------------------------*/ -int pc_setparam(struct map_session_data *sd, int type, int64 val) +static int pc_setparam(struct map_session_data *sd, int type, int64 val) { int delta; nullpo_ret(sd); @@ -8655,7 +8689,7 @@ int pc_setparam(struct map_session_data *sd, int type, int64 val) /*========================================== * HP/SP Healing. If flag is passed, the heal type is through clif->heal, otherwise update status. *------------------------------------------*/ -void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, int type) +static void pc_heal(struct map_session_data *sd, unsigned int hp, unsigned int sp, int type) { nullpo_retv(sd); if (type) { @@ -8677,7 +8711,7 @@ void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, int ty * Heal player hp and/or sp linearly. * Calculate bonus by status. *------------------------------------------*/ -int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp) +static int pc_itemheal(struct map_session_data *sd, int itemid, int hp, int sp) { int bonus, tmp; @@ -8760,7 +8794,7 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp) * HP/SP Recovery * Heal player hp nad/or sp by rate *------------------------------------------*/ -int pc_percentheal(struct map_session_data *sd,int hp,int sp) +static int pc_percentheal(struct map_session_data *sd, int hp, int sp) { nullpo_ret(sd); @@ -8795,7 +8829,7 @@ int pc_percentheal(struct map_session_data *sd,int hp,int sp) return 0; } -int jobchange_killclone(struct block_list *bl, va_list ap) +static int jobchange_killclone(struct block_list *bl, va_list ap) { struct mob_data *md = NULL; int flag = va_arg(ap, int); @@ -8813,7 +8847,7 @@ int jobchange_killclone(struct block_list *bl, va_list ap) * Called when player changes job * Rewrote to make it tidider [Celest] *------------------------------------------*/ -int pc_jobchange(struct map_session_data *sd, int class, int upper) +static int pc_jobchange(struct map_session_data *sd, int class, int upper) { int i, fame_flag=0; int job, idx = 0; @@ -9009,7 +9043,7 @@ int pc_jobchange(struct map_session_data *sd, int class, int upper) /*========================================== * Tell client player sd has change equipement *------------------------------------------*/ -int pc_equiplookall(struct map_session_data *sd) +static int pc_equiplookall(struct map_session_data *sd) { nullpo_ret(sd); @@ -9026,7 +9060,7 @@ int pc_equiplookall(struct map_session_data *sd) /*========================================== * Tell client player sd has change look (hair,equip...) *------------------------------------------*/ -int pc_changelook(struct map_session_data *sd,int type,int val) +static int pc_changelook(struct map_session_data *sd, int type, int val) { nullpo_ret(sd); @@ -9099,7 +9133,7 @@ int pc_changelook(struct map_session_data *sd,int type,int val) /*========================================== * Give an option (type) to player (sd) and display it to client *------------------------------------------*/ -int pc_setoption(struct map_session_data *sd,int type) +static int pc_setoption(struct map_session_data *sd, int type) { int p_type, new_look=0; nullpo_ret(sd); @@ -9197,7 +9231,8 @@ int pc_setoption(struct map_session_data *sd,int type) /*========================================== * Give player a cart *------------------------------------------*/ -int pc_setcart(struct map_session_data *sd,int type) { +static int pc_setcart(struct map_session_data *sd, int type) +{ #ifndef NEW_CARTS int cart[6] = {OPTION_NOTHING,OPTION_CART1,OPTION_CART2,OPTION_CART3,OPTION_CART4,OPTION_CART5}; int option; @@ -9260,7 +9295,7 @@ int pc_setcart(struct map_session_data *sd,int type) { * @param sd Target player. * @param flag New state. **/ -void pc_setfalcon(struct map_session_data *sd, bool flag) +static void pc_setfalcon(struct map_session_data *sd, bool flag) { nullpo_retv(sd); if (flag) { @@ -9279,7 +9314,7 @@ void pc_setfalcon(struct map_session_data *sd, bool flag) * @param sd Target player. * @param flag New state. **/ -void pc_setridingpeco(struct map_session_data *sd, bool flag) +static void pc_setridingpeco(struct map_session_data *sd, bool flag) { nullpo_retv(sd); if (flag) { @@ -9298,7 +9333,7 @@ void pc_setridingpeco(struct map_session_data *sd, bool flag) * @param sd Target player. * @param flag New state. **/ -void pc_setmadogear(struct map_session_data *sd, bool flag) +static void pc_setmadogear(struct map_session_data *sd, bool flag) { nullpo_retv(sd); if (flag) { @@ -9317,7 +9352,7 @@ void pc_setmadogear(struct map_session_data *sd, bool flag) * @param sd Target player. * @param type New state. This must be a valid OPTION_DRAGON* or 0. **/ -void pc_setridingdragon(struct map_session_data *sd, unsigned int type) +static void pc_setridingdragon(struct map_session_data *sd, unsigned int type) { nullpo_retv(sd); if (type&OPTION_DRAGON) { @@ -9350,7 +9385,7 @@ void pc_setridingdragon(struct map_session_data *sd, unsigned int type) * @param sd Target player. * @param flag New state. **/ -void pc_setridingwug(struct map_session_data *sd, bool flag) +static void pc_setridingwug(struct map_session_data *sd, bool flag) { nullpo_retv(sd); if (flag) { @@ -9369,7 +9404,8 @@ void pc_setridingwug(struct map_session_data *sd, bool flag) * Called from unit_attack and unit_attack_timer_sub * @retval true Can attack **/ -bool pc_can_attack( struct map_session_data *sd, int target_id ) { +static bool pc_can_attack(struct map_session_data *sd, int target_id) +{ nullpo_retr(false, sd); if( sd->sc.data[SC_BASILICA] || @@ -9395,7 +9431,8 @@ bool pc_can_attack( struct map_session_data *sd, int target_id ) { * Called from clif_parse_GlobalMessage and clif_parse_WisMessage * @retval true Can talk **/ -bool pc_can_talk( struct map_session_data *sd ) { +static bool pc_can_talk(struct map_session_data *sd) +{ nullpo_retr(false, sd); if( sd->sc.data[SC_BERSERK] || @@ -9410,7 +9447,7 @@ bool pc_can_talk( struct map_session_data *sd ) { /*========================================== * Check if player can drop an item *------------------------------------------*/ -int pc_candrop(struct map_session_data *sd, struct item *item) +static int pc_candrop(struct map_session_data *sd, struct item *item) { if( item && (item->expire_time || (item->bound && !pc_can_give_bound_items(sd))) ) return 0; @@ -9421,14 +9458,16 @@ int pc_candrop(struct map_session_data *sd, struct item *item) /** * For '@type' variables (temporary numeric char reg) **/ -int pc_readreg(struct map_session_data* sd, int64 reg) { +static int pc_readreg(struct map_session_data *sd, int64 reg) +{ nullpo_ret(sd); return i64db_iget(sd->regs.vars, reg); } /** * For '@type' variables (temporary numeric char reg) **/ -void pc_setreg(struct map_session_data* sd, int64 reg, int val) { +static void pc_setreg(struct map_session_data *sd, int64 reg, int val) +{ unsigned int index = script_getvaridx(reg); nullpo_retv(sd); @@ -9446,7 +9485,8 @@ void pc_setreg(struct map_session_data* sd, int64 reg, int val) { /** * For '@type$' variables (temporary string char reg) **/ -char* pc_readregstr(struct map_session_data* sd, int64 reg) { +static char *pc_readregstr(struct map_session_data *sd, int64 reg) +{ struct script_reg_str *p = NULL; nullpo_retr(NULL, sd); @@ -9457,7 +9497,8 @@ char* pc_readregstr(struct map_session_data* sd, int64 reg) { /** * For '@type$' variables (temporary string char reg) **/ -void pc_setregstr(struct map_session_data* sd, int64 reg, const char* str) { +static void pc_setregstr(struct map_session_data *sd, int64 reg, const char *str) +{ struct script_reg_str *p = NULL; unsigned int index = script_getvaridx(reg); struct DBData prev; @@ -9496,7 +9537,8 @@ void pc_setregstr(struct map_session_data* sd, int64 reg, const char* str) { * - '#type' (permanent numeric account reg) * - '##type' (permanent numeric account reg2) **/ -int pc_readregistry(struct map_session_data *sd, int64 reg) { +static int pc_readregistry(struct map_session_data *sd, int64 reg) +{ struct script_reg_num *p = NULL; nullpo_ret(sd); @@ -9518,7 +9560,8 @@ int pc_readregistry(struct map_session_data *sd, int64 reg) { * - '#type$' (permanent str account reg) * - '##type$' (permanent str account reg2) **/ -char* pc_readregistry_str(struct map_session_data *sd, int64 reg) { +static char *pc_readregistry_str(struct map_session_data *sd, int64 reg) +{ struct script_reg_str *p = NULL; nullpo_retr(NULL, sd); @@ -9540,7 +9583,8 @@ char* pc_readregistry_str(struct map_session_data *sd, int64 reg) { * - '#type' (permanent numeric account reg) * - '##type' (permanent numeric account reg2) **/ -int pc_setregistry(struct map_session_data *sd, int64 reg, int val) { +static int pc_setregistry(struct map_session_data *sd, int64 reg, int val) +{ struct script_reg_num *p = NULL; const char *regname = script->get_str( script_getvarid(reg) ); unsigned int index = script_getvaridx(reg); @@ -9616,7 +9660,8 @@ int pc_setregistry(struct map_session_data *sd, int64 reg, int val) { * - '#type$' (permanent str account reg) * - '##type$' (permanent str account reg2) **/ -int pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val) { +static int pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val) +{ struct script_reg_str *p = NULL; const char *regname = script->get_str( script_getvarid(reg) ); unsigned int index = script_getvaridx(reg); @@ -9672,7 +9717,8 @@ int pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val) /*========================================== * Exec eventtimer for player sd (retrieved from map_session (id)) *------------------------------------------*/ -int pc_eventtimer(int tid, int64 tick, int id, intptr_t data) { +static int pc_eventtimer(int tid, int64 tick, int id, intptr_t data) +{ struct map_session_data *sd=map->id2sd(id); char *p = (char *)data; int i; @@ -9696,7 +9742,7 @@ int pc_eventtimer(int tid, int64 tick, int id, intptr_t data) { /*========================================== * Add eventtimer for player sd ? *------------------------------------------*/ -int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name) +static int pc_addeventtimer(struct map_session_data *sd, int tick, const char *name) { int i; nullpo_ret(sd); @@ -9715,7 +9761,7 @@ int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name) /*========================================== * Del eventtimer for player sd ? *------------------------------------------*/ -int pc_deleventtimer(struct map_session_data *sd,const char *name) +static int pc_deleventtimer(struct map_session_data *sd, const char *name) { char* p = NULL; int i; @@ -9746,7 +9792,7 @@ int pc_deleventtimer(struct map_session_data *sd,const char *name) /*========================================== * Update eventtimer count for player sd *------------------------------------------*/ -int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick) +static int pc_addeventtimercount(struct map_session_data *sd, const char *name, int tick) { int i; @@ -9765,7 +9811,7 @@ int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick) /*========================================== * Remove all eventtimer for player sd *------------------------------------------*/ -int pc_cleareventtimer(struct map_session_data *sd) +static int pc_cleareventtimer(struct map_session_data *sd) { int i; @@ -9785,7 +9831,8 @@ int pc_cleareventtimer(struct map_session_data *sd) return 0; } /* called when a item with combo is worn */ -int pc_checkcombo(struct map_session_data *sd, struct item_data *data ) { +static int pc_checkcombo(struct map_session_data *sd, struct item_data *data) +{ int i, j, k, z; int index, success = 0; struct pc_combos *combo; @@ -9864,7 +9911,8 @@ int pc_checkcombo(struct map_session_data *sd, struct item_data *data ) { } /* called when a item with combo is removed */ -int pc_removecombo(struct map_session_data *sd, struct item_data *data ) { +static int pc_removecombo(struct map_session_data *sd, struct item_data *data) +{ int i, retval = 0; nullpo_ret(sd); @@ -9911,7 +9959,8 @@ int pc_removecombo(struct map_session_data *sd, struct item_data *data ) { return retval; } -int pc_load_combo(struct map_session_data *sd) { +static int pc_load_combo(struct map_session_data *sd) +{ int i, ret = 0; nullpo_ret(sd); for( i = 0; i < EQI_MAX; i++ ) { @@ -9938,13 +9987,13 @@ int pc_load_combo(struct map_session_data *sd) { } /** -* Equip item at given position. -* @param sd the affected player structure. Must be checked before. -* @param id item structure for equip. Must be checked before. -* @param n inventory item position. Must be checked before. -* @param pos slot position. Must be checked before. -**/ -void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n, int pos) + * Equip item at given position. + * @param sd the affected player structure. Must be checked before. + * @param id item structure for equip. Must be checked before. + * @param n inventory item position. Must be checked before. + * @param pos slot position. Must be checked before. + */ +static void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n, int pos) { nullpo_retv(sd); if ((!map_no_view(sd->bl.m,EQP_SHADOW_WEAPON) && pos & EQP_SHADOW_WEAPON) || @@ -10043,7 +10092,7 @@ void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n, * 0 = fail * 1 = success *------------------------------------------*/ -int pc_equipitem(struct map_session_data *sd,int n,int req_pos) +static int pc_equipitem(struct map_session_data *sd, int n, int req_pos) { int i,pos,flag=0,iflag; struct item_data *id; @@ -10178,12 +10227,12 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos) } /** -* Unequip an item at the given position. -* @param sd the affected player structure. Must be checked before. -* @param n inventory item position. Must be checked before. -* @param pos slot position. Must be checked before. -**/ -void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos) + * Unequip an item at the given position. + * @param sd the affected player structure. Must be checked before. + * @param n inventory item position. Must be checked before. + * @param pos slot position. Must be checked before. + */ +static void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos) { nullpo_retv(sd); if (pos & EQP_HAND_R) { @@ -10250,7 +10299,7 @@ void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos) * 0 = fail * 1 = success *------------------------------------------*/ -int pc_unequipitem(struct map_session_data *sd,int n,int flag) +static int pc_unequipitem(struct map_session_data *sd, int n, int flag) { int i, iflag; bool status_calc = false; @@ -10397,7 +10446,7 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) * Checking if player (sd) have unauthorize, invalide item * on inventory, cart, equiped for the map (item_noequip) *------------------------------------------*/ -int pc_checkitem(struct map_session_data *sd) +static int pc_checkitem(struct map_session_data *sd) { int i, calc_flag = 0; @@ -10541,7 +10590,7 @@ int pc_checkitem(struct map_session_data *sd) /*========================================== * Update PVP rank for sd1 in cmp to sd2 *------------------------------------------*/ -int pc_calc_pvprank_sub(struct block_list *bl, va_list ap) +static int pc_calc_pvprank_sub(struct block_list *bl, va_list ap) { struct map_session_data *sd1 = NULL; struct map_session_data *sd2 = va_arg(ap,struct map_session_data *); @@ -10564,7 +10613,8 @@ int pc_calc_pvprank_sub(struct block_list *bl, va_list ap) * Calculate new rank beetween all present players (map->foreachinarea) * and display result *------------------------------------------*/ -int pc_calc_pvprank(struct map_session_data *sd) { +static int pc_calc_pvprank(struct map_session_data *sd) +{ int old; struct map_data *m; nullpo_ret(sd); @@ -10579,7 +10629,8 @@ int pc_calc_pvprank(struct map_session_data *sd) { /*========================================== * Calculate next sd ranking calculation from config *------------------------------------------*/ -int pc_calc_pvprank_timer(int tid, int64 tick, int id, intptr_t data) { +static int pc_calc_pvprank_timer(int tid, int64 tick, int id, intptr_t data) +{ struct map_session_data *sd; sd=map->id2sd(id); @@ -10603,7 +10654,7 @@ int pc_calc_pvprank_timer(int tid, int64 tick, int id, intptr_t data) { * partner_id = yes * 0 = no *------------------------------------------*/ -int pc_ismarried(struct map_session_data *sd) +static int pc_ismarried(struct map_session_data *sd) { if(sd == NULL) return -1; @@ -10618,7 +10669,7 @@ int pc_ismarried(struct map_session_data *sd) * -1 = fail * 0 = success *------------------------------------------*/ -int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd) +static int pc_marriage(struct map_session_data *sd, struct map_session_data *dstsd) { if(sd == NULL || dstsd == NULL || sd->status.partner_id > 0 || dstsd->status.partner_id > 0 || @@ -10635,7 +10686,7 @@ int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd) * -1 = fail * 0 = success *------------------------------------------*/ -int pc_divorce(struct map_session_data *sd) +static int pc_divorce(struct map_session_data *sd) { struct map_session_data *p_sd; int i; @@ -10674,7 +10725,8 @@ int pc_divorce(struct map_session_data *sd) /*========================================== * Get sd partner charid. (Married partner) *------------------------------------------*/ -struct map_session_data *pc_get_partner(struct map_session_data *sd) { +static struct map_session_data *pc_get_partner(struct map_session_data *sd) +{ if (sd && pc->ismarried(sd)) // charid2sd returns NULL if not found return map->charid2sd(sd->status.partner_id); @@ -10685,7 +10737,8 @@ struct map_session_data *pc_get_partner(struct map_session_data *sd) { /*========================================== * Get sd father charid. (Need to be baby) *------------------------------------------*/ -struct map_session_data *pc_get_father(struct map_session_data *sd) { +static struct map_session_data *pc_get_father(struct map_session_data *sd) +{ if (sd && (sd->job & JOBL_BABY) != 0 && sd->status.father > 0) // charid2sd returns NULL if not found return map->charid2sd(sd->status.father); @@ -10696,7 +10749,8 @@ struct map_session_data *pc_get_father(struct map_session_data *sd) { /*========================================== * Get sd mother charid. (Need to be baby) *------------------------------------------*/ -struct map_session_data *pc_get_mother(struct map_session_data *sd) { +static struct map_session_data *pc_get_mother(struct map_session_data *sd) +{ if (sd && (sd->job & JOBL_BABY) != 0 && sd->status.mother > 0) // charid2sd returns NULL if not found return map->charid2sd(sd->status.mother); @@ -10707,7 +10761,8 @@ struct map_session_data *pc_get_mother(struct map_session_data *sd) { /*========================================== * Get sd children charid. (Need to be married) *------------------------------------------*/ -struct map_session_data *pc_get_child(struct map_session_data *sd) { +static struct map_session_data *pc_get_child(struct map_session_data *sd) +{ if (sd && pc->ismarried(sd) && sd->status.child > 0) // charid2sd returns NULL if not found return map->charid2sd(sd->status.child); @@ -10718,7 +10773,7 @@ struct map_session_data *pc_get_child(struct map_session_data *sd) { /*========================================== * Set player sd to bleed. (losing hp and/or sp each diff_tick) *------------------------------------------*/ -void pc_bleeding (struct map_session_data *sd, unsigned int diff_tick) +static void pc_bleeding(struct map_session_data *sd, unsigned int diff_tick) { int hp = 0, sp = 0; @@ -10753,7 +10808,8 @@ void pc_bleeding (struct map_session_data *sd, unsigned int diff_tick) //Character regen. Flag is used to know which types of regen can take place. //&1: HP regen //&2: SP regen -void pc_regen (struct map_session_data *sd, unsigned int diff_tick) { +static void pc_regen(struct map_session_data *sd, unsigned int diff_tick) +{ int hp = 0, sp = 0; nullpo_retv(sd); @@ -10782,7 +10838,8 @@ void pc_regen (struct map_session_data *sd, unsigned int diff_tick) { /*========================================== * Memo player sd savepoint. (map,x,y) *------------------------------------------*/ -int pc_setsavepoint(struct map_session_data *sd, short map_index, int x, int y) { +static int pc_setsavepoint(struct map_session_data *sd, short map_index, int x, int y) +{ nullpo_ret(sd); sd->status.save_point.map = map_index; @@ -10795,7 +10852,8 @@ int pc_setsavepoint(struct map_session_data *sd, short map_index, int x, int y) /*========================================== * Save 1 player data at autosave intervall *------------------------------------------*/ -int pc_autosave(int tid, int64 tick, int id, intptr_t data) { +static int pc_autosave(int tid, int64 tick, int id, intptr_t data) +{ int interval; struct s_mapiterator* iter; struct map_session_data* sd; @@ -10833,7 +10891,8 @@ int pc_autosave(int tid, int64 tick, int id, intptr_t data) { return 0; } -int pc_daynight_timer_sub(struct map_session_data *sd,va_list ap) { +static int pc_daynight_timer_sub(struct map_session_data *sd, va_list ap) +{ nullpo_ret(sd); if (sd->state.night != map->night_flag && map->list[sd->bl.m].flag.nightenabled) { //Night/day state does not match. clif->status_change(&sd->bl, SI_SKE, map->night_flag, 0, 0, 0, 0); //New night effect by dynamix [Skotlex] @@ -10846,7 +10905,8 @@ int pc_daynight_timer_sub(struct map_session_data *sd,va_list ap) { * timer to do the day [Yor] * data: 0 = called by timer, 1 = gmcommand/script *------------------------------------------------*/ -int map_day_timer(int tid, int64 tick, int id, intptr_t data) { +static int map_day_timer(int tid, int64 tick, int id, intptr_t data) +{ char tmp_soutput[1024]; if (data == 0 && battle_config.day_duration <= 0) // if we want a day @@ -10866,7 +10926,8 @@ int map_day_timer(int tid, int64 tick, int id, intptr_t data) { * timer to do the night [Yor] * data: 0 = called by timer, 1 = gmcommand/script *------------------------------------------------*/ -int map_night_timer(int tid, int64 tick, int id, intptr_t data) { +static int map_night_timer(int tid, int64 tick, int id, intptr_t data) +{ char tmp_soutput[1024]; if (data == 0 && battle_config.night_duration <= 0) // if we want a night @@ -10882,7 +10943,8 @@ int map_night_timer(int tid, int64 tick, int id, intptr_t data) { return 0; } -void pc_setstand(struct map_session_data *sd) { +static void pc_setstand(struct map_session_data *sd) +{ nullpo_retv(sd); status_change_end(&sd->bl, SC_TENSIONRELAX, INVALID_TIMER); @@ -10895,7 +10957,8 @@ void pc_setstand(struct map_session_data *sd) { /** * Mechanic (MADO GEAR) **/ -void pc_overheat(struct map_session_data *sd, int val) { +static void pc_overheat(struct map_session_data *sd, int val) +{ int heat = val, skill_lv, limit[] = { 10, 20, 28, 46, 66 }; @@ -10921,7 +10984,7 @@ void pc_overheat(struct map_session_data *sd, int val) { /** * Check if player is autolooting given itemID. */ -bool pc_isautolooting(struct map_session_data *sd, int nameid) +static bool pc_isautolooting(struct map_session_data *sd, int nameid) { int i = 0; @@ -10942,7 +11005,8 @@ bool pc_isautolooting(struct map_session_data *sd, int nameid) * @param sd Player map session data * @param command Command name with @/# and without params */ -bool pc_can_use_command(struct map_session_data *sd, const char *command) { +static bool pc_can_use_command(struct map_session_data *sd, const char *command) +{ return atcommand->can_use(sd,command); } @@ -10951,7 +11015,7 @@ bool pc_can_use_command(struct map_session_data *sd, const char *command) { * * @see TimerFunc */ -int pc_charm_timer(int tid, int64 tick, int id, intptr_t data) +static int pc_charm_timer(int tid, int64 tick, int id, intptr_t data) { struct map_session_data *sd = map->id2sd(id); int i; @@ -10992,7 +11056,7 @@ int pc_charm_timer(int tid, int64 tick, int id, intptr_t data) * @param max Maximum amount of charms to add. * @param type Charm type (@see spirit_charm_types) */ -void pc_add_charm(struct map_session_data *sd, int interval, int max, int type) +static void pc_add_charm(struct map_session_data *sd, int interval, int max, int type) { int tid, i; @@ -11034,7 +11098,7 @@ void pc_add_charm(struct map_session_data *sd, int interval, int max, int type) * @param count Amount of charms to remove. * @param type Type of charm to remove. */ -void pc_del_charm(struct map_session_data *sd, int count, int type) +static void pc_del_charm(struct map_session_data *sd, int count, int type) { int i; @@ -11081,7 +11145,7 @@ void pc_del_charm(struct map_session_data *sd, int count, int type) * @param type Modifier type (1=exp 2=itemdrop) * @return The percent rate modifier (100 = 100%) */ -int pc_level_penalty_mod(int diff, unsigned char race, uint32 mode, int type) +static int pc_level_penalty_mod(int diff, unsigned char race, uint32 mode, int type) { #if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) int rate = 100, i; @@ -11111,7 +11175,7 @@ int pc_level_penalty_mod(int diff, unsigned char race, uint32 mode, int type) #endif } -bool pc_read_skill_job_skip(short skill_id, int job_id) +static bool pc_read_skill_job_skip(short skill_id, int job_id) { return skill_id == NV_TRICKDEAD && ((pc->jobid2mapid(job_id) & (MAPID_BASEMASK | JOBL_2)) != MAPID_NOVICE); // skip trickdead for non-novices } @@ -11129,7 +11193,7 @@ bool pc_read_skill_job_skip(short skill_id, int job_id) * * @author [Ind/Hercules] */ -void pc_read_skill_tree(void) +static void pc_read_skill_tree(void) { struct config_t skill_tree_conf; struct config_setting_t *skt = NULL; @@ -11326,7 +11390,7 @@ void pc_read_skill_tree(void) /** * Clears the skill tree and frees any allocated memory. */ -void pc_clear_skill_tree(void) +static void pc_clear_skill_tree(void) { int i; for (i = 0; i < CLASS_COUNT; i++) { @@ -11340,7 +11404,8 @@ void pc_clear_skill_tree(void) memset(pc->skill_tree, 0, sizeof(pc->skill_tree)); } -bool pc_readdb_levelpenalty(char* fields[], int columns, int current) { +static bool pc_readdb_levelpenalty(char *fields[], int columns, int current) +{ #if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) int type, race, diff; @@ -11369,7 +11434,7 @@ bool pc_readdb_levelpenalty(char* fields[], int columns, int current) { return true; } -bool pc_read_exp_db_sub_class(struct config_setting_t *t, bool base) +static bool pc_read_exp_db_sub_class(struct config_setting_t *t, bool base) { struct class_exp_group entry = { { 0 } }; struct config_setting_t *exp_t = NULL; @@ -11421,7 +11486,7 @@ bool pc_read_exp_db_sub_class(struct config_setting_t *t, bool base) * @param[in] base boolean switch determining whether to read either base or job exp. * @return total number of valid entries read from the setting. */ -int pc_read_exp_db_sub(struct config_setting_t *t, bool base) +static int pc_read_exp_db_sub(struct config_setting_t *t, bool base) { int i = 0, entry_count = 0; struct config_setting_t *tt = NULL; @@ -11440,7 +11505,7 @@ int pc_read_exp_db_sub(struct config_setting_t *t, bool base) * Description: Initiates reading of the exp_group_db.conf. * @return true success, false on failure. */ -bool pc_read_exp_db(void) +static bool pc_read_exp_db(void) { struct config_t exp_db_conf; struct config_setting_t *edb = NULL; @@ -11484,7 +11549,8 @@ bool pc_read_exp_db(void) * skill_tree.txt - skill tree for every class * attr_fix.txt - elemental adjustment table *------------------------------------------*/ -int pc_readdb(void) { +static int pc_readdb(void) +{ int i,j,k; unsigned int count = 0; FILE *fp; @@ -11609,7 +11675,7 @@ int pc_readdb(void) { return 0; } -bool pc_job_is_dummy(int job) +static bool pc_job_is_dummy(int job) { if (job == JOB_KNIGHT2 || job == JOB_CRUSADER2 || job == JOB_WEDDING || job == JOB_XMAS || job == JOB_SUMMER @@ -11622,7 +11688,8 @@ bool pc_job_is_dummy(int job) return false; } -void pc_validate_levels(void) { +static void pc_validate_levels(void) +{ int i; int j; for (i = 0; i < JOB_MAX; i++) { @@ -11637,7 +11704,8 @@ void pc_validate_levels(void) { } } -void pc_itemcd_do(struct map_session_data *sd, bool load) { +static void pc_itemcd_do(struct map_session_data *sd, bool load) +{ int i,cursor = 0; struct item_cd* cd = NULL; @@ -11672,7 +11740,8 @@ void pc_itemcd_do(struct map_session_data *sd, bool load) { return; } -void pc_bank_deposit(struct map_session_data *sd, int money) { +static void pc_bank_deposit(struct map_session_data *sd, int money) +{ unsigned int limit_check; nullpo_retv(sd); @@ -11695,7 +11764,8 @@ void pc_bank_deposit(struct map_session_data *sd, int money) { clif->bank_deposit(sd,BDA_SUCCESS); } } -void pc_bank_withdraw(struct map_session_data *sd, int money) { +static void pc_bank_withdraw(struct map_session_data *sd, int money) +{ unsigned int limit_check; nullpo_retv(sd); @@ -11722,7 +11792,8 @@ void pc_bank_withdraw(struct map_session_data *sd, int money) { } } /* status change data arrived from char-server */ -void pc_scdata_received(struct map_session_data *sd) { +static void pc_scdata_received(struct map_session_data *sd) +{ nullpo_retv(sd); pc->inventory_rentals(sd); clif->show_modifiers(sd); @@ -11742,7 +11813,8 @@ void pc_scdata_received(struct map_session_data *sd) { pc->autotrade_start(sd); } } -int pc_expiration_timer(int tid, int64 tick, int id, intptr_t data) { +static int pc_expiration_timer(int tid, int64 tick, int id, intptr_t data) +{ struct map_session_data *sd = map->id2sd(id); if( !sd ) return 0; @@ -11758,7 +11830,8 @@ int pc_expiration_timer(int tid, int64 tick, int id, intptr_t data) { } /* This timer exists only when a character with an expire timer > 24h is online */ /* It loops through online players once an hour to check whether a new < 24h is available */ -int pc_global_expiration_timer(int tid, int64 tick, int id, intptr_t data) { +static int pc_global_expiration_timer(int tid, int64 tick, int id, intptr_t data) +{ struct s_mapiterator* iter; struct map_session_data* sd; @@ -11771,7 +11844,8 @@ int pc_global_expiration_timer(int tid, int64 tick, int id, intptr_t data) { return 0; } -void pc_expire_check(struct map_session_data *sd) { +static void pc_expire_check(struct map_session_data *sd) +{ nullpo_retv(sd); /* ongoing timer */ if( sd->expiration_tid != INVALID_TIMER ) @@ -11792,7 +11866,7 @@ void pc_expire_check(struct map_session_data *sd) { /** * Loads autotraders ***/ -void pc_autotrade_load(void) +static void pc_autotrade_load(void) { char *data; @@ -11825,7 +11899,8 @@ void pc_autotrade_load(void) /** * Loads vending data and sets it up, is triggered when char server data that pc_autotrade_load requested arrives **/ -void pc_autotrade_start(struct map_session_data *sd) { +static void pc_autotrade_start(struct map_session_data *sd) +{ unsigned int count = 0; int i; char *data; @@ -11872,7 +11947,8 @@ void pc_autotrade_start(struct map_session_data *sd) { /** * Perform a autotrade action **/ -void pc_autotrade_update(struct map_session_data *sd, enum e_pc_autotrade_update_action action) { +static void pc_autotrade_update(struct map_session_data *sd, enum e_pc_autotrade_update_action action) +{ int i; nullpo_retv(sd); @@ -11922,7 +11998,8 @@ void pc_autotrade_update(struct map_session_data *sd, enum e_pc_autotrade_update /** * Handles characters upon @autotrade usage **/ -void pc_autotrade_prepare(struct map_session_data *sd) { +static void pc_autotrade_prepare(struct map_session_data *sd) +{ struct autotrade_vending *data; int i, cursor = 0; int account_id, char_id; @@ -11972,7 +12049,8 @@ void pc_autotrade_prepare(struct map_session_data *sd) { /** * Prepares autotrade data from pc->at_db from a player that has already returned from char server **/ -void pc_autotrade_populate(struct map_session_data *sd) { +static void pc_autotrade_populate(struct map_session_data *sd) +{ struct autotrade_vending *data; int i, j, k, cursor = 0; @@ -12016,7 +12094,7 @@ void pc_autotrade_populate(struct map_session_data *sd) { /** * @see DBApply */ -int pc_autotrade_final(union DBKey key, struct DBData *data, va_list ap) +static int pc_autotrade_final(union DBKey key, struct DBData *data, va_list ap) { struct autotrade_vending* at_v = DB->data2ptr(data); nullpo_ret(at_v); @@ -12024,7 +12102,7 @@ int pc_autotrade_final(union DBKey key, struct DBData *data, va_list ap) return 0; } -void pc_update_idle_time(struct map_session_data* sd, enum e_battle_config_idletime type) +static void pc_update_idle_time(struct map_session_data *sd, enum e_battle_config_idletime type) { nullpo_retv(sd); if (battle_config.idletime_criteria&type) @@ -12033,7 +12111,7 @@ void pc_update_idle_time(struct map_session_data* sd, enum e_battle_config_idlet //Checks if the given class value corresponds to a player class. [Skotlex] //JOB_NOVICE isn't checked for class is supposed to be unsigned -bool pc_db_checkid(int class) +static bool pc_db_checkid(int class) { return class < JOB_MAX_BASIC || (class >= JOB_NOVICE_HIGH && class <= JOB_DARK_COLLECTOR ) @@ -12050,7 +12128,7 @@ bool pc_db_checkid(int class) * @param sd map_session_data of Player * @return index of magnifer, INDEX_NOT_FOUND if it is not found */ -int pc_have_magnifier(struct map_session_data *sd) +static int pc_have_magnifier(struct map_session_data *sd) { int n; n = pc->search_inventory(sd, ITEMID_SPECTACLES); @@ -12065,7 +12143,8 @@ int pc_have_magnifier(struct map_session_data *sd) * @param level Required Level of Novice Skill * @return bool true, if requirement is satisfied */ -bool pc_check_basicskill(struct map_session_data *sd, int level) { +static bool pc_check_basicskill(struct map_session_data *sd, int level) +{ if (pc->checkskill(sd, NV_BASIC) >= level || pc->checkskill(sd, SU_BASIC_SKILL)) return true; return false; @@ -12079,7 +12158,7 @@ bool pc_check_basicskill(struct map_session_data *sd, int level) { * @param message The message text. * @return Whether the message is a valid chat message. */ -bool pc_process_chat_message(struct map_session_data *sd, const char *message) +static bool pc_process_chat_message(struct map_session_data *sd, const char *message) { nullpo_retr(false, sd); if (atcommand->exec(sd->fd, sd, message, true)) { @@ -12111,7 +12190,7 @@ bool pc_process_chat_message(struct map_session_data *sd, const char *message) * @param sd The sender character. * @param message The message text. */ -void pc_check_supernovice_call(struct map_session_data *sd, const char *message) +static void pc_check_supernovice_call(struct map_session_data *sd, const char *message) { uint64 next = pc->nextbaseexp(sd); int percent = 0; @@ -12155,7 +12234,7 @@ void pc_check_supernovice_call(struct map_session_data *sd, const char *message) } } -void pc_update_job_and_level(struct map_session_data *sd) +static void pc_update_job_and_level(struct map_session_data *sd) { nullpo_retv(sd); @@ -12173,7 +12252,7 @@ void pc_update_job_and_level(struct map_session_data *sd) } } -void pc_clear_exp_groups(void) +static void pc_clear_exp_groups(void) { int i, k, size; for (k = 0; k < 2; k++) { @@ -12185,7 +12264,7 @@ void pc_clear_exp_groups(void) } } -void pc_init_exp_groups(void) +static void pc_init_exp_groups(void) { int i; for (i = 0; i < 2; i++) { @@ -12193,7 +12272,7 @@ void pc_init_exp_groups(void) } } -void do_final_pc(void) +static void do_final_pc(void) { db_destroy(pc->itemcd_db); @@ -12212,7 +12291,8 @@ void do_final_pc(void) return; } -void do_init_pc(bool minimal) { +static void do_init_pc(bool minimal) +{ if (minimal) return; @@ -12260,12 +12340,14 @@ void do_init_pc(bool minimal) { ers_chunk_size(pc->num_reg_ers, 300); ers_chunk_size(pc->str_reg_ers, 50); } + /*===================================== -* Default Functions : pc.h -* Generated by HerculesInterfaceMaker -* created by Susu -*-------------------------------------*/ -void pc_defaults(void) { + * Default Functions : pc.h + * Generated by HerculesInterfaceMaker + * created by Susu + *-------------------------------------*/ +void pc_defaults(void) +{ const struct sg_data sg_info[MAX_PC_FEELHATE] = { { SG_SUN_ANGER, SG_SUN_BLESS, SG_SUN_COMFORT, "PC_FEEL_SUN", "PC_HATE_MOB_SUN", is_day_of_sun }, { SG_MOON_ANGER, SG_MOON_BLESS, SG_MOON_COMFORT, "PC_FEEL_MOON", "PC_HATE_MOB_MOON", is_day_of_moon }, -- cgit v1.2.3-70-g09d2