diff options
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 993 |
1 files changed, 510 insertions, 483 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 34c36d7f3..ed69b8c0f 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -80,13 +80,13 @@ #error GD_SKILLRANGEMAX is greater than 999 #endif -struct skill_interface skill_s; +static struct skill_interface skill_s; struct s_skill_dbs skilldbs; struct skill_interface *skill; //Since only mob-casted splash skills can hit ice-walls -int skill_splash_target(struct block_list* bl) +static int skill_splash_target(struct block_list *bl) { nullpo_retr(BL_CHAR, bl); #ifndef RENEWAL @@ -97,7 +97,7 @@ int skill_splash_target(struct block_list* bl) } /// Returns the id of the skill, or 0 if not found. -int skill_name2id(const char* name) +static int skill_name2id(const char *name) { if( name == NULL ) return 0; @@ -107,7 +107,7 @@ int skill_name2id(const char* name) /// Maps skill ids to skill db offsets. /// Returns the skill's array index, or 0 (Unknown Skill). -int skill_get_index(int skill_id) +static int skill_get_index(int skill_id) { // avoid ranges reserved for mapping guild/homun/mercenary skills if( (skill_id >= GD_SKILLRANGEMIN && skill_id <= GD_SKILLRANGEMAX) @@ -146,12 +146,12 @@ int skill_get_index(int skill_id) return skill_id; } -const char *skill_get_name(int skill_id) +static const char *skill_get_name(int skill_id) { return skill->dbs->db[skill->get_index(skill_id)].name; } -const char *skill_get_desc(int skill_id) +static const char *skill_get_desc(int skill_id) { return skill->dbs->db[skill->get_index(skill_id)].desc; } @@ -161,7 +161,7 @@ const char *skill_get_desc(int skill_id) // Skill DB -int skill_get_hit(int skill_id) +static int skill_get_hit(int skill_id) { int idx; if (skill_id == 0) @@ -171,7 +171,7 @@ int skill_get_hit(int skill_id) return skill->dbs->db[idx].hit; } -int skill_get_inf(int skill_id) +static int skill_get_inf(int skill_id) { int idx; if (skill_id == 0) @@ -181,7 +181,7 @@ int skill_get_inf(int skill_id) return skill->dbs->db[idx].inf; } -int skill_get_ele(int skill_id, int skill_lv) +static int skill_get_ele(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -192,7 +192,7 @@ int skill_get_ele(int skill_id, int skill_lv) return skill->dbs->db[idx].element[skill_get_lvl_idx(skill_lv)]; } -int skill_get_nk(int skill_id) +static int skill_get_nk(int skill_id) { int idx; if (skill_id == 0) @@ -202,7 +202,7 @@ int skill_get_nk(int skill_id) return skill->dbs->db[idx].nk; } -int skill_get_max(int skill_id) +static int skill_get_max(int skill_id) { int idx; if (skill_id == 0) @@ -212,7 +212,7 @@ int skill_get_max(int skill_id) return skill->dbs->db[idx].max; } -int skill_get_range(int skill_id, int skill_lv) +static int skill_get_range(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -227,7 +227,7 @@ int skill_get_range(int skill_id, int skill_lv) return skill->dbs->db[idx].range[skill_get_lvl_idx(skill_lv)]; } -int skill_get_splash(int skill_id, int skill_lv) +static int skill_get_splash(int skill_id, int skill_lv) { int idx, val; if (skill_id == 0) @@ -245,7 +245,7 @@ int skill_get_splash(int skill_id, int skill_lv) return val; } -int skill_get_hp(int skill_id, int skill_lv) +static int skill_get_hp(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -260,7 +260,7 @@ int skill_get_hp(int skill_id, int skill_lv) return skill->dbs->db[idx].hp[skill_get_lvl_idx(skill_lv)]; } -int skill_get_sp(int skill_id, int skill_lv) +static int skill_get_sp(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -275,7 +275,7 @@ int skill_get_sp(int skill_id, int skill_lv) return skill->dbs->db[idx].sp[skill_get_lvl_idx(skill_lv)]; } -int skill_get_hp_rate(int skill_id, int skill_lv) +static int skill_get_hp_rate(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -290,7 +290,7 @@ int skill_get_hp_rate(int skill_id, int skill_lv) return skill->dbs->db[idx].hp_rate[skill_get_lvl_idx(skill_lv)]; } -int skill_get_sp_rate(int skill_id, int skill_lv) +static int skill_get_sp_rate(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -305,7 +305,7 @@ int skill_get_sp_rate(int skill_id, int skill_lv) return skill->dbs->db[idx].sp_rate[skill_get_lvl_idx(skill_lv)]; } -int skill_get_state(int skill_id) +static int skill_get_state(int skill_id) { int idx; if (skill_id == 0) @@ -315,7 +315,7 @@ int skill_get_state(int skill_id) return skill->dbs->db[idx].state; } -int skill_get_spiritball(int skill_id, int skill_lv) +static int skill_get_spiritball(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -330,7 +330,7 @@ int skill_get_spiritball(int skill_id, int skill_lv) return skill->dbs->db[idx].spiritball[skill_get_lvl_idx(skill_lv)]; } -int skill_get_itemid(int skill_id, int item_idx) +static int skill_get_itemid(int skill_id, int item_idx) { int idx; if (skill_id == 0) @@ -341,7 +341,7 @@ int skill_get_itemid(int skill_id, int item_idx) return skill->dbs->db[idx].itemid[item_idx]; } -int skill_get_itemqty(int skill_id, int item_idx) +static int skill_get_itemqty(int skill_id, int item_idx) { int idx; if (skill_id == 0) @@ -352,7 +352,7 @@ int skill_get_itemqty(int skill_id, int item_idx) return skill->dbs->db[idx].amount[item_idx]; } -int skill_get_zeny(int skill_id, int skill_lv) +static int skill_get_zeny(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -367,7 +367,7 @@ int skill_get_zeny(int skill_id, int skill_lv) return skill->dbs->db[idx].zeny[skill_get_lvl_idx(skill_lv)]; } -int skill_get_num(int skill_id, int skill_lv) +static int skill_get_num(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -382,7 +382,7 @@ int skill_get_num(int skill_id, int skill_lv) return skill->dbs->db[idx].num[skill_get_lvl_idx(skill_lv)]; } -int skill_get_cast(int skill_id, int skill_lv) +static int skill_get_cast(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -397,7 +397,7 @@ int skill_get_cast(int skill_id, int skill_lv) return skill->dbs->db[idx].cast[skill_get_lvl_idx(skill_lv)]; } -int skill_get_delay(int skill_id, int skill_lv) +static int skill_get_delay(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -412,7 +412,7 @@ int skill_get_delay(int skill_id, int skill_lv) return skill->dbs->db[idx].delay[skill_get_lvl_idx(skill_lv)]; } -int skill_get_walkdelay(int skill_id, int skill_lv) +static int skill_get_walkdelay(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -427,7 +427,7 @@ int skill_get_walkdelay(int skill_id, int skill_lv) return skill->dbs->db[idx].walkdelay[skill_get_lvl_idx(skill_lv)]; } -int skill_get_time(int skill_id, int skill_lv) +static int skill_get_time(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -442,7 +442,7 @@ int skill_get_time(int skill_id, int skill_lv) return skill->dbs->db[idx].upkeep_time[skill_get_lvl_idx(skill_lv)]; } -int skill_get_time2(int skill_id, int skill_lv) +static int skill_get_time2(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -457,7 +457,7 @@ int skill_get_time2(int skill_id, int skill_lv) return skill->dbs->db[idx].upkeep_time2[skill_get_lvl_idx(skill_lv)]; } -int skill_get_castdef(int skill_id) +static int skill_get_castdef(int skill_id) { int idx; if (skill_id == 0) @@ -467,7 +467,7 @@ int skill_get_castdef(int skill_id) return skill->dbs->db[idx].cast_def_rate; } -int skill_get_weapontype(int skill_id) +static int skill_get_weapontype(int skill_id) { int idx; if (skill_id == 0) @@ -477,7 +477,7 @@ int skill_get_weapontype(int skill_id) return skill->dbs->db[idx].weapon; } -int skill_get_ammotype(int skill_id) +static int skill_get_ammotype(int skill_id) { int idx; if (skill_id == 0) @@ -487,7 +487,7 @@ int skill_get_ammotype(int skill_id) return skill->dbs->db[idx].ammo; } -int skill_get_ammo_qty(int skill_id, int skill_lv) +static int skill_get_ammo_qty(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -502,7 +502,7 @@ int skill_get_ammo_qty(int skill_id, int skill_lv) return skill->dbs->db[idx].ammo_qty[skill_get_lvl_idx(skill_lv)]; } -int skill_get_inf2(int skill_id) +static int skill_get_inf2(int skill_id) { int idx; if (skill_id == 0) @@ -512,7 +512,7 @@ int skill_get_inf2(int skill_id) return skill->dbs->db[idx].inf2; } -int skill_get_castcancel(int skill_id) +static int skill_get_castcancel(int skill_id) { int idx; if (skill_id == 0) @@ -522,7 +522,7 @@ int skill_get_castcancel(int skill_id) return skill->dbs->db[idx].castcancel; } -int skill_get_maxcount(int skill_id, int skill_lv) +static int skill_get_maxcount(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -537,7 +537,7 @@ int skill_get_maxcount(int skill_id, int skill_lv) return skill->dbs->db[idx].maxcount[skill_get_lvl_idx(skill_lv)]; } -int skill_get_blewcount(int skill_id, int skill_lv) +static int skill_get_blewcount(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -552,7 +552,7 @@ int skill_get_blewcount(int skill_id, int skill_lv) return skill->dbs->db[idx].blewcount[skill_get_lvl_idx(skill_lv)]; } -int skill_get_mhp(int skill_id, int skill_lv) +static int skill_get_mhp(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -567,7 +567,7 @@ int skill_get_mhp(int skill_id, int skill_lv) return skill->dbs->db[idx].mhp[skill_get_lvl_idx(skill_lv)]; } -int skill_get_castnodex(int skill_id, int skill_lv) +static int skill_get_castnodex(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -582,7 +582,7 @@ int skill_get_castnodex(int skill_id, int skill_lv) return skill->dbs->db[idx].castnodex[skill_get_lvl_idx(skill_lv)]; } -int skill_get_delaynodex(int skill_id, int skill_lv) +static int skill_get_delaynodex(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -597,7 +597,7 @@ int skill_get_delaynodex(int skill_id, int skill_lv) return skill->dbs->db[idx].delaynodex[skill_get_lvl_idx(skill_lv)]; } -int skill_get_type(int skill_id) +static int skill_get_type(int skill_id) { int idx; if (skill_id == 0) @@ -607,7 +607,7 @@ int skill_get_type(int skill_id) return skill->dbs->db[idx].skill_type; } -int skill_get_unit_id(int skill_id, int flag) +static int skill_get_unit_id(int skill_id, int flag) { int idx; if (skill_id == 0) @@ -618,7 +618,7 @@ int skill_get_unit_id(int skill_id, int flag) return skill->dbs->db[idx].unit_id[flag]; } -int skill_get_unit_interval(int skill_id) +static int skill_get_unit_interval(int skill_id) { int idx; if (skill_id == 0) @@ -628,7 +628,7 @@ int skill_get_unit_interval(int skill_id) return skill->dbs->db[idx].unit_interval; } -int skill_get_unit_range(int skill_id, int skill_lv) +static int skill_get_unit_range(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -643,7 +643,7 @@ int skill_get_unit_range(int skill_id, int skill_lv) return skill->dbs->db[idx].unit_range[skill_get_lvl_idx(skill_lv)]; } -int skill_get_unit_target(int skill_id) +static int skill_get_unit_target(int skill_id) { int idx; if (skill_id == 0) @@ -653,7 +653,7 @@ int skill_get_unit_target(int skill_id) return skill->dbs->db[idx].unit_target & BCT_ALL; } -int skill_get_unit_bl_target(int skill_id) +static int skill_get_unit_bl_target(int skill_id) { int idx; if (skill_id == 0) @@ -663,7 +663,7 @@ int skill_get_unit_bl_target(int skill_id) return skill->dbs->db[idx].unit_target & BL_ALL; } -int skill_get_unit_flag(int skill_id) +static int skill_get_unit_flag(int skill_id) { int idx; if (skill_id == 0) @@ -673,7 +673,7 @@ int skill_get_unit_flag(int skill_id) return skill->dbs->db[idx].unit_flag; } -int skill_get_unit_layout_type(int skill_id, int skill_lv) +static int skill_get_unit_layout_type(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -688,7 +688,7 @@ int skill_get_unit_layout_type(int skill_id, int skill_lv) return skill->dbs->db[idx].unit_layout_type[skill_get_lvl_idx(skill_lv)]; } -int skill_get_cooldown(int skill_id, int skill_lv) +static int skill_get_cooldown(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -703,7 +703,7 @@ int skill_get_cooldown(int skill_id, int skill_lv) return skill->dbs->db[idx].cooldown[skill_get_lvl_idx(skill_lv)]; } -int skill_get_fixed_cast(int skill_id, int skill_lv) +static int skill_get_fixed_cast(int skill_id, int skill_lv) { int idx; if (skill_id == 0) @@ -722,7 +722,7 @@ int skill_get_fixed_cast(int skill_id, int skill_lv) #endif } -int skill_tree_get_max(int skill_id, int class) +static int skill_tree_get_max(int skill_id, int class) { int i; int class_idx = pc->class2idx(class); @@ -734,7 +734,7 @@ int skill_tree_get_max(int skill_id, int class) return skill->get_max(skill_id); } -int skill_get_casttype(int skill_id) +static int skill_get_casttype(int skill_id) { int inf = skill->get_inf(skill_id); if (inf&(INF_GROUND_SKILL)) @@ -751,7 +751,7 @@ int skill_get_casttype(int skill_id) return CAST_DAMAGE; } -int skill_get_casttype2(int index) +static int skill_get_casttype2(int index) { int inf; Assert_retr(CAST_NODAMAGE, index < MAX_SKILL_DB); @@ -771,7 +771,7 @@ int skill_get_casttype2(int index) } //Returns actual skill range taking into account attack range and AC_OWL [Skotlex] -int skill_get_range2(struct block_list *bl, int skill_id, int skill_lv) +static int skill_get_range2(struct block_list *bl, int skill_id, int skill_lv) { int range; struct map_session_data *sd = BL_CAST(BL_PC, bl); @@ -860,7 +860,8 @@ int skill_get_range2(struct block_list *bl, int skill_id, int skill_lv) return range; } -int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, bool heal) { +static int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, bool heal) +{ int skill2_lv, hp; struct map_session_data *sd = BL_CAST(BL_PC, src); struct map_session_data *tsd = BL_CAST(BL_PC, target); @@ -955,7 +956,7 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk } // Making plagiarize check its own function [Aru] -int can_copy (struct map_session_data *sd, uint16 skill_id, struct block_list* bl) +static int can_copy(struct map_session_data *sd, uint16 skill_id, struct block_list *bl) { nullpo_ret(sd); // Never copy NPC/Wedding Skills @@ -992,7 +993,7 @@ int can_copy (struct map_session_data *sd, uint16 skill_id, struct block_list* b } // [MouseJstr] - skill ok to cast? and when? -int skillnotok (uint16 skill_id, struct map_session_data *sd) +static int skillnotok(uint16 skill_id, struct map_session_data *sd) { int16 idx,m; nullpo_retr (1, sd); @@ -1022,7 +1023,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd) } if (sd->blockskill[idx]) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_SKILLINTERVAL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_SKILLINTERVAL, 0, 0); return 1; } @@ -1069,7 +1070,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd) //char output[150]; //sprintf(output, msg_txt(862), battle_config.min_npc_vendchat_distance); // "You're too close to a NPC, you must be at least %d cells away from any NPC." //clif->message(sd->fd, output); - clif->skill_fail(sd,skill_id,USESKILL_FAIL_THERE_ARE_NPC_AROUND,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_THERE_ARE_NPC_AROUND, 0, 0); return 1; } FALLTHROUGH @@ -1078,13 +1079,13 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd) case WZ_ICEWALL: // noicewall flag [Valaris] if (map->list[m].flag.noicewall) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 1; } break; case GC_DARKILLUSION: if( map_flag_gvg2(m) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 1; } break; @@ -1093,7 +1094,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd) || !(battle_config.emergency_call&(map->list[m].flag.gvg || map->list[m].flag.gvg_castle?8:4)) || (battle_config.emergency_call&16 && map->list[m].flag.nowarpto && !map->list[m].flag.gvg_castle) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 1; } break; @@ -1113,7 +1114,7 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd) return (map->list[m].flag.noskill); } -int skill_notok_unknown(uint16 skill_id, struct map_session_data *sd) +static int skill_notok_unknown(uint16 skill_id, struct map_session_data *sd) { int16 m; nullpo_retr (1, sd); @@ -1121,7 +1122,7 @@ int skill_notok_unknown(uint16 skill_id, struct map_session_data *sd) return (map->list[m].flag.noskill); } -int skillnotok_hom(uint16 skill_id, struct homun_data *hd) +static int skillnotok_hom(uint16 skill_id, struct homun_data *hd) { uint16 idx = skill->get_index(skill_id); nullpo_retr(1,hd); @@ -1135,7 +1136,7 @@ int skillnotok_hom(uint16 skill_id, struct homun_data *hd) case MH_LIGHT_OF_REGENE: if( homun->get_intimacy_grade(hd) != 4 ){ if( hd->master ) - clif->skill_fail(hd->master, skill_id, USESKILL_FAIL_RELATIONGRADE, 0); + clif->skill_fail(hd->master, skill_id, USESKILL_FAIL_RELATIONGRADE, 0, 0); return 1; } break; @@ -1155,14 +1156,14 @@ int skillnotok_hom(uint16 skill_id, struct homun_data *hd) return skill->not_ok(skill_id, hd->master); } -int skillnotok_hom_unknown(uint16 skill_id, struct homun_data *hd) +static int skillnotok_hom_unknown(uint16 skill_id, struct homun_data *hd) { nullpo_retr(1, hd); //Use master's criteria. return skill->not_ok(skill_id, hd->master); } -int skillnotok_mercenary(uint16 skill_id, struct mercenary_data *md) +static int skillnotok_mercenary(uint16 skill_id, struct mercenary_data *md) { uint16 idx = skill->get_index(skill_id); nullpo_retr(1,md); @@ -1175,7 +1176,7 @@ int skillnotok_mercenary(uint16 skill_id, struct mercenary_data *md) return skill->not_ok(skill_id, md->master); } -struct s_skill_unit_layout* skill_get_unit_layout(uint16 skill_id, uint16 skill_lv, struct block_list* src, int x, int y) +static struct s_skill_unit_layout *skill_get_unit_layout(uint16 skill_id, uint16 skill_lv, struct block_list *src, int x, int y) { int pos = skill->get_unit_layout_type(skill_id,skill_lv); uint8 dir; @@ -1205,7 +1206,8 @@ struct s_skill_unit_layout* skill_get_unit_layout(uint16 skill_id, uint16 skill_ /*========================================== * *------------------------------------------*/ -int skill_additional_effect(struct block_list* src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, int dmg_lv, int64 tick) { +static int skill_additional_effect(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, int dmg_lv, int64 tick) +{ struct map_session_data *sd, *dstsd; struct mob_data *md, *dstmd; struct status_data *sstatus, *tstatus; @@ -1324,7 +1326,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1 if(pc->steal_item(sd,bl,pc->checkskill(sd,TF_STEAL))) clif->skill_nodamage(src,bl,TF_STEAL,temp,1); else - clif->skill_fail(sd,RG_SNATCHER,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, RG_SNATCHER, USESKILL_FAIL_LEVEL, 0, 0); } // Chance to trigger Taekwon kicks [Dralnu] if(sc && !sc->data[SC_COMBOATTACK]) { @@ -1390,7 +1392,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1 if (!sc_start2(src,bl,SC_POISON,(4*skill_lv+10),skill_lv,src->id,skill->get_time2(skill_id,skill_lv)) && sd && skill_id==TF_POISON ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; case AS_SONICBLOW: @@ -1408,7 +1410,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1 if (!sc_start(src,bl,SC_FREEZE,skill_lv*3+35,skill_lv,skill->get_time2(skill_id,skill_lv)) && sd && skill_id == MG_FROSTDIVER ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; #ifdef RENEWAL @@ -2175,10 +2177,12 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1 return 0; } -void skill_additional_effect_unknown(struct block_list* src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int *dmg_lv, int64 *tick) { +static void skill_additional_effect_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int *dmg_lv, int64 *tick) +{ } -int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, uint16 skill_id, int64 tick) { +static int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, uint16 skill_id, int64 tick) +{ int temp, skill_lv, i, type, notok; struct block_list *tbl; @@ -2272,7 +2276,8 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, uint1 * type of skills, so not every instance of skill->additional_effect needs a call * to this one. */ -int skill_counter_additional_effect(struct block_list* src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, int64 tick) { +static int skill_counter_additional_effect(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, int64 tick) +{ int rate; struct map_session_data *sd=NULL; struct map_session_data *dstsd=NULL; @@ -2489,7 +2494,8 @@ int skill_counter_additional_effect(struct block_list* src, struct block_list *b return 0; } -void skill_counter_additional_effect_unknown(struct block_list* src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int64 *tick) { +static void skill_counter_additional_effect_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int *attack_type, int64 *tick) +{ } /*========================================================================= @@ -2498,7 +2504,7 @@ void skill_counter_additional_effect_unknown(struct block_list* src, struct bloc * - flag is a BCT_ flag to indicate which type of adjustment should be used * (BCT_ENEMY/BCT_PARTY/BCT_SELF) are the valid values. *------------------------------------------------------------------------*/ -int skill_break_equip (struct block_list *bl, unsigned short where, int rate, int flag) +static int skill_break_equip(struct block_list *bl, unsigned short where, int rate, int flag) { const int where_list[4] = {EQP_WEAPON, EQP_ARMOR, EQP_SHIELD, EQP_HELM}; const enum sc_type scatk[4] = {SC_NOEQUIPWEAPON, SC_NOEQUIPARMOR, SC_NOEQUIPSHIELD, SC_NOEQUIPHELM}; @@ -2588,7 +2594,7 @@ int skill_break_equip (struct block_list *bl, unsigned short where, int rate, in return where; //Return list of pieces broken. } -int skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int lv, int time) +static int skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int lv, int time) { struct status_change *sc; const int pos[5] = {EQP_WEAPON, EQP_SHIELD, EQP_ARMOR, EQP_HELM, EQP_ACC}; @@ -2623,7 +2629,7 @@ int skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int * if 'flag&0x1', position update packets must not be sent. * if 'flag&0x2', skill blown ignores players' special_state.no_knockback */ -int skill_blown(struct block_list* src, struct block_list* target, int count, int8 dir, int flag) +static int skill_blown(struct block_list *src, struct block_list *target, int count, int8 dir, int flag) { int dx = 0, dy = 0; struct status_change *tsc = status->get_sc(target); @@ -2687,7 +2693,7 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in 1 - Regular reflection (Maya) 2 - SL_KAITE reflection */ -int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type) +static int skill_magic_reflect(struct block_list *src, struct block_list *bl, int type) { struct status_change *sc = status->get_sc(bl); struct map_session_data* sd = BL_CAST(BL_PC, bl); @@ -2736,7 +2742,7 @@ int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type) * client (causes player characters to not scream skill name) * flag&0x4000 - Return 0 if damage was reflected *-------------------------------------------------------------------------*/ -int skill_attack(int attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) +static int skill_attack(int attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) { struct Damage dmg; struct status_data *sstatus, *tstatus; @@ -3432,17 +3438,17 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr return (int)cap_value(damage,INT_MIN,INT_MAX); } -void skill_attack_combo1_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_change_entry *sce, int *combo) +static void skill_attack_combo1_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_change_entry *sce, int *combo) { if (src == dsrc) // Ground skills are exceptions. [Inkfish] status_change_end(src, SC_COMBOATTACK, INVALID_TIMER); } -void skill_attack_combo2_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *combo) +static void skill_attack_combo2_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *combo) { } -void skill_attack_display_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage) +static void skill_attack_display_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage) { nullpo_retv(bl); nullpo_retv(dmg); @@ -3463,18 +3469,18 @@ void skill_attack_display_unknown(int *attack_type, struct block_list* src, stru dmg->dmotion = clif->skill_damage(dsrc, bl, *tick, dmg->amotion, dmg->dmotion, *damage, dmg->div_, *skill_id, (*flag & SD_LEVEL) ? -1 : *skill_lv, *type); } -int skill_attack_copy_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) +static int skill_attack_copy_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) { nullpo_ret(skill_id); return *skill_id; } -int skill_attack_dir_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) +static int skill_attack_dir_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) { return -1; } -void skill_attack_blow_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage, int8 *dir) +static void skill_attack_blow_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, int *type, struct Damage *dmg, int64 *damage, int8 *dir) { nullpo_retv(bl); nullpo_retv(dmg); @@ -3489,7 +3495,7 @@ void skill_attack_blow_unknown(int *attack_type, struct block_list* src, struct } } -void skill_attack_post_unknown(int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) +static void skill_attack_post_unknown(int *attack_type, struct block_list *src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) { } @@ -3498,7 +3504,7 @@ void skill_attack_post_unknown(int *attack_type, struct block_list* src, struct * Checking bl battle flag and display damage * then call func with source,target,skill_id,skill_lv,tick,flag *------------------------------------------*/ -int skill_area_sub(struct block_list *bl, va_list ap) +static int skill_area_sub(struct block_list *bl, va_list ap) { struct block_list *src; uint16 skill_id,skill_lv; @@ -3528,7 +3534,7 @@ int skill_area_sub(struct block_list *bl, va_list ap) return 0; } -int skill_check_unit_range_sub(struct block_list *bl, va_list ap) +static int skill_check_unit_range_sub(struct block_list *bl, va_list ap) { const struct skill_unit *su = NULL; uint16 skill_id,g_skill_id; @@ -3599,7 +3605,8 @@ int skill_check_unit_range_sub(struct block_list *bl, va_list ap) return 1; } -int skill_check_unit_range (struct block_list *bl, int x, int y, uint16 skill_id, uint16 skill_lv) { +static int skill_check_unit_range(struct block_list *bl, int x, int y, uint16 skill_id, uint16 skill_lv) +{ //Non players do not check for the skill's splash-trigger area. int range = bl->type == BL_PC ? skill->get_unit_range(skill_id, skill_lv):0; int layout_type = skill->get_unit_layout_type(skill_id,skill_lv); @@ -3612,7 +3619,8 @@ int skill_check_unit_range (struct block_list *bl, int x, int y, uint16 skill_id return map->foreachinarea(skill->check_unit_range_sub,bl->m,x-range,y-range,x+range,y+range,BL_SKILL,skill_id); } -int skill_check_unit_range2_sub (struct block_list *bl, va_list ap) { +static int skill_check_unit_range2_sub(struct block_list *bl, va_list ap) +{ uint16 skill_id; if(bl->prev == NULL) @@ -3631,7 +3639,8 @@ int skill_check_unit_range2_sub (struct block_list *bl, va_list ap) { return 1; } -int skill_check_unit_range2 (struct block_list *bl, int x, int y, uint16 skill_id, uint16 skill_lv) { +static int skill_check_unit_range2(struct block_list *bl, int x, int y, uint16 skill_id, uint16 skill_lv) +{ int range, type; switch (skill_id) { @@ -3674,7 +3683,8 @@ int skill_check_unit_range2 (struct block_list *bl, int x, int y, uint16 skill_i * &1: finished casting the skill (invoke hp/sp/item consumption) * &2: picked menu entry (Warp Portal, Teleport and other menu based skills) *------------------------------------------*/ -int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv, int type) { +static int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv, int type) +{ struct status_data *st; struct map_session_data *sd = NULL; int i, hp, sp, hp_rate, sp_rate, state, mhp; @@ -3731,11 +3741,11 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv, if( !(type&2) ) { if( hp > 0 && st->hp <= (unsigned int)hp ) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_HP_INSUFFICIENT, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_HP_INSUFFICIENT, 0, 0); return 0; } if( sp > 0 && st->sp <= (unsigned int)sp ) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_SP_INSUFFICIENT, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_SP_INSUFFICIENT, 0, 0); return 0; } } @@ -3744,7 +3754,7 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv, switch( state ) { case ST_MOVE_ENABLE: if( !unit->can_move(bl) ) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -3758,7 +3768,7 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv, if (itemid[i] < 1) continue; // No item index[i] = pc->search_inventory(sd, itemid[i]); if (index[i] == INDEX_NOT_FOUND || sd->status.inventory[index[i]].amount < amount[i]) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_NEED_ITEM, amount[i]|(itemid[i] << 16)); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_NEED_ITEM, amount[i], itemid[i] << 16); return 0; } } @@ -3781,14 +3791,16 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv, /*========================================== * what the hell it doesn't need to receive this many params, it doesn't do anything ~_~ *------------------------------------------*/ -int skill_area_sub_count(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) { +static int skill_area_sub_count(struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) +{ return 1; } /*========================================== * *------------------------------------------*/ -int skill_timerskill(int tid, int64 tick, int id, intptr_t data) { +static int skill_timerskill(int tid, int64 tick, int id, intptr_t data) +{ struct block_list *src = map->id2bl(id),*target = NULL; struct unit_data *ud = unit->bl2ud(src); struct skill_timerskill *skl; @@ -4021,25 +4033,25 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) { return 0; } -bool skill_timerskill_dead_unknown(struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl) +static bool skill_timerskill_dead_unknown(struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl) { return false; } -void skill_timerskill_target_unknown(int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl) +static void skill_timerskill_target_unknown(int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl) { nullpo_retv(skl); skill->attack(skl->type, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag); } -void skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl) +static void skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl) { } /*========================================== * *------------------------------------------*/ -int skill_addtimerskill(struct block_list *src, int64 tick, int target, int x,int y, uint16 skill_id, uint16 skill_lv, int type, int flag) +static int skill_addtimerskill(struct block_list *src, int64 tick, int target, int x, int y, uint16 skill_id, uint16 skill_lv, int type, int flag) { int i; struct unit_data *ud; @@ -4069,7 +4081,7 @@ int skill_addtimerskill(struct block_list *src, int64 tick, int target, int x,in /*========================================== * *------------------------------------------*/ -int skill_cleartimerskill (struct block_list *src) +static int skill_cleartimerskill(struct block_list *src) { int i; struct unit_data *ud; @@ -4102,12 +4114,12 @@ int skill_cleartimerskill (struct block_list *src) return 1; } -bool skill_cleartimerskill_exception(int skill_id) +static bool skill_cleartimerskill_exception(int skill_id) { return false; } -int skill_activate_reverberation(struct block_list *bl, va_list ap) +static int skill_activate_reverberation(struct block_list *bl, va_list ap) { struct skill_unit *su = NULL; struct skill_unit_group *sg = NULL; @@ -4127,7 +4139,7 @@ int skill_activate_reverberation(struct block_list *bl, va_list ap) return 0; } -int skill_reveal_trap(struct block_list *bl, va_list ap) +static int skill_reveal_trap(struct block_list *bl, va_list ap) { struct skill_unit *su = NULL; @@ -4144,7 +4156,7 @@ int skill_reveal_trap(struct block_list *bl, va_list ap) return 0; } -void skill_castend_type(int type, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) +static void skill_castend_type(int type, struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) { switch (type) { case CAST_GROUND: @@ -4164,7 +4176,7 @@ void skill_castend_type(int type, struct block_list *src, struct block_list *bl, * * *------------------------------------------*/ -int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) +static int skill_castend_damage_id(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) { struct map_session_data *sd = NULL; struct status_data *tstatus; @@ -4428,7 +4440,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 unit->setdir(bl,dir); } else if (sd) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; @@ -4879,7 +4891,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 case SL_STUN: if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) { status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,500,SCFLAG_FIXEDTICK|SCFLAG_FIXEDRATE); - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } skill->attack(BF_MAGIC,src,src,bl,skill_id,skill_lv,tick,flag); @@ -5023,12 +5035,12 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 if( sc && sc->data[SC_COMBOATTACK] && sc->data[SC_COMBOATTACK]->val1 == GC_WEAPONBLOCKING ) skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag); else if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_GC_WEAPONBLOCKING,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_GC_WEAPONBLOCKING, 0, 0); break; case GC_CROSSRIPPERSLASHER: if( sd && !(sc && sc->data[SC_ROLLINGCUTTER]) ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_CONDITION,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION, 0, 0); else { skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag); @@ -5183,7 +5195,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 if( path->search(NULL,src,src->m,src->x,src->y,bl->x,bl->y,1,CELL_CHKNOREACH) ) { skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag); }else if( sd && skill_id == RA_WUGBITE ) // Only RA_WUGBITE has the skill fail message. - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; @@ -5341,7 +5353,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 skill->attack(skill->get_type(skill_id), src, src, bl, skill_id, skill_lv, tick, flag); status_change_end(bl, SC_POISON, INVALID_TIMER); } else if( sd ) - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; @@ -5506,7 +5518,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 return 0; } -bool skill_castend_damage_id_unknown(struct block_list* src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_data *tstatus, struct status_change *sc) +static bool skill_castend_damage_id_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag, struct status_data *tstatus, struct status_change *sc) { nullpo_retr(true, skill_id); nullpo_retr(true, skill_lv); @@ -5523,7 +5535,7 @@ bool skill_castend_damage_id_unknown(struct block_list* src, struct block_list * /*========================================== * *------------------------------------------*/ -int skill_castend_id(int tid, int64 tick, int id, intptr_t data) +static int skill_castend_id(int tid, int64 tick, int id, intptr_t data) { struct block_list *target, *src; struct map_session_data *sd; @@ -5662,7 +5674,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) } if( sd && (inf2&INF2_CHORUS_SKILL) && skill->check_pc_partner(sd, ud->skill_id, &ud->skill_lv, 1, 0) < 1 ) { - clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_NEED_HELPER, 0); + clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_NEED_HELPER, 0, 0); break; } @@ -5670,7 +5682,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) if (BL_UCCAST(BL_MOB, target)->class_ == MOBID_EMPELIUM) break; } else if (inf && battle->check_target(src, target, inf) <= 0) { - if (sd) clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0); + if (sd) clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } else if (ud->skill_id == RK_PHANTOMTHRUST && target->type != BL_MOB) { if( !map_flag_vs(src->m) && battle->check_target(src,target,BCT_PARTY) <= 0 ) @@ -5682,7 +5694,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) && rnd() % 100 < 75 ) { // Fogwall makes all offensive-type targeted skills fail at 75% - if (sd) clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_LEVEL, 0); + if (sd) clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } } @@ -5701,7 +5713,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) !check_distance_bl(src, target, skill->get_range2(src,ud->skill_id,ud->skill_lv)+battle_config.skill_add_range)) { if (sd) { - clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_LEVEL, 0, 0); if(battle_config.skill_out_range_consume) //Consume items anyway. [Skotlex] skill->consume_requirement(sd,ud->skill_id,ud->skill_lv,3); } @@ -5845,7 +5857,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) clif->slide(src,src->x,src->y); clif->spiritball(src); } - clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_LEVEL, 0, 0); } } @@ -5862,7 +5874,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) return 0; } -bool skill_castend_id_unknown(struct unit_data *ud, struct block_list *src, struct block_list *target) +static bool skill_castend_id_unknown(struct unit_data *ud, struct block_list *src, struct block_list *target) { return false; } @@ -5870,7 +5882,7 @@ bool skill_castend_id_unknown(struct unit_data *ud, struct block_list *src, stru /*========================================== * *------------------------------------------*/ -int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) +static int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) { struct map_session_data *sd, *dstsd; struct mob_data *md, *dstmd; @@ -5929,7 +5941,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case AL_DECAGI: case AB_RENOVATIO: case AB_HIGHNESSHEAL: - clif->skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_TOTARGET, 0, 0); return 0; default: if (skill->castend_nodamage_id_mado_unknown(src, bl, &skill_id, &skill_lv, &tick, &flag)) @@ -5945,7 +5957,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin switch (skill_id) { case HLIF_HEAL: // [orn] if (bl->type != BL_HOM) { - if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0) ; + if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0) ; break ; } FALLTHROUGH @@ -5963,7 +5975,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if (sd && battle->check_undead(tstatus->race,tstatus->def_ele) && skill_id != AL_INCAGI) { if (battle->check_target(src, bl, BCT_ENEMY) < 1) { //Offensive heal does not works on non-enemies. [Skotlex] - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } return skill->castend_damage_id(src, bl, skill_id, skill_lv, tick, flag); @@ -6117,7 +6129,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case PR_REDEMPTIO: if (sd && !(flag&1)) { if (sd->status.party_id == 0) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } skill->area_temp[0] = 0; @@ -6126,7 +6138,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin src,skill_id,skill_lv,tick, flag|BCT_PARTY|1, skill->castend_nodamage_id); if (skill->area_temp[0] == 0) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } skill->area_temp[0] = 5 - skill->area_temp[0]; // The actual penalty... @@ -6148,7 +6160,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case ALL_RESURRECTION: if(sd && (map_flag_gvg2(bl->m) || map->list[bl->m].flag.battleground)) { //No reviving in WoE grounds! - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } if (!status->isdead(bl)) @@ -6323,7 +6335,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin int class_; if ( sd && dstmd->status.mode&MD_BOSS ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } class_ = skill_id == SA_MONOCELL ? MOBID_PORING : mob->get_random_id(4, 1, 0); @@ -6343,7 +6355,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case SA_DEATH: if ( sd && dstmd && dstmd->status.mode&MD_BOSS ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } clif->skill_nodamage(src,bl,skill_id,skill_lv,1); @@ -6371,7 +6383,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case CR_PROVIDENCE: if(sd && dstsd){ //Check they are not another crusader [Skotlex] if ((dstsd->job & MAPID_UPPERMASK) == MAPID_CRUSADER) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 1; } @@ -6386,7 +6398,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if (sd != NULL && dstsd != NULL && (dstsd->job & MAPID_UPPERMASK) == MAPID_BARDDANCER && dstsd->status.sex == sd->status.sex) { // Cannot cast on another bard/dancer-type class of the same gender as caster - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 1; } @@ -6403,7 +6415,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin status_change_end(bl, SC_MARIONETTE, INVALID_TIMER); } else { if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 1; } @@ -6432,7 +6444,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin dstsd->sc.data[SC_ENCHANTPOISON] )) ) { - if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); clif->skill_nodamage(src,bl,skill_id,skill_lv,0); break; } @@ -6440,7 +6452,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin // 100% success rate at lv4 & 5, but lasts longer at lv5 if(!clif->skill_nodamage(src,bl,skill_id,skill_lv, sc_start(src,bl,type,(60+skill_lv*10),skill_lv, skill->get_time(skill_id,skill_lv)))) { if (sd) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); if (skill->break_equip(bl, EQP_WEAPON, 10000, BCT_PARTY) && sd && sd != dstsd) clif->message(sd->fd, msg_sd(sd,869)); // "You broke the target's weapon." } @@ -6507,7 +6519,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin clif->slide(src, bl->x, bl->y); } } else if (sd != NULL) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL, 0, 0); } break; @@ -6629,7 +6641,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin break; case HP_ASSUMPTIO: if( sd && dstmd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); else clif->skill_nodamage(src,bl,skill_id,skill_lv, sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv))); @@ -6682,7 +6694,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin clif->skill_nodamage(src,bl,skill_id,skill_lv, sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv))); else if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; case AS_ENCHANTPOISON: // Prevent spamming [Valaris] if (sd && dstsd && dstsd->sc.count) { @@ -6695,7 +6707,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin //dstsd->sc.data[SC_ENCHANTPOISON] //People say you should be able to recast to lengthen the timer. [Skotlex] ) { clif->skill_nodamage(src,bl,skill_id,skill_lv,0); - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } } @@ -6725,12 +6737,12 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin int id; if (sd->mission_mobid && (sd->mission_count || rnd()%100)) { //Cannot change target when already have one clif->mission_info(sd, sd->mission_mobid, sd->mission_count); - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } id = mob->get_random_id(0,0xF, sd->status.base_level); if (!id) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } sd->mission_mobid = id; @@ -6765,7 +6777,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin (failure = sc_start(src,bl,type, skill_id == SM_SELFPROVOKE ? 100:( 50 + 3*skill_lv + status->get_lv(src) - status->get_lv(bl)), skill_lv, skill->get_time(skill_id,skill_lv)))); if( !failure ) { if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 0; } @@ -6795,7 +6807,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if( !dstsd || (!sd && !mer) ) { // Only players can be devoted if( sd ) - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } @@ -6808,7 +6820,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin (dstsd->sc.data[SC_HELLPOWER])) // Players affected by SC_HELLPOWERR cannot be devoted. { if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 1; } @@ -6823,7 +6835,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin ARR_FIND(0, count, i, sd->devotion[i] == 0 ); if( i == count ) { // No free slots, skill Fail - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 1; } @@ -7084,7 +7096,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin ) ) { status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,500,SCFLAG_FIXEDRATE); - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } } @@ -7111,7 +7123,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin return 0; } else if( tsc && tsc->option&OPTION_MADOGEAR ) { //Mado Gear cannot hide - if( sd ) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if( sd ) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 0; } @@ -7137,7 +7149,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if( failure ) clif->skill_nodamage(src,bl,skill_id,( skill_id == LG_FORCEOFVANGUARD ) ? skill_lv : -1,failure); else if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); if ( skill_id == LG_FORCEOFVANGUARD || skill_id == RA_CAMOUFLAGE ) break; map->freeblock_unlock(); @@ -7147,7 +7159,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if( failure ) clif->skill_nodamage(src,bl,skill_id,( skill_id == LG_FORCEOFVANGUARD ) ? skill_lv : -1,failure); else if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; @@ -7168,7 +7180,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin //NOTE: mobs don't have the sprite animation that is used when performing this skill (will cause glitches) char temp[70]; snprintf(temp, sizeof(temp), "%s : %s !!", md->name, skill->get_desc(skill_id)); - clif->disp_overhead(&md->bl,temp); + clif->disp_overhead(&md->bl, temp, AREA_CHAT_WOC, NULL); } break; @@ -7187,7 +7199,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin clif->skill_nodamage(src,bl,skill_id,skill_lv, sc_start2(src,bl,type,70,skill_lv,src->id,skill->get_time(skill_id,skill_lv))); } else { clif->skill_nodamage(src,bl,skill_id,skill_lv,0); - if(sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if(sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } } break; @@ -7197,7 +7209,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if(pc->steal_item(sd,bl,skill_lv)) clif->skill_nodamage(src,bl,skill_id,skill_lv,1); else - clif->skill_fail(sd,skill_id,USESKILL_FAIL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL, 0, 0); } break; @@ -7210,7 +7222,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin clif->skill_nodamage(src, bl, skill_id, amount, 1); } else - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; @@ -7218,7 +7230,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin { int brate = 0; if (tstatus->mode&MD_BOSS) { - if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } if(status->isimmune(bl) || !tsc) @@ -7237,7 +7249,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin skill->get_time2(skill_id,skill_lv))) clif->skill_nodamage(src,bl,skill_id,skill_lv,1); else if(sd) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); // Level 6-10 doesn't consume a red gem if it fails [celest] if (skill_lv > 5) { // not to consume items @@ -7341,7 +7353,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin break; if( dstsd ) { // Fail on Players - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } if (dstmd && dstmd->class_ == MOBID_EMPELIUM) @@ -7382,7 +7394,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if (sd) { //Prevent vending of GMs with unnecessary Level to trade/drop. [Skotlex] if ( !pc_can_give_items(sd) ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); else { sd->state.prevend = sd->state.workinprogress = 3; clif->openvendingreq(sd,2+skill_lv); @@ -7430,7 +7442,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if (skill->produce_mix(sd, skill_id, ITEMID_HOLY_WATER, 0, 0, 0, 1)) clif->skill_nodamage(src,bl,skill_id,skill_lv,1); else - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; @@ -7528,7 +7540,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin //Nothing stripped. if( sd && !rate ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } @@ -7547,18 +7559,18 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin int item_id = skill->get_itemid(skill_id, item_idx); int inventory_idx = pc->search_inventory(sd, item_id); if (inventory_idx == INDEX_NOT_FOUND || item_id <= 0) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 1; } if (sd->inventory_data[inventory_idx] == NULL || sd->status.inventory[inventory_idx].amount < skill->get_itemqty(skill_id, item_idx)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 1; } if( skill_id == AM_BERSERKPITCHER ) { if (dstsd != NULL && dstsd->status.base_level < sd->inventory_data[inventory_idx]->elv) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 1; } @@ -7658,7 +7670,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin (dstsd && equip[skill_id - AM_CP_WEAPON] == EQP_SHIELD && pc->checkequip(dstsd, EQP_SHIELD) > 0 && (index = dstsd->equip_index[EQI_HAND_L]) >= 0 && dstsd->inventory_data[index] && dstsd->inventory_data[index]->type != IT_ARMOR)) ) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); // Don't consume item requirements return 0; } @@ -7671,7 +7683,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin clif->skill_nodamage(src,bl,skill_id,skill_lv,1); //Prepare 200 White Potions. if (!skill->produce_mix(sd, skill_id, ITEMID_WHITE_POTION, 0, 0, 0, 200)) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; case AM_TWILIGHT2: @@ -7679,7 +7691,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin clif->skill_nodamage(src,bl,skill_id,skill_lv,1); //Prepare 200 Slim White Potions. if (!skill->produce_mix(sd, skill_id, ITEMID_WHITE_SLIM_POTION, 0, 0, 0, 200)) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; case AM_TWILIGHT3: @@ -7693,7 +7705,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin || !skill->can_produce_mix(sd,ITEMID_FIRE_BOTTLE,-1, 50) //50 Flame Bottle || ebottle < 200 //200 empty bottle are required at total. ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } clif->skill_nodamage(src,bl,skill_id,skill_lv,1); @@ -7719,7 +7731,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin || rnd()%100 >= 50+10*skill_lv ) { if (sd) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } if(status->isimmune(bl) || !tsc || !tsc->count) @@ -7832,7 +7844,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin //Only 10% success chance against bosses. [Skotlex] if (rnd()%100 < 90) { - if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } } else if (!dstsd || map_flag_vs(bl->m)) //HP damage only on pvp-maps when against players. @@ -8123,7 +8135,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin we_baby_parents = true; } if (!we_baby_parents) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 0; } @@ -8138,7 +8150,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin hp = sstatus->max_hp/10; sp = hp * 10 * skill_lv / 100; if (!status->charge(src,hp,0)) { - if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); @@ -8191,7 +8203,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin } skill->delunit(su); }else if(sd) - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; @@ -8238,7 +8250,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin || tstatus-> hp > tstatus->max_hp*3/4 #endif // RENEWAL ) { - if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 1; } @@ -8268,7 +8280,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if (!clif->skill_nodamage(src,bl,skill_id,skill_lv, sc_start(src,bl,type,55+5*skill_lv,skill_lv,skill->get_time(skill_id,skill_lv))) ) { - if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 0; } @@ -8292,7 +8304,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin unsigned int sp1 = 0, sp2 = 0; if (dstmd) { if (dstmd->state.soul_change_flag) { - if(sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if(sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } dstmd->state.soul_change_flag = 1; @@ -8368,7 +8380,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin s++; } if ( sd && !s ) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); // Don't consume item requirements return 0; } @@ -8400,7 +8412,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin } if (rnd() % 100 > skill_lv * 8 || (dstmd && ((dstmd->guardian_data && dstmd->class_ == MOBID_EMPELIUM) || mob_is_battleground(dstmd)))) { if (sd != NULL) - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 0; @@ -8508,7 +8520,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case SL_WIZARD: //NOTE: here, 'type' has the value of the associated MAPID, not of the SC_SOULLINK constant. if (sd != NULL && !(dstsd != NULL && (dstsd->job & MAPID_UPPERMASK) == type)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } if (skill_id == SL_SUPERNOVICE && dstsd && dstsd->die_counter && !(rnd()%100)) { @@ -8524,7 +8536,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin break; case SL_HIGH: if (sd != NULL && !(dstsd != NULL && (dstsd->job & JOBL_UPPER) != 0 && (dstsd->job & JOBL_2) == 0 && dstsd->status.base_level < 70)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } clif->skill_nodamage(src,bl,skill_id,skill_lv, @@ -8535,7 +8547,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case SL_SWOO: if (tsce) { if(sd) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,10000,SCFLAG_FIXEDRATE); status_change_end(bl, SC_SWOO, INVALID_TIMER); break; @@ -8543,7 +8555,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case SL_SKA: // [marquis007] case SL_SKE: if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); status->change_start(src,src,SC_STUN,10000,skill_lv,0,0,0,500,SCFLAG_FIXEDTICK|SCFLAG_FIXEDRATE); break; } @@ -8635,7 +8647,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if (sd) { clif->skill_nodamage(src,bl,skill_id,skill_lv,1); if (!pc->set_hate_mob(sd, skill_lv-1, bl)) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; @@ -8665,7 +8677,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if (homun->call(sd)) clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); else - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; @@ -8674,7 +8686,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if (homun->vaporize(sd,HOM_ST_REST)) clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); else - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; @@ -8709,9 +8721,9 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin } // Failed else if (hd && hd->master) - clif->skill_fail(hd->master, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(hd->master, skill_id, USESKILL_FAIL_LEVEL, 0, 0); else if (sd) - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; case HVAN_CHAOTIC: // [orn] { @@ -8814,7 +8826,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin { if( !sd->status.party_id ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } party->foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill->castend_nodamage_id); @@ -8870,7 +8882,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if( status->charge(bl,heal,0) ) clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start2(src,bl,type,100,skill_lv,heal,skill->get_time(skill_id,skill_lv))); else - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; case RK_REFRESH: @@ -9048,11 +9060,11 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin { int heal = status_get_max_hp(bl) * ( 18 - 2 * skill_lv ) / 100; if( status_get_hp(bl) < heal ) { // if you haven't enough HP skill fails. - if( sd ) clif->skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0); + if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_HP_INSUFFICIENT, 0, 0); break; } if( !status->charge(bl,heal,0) ) { - if( sd ) clif->skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0); + if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_HP_INSUFFICIENT, 0, 0); break; } clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv))); @@ -9078,7 +9090,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin clif->skill_nodamage(bl, bl, skill_id, skill_lv, sc_start(src, bl, type, 100, level + (sd?(sd->status.job_level / 10):0), skill->get_time(skill_id,skill_lv))); else if( sd ) { if( !level ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL, 0, 0); else party->foreachsamemap(skill->area_sub, sd, skill->get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill->castend_nodamage_id); } @@ -9184,7 +9196,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if ((dstsd != NULL && (dstsd->job & MAPID_UPPERMASK) == MAPID_SOUL_LINKER) || rnd()%100 >= 60 + 8 * skill_lv) { if (sd) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } if(status->isimmune(bl) || !tsc || !tsc->count) @@ -9247,11 +9259,11 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin int failure = sc_start2(src,bl,type,rate,skill_lv,src->id,(src == bl)?5000:(bl->type == BL_PC)?skill->get_time(skill_id,skill_lv):skill->get_time2(skill_id, skill_lv)); clif->skill_nodamage(src,bl,skill_id,skill_lv,failure); if( sd && !failure ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } }else if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_TOTARGET, 0, 0); break; case WL_FROSTMISTY: @@ -9287,7 +9299,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); map->foreachinrange(skill->area_sub,bl,skill->get_splash(skill_id,skill_lv),BL_CHAR,src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_nodamage_id); }else if( sd ) // Failure on Rate - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } break; @@ -9317,7 +9329,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if( sc && !sc->data[i] ) break; if( i == SC_SPELLBOOK7 ) { - clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_READING, 0); + clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_READING, 0, 0); break; } @@ -9421,7 +9433,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if( sd ) { int heal, hp = 0; // % of max hp regen if( !dstsd || !pc_ismadogear(dstsd) ) { - clif->skill_fail(sd, skill_id,USESKILL_FAIL_TOTARGET,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_TOTARGET, 0, 0); break; } switch (cap_value(skill_lv, 1, 5)) { @@ -9455,7 +9467,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin clif->skill_nodamage(src,bl,skill_id,1,1); } else - clif->skill_fail(sd,skill_id,USESKILL_FAIL_IMITATION_SKILL_NONE,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_IMITATION_SKILL_NONE, 0, 0); } break; @@ -9465,7 +9477,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin dstsd->shadowform_id = src->id; } else if( sd ) - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; case SC_BODYPAINT: @@ -9526,7 +9538,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin } } } else if( sd ) - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; case LG_TRAMPLE: @@ -9553,7 +9565,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin struct item_data *shield_data = NULL; if( sd->equip_index[EQI_HAND_L] < 0 || !( shield_data = sd->inventory_data[sd->equip_index[EQI_HAND_L]] ) || shield_data->type != IT_ARMOR ) { //Skill will first check if a shield is equipped. If none is found on the caster the skill will fail. - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } //Generates a number between 1 - 3. The number generated will determine which effect will be triggered. @@ -9887,7 +9899,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case WM_GLOOMYDAY: if ( tsc && tsc->data[type] ) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } // val4 indicates caster's voice lesson level @@ -10019,7 +10031,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin break; } if( !mapindex ) { //Given map not found? - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); map->freeblock_unlock(); return 0; } @@ -10114,7 +10126,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin // Summoning the new one. if( !elemental->create(sd,elemental_class,skill->get_time(skill_id,skill_lv)) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } clif->skill_nodamage(src,bl,skill_id,skill_lv,1); @@ -10136,7 +10148,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case 3: mode = EL_MODE_AGGRESSIVE; break; } if (!elemental->change_mode(sd->ed, mode)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } clif->skill_nodamage(src,bl,skill_id,skill_lv,1); @@ -10180,7 +10192,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if( !ed ) break; if( !status->charge(&sd->bl,s_hp,s_sp) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } e_hp = ed->battle_status.max_hp * 10 / 100; @@ -10211,7 +10223,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin sc_start2(src,bl, type, 100, skill_lv, src->id, skill->get_time(skill_id,skill_lv)); (sc->bs_counter)++; } else if( sd ) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } } @@ -10234,7 +10246,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case GN_SLINGITEM: if( sd ) { - short ammo_id; + int ammo_id; int equip_idx = sd->equip_index[EQI_AMMO]; if( equip_idx <= 0 ) break; // No ammo. @@ -10249,7 +10261,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin else skill->attack(BF_WEAPON,src,src,bl,GN_SLINGITEM_RANGEMELEEATK,skill_lv,tick,flag); } else //Otherwise, it fails, shows animation and removes items. - clif->skill_fail(sd,GN_SLINGITEM_RANGEMELEEATK,0xa,0); + clif->skill_fail(sd, GN_SLINGITEM_RANGEMELEEATK, 0xa, 0, 0); } else if( itemdb_is_GNthrowable(ammo_id) ) { struct script_code *scriptroot = sd->inventory_data[equip_idx]->script; if( !scriptroot ) @@ -10377,7 +10389,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case KO_KYOUGAKU: if (!map_flag_vs(src->m) || !dstsd) { - if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_SIZE, 0); + if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_SIZE, 0, 0); break; } else { int time; @@ -10399,14 +10411,14 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if( status->get_lv(bl) <= status->get_lv(src) ) status->change_start(src, bl, SC_COMA, skill_lv, skill_lv, 0, src->id, 0, 0, SCFLAG_NONE); } else if( sd ) - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; case KO_GENWAKU: if ( !map_flag_gvg2(src->m) && ( dstsd || dstmd ) && !(tstatus->mode&MD_PLANT) && battle->check_target(src,bl,BCT_ENEMY) > 0 ) { int x = src->x, y = src->y; if( sd && rnd()%100 > max(5, (45 + 5 * skill_lv) - status_get_int(bl) / 10) ){//[(Base chance of success) - ( target's int / 10)]%. - clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } @@ -10428,7 +10440,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case OB_OBOROGENSOU: if( sd && ( (skill_id == OB_OBOROGENSOU && bl->type == BL_MOB) // This skill does not work on monsters. || is_boss(bl) ) ){ // Does not work on Boss monsters. - clif->skill_fail(sd, skill_id, USESKILL_FAIL_TOTARGET_PLAYER, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_TOTARGET_PLAYER, 0, 0); break; } case KO_IZAYOI: @@ -10592,22 +10604,22 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin return 0; } -bool skill_castend_nodamage_id_dead_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) +static bool skill_castend_nodamage_id_dead_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) { return true; } -bool skill_castend_nodamage_id_undead_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) +static bool skill_castend_nodamage_id_undead_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) { return true; } -bool skill_castend_nodamage_id_mado_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) +static bool skill_castend_nodamage_id_mado_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) { return false; } -bool skill_castend_nodamage_id_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) +static bool skill_castend_nodamage_id_unknown(struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) { nullpo_retr(true, skill_id); nullpo_retr(true, skill_lv); @@ -10620,7 +10632,7 @@ bool skill_castend_nodamage_id_unknown(struct block_list *src, struct block_list /*========================================== * *------------------------------------------*/ -int skill_castend_pos(int tid, int64 tick, int id, intptr_t data) +static int skill_castend_pos(int tid, int64 tick, int id, intptr_t data) { struct block_list* src = map->id2bl(id); struct map_session_data *sd; @@ -10662,7 +10674,7 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data) skill->check_unit_range(src,ud->skillx,ud->skilly,ud->skill_id,ud->skill_lv) ) { - if (sd) clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0); + if (sd) clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } if( src->type&battle_config.skill_nofootset && @@ -10670,7 +10682,7 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data) skill->check_unit_range2(src,ud->skillx,ud->skilly,ud->skill_id,ud->skill_lv) ) { - if (sd) clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0); + if (sd) clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } if( src->type&battle_config.land_skill_limit && @@ -10683,7 +10695,7 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data) } if( maxcount == 0 ) { - if (sd) clif->skill_fail(sd,ud->skill_id,USESKILL_FAIL_LEVEL,0); + if (sd) clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } } @@ -10781,7 +10793,7 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data) } -int skill_check_npc_chaospanic(struct block_list *bl, va_list args) +static int skill_check_npc_chaospanic(struct block_list *bl, va_list args) { const struct npc_data *nd = NULL; @@ -10796,7 +10808,7 @@ int skill_check_npc_chaospanic(struct block_list *bl, va_list args) } /* skill count without self */ -int skill_count_wos(struct block_list *bl, va_list ap) +static int skill_count_wos(struct block_list *bl, va_list ap) { struct block_list* src = va_arg(ap, struct block_list*); nullpo_retr(1, bl); @@ -10810,7 +10822,7 @@ int skill_count_wos(struct block_list *bl, va_list ap) /*========================================== * *------------------------------------------*/ -int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char *mapname) +static int skill_castend_map(struct map_session_data *sd, uint16 skill_id, const char *mapname) { nullpo_ret(sd); nullpo_ret(mapname); @@ -10883,7 +10895,7 @@ int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char map_index = mapindex->name2id(mapname); if(!map_index) { //Given map not found? - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); skill_failed(sd); return 0; } @@ -10898,7 +10910,7 @@ int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char maxcount--; } if(!maxcount) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); skill_failed(sd); return 0; } @@ -10950,7 +10962,7 @@ int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char /*========================================== * *------------------------------------------*/ -int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) +static int skill_castend_pos2(struct block_list *src, int x, int y, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) { struct map_session_data* sd; struct status_change* sc; @@ -11046,7 +11058,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui case SC_CHAOSPANIC: case SC_MAELSTROM: if (sd && map->foreachinarea(skill->check_npc_chaospanic, src->m, x-3, y-3, x+3, y+3, BL_NPC) > 0 ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } FALLTHROUGH @@ -11194,7 +11206,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui else { // Create Basilica. Start SC on caster. Unit timer start SC on others. if( map->foreachinrange(skill->count_wos, src, 2, BL_MOB|BL_PC, src) ) { if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL, 0, 0); return 1; } @@ -11348,7 +11360,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui || sd->inventory_data[inventory_idx] == NULL || sd->status.inventory[inventory_idx].amount < skill->get_itemqty(skill_id, item_idx) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 1; } script->potion_flag = 1; @@ -11404,7 +11416,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui r = skill->get_splash(skill_id, skill_lv); map->foreachinarea(skill->cell_overlap, src->m, x-r, y-r, x+r, y+r, BL_SKILL, HW_GANBANTEIN, &dummy, src); } else { - if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 1; } break; @@ -11419,12 +11431,12 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui case CR_CULTIVATION: if (sd) { if( map->count_oncell(src->m,x,y,BL_CHAR,0) > 0 ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 1; } clif->skill_poseffect(src,skill_id,skill_lv,x,y,tick); if (rnd()%100 < 50) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); } else { int mob_id = skill_lv < 2 ? MOBID_BLACK_MUSHROOM + rnd()%2 : MOBID_RED_PLANT + rnd()%6; struct mob_data *md = mob->once_spawn_sub(src, src->m, x, y, DEFAULT_MOB_JNAME, mob_id, "", SZ_SMALL, AI_NONE); @@ -11473,7 +11485,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui case AM_RESURRECTHOMUN: // [orn] if (sd) { if (!homun->ressurect(sd, 20*skill_lv, x, y)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); break; } } @@ -11517,7 +11529,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui case GC_POISONSMOKE: if( !(sc && sc->data[SC_POISONINGWEAPON]) ) { if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_GC_POISONINGWEAPON,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_GC_POISONINGWEAPON, 0, 0); return 0; } clif->skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skill_id,skill_lv,BDT_SKILL); @@ -11626,7 +11638,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui map->foreachinarea(skill->area_sub,src->m,x-r,y-r,x+r,y+r,skill->splash_target(src), src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id); } else if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL, 0, 0); break; case WM_DOMINION_IMPULSE: @@ -11735,20 +11747,22 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui return 0; } -void skill_castend_pos2_effect_unknown(struct block_list* src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) { +static void skill_castend_pos2_effect_unknown(struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) +{ if (skill->get_inf(*skill_id) & INF_SELF_SKILL) clif->skill_nodamage(src, src, *skill_id, *skill_lv, 1); else clif->skill_poseffect(src, *skill_id, *skill_lv, *x, *y, *tick); } -bool skill_castend_pos2_unknown(struct block_list* src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) { +static bool skill_castend_pos2_unknown(struct block_list *src, int *x, int *y, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag) +{ ShowWarning("skill_castend_pos2: Unknown skill used:%d\n", *skill_id); return true; } /// transforms 'target' skill unit into dissonance (if conditions are met) -int skill_dance_overlap_sub(struct block_list *bl, va_list ap) +static int skill_dance_overlap_sub(struct block_list *bl, va_list ap) { struct skill_unit *target = NULL; struct skill_unit *src = va_arg(ap, struct skill_unit*); @@ -11778,7 +11792,7 @@ int skill_dance_overlap_sub(struct block_list *bl, va_list ap) //Does the song/dance overlapping -> dissonance check. [Skotlex] //When flag is 0, this unit is about to be removed, cancel the dissonance effect //When 1, this unit has been positioned, so start the cancel effect. -int skill_dance_overlap(struct skill_unit* su, int flag) +static int skill_dance_overlap(struct skill_unit *su, int flag) { if (!su || !su->group || !(su->group->state.song_dance&0x1)) return 0; @@ -11801,7 +11815,7 @@ int skill_dance_overlap(struct skill_unit* su, int flag) * @param flag 1 Revert * @retval true success **/ -bool skill_dance_switch(struct skill_unit* su, int flag) +static bool skill_dance_switch(struct skill_unit *su, int flag) { static int prevflag = 1; // by default the backup is empty static struct skill_unit_group backup; @@ -11858,7 +11872,7 @@ bool skill_dance_switch(struct skill_unit* su, int flag) * Initializes and sets a ground skill. * flag&1 is used to determine when the skill 'morphs' (Warp portal becomes active, or Fire Pillar becomes active) *------------------------------------------*/ -struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_id, uint16 skill_lv, int16 x, int16 y, int flag) +static struct skill_unit_group *skill_unitsetting(struct block_list *src, uint16 skill_id, uint16 skill_lv, int16 x, int16 y, int flag) { struct skill_unit_group *group; int i,limit,val1=0,val2=0,val3=0; @@ -12379,11 +12393,11 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_ return group; } -void skill_unitsetting1_unknown(struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *val1, int *val2, int *val3) +static void skill_unitsetting1_unknown(struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *val1, int *val2, int *val3) { } -void skill_unitsetting2_unknown(struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *unit_flag, int *val1, int *val2, int *val3, struct skill_unit_group *group) +static void skill_unitsetting2_unknown(struct block_list *src, uint16 *skill_id, uint16 *skill_lv, int16 *x, int16 *y, int *flag, int *unit_flag, int *val1, int *val2, int *val3, struct skill_unit_group *group) { nullpo_retv(group); nullpo_retv(val2); @@ -12395,7 +12409,7 @@ void skill_unitsetting2_unknown(struct block_list *src, uint16 *skill_id, uint16 /*========================================== * *------------------------------------------*/ -int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick) +static int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick) { struct skill_unit_group *sg; struct block_list *ss; @@ -12650,14 +12664,14 @@ int skill_unit_onplace(struct skill_unit *src, struct block_list *bl, int64 tick return skill_id; } -void skill_unit_onplace_unknown(struct skill_unit *src, struct block_list *bl, int64 *tick) +static void skill_unit_onplace_unknown(struct skill_unit *src, struct block_list *bl, int64 *tick) { } /*========================================== * *------------------------------------------*/ -int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int64 tick) +static int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int64 tick) { struct skill_unit_group *sg; struct block_list *ss; @@ -13455,14 +13469,14 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6 return skill_id; } -void skill_unit_onplace_timer_unknown(struct skill_unit *src, struct block_list *bl, int64 *tick) +static void skill_unit_onplace_timer_unknown(struct skill_unit *src, struct block_list *bl, int64 *tick) { } /*========================================== * Triggered when a char steps out of a skill cell *------------------------------------------*/ -int skill_unit_onout(struct skill_unit *src, struct block_list *bl, int64 tick) +static int skill_unit_onout(struct skill_unit *src, struct block_list *bl, int64 tick) { struct skill_unit_group *sg; struct status_change *sc; @@ -13528,7 +13542,7 @@ int skill_unit_onout(struct skill_unit *src, struct block_list *bl, int64 tick) /*========================================== * Triggered when a char steps out of a skill group (entirely) [Skotlex] *------------------------------------------*/ -int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) +static int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) { struct status_change *sc; struct status_change_entry *sce; @@ -13643,7 +13657,7 @@ int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) * flag&1: Invoke onplace function (otherwise invoke onout) * flag&4: Invoke a onleft call (the unit might be scheduled for deletion) *------------------------------------------*/ -int skill_unit_effect(struct block_list* bl, va_list ap) +static int skill_unit_effect(struct block_list *bl, va_list ap) { struct skill_unit* su = va_arg(ap,struct skill_unit*); struct skill_unit_group* group; @@ -13687,7 +13701,7 @@ int skill_unit_effect(struct block_list* bl, va_list ap) /*========================================== * *------------------------------------------*/ -int skill_unit_ondamaged(struct skill_unit *src, struct block_list *bl, int64 damage, int64 tick) +static int skill_unit_ondamaged(struct skill_unit *src, struct block_list *bl, int64 damage, int64 tick) { struct skill_unit_group *sg; @@ -13722,7 +13736,7 @@ int skill_unit_ondamaged(struct skill_unit *src, struct block_list *bl, int64 da /*========================================== * *------------------------------------------*/ -int skill_check_condition_char_sub (struct block_list *bl, va_list ap) +static int skill_check_condition_char_sub(struct block_list *bl, va_list ap) { struct map_session_data *tsd = NULL; struct block_list *src = va_arg(ap, struct block_list *); @@ -13808,7 +13822,7 @@ int skill_check_condition_char_sub (struct block_list *bl, va_list ap) /*========================================== * Checks and stores partners for ensemble skills [Skotlex] *------------------------------------------*/ -int skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, uint16* skill_lv, int range, int cast_flag) +static int skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, uint16 *skill_lv, int range, int cast_flag) { static int c=0; static int p_sd[2] = { 0, 0 }; @@ -13867,7 +13881,7 @@ int skill_check_pc_partner(struct map_session_data *sd, uint16 skill_id, uint16* /*========================================== * *------------------------------------------*/ -int skill_check_condition_mob_master_sub (struct block_list *bl, va_list ap) +static int skill_check_condition_mob_master_sub(struct block_list *bl, va_list ap) { const struct mob_data *md = NULL; int src_id = va_arg(ap, int); @@ -13892,7 +13906,7 @@ int skill_check_condition_mob_master_sub (struct block_list *bl, va_list ap) * Determines if a given skill should be made to consume ammo * when used by the player. [Skotlex] *------------------------------------------*/ -int skill_isammotype (struct map_session_data *sd, int skill_id) +static int skill_isammotype(struct map_session_data *sd, int skill_id) { nullpo_ret(sd); return ( @@ -13908,7 +13922,7 @@ int skill_isammotype (struct map_session_data *sd, int skill_id) /** * Checks whether a skill can be used in combos or not **/ -bool skill_is_combo( int skill_id ) +static bool skill_is_combo(int skill_id) { switch( skill_id ) { @@ -13934,7 +13948,7 @@ bool skill_is_combo( int skill_id ) return false; } -int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv) +static int skill_check_condition_castbegin(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) { struct status_data *st; struct status_change *sc; @@ -14004,7 +14018,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id } if( pc_is90overweight(sd) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_WEIGHTOVER,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_WEIGHTOVER, 0, 0); return 0; } @@ -14137,15 +14151,28 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id // perform skill-specific checks (and actions) switch( skill_id ) { + case MC_VENDING: + case ALL_BUYING_STORE: + if (map->list[sd->bl.m].flag.novending) { + clif->message(sd->fd, msg_sd(sd, 276)); // "You can't open a shop on this map" + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); + return 0; + } + if (map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y, CELL_CHKNOVENDING)) { + clif->message(sd->fd, msg_sd(sd, 204)); // "You can't open a shop on this cell." + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); + return 0; + } + break; case SO_SPELLFIST: if(sd->skill_id_old != MG_FIREBOLT && sd->skill_id_old != MG_COLDBOLT && sd->skill_id_old != MG_LIGHTNINGBOLT){ - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } FALLTHROUGH case SA_CASTCANCEL: if(sd->ud.skilltimer == INVALID_TIMER) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14160,7 +14187,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if(sc && sc->data[SC_RAISINGDRAGON]) skill_lv += sc->data[SC_RAISINGDRAGON]->val1; if(sd->spiritball >= skill_lv) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14181,7 +14208,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if (sc->data[SC_COMBOATTACK]) { if( sc->data[SC_COMBOATTACK]->val1 == MO_TRIPLEATTACK ) break; - clif->skill_fail(sd, skill_id, USESKILL_FAIL_COMBOSKILL, MO_TRIPLEATTACK); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_COMBOSKILL, MO_TRIPLEATTACK, 0); } return 0; case MO_COMBOFINISH: @@ -14190,7 +14217,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if( sc && sc->data[SC_COMBOATTACK] ) { if ( sc->data[SC_COMBOATTACK]->val1 == MO_CHAINCOMBO ) break; - clif->skill_fail(sd, skill_id, USESKILL_FAIL_COMBOSKILL, MO_CHAINCOMBO); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_COMBOSKILL, MO_CHAINCOMBO, 0); } return 0; case CH_TIGERFIST: @@ -14199,7 +14226,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if( sc && sc->data[SC_COMBOATTACK] ) { if ( sc->data[SC_COMBOATTACK]->val1 == MO_COMBOFINISH ) break; - clif->skill_fail(sd, skill_id, USESKILL_FAIL_COMBOSKILL, MO_COMBOFINISH); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_COMBOSKILL, MO_COMBOFINISH, 0); } return 0; case CH_CHAINCRUSH: @@ -14208,7 +14235,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if( sc && sc->data[SC_COMBOATTACK] ) { if( sc->data[SC_COMBOATTACK]->val1 == CH_TIGERFIST ) break; - clif->skill_fail(sd, skill_id, USESKILL_FAIL_COMBOSKILL, CH_TIGERFIST); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_COMBOSKILL, CH_TIGERFIST, 0); } return 0; case MO_EXTREMITYFIST: @@ -14229,7 +14256,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id } } else if (!unit->can_move(&sd->bl)) { //Placed here as ST_MOVE_ENABLE should not apply if rooted or on a combo. [Skotlex] - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14237,7 +14264,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case TK_MISSION: if ((sd->job & MAPID_UPPERMASK) != MAPID_TAEKWON) { // Cannot be used by Non-Taekwon classes - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14249,7 +14276,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case TK_JUMPKICK: if ((sd->job & MAPID_UPPERMASK) == MAPID_SOUL_LINKER) { // Soul Linkers cannot use this skill - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14282,7 +14309,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id int time; if(!(sc && sc->data[SC_DANCING])) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } time = 1000*(sc->data[SC_DANCING]->val3>>16); @@ -14291,7 +14318,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id (sc->data[SC_DANCING]->val1>>16)) //Dance Skill LV - time < skill->get_time2(skill_id,skill_lv)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } } @@ -14300,7 +14327,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case PR_BENEDICTIO: if (skill->check_pc_partner(sd, skill_id, &skill_lv, 1, 0) < 2) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14318,7 +14345,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case CG_HERMODE: if(!npc->check_areanpc(1,sd->bl.m,sd->bl.x,sd->bl.y,skill->get_splash(skill_id, skill_lv))) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14330,7 +14357,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id int x = sd->bl.x+(i%size-range); int y = sd->bl.y+(i/size-range); if (map->getcell(sd->bl.m, &sd->bl, x, y, CELL_CHKWALL)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } } @@ -14341,7 +14368,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id int64 exp; if (((exp = pc->nextbaseexp(sd)) > 0 && get_percentage64(sd->status.base_exp, exp) < 1) || ((exp = pc->nextjobexp(sd)) > 0 && get_percentage64(sd->status.job_exp, exp) < 1)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); //Not enough exp. + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); //Not enough exp. return 0; } break; @@ -14350,7 +14377,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case AM_TWILIGHT3: if (!party->skill_check(sd, sd->status.party_id, skill_id, skill_lv)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14361,7 +14388,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id break; if (sd->bl.m == sd->feel_map[skill_id-SG_SUN_WARM].m) break; - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; break; case SG_SUN_COMFORT: @@ -14372,7 +14399,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if (sd->bl.m == sd->feel_map[skill_id-SG_SUN_COMFORT].m && (battle_config.allow_skill_without_day || pc->sg_info[skill_id-SG_SUN_COMFORT].day_func())) break; - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; case SG_FUSION: if (sc && sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_STAR) @@ -14381,7 +14408,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id //Only invoke on skill begin cast (instant cast skill). [Kevin] if( require.sp > 0 ) { if (st->sp < (unsigned int)require.sp) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_SP_INSUFFICIENT,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_SP_INSUFFICIENT, 0, 0); else status_zap(&sd->bl, 0, require.sp); } @@ -14390,7 +14417,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case GD_REGENERATION: case GD_RESTORE: if (!map_flag_gvg2(sd->bl.m)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } FALLTHROUGH @@ -14402,7 +14429,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case GS_GLITTERING: if(sd->spiritball >= 10) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14413,13 +14440,13 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id #else if (st->hp < 2) { #endif - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } FALLTHROUGH case NJ_BUNSINJYUTSU: if (!(sc && sc->data[SC_NJ_NEN])) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14427,7 +14454,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case NJ_ZENYNAGE: case KO_MUCHANAGE: if(sd->status.zeny < require.zeny) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_MONEY,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_MONEY, 0, 0); return 0; } break; @@ -14437,14 +14464,14 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id break; case AM_CALLHOMUN: //Can't summon if a hom is already out if (sd->status.hom_id && sd->hd && !sd->hd->homunculus.vaporize) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case AM_REST: //Can't vapo homun if you don't have an active homun or it's hp is < 80% if (!homun_alive(sd->hd) || sd->hd->battle_status.hp < (sd->hd->battle_status.max_hp*80/100)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14458,7 +14485,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if (sd->status.inventory[i].nameid == ITEMID_ANSILA) count += sd->status.inventory[i].amount; if( count >= 3 ) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_ANCILLA_NUMOVER, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_ANCILLA_NUMOVER, 0, 0); return 0; } } @@ -14478,8 +14505,8 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id && ((idx = pc->search_inventory(sd,require.itemid[0])) == INDEX_NOT_FOUND || sd->status.inventory[idx].amount < require.amount[0]) ) { - //clif->skill_fail(sd,skill_id,USESKILL_FAIL_NEED_ITEM,require.amount[0],require.itemid[0]); - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + //clif->skill_fail(sd, skill_id, USESKILL_FAIL_NEED_ITEM, require.amount[0], 0, require.itemid[0]); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14499,7 +14526,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id switch(skill_id){ case WL_TETRAVORTEX: if( i < 4 ){ - clif->skill_fail(sd,skill_id,USESKILL_FAIL_CONDITION,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION, 0, 0); return 0; } break; @@ -14508,13 +14535,13 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if( sc && sc->data[j] ) i++; if( i == 0 ){ - clif->skill_fail(sd,skill_id,USESKILL_FAIL_SUMMON_NONE,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_SUMMON_NONE, 0, 0); return 0; } break; default: if( i == 5 ){ - clif->skill_fail(sd,skill_id,USESKILL_FAIL_SUMMON,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_SUMMON, 0, 0); return 0; } } @@ -14525,14 +14552,14 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id **/ case GC_HALLUCINATIONWALK: if( sc && (sc->data[SC_HALLUCINATIONWALK] || sc->data[SC_HALLUCINATIONWALK_POSTDELAY]) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case GC_COUNTERSLASH: case GC_WEAPONCRUSH: if( !(sc && sc->data[SC_COMBOATTACK] && sc->data[SC_COMBOATTACK]->val1 == GC_WEAPONBLOCKING) ) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_GC_WEAPONBLOCKING, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_GC_WEAPONBLOCKING, 0, 0); return 0; } break; @@ -14541,25 +14568,25 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id **/ case RA_WUGMASTERY: if( pc_isfalcon(sd) || pc_isridingwug(sd) || sd->sc.data[SC__GROOMY] ) { - clif->skill_fail(sd,skill_id,sd->sc.data[SC__GROOMY]?USESKILL_FAIL_MANUAL_NOTIFY:USESKILL_FAIL_CONDITION,0); + clif->skill_fail(sd, skill_id, sd->sc.data[SC__GROOMY] ? USESKILL_FAIL_MANUAL_NOTIFY : USESKILL_FAIL_CONDITION, 0, 0); return 0; } break; case RA_WUGSTRIKE: if( !pc_iswug(sd) && !pc_isridingwug(sd) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_CONDITION,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION, 0, 0); return 0; } break; case RA_WUGRIDER: if( pc_isfalcon(sd) || ( !pc_isridingwug(sd) && !pc_iswug(sd) ) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_CONDITION,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION, 0, 0); return 0; } break; case RA_WUGDASH: if(!pc_isridingwug(sd)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_CONDITION,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION, 0, 0); return 0; } break; @@ -14568,13 +14595,13 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id **/ case LG_BANDING: if( sc && sc->data[SC_INSPIRATION] ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case LG_PRESTIGE: if( sc && (sc->data[SC_BANDING] || sc->data[SC_INSPIRATION]) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14583,7 +14610,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if( sc && sc->data[SC_INSPIRATION] ) return 1; // Don't check for partner. if( !(sc && sc->data[SC_BANDING]) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL, 0, 0); return 0; } if( sc->data[SC_BANDING] && @@ -14594,12 +14621,12 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if( sc && sc->data[SC_COMBOATTACK] ) { if( sc->data[SC_COMBOATTACK]->val1 == SR_DRAGONCOMBO ) break; - clif->skill_fail(sd, skill_id, USESKILL_FAIL_COMBOSKILL, SR_DRAGONCOMBO); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_COMBOSKILL, SR_DRAGONCOMBO, 0); } return 0; case SR_CRESCENTELBOW: if( sc && sc->data[SC_CRESCENTELBOW] ) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_DUPLICATE, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_DUPLICATE, 0, 0); return 0; } break; @@ -14616,7 +14643,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if( sd->spiritball > 0 ) sd->spiritball_old = require.spiritball = sd->spiritball; else { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14627,7 +14654,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case SC_MANHOLE: case SC_DIMENSIONDOOR: if( sc && sc->data[SC_MAGNETICFIELD] ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14635,7 +14662,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id int count; count = skill->check_pc_partner(sd, skill_id, &skill_lv, skill->get_splash(skill_id,skill_lv), 0); if( count < 1 ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_NEED_HELPER,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_NEED_HELPER, 0, 0); return 0; } else require.sp -= require.sp * 20 * count / 100; // -20% each W/M in the party. @@ -14645,7 +14672,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if (sd->equip_index[EQI_HAND_R] < 0 || !itemid_is_pilebunker(sd->status.inventory[sd->equip_index[EQI_HAND_R]].nameid) ) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_THIS_WEAPON, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_THIS_WEAPON, 0, 0); return 0; } break; @@ -14653,7 +14680,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if (( sd->equip_index[EQI_ACC_L] >= 0 && sd->status.inventory[sd->equip_index[EQI_ACC_L]].nameid == ITEMID_HOVERING_BOOSTER ) || ( sd->equip_index[EQI_ACC_R] >= 0 && sd->status.inventory[sd->equip_index[EQI_ACC_R]].nameid == ITEMID_HOVERING_BOOSTER )); else { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14661,25 +14688,25 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case SO_ELECTRICWALK: // Can't be casted until you've walked all cells. if( sc && sc->data[SC_PROPERTYWALK] && sc->data[SC_PROPERTYWALK]->val3 < skill->get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case SO_EL_CONTROL: if( !sd->status.ele_id || !sd->ed ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_EL_SUMMON,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_EL_SUMMON, 0, 0); return 0; } break; case RETURN_TO_ELDICASTES: if( pc_ismadogear(sd) ) { //Cannot be used if Mado is equipped. - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case CR_REFLECTSHIELD: if( sc && sc->data[SC_KYOMU] && rnd()%100 < 5 * sc->data[SC_KYOMU]->val1 ){ - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14688,14 +14715,14 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case KO_KAZEHU_SEIRAN: case KO_DOHU_KOUKAI: if (sd->charm_type == skill->get_ele(skill_id, skill_lv) && sd->charm_count >= MAX_SPIRITCHARM) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_SUMMON, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_SUMMON, 0, 0); return 0; } break; case KO_KAIHOU: case KO_ZENKAI: if (sd->charm_type == CHARM_TYPE_NONE || sd->charm_count <= 0) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_SUMMON,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_SUMMON, 0, 0); return 0; } break; @@ -14710,67 +14737,67 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id switch(require.state) { case ST_HIDING: if(!(sc && sc->option&OPTION_HIDE)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case ST_CLOAKING: if(!pc_iscloaking(sd)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case ST_HIDDEN: if(!pc_ishiding(sd)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case ST_RIDING: if (!pc_isridingpeco(sd) && !pc_isridingdragon(sd)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case ST_FALCON: if(!pc_isfalcon(sd)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case ST_CARTBOOST: if(!(sc && sc->data[SC_CARTBOOST])) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } FALLTHROUGH case ST_CART: if(!pc_iscarton(sd)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_CART,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_CART, 0, 0); return 0; } break; case ST_SHIELD: if (!sd->has_shield) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case ST_SIGHT: if(!(sc && sc->data[SC_SIGHT])) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case ST_EXPLOSIONSPIRITS: if(!(sc && sc->data[SC_EXPLOSIONSPIRITS])) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_EXPLOSIONSPIRITS,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_EXPLOSIONSPIRITS, 0, 0); return 0; } break; case ST_RECOV_WEIGHT_RATE: if(battle_config.natural_heal_weight_rate <= 100 && sd->weight*100/sd->max_weight >= (unsigned int)battle_config.natural_heal_weight_rate) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14779,7 +14806,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id sd->ud.canmove_tick = timer->gettick(); //When using a combo, cancel the can't move delay to enable the skill. [Skotlex] if (!unit->can_move(&sd->bl)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14788,65 +14815,65 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id break; if (map->getcell(sd->bl.m, &sd->bl, sd->bl.x, sd->bl.y, CELL_CHKWATER)) break; - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; case ST_RIDINGDRAGON: if( !pc_isridingdragon(sd) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_DRAGON,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_DRAGON, 0, 0); return 0; } break; case ST_WUG: if( !pc_iswug(sd) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case ST_RIDINGWUG: if( !pc_isridingwug(sd) ){ - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; case ST_MADO: if( !pc_ismadogear(sd) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_MADOGEAR,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_MADOGEAR, 0, 0); return 0; } break; case ST_ELEMENTALSPIRIT: if(!sd->ed) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_EL_SUMMON,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_EL_SUMMON, 0, 0); return 0; } break; case ST_POISONINGWEAPON: if (!(sc && sc->data[SC_POISONINGWEAPON])) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_GC_POISONINGWEAPON, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_GC_POISONINGWEAPON, 0, 0); return 0; } break; case ST_ROLLINGCUTTER: if (!(sc && sc->data[SC_ROLLINGCUTTER])) { - clif->skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_CONDITION, 0, 0); return 0; } break; case ST_MH_FIGHTING: if (!(sc && sc->data[SC_STYLE_CHANGE] && sc->data[SC_STYLE_CHANGE]->val2 == MH_MD_FIGHTING)){ - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } FALLTHROUGH case ST_MH_GRAPPLING: if (!(sc && sc->data[SC_STYLE_CHANGE] && sc->data[SC_STYLE_CHANGE]->val2 == MH_MD_GRAPPLING)){ - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } FALLTHROUGH case ST_PECO: if (!pc_isridingpeco(sd)) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } break; @@ -14855,27 +14882,27 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id if(require.mhp > 0 && get_percentage(st->hp, st->max_hp) > require.mhp) { //mhp is the max-hp-requirement, that is, //you must have this % or less of HP to cast it. - clif->skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_HP_INSUFFICIENT, 0, 0); return 0; } if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_THIS_WEAPON, 0, 0); return 0; } if( require.sp > 0 && st->sp < (unsigned int)require.sp) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_SP_INSUFFICIENT,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_SP_INSUFFICIENT, 0, 0); return 0; } if( require.zeny > 0 && sd->status.zeny < require.zeny ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_MONEY,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_MONEY, 0, 0); return 0; } if( require.spiritball > 0 && sd->spiritball < require.spiritball) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_SPIRITS,require.spiritball); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_SPIRITS, require.spiritball, 0); return 0; } @@ -14890,27 +14917,27 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id return 1; } -int skill_check_condition_castbegin_off_unknown(struct status_change *sc, uint16 *skill_id) +static int skill_check_condition_castbegin_off_unknown(struct status_change *sc, uint16 *skill_id) { return -1; } -int skill_check_condition_castbegin_mount_unknown(struct status_change *sc, uint16 *skill_id) +static int skill_check_condition_castbegin_mount_unknown(struct status_change *sc, uint16 *skill_id) { return 0; } -int skill_check_condition_castbegin_madogear_unknown(struct status_change *sc, uint16 *skill_id) +static int skill_check_condition_castbegin_madogear_unknown(struct status_change *sc, uint16 *skill_id) { return 0; } -int skill_check_condition_castbegin_unknown(struct status_change *sc, uint16 *skill_id) +static int skill_check_condition_castbegin_unknown(struct status_change *sc, uint16 *skill_id) { return -1; } -int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv) +static int skill_check_condition_castend(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) { struct skill_condition require; struct status_data *st; @@ -14957,7 +14984,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, if( sd->skillitem == skill_id ) return 1; if( pc_is90overweight(sd) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_WEIGHTOVER,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_WEIGHTOVER, 0, 0); return 0; } @@ -14991,7 +15018,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, || (skill_id==AM_CANNIBALIZE && c != i && battle_config.summon_flora&2) ) { //Fails when: exceed max limit. There are other plant types already out. - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } } @@ -15011,7 +15038,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, map->foreachinmap(skill->check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, MOBID_SILVERSNIPER, skill_id, &c); } if( c >= maxcount ) { - clif->skill_fail(sd , skill_id, USESKILL_FAIL_SUMMON, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_SUMMON, 0, 0); return 0; } } @@ -15021,7 +15048,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, int c = 0; i = map->foreachinmap(skill->check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, MOBID_KO_KAGE, skill_id, &c); if( c >= skill->get_maxcount(skill_id,skill_lv) || c != i) { - clif->skill_fail(sd , skill_id, USESKILL_FAIL_LEVEL, 0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0, 0); return 0; } } @@ -15037,19 +15064,19 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, require = skill->get_requirement(sd,skill_id,skill_lv); if( require.hp > 0 && st->hp <= (unsigned int)require.hp) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_HP_INSUFFICIENT,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_HP_INSUFFICIENT, 0, 0); return 0; } if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) { - clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_THIS_WEAPON, 0, 0); return 0; } if( require.ammo ) { //Skill requires stuff equipped in the arrow slot. if((i=sd->equip_index[EQI_AMMO]) < 0 || !sd->inventory_data[i] ) { if( require.ammo&1<<8 ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_CANONBALL,0); + clif->skill_fail(sd, skill_id, USESKILL_FAIL_CANONBALL, 0, 0); else clif->arrow_fail(sd,0); return 0; @@ -15065,7 +15092,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, if (!(require.ammo&1<<sd->inventory_data[i]->subtype)) { //Ammo type check. Send the "wrong weapon type" message //which is the closest we have to wrong ammo type. [Skotlex] clif->arrow_fail(sd,0); //Haplo suggested we just send the equip-arrows message instead. [Skotlex] - //clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0); + //clif->skill_fail(sd, skill_id, USESKILL_FAIL_THIS_WEAPON, 0, 0); return 0; } } @@ -15104,11 +15131,11 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, cause = USESKILL_FAIL_NEED_EQUIPMENT; /* Fall through */ default: - clif->skill_fail(sd, skill_id, cause, max(1,require.amount[i])|(require.itemid[i] << 16)); + clif->skill_fail(sd, skill_id, cause, max(1, require.amount[i]), require.itemid[i]); return 0; } } - clif->skill_fail(sd, skill_id, cause, 0); + clif->skill_fail(sd, skill_id, cause, 0, 0); return 0; } } @@ -15116,14 +15143,14 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, return 1; } -bool skill_check_condition_castend_unknown(struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv) +static bool skill_check_condition_castend_unknown(struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv) { return false; } // type&2: consume items (after skill was used) // type&1: consume the others (before skill was used) -int skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type) +static int skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type) { struct skill_condition req; @@ -15205,7 +15232,7 @@ int skill_consume_requirement(struct map_session_data *sd, uint16 skill_id, uint return 1; } -struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv) +static struct skill_condition skill_get_requirement(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) { struct skill_condition req; struct status_data *st; @@ -15536,24 +15563,24 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16 return req; } -bool skill_get_requirement_off_unknown(struct status_change *sc, uint16 *skill_id) +static bool skill_get_requirement_off_unknown(struct status_change *sc, uint16 *skill_id) { return false; } -bool skill_get_requirement_item_unknown(struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i) +static bool skill_get_requirement_item_unknown(struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i) { return false; } -void skill_get_requirement_unknown(struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req) +static void skill_get_requirement_unknown(struct status_change *sc, struct map_session_data *sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req) { } /*========================================== * Does cast-time reductions based on dex, item bonuses and config setting *------------------------------------------*/ -int skill_castfix (struct block_list *bl, uint16 skill_id, uint16 skill_lv) +static int skill_castfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) { int time = skill->get_cast(skill_id, skill_lv); @@ -15604,7 +15631,7 @@ int skill_castfix (struct block_list *bl, uint16 skill_id, uint16 skill_lv) /*========================================== * Does cast-time reductions based on sc data. *------------------------------------------*/ -int skill_castfix_sc (struct block_list *bl, int time) +static int skill_castfix_sc(struct block_list *bl, int time) { struct status_change *sc = status->get_sc(bl); @@ -15640,7 +15667,7 @@ int skill_castfix_sc (struct block_list *bl, int time) return time; } -int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 skill_lv) +static int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 skill_lv) { #ifdef RENEWAL_CAST struct status_change *sc = status->get_sc(bl); @@ -15783,7 +15810,7 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 /*========================================== * Does delay reductions based on dex/agi, sc data, item bonuses, ... *------------------------------------------*/ -int skill_delay_fix (struct block_list *bl, uint16 skill_id, uint16 skill_lv) +static int skill_delay_fix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) { int delaynodex = skill->get_delaynodex(skill_id, skill_lv); int time = skill->get_delay(skill_id, skill_lv); @@ -15883,7 +15910,7 @@ struct square { int val2[5]; }; -void skill_brandishspear_first (struct square *tc, uint8 dir, int16 x, int16 y) +static void skill_brandishspear_first(struct square *tc, uint8 dir, int16 x, int16 y) { nullpo_retv(tc); @@ -15979,7 +16006,7 @@ void skill_brandishspear_first (struct square *tc, uint8 dir, int16 x, int16 y) } -void skill_brandishspear_dir (struct square* tc, uint8 dir, int are) +static void skill_brandishspear_dir(struct square *tc, uint8 dir, int are) { int c; nullpo_retv(tc); @@ -15998,7 +16025,7 @@ void skill_brandishspear_dir (struct square* tc, uint8 dir, int are) } } -void skill_brandishspear(struct block_list* src, struct block_list* bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) +static void skill_brandishspear(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int64 tick, int flag) { int c,n=4; uint8 dir; @@ -16053,7 +16080,7 @@ void skill_brandishspear(struct block_list* src, struct block_list* bl, uint16 s /*========================================== * Weapon Repair [Celest/DracoRPG] *------------------------------------------*/ -void skill_repairweapon (struct map_session_data *sd, int idx) +static void skill_repairweapon(struct map_session_data *sd, int idx) { int material; int materials[4] = { @@ -16070,7 +16097,7 @@ void skill_repairweapon (struct map_session_data *sd, int idx) if ( !( target_sd = map->id2sd(sd->menuskill_val) ) ) //Failed.... return; - if( idx == 0xFFFF ) // No item selected ('Cancel' clicked) + if (idx == 0xFFFF || idx == -1) // No item selected ('Cancel' clicked) return; if( idx < 0 || idx >= MAX_INVENTORY ) return; //Invalid index?? @@ -16089,7 +16116,7 @@ void skill_repairweapon (struct map_session_data *sd, int idx) else material = materials[2]; // Armors consume 1 Steel if (pc->search_inventory(sd,material) == INDEX_NOT_FOUND) { - clif->skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, sd->menuskill_id, USESKILL_FAIL_LEVEL, 0, 0); return; } @@ -16111,7 +16138,7 @@ void skill_repairweapon (struct map_session_data *sd, int idx) /*========================================== * Item Appraisal *------------------------------------------*/ -void skill_identify (struct map_session_data *sd, int idx) +static void skill_identify(struct map_session_data *sd, int idx) { int flag=1; @@ -16129,7 +16156,7 @@ void skill_identify (struct map_session_data *sd, int idx) /*========================================== * Weapon Refine [Celest] *------------------------------------------*/ -void skill_weaponrefine (struct map_session_data *sd, int idx) +static void skill_weaponrefine(struct map_session_data *sd, int idx) { nullpo_retv(sd); @@ -16149,7 +16176,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) int i = 0, per; if( ditem->flag.no_refine ) { // if the item isn't refinable - clif->skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, sd->menuskill_id, USESKILL_FAIL_LEVEL, 0, 0); return; } if( item->refine >= sd->menuskill_val || item->refine >= 10 ){ @@ -16218,7 +16245,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) /*========================================== * *------------------------------------------*/ -int skill_autospell (struct map_session_data *sd, uint16 skill_id) +static int skill_autospell(struct map_session_data *sd, uint16 skill_id) { uint16 skill_lv; int maxlv=1,lv; @@ -16261,7 +16288,7 @@ int skill_autospell (struct map_session_data *sd, uint16 skill_id) /*========================================== * Sitting skills functions. *------------------------------------------*/ -int skill_sit_count(struct block_list *bl, va_list ap) +static int skill_sit_count(struct block_list *bl, va_list ap) { int type = va_arg(ap, int); struct map_session_data *sd = NULL; @@ -16282,7 +16309,7 @@ int skill_sit_count(struct block_list *bl, va_list ap) return 0; } -int skill_sit_in(struct block_list *bl, va_list ap) +static int skill_sit_in(struct block_list *bl, va_list ap) { int type = va_arg(ap, int); struct map_session_data *sd = NULL; @@ -16306,7 +16333,7 @@ int skill_sit_in(struct block_list *bl, va_list ap) return 0; } -int skill_sit_out(struct block_list *bl, va_list ap) +static int skill_sit_out(struct block_list *bl, va_list ap) { int type = va_arg(ap, int); struct map_session_data *sd = NULL; @@ -16325,7 +16352,7 @@ int skill_sit_out(struct block_list *bl, va_list ap) return 0; } -int skill_sit (struct map_session_data *sd, int type) +static int skill_sit(struct map_session_data *sd, int type) { int flag = 0; int range = 0, lv; @@ -16365,7 +16392,7 @@ int skill_sit (struct map_session_data *sd, int type) /*========================================== * *------------------------------------------*/ -int skill_frostjoke_scream(struct block_list *bl, va_list ap) +static int skill_frostjoke_scream(struct block_list *bl, va_list ap) { struct block_list *src; uint16 skill_id,skill_lv; @@ -16398,7 +16425,7 @@ int skill_frostjoke_scream(struct block_list *bl, va_list ap) /*========================================== * *------------------------------------------*/ -void skill_unitsetmapcell (struct skill_unit *src, uint16 skill_id, uint16 skill_lv, cell_t cell, bool flag) +static void skill_unitsetmapcell(struct skill_unit *src, uint16 skill_id, uint16 skill_lv, cell_t cell, bool flag) { int range = skill->get_unit_range(skill_id,skill_lv); int x,y; @@ -16412,7 +16439,7 @@ void skill_unitsetmapcell (struct skill_unit *src, uint16 skill_id, uint16 skill /*========================================== * *------------------------------------------*/ -int skill_attack_area(struct block_list *bl, va_list ap) +static int skill_attack_area(struct block_list *bl, va_list ap) { struct block_list *src,*dsrc; int atk_type,skill_id,skill_lv,flag,type; @@ -16455,7 +16482,7 @@ int skill_attack_area(struct block_list *bl, va_list ap) /*========================================== * *------------------------------------------*/ -int skill_clear_group (struct block_list *bl, int flag) +static int skill_clear_group(struct block_list *bl, int flag) { struct unit_data *ud = unit->bl2ud(bl); struct skill_unit_group *group[MAX_SKILLUNITGROUP]; @@ -16499,7 +16526,7 @@ int skill_clear_group (struct block_list *bl, int flag) /*========================================== * Returns the first element field found [Skotlex] *------------------------------------------*/ -struct skill_unit_group *skill_locate_element_field(struct block_list *bl) +static struct skill_unit_group *skill_locate_element_field(struct block_list *bl) { struct unit_data *ud = unit->bl2ud(bl); int i; @@ -16522,7 +16549,7 @@ struct skill_unit_group *skill_locate_element_field(struct block_list *bl) } // for graffiti cleaner [Valaris] -int skill_graffitiremover(struct block_list *bl, va_list ap) +static int skill_graffitiremover(struct block_list *bl, va_list ap) { struct skill_unit *su = NULL; @@ -16538,7 +16565,7 @@ int skill_graffitiremover(struct block_list *bl, va_list ap) return 0; } -int skill_greed(struct block_list *bl, va_list ap) +static int skill_greed(struct block_list *bl, va_list ap) { struct block_list *src = va_arg(ap, struct block_list *); @@ -16555,7 +16582,7 @@ int skill_greed(struct block_list *bl, va_list ap) } //For Ranger's Detonator [Jobbie/3CeAM] -int skill_detonator(struct block_list *bl, va_list ap) +static int skill_detonator(struct block_list *bl, va_list ap) { struct skill_unit *su = NULL; struct block_list *src = va_arg(ap,struct block_list *); @@ -16606,7 +16633,7 @@ int skill_detonator(struct block_list *bl, va_list ap) /*========================================== * *------------------------------------------*/ -int skill_cell_overlap(struct block_list *bl, va_list ap) +static int skill_cell_overlap(struct block_list *bl, va_list ap) { uint16 skill_id; int *alive; @@ -16704,7 +16731,7 @@ int skill_cell_overlap(struct block_list *bl, va_list ap) /*========================================== * *------------------------------------------*/ -int skill_chastle_mob_changetarget(struct block_list *bl, va_list ap) +static int skill_chastle_mob_changetarget(struct block_list *bl, va_list ap) { struct unit_data *ud = unit->bl2ud(bl); struct block_list *from_bl = va_arg(ap, struct block_list *); @@ -16728,7 +16755,7 @@ int skill_chastle_mob_changetarget(struct block_list *bl, va_list ap) /*========================================== * *------------------------------------------*/ -int skill_trap_splash(struct block_list *bl, va_list ap) +static int skill_trap_splash(struct block_list *bl, va_list ap) { struct block_list *src = va_arg(ap, struct block_list *); int64 tick = va_arg(ap, int64); @@ -16838,7 +16865,7 @@ int skill_trap_splash(struct block_list *bl, va_list ap) /*========================================== * *------------------------------------------*/ -int skill_enchant_elemental_end(struct block_list *bl, int type) +static int skill_enchant_elemental_end(struct block_list *bl, int type) { struct status_change *sc; const enum sc_type scs[] = { SC_ENCHANTPOISON, SC_ASPERSIO, SC_PROPERTYFIRE, SC_PROPERTYWATER, SC_PROPERTYWIND, SC_PROPERTYGROUND, SC_PROPERTYDARK, SC_PROPERTYTELEKINESIS, SC_ENCHANTARMS }; @@ -16855,7 +16882,7 @@ int skill_enchant_elemental_end(struct block_list *bl, int type) return 0; } -bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce) +static bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce) { bool wall = true; @@ -16894,7 +16921,7 @@ bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce /** * Verifies if an user can use SC_CLOAKING **/ -bool skill_can_cloak(struct map_session_data *sd) +static bool skill_can_cloak(struct map_session_data *sd) { nullpo_retr(false, sd); @@ -16912,7 +16939,7 @@ bool skill_can_cloak(struct map_session_data *sd) * Verifies if an user can still be cloaked (AS_CLOAKING) * Is called via map->foreachinrange when any kind of wall disapears **/ -int skill_check_cloaking_end(struct block_list *bl, va_list ap) +static int skill_check_cloaking_end(struct block_list *bl, va_list ap) { struct map_session_data *sd = BL_CAST(BL_PC, bl); @@ -16922,7 +16949,7 @@ int skill_check_cloaking_end(struct block_list *bl, va_list ap) return 0; } -bool skill_check_camouflage(struct block_list *bl, struct status_change_entry *sce) +static bool skill_check_camouflage(struct block_list *bl, struct status_change_entry *sce) { bool wall = true; @@ -16950,7 +16977,7 @@ bool skill_check_camouflage(struct block_list *bl, struct status_change_entry *s return wall; } -bool skill_check_shadowform(struct block_list *bl, int64 damage, int hit) +static bool skill_check_shadowform(struct block_list *bl, int64 damage, int hit) { struct status_change *sc; @@ -16989,7 +17016,7 @@ bool skill_check_shadowform(struct block_list *bl, int64 damage, int hit) /*========================================== * *------------------------------------------*/ -struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2) +static struct skill_unit *skill_initunit(struct skill_unit_group *group, int idx, int x, int y, int val1, int val2) { struct skill_unit *su; @@ -17042,7 +17069,7 @@ struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int /*========================================== * *------------------------------------------*/ -int skill_delunit (struct skill_unit* su) +static int skill_delunit(struct skill_unit *su) { struct skill_unit_group *group; @@ -17118,14 +17145,14 @@ int skill_delunit (struct skill_unit* su) * *------------------------------------------*/ /// Returns the target skill_unit_group or NULL if not found. -struct skill_unit_group* skill_id2group(int group_id) +static struct skill_unit_group *skill_id2group(int group_id) { return (struct skill_unit_group*)idb_get(skill->group_db, group_id); } /// Returns a new group_id that isn't being used in skill->group_db. /// Fatal error if nothing is available. -int skill_get_new_group_id(void) +static int skill_get_new_group_id(void) { if (skill->unit_group_newid > MAX_SKILL_ID && skill->id2group(skill->unit_group_newid) == NULL) return skill->unit_group_newid++;// available @@ -17145,7 +17172,7 @@ int skill_get_new_group_id(void) } } -struct skill_unit_group* skill_initunitgroup (struct block_list* src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval) +static struct skill_unit_group *skill_initunitgroup(struct block_list *src, int count, uint16 skill_id, uint16 skill_lv, int unit_id, int limit, int interval) { struct unit_data* ud = unit->bl2ud( src ); struct skill_unit_group* group; @@ -17208,7 +17235,7 @@ struct skill_unit_group* skill_initunitgroup (struct block_list* src, int count, /*========================================== * *------------------------------------------*/ -int skill_delunitgroup(struct skill_unit_group *group, const char *file, int line, const char *func) +static int skill_delunitgroup(struct skill_unit_group *group, const char *file, int line, const char *func) { struct block_list* src; struct unit_data *ud; @@ -17344,7 +17371,7 @@ int skill_delunitgroup(struct skill_unit_group *group, const char *file, int lin /*========================================== * *------------------------------------------*/ -int skill_clear_unitgroup (struct block_list *src) +static int skill_clear_unitgroup(struct block_list *src) { struct unit_data *ud = unit->bl2ud(src); @@ -17359,7 +17386,7 @@ int skill_clear_unitgroup (struct block_list *src) /*========================================== * *------------------------------------------*/ -struct skill_unit_group_tickset *skill_unitgrouptickset_search(struct block_list *bl, struct skill_unit_group *group, int64 tick) +static struct skill_unit_group_tickset *skill_unitgrouptickset_search(struct block_list *bl, struct skill_unit_group *group, int64 tick) { int i,j=-1,s,id; struct unit_data *ud; @@ -17401,7 +17428,7 @@ struct skill_unit_group_tickset *skill_unitgrouptickset_search(struct block_list /*========================================== * *------------------------------------------*/ -int skill_unit_timer_sub_onplace(struct block_list* bl, va_list ap) +static int skill_unit_timer_sub_onplace(struct block_list *bl, va_list ap) { struct skill_unit* su; struct skill_unit_group* group; @@ -17431,7 +17458,7 @@ int skill_unit_timer_sub_onplace(struct block_list* bl, va_list ap) /** * @see DBApply */ -int skill_unit_timer_sub(union DBKey key, struct DBData *data, va_list ap) +static int skill_unit_timer_sub(union DBKey key, struct DBData *data, va_list ap) { struct skill_unit* su; struct skill_unit_group* group; @@ -17651,7 +17678,7 @@ int skill_unit_timer_sub(union DBKey key, struct DBData *data, va_list ap) /*========================================== * Executes on all skill units every SKILLUNITTIMER_INTERVAL milliseconds. *------------------------------------------*/ -int skill_unit_timer(int tid, int64 tick, int id, intptr_t data) +static int skill_unit_timer(int tid, int64 tick, int id, intptr_t data) { map->freeblock_lock(); @@ -17665,7 +17692,7 @@ int skill_unit_timer(int tid, int64 tick, int id, intptr_t data) /*========================================== * *------------------------------------------*/ -int skill_unit_move_sub(struct block_list* bl, va_list ap) +static int skill_unit_move_sub(struct block_list *bl, va_list ap) { struct skill_unit *su = NULL; struct skill_unit_group *group = NULL; @@ -17765,7 +17792,7 @@ int skill_unit_move_sub(struct block_list* bl, va_list ap) * units to figure out when they have left a group. * flag&4: Force a onleft event (triggered when the bl is killed, for example) *------------------------------------------*/ -int skill_unit_move(struct block_list *bl, int64 tick, int flag) +static int skill_unit_move(struct block_list *bl, int64 tick, int flag) { nullpo_ret(bl); @@ -17791,7 +17818,7 @@ int skill_unit_move(struct block_list *bl, int64 tick, int flag) /*========================================== * *------------------------------------------*/ -int skill_unit_move_unit_group(struct skill_unit_group *group, int16 m, int16 dx, int16 dy) +static int skill_unit_move_unit_group(struct skill_unit_group *group, int16 m, int16 dx, int16 dy) { int i,j; int64 tick = timer->gettick(); @@ -17881,7 +17908,7 @@ int skill_unit_move_unit_group(struct skill_unit_group *group, int16 m, int16 dx /*========================================== * *------------------------------------------*/ -int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger, int qty) +static int skill_can_produce_mix(struct map_session_data *sd, int nameid, int trigger, int qty) { int i,j; @@ -17944,7 +17971,7 @@ int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger, /*========================================== * *------------------------------------------*/ -int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, int slot1, int slot2, int slot3, int qty) +static int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, int slot1, int slot2, int slot3, int qty) { int slot[3]; int i,sc,ele,idx,equip,wlv,make_per = 0,flag = 0,skill_lv = 0; @@ -18563,7 +18590,7 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, return 0; } -int skill_arrow_create (struct map_session_data *sd, int nameid) +static int skill_arrow_create(struct map_session_data *sd, int nameid) { int i,j,flag,index=-1; struct item tmp_item; @@ -18605,13 +18632,13 @@ int skill_arrow_create (struct map_session_data *sd, int nameid) return 0; } -int skill_poisoningweapon(struct map_session_data *sd, int nameid) +static int skill_poisoningweapon(struct map_session_data *sd, int nameid) { sc_type type; int chance, i; nullpo_ret(sd); if (nameid <= 0 || (i = pc->search_inventory(sd,nameid)) == INDEX_NOT_FOUND || pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME)) { - clif->skill_fail(sd,GC_POISONINGWEAPON,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, GC_POISONINGWEAPON, USESKILL_FAIL_LEVEL, 0, 0); return 0; } switch( nameid ) @@ -18625,7 +18652,7 @@ int skill_poisoningweapon(struct map_session_data *sd, int nameid) case ITEMID_POISON_LAUGHING: type = SC_MAGICMUSHROOM; break; case ITEMID_POISON_OBLIVION: type = SC_OBLIVIONCURSE; break; default: - clif->skill_fail(sd,GC_POISONINGWEAPON,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, GC_POISONINGWEAPON, USESKILL_FAIL_LEVEL, 0, 0); return 0; } @@ -18637,7 +18664,7 @@ int skill_poisoningweapon(struct map_session_data *sd, int nameid) return 0; } -void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id) +static void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id) { struct status_change *sc = status->get_sc(bl); @@ -18662,7 +18689,7 @@ void skill_toggle_magicpower(struct block_list *bl, uint16 skill_id) } } -int skill_magicdecoy(struct map_session_data *sd, int nameid) +static int skill_magicdecoy(struct map_session_data *sd, int nameid) { int x, y, i, class_ = 0, skill_id; struct mob_data *md; @@ -18673,7 +18700,7 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid) || (i = pc->search_inventory(sd, nameid)) == INDEX_NOT_FOUND || pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME) != 0 ) { - clif->skill_fail(sd,NC_MAGICDECOY,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, NC_MAGICDECOY, USESKILL_FAIL_LEVEL, 0, 0); return 0; } @@ -18714,7 +18741,7 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid) } // Warlock Spellbooks. [LimitLine/3CeAM] -int skill_spellbook(struct map_session_data *sd, int nameid) +static int skill_spellbook(struct map_session_data *sd, int nameid) { int i, max_preserve, skill_id, point; struct status_change *sc; @@ -18727,7 +18754,7 @@ int skill_spellbook(struct map_session_data *sd, int nameid) for(i=SC_SPELLBOOK1; i <= SC_SPELLBOOK7; i++) if( sc && !sc->data[i] ) break; if( i > SC_SPELLBOOK7 ) { - clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_READING, 0); + clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_READING, 0, 0); return 0; } @@ -18737,7 +18764,7 @@ int skill_spellbook(struct map_session_data *sd, int nameid) if( !pc->checkskill(sd, (skill_id = skill->dbs->spellbook_db[i].skill_id)) ) { // User don't know the skill sc_start(&sd->bl, &sd->bl, SC_SLEEP, 100, 1, skill->get_time(WL_READING_SB, pc->checkskill(sd,WL_READING_SB))); - clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_DIFFICULT_SLEEP, 0); + clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_DIFFICULT_SLEEP, 0, 0); return 0; } @@ -18746,7 +18773,7 @@ int skill_spellbook(struct map_session_data *sd, int nameid) if( sc && sc->data[SC_READING_SB] ) { if( (sc->data[SC_READING_SB]->val2 + point) > max_preserve ) { - clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_PRESERVATION_POINT, 0); + clif->skill_fail(sd, WL_READING_SB, USESKILL_FAIL_SPELLBOOK_PRESERVATION_POINT, 0, 0); return 0; } for(i = SC_SPELLBOOK7; i >= SC_SPELLBOOK1; i--){ // This is how official saves spellbook. [malufett] @@ -18764,7 +18791,7 @@ int skill_spellbook(struct map_session_data *sd, int nameid) return 1; } -int skill_select_menu(struct map_session_data *sd,uint16 skill_id) +static int skill_select_menu(struct map_session_data *sd, uint16 skill_id) { int id, lv, prob, aslvl = 0, idx = 0; nullpo_ret(sd); @@ -18778,7 +18805,7 @@ int skill_select_menu(struct map_session_data *sd,uint16 skill_id) if( skill_id >= GS_GLITTERING || skill->get_type(skill_id) != BF_MAGIC || (id = sd->status.skill[idx].id) == 0 || sd->status.skill[idx].flag != SKILL_FLAG_PLAGIARIZED ) { - clif->skill_fail(sd,SC_AUTOSHADOWSPELL,0,0); + clif->skill_fail(sd, SC_AUTOSHADOWSPELL, 0, 0, 0); return 0; } @@ -18789,7 +18816,7 @@ int skill_select_menu(struct map_session_data *sd,uint16 skill_id) return 0; } -int skill_elementalanalysis(struct map_session_data *sd, uint16 skill_lv, const struct itemlist *item_list) +static int skill_elementalanalysis(struct map_session_data *sd, uint16 skill_lv, const struct itemlist *item_list) { int i; @@ -18813,7 +18840,7 @@ int skill_elementalanalysis(struct map_session_data *sd, uint16 skill_lv, const if (idx < 0 || idx >= MAX_INVENTORY || (nameid = sd->status.inventory[idx].nameid) <= 0 || del_amount < 0 || del_amount > sd->status.inventory[idx].amount) { - clif->skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, SO_EL_ANALYSIS, USESKILL_FAIL_LEVEL, 0, 0); return 1; } @@ -18829,18 +18856,18 @@ int skill_elementalanalysis(struct map_session_data *sd, uint16 skill_lv, const case ITEMID_WIND_OF_VERDURE: product = ITEMID_ROUGH_WIND; break; case ITEMID_YELLOW_LIVE: product = ITEMID_GREAT_NATURE; break; default: - clif->skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, SO_EL_ANALYSIS, USESKILL_FAIL_LEVEL, 0, 0); return 1; } if( pc->delitem(sd, idx, del_amount, 0, DELITEM_SKILLUSE, LOG_TYPE_CONSUME) ) { - clif->skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, SO_EL_ANALYSIS, USESKILL_FAIL_LEVEL, 0, 0); return 1; } if( skill_lv == 2 && rnd()%100 < 25 ) { // At level 2 have a fail chance. You loose your items if it fails. - clif->skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0); + clif->skill_fail(sd, SO_EL_ANALYSIS, USESKILL_FAIL_LEVEL, 0, 0); return 1; } @@ -18862,7 +18889,7 @@ int skill_elementalanalysis(struct map_session_data *sd, uint16 skill_lv, const return 0; } -int skill_changematerial(struct map_session_data *sd, const struct itemlist *item_list) +static int skill_changematerial(struct map_session_data *sd, const struct itemlist *item_list) { int i, j, k, c, p = 0, nameid, amount; @@ -18917,7 +18944,7 @@ int skill_changematerial(struct map_session_data *sd, const struct itemlist *ite /** * for Royal Guard's LG_TRAMPLE **/ -int skill_destroy_trap(struct block_list *bl, va_list ap) +static int skill_destroy_trap(struct block_list *bl, va_list ap) { struct skill_unit *su = NULL; struct skill_unit_group *sg; @@ -18953,7 +18980,7 @@ int skill_destroy_trap(struct block_list *bl, va_list ap) /*========================================== * *------------------------------------------*/ -int skill_blockpc_end(int tid, int64 tick, int id, intptr_t data) +static int skill_blockpc_end(int tid, int64 tick, int id, intptr_t data) { struct map_session_data *sd = map->id2sd(id); struct skill_cd * cd = NULL; @@ -19006,7 +19033,7 @@ int skill_blockpc_end(int tid, int64 tick, int id, intptr_t data) * @param tick the length of time the delay should last * @return 0 if successful, -1 otherwise */ -int skill_blockpc_start_(struct map_session_data *sd, uint16 skill_id, int tick) +static int skill_blockpc_start_(struct map_session_data *sd, uint16 skill_id, int tick) { struct skill_cd* cd = NULL; uint16 idx = skill->get_index(skill_id); @@ -19087,7 +19114,7 @@ int skill_blockpc_start_(struct map_session_data *sd, uint16 skill_id, int tick) } // [orn] -int skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data) +static int skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data) { struct homun_data *hd = map->id2hd(id); if (data <= 0 || data >= MAX_SKILL_DB) @@ -19099,7 +19126,7 @@ int skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data) } // [orn] -int skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick) +static int skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick) { uint16 idx = skill->get_index(skill_id); nullpo_retr (-1, hd); @@ -19116,7 +19143,7 @@ int skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick) } // [orn] -int skill_blockmerc_end(int tid, int64 tick, int id, intptr_t data) +static int skill_blockmerc_end(int tid, int64 tick, int id, intptr_t data) { struct mercenary_data *md = map->id2mc(id); if (data <= 0 || data >= MAX_SKILL_DB) @@ -19127,7 +19154,7 @@ int skill_blockmerc_end(int tid, int64 tick, int id, intptr_t data) return 1; } -int skill_blockmerc_start(struct mercenary_data *md, uint16 skill_id, int tick) +static int skill_blockmerc_start(struct mercenary_data *md, uint16 skill_id, int tick) { uint16 idx = skill->get_index(skill_id); nullpo_retr (-1, md); @@ -19146,7 +19173,7 @@ int skill_blockmerc_start(struct mercenary_data *md, uint16 skill_id, int tick) /** * Adds a new skill unit entry for this player to recast after map load **/ -void skill_usave_add(struct map_session_data * sd, uint16 skill_id, uint16 skill_lv) +static void skill_usave_add(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) { struct skill_unit_save * sus = NULL; @@ -19164,7 +19191,7 @@ void skill_usave_add(struct map_session_data * sd, uint16 skill_id, uint16 skill return; } -void skill_usave_trigger(struct map_session_data *sd) +static void skill_usave_trigger(struct map_session_data *sd) { struct skill_unit_save * sus = NULL; @@ -19182,7 +19209,7 @@ void skill_usave_trigger(struct map_session_data *sd) /* * */ -int skill_split_atoi(char *str, int *val) +static int skill_split_atoi(char *str, int *val) { int i, j, step = 1; @@ -19229,7 +19256,7 @@ int skill_split_atoi(char *str, int *val) /* * */ -void skill_init_unit_layout (void) +static void skill_init_unit_layout(void) { int i,j,pos = 0; @@ -19501,13 +19528,13 @@ void skill_init_unit_layout (void) } -void skill_init_unit_layout_unknown(int skill_idx) +static void skill_init_unit_layout_unknown(int skill_idx) { Assert_retv(skill_idx >= 0 && skill_idx < MAX_SKILL_DB); ShowError("unknown unit layout at skill %d\n", skill->dbs->db[skill_idx].nameid); } -int skill_block_check(struct block_list *bl, sc_type type , uint16 skill_id) +static int skill_block_check(struct block_list *bl, sc_type type, uint16 skill_id) { int inf = 0; struct status_change *sc = status->get_sc(bl); @@ -19655,7 +19682,7 @@ int skill_block_check(struct block_list *bl, sc_type type , uint16 skill_id) return 0; } -int skill_get_elemental_type(uint16 skill_id , uint16 skill_lv) +static int skill_get_elemental_type(uint16 skill_id, uint16 skill_lv) { int type = 0; @@ -19675,7 +19702,7 @@ int skill_get_elemental_type(uint16 skill_id , uint16 skill_lv) * update stored skill cooldowns for player logout * @param sd the affected player structure */ -void skill_cooldown_save(struct map_session_data * sd) +static void skill_cooldown_save(struct map_session_data *sd) { int i; struct skill_cd* cd = NULL; @@ -19704,7 +19731,7 @@ void skill_cooldown_save(struct map_session_data * sd) * reload stored skill cooldowns when a player logs in. * @param sd the affected player structure */ -void skill_cooldown_load(struct map_session_data * sd) +static void skill_cooldown_load(struct map_session_data *sd) { int i; struct skill_cd* cd = NULL; @@ -19737,7 +19764,7 @@ void skill_cooldown_load(struct map_session_data * sd) } } -bool skill_parse_row_producedb(char* split[], int columns, int current) +static bool skill_parse_row_producedb(char *split[], int columns, int current) { // ProduceItemID,ItemLV,RequireSkill,Requireskill_lv,MaterialID1,MaterialAmount1,...... int x,y; @@ -19761,7 +19788,7 @@ bool skill_parse_row_producedb(char* split[], int columns, int current) return true; } -bool skill_parse_row_createarrowdb(char* split[], int columns, int current) +static bool skill_parse_row_createarrowdb(char *split[], int columns, int current) { // SourceID,MakeID1,MakeAmount1,...,MakeID5,MakeAmount5 int x,y; @@ -19782,7 +19809,7 @@ bool skill_parse_row_createarrowdb(char* split[], int columns, int current) return true; } -bool skill_parse_row_spellbookdb(char* split[], int columns, int current) +static bool skill_parse_row_spellbookdb(char *split[], int columns, int current) { // skill_id,PreservePoints @@ -19812,7 +19839,7 @@ bool skill_parse_row_spellbookdb(char* split[], int columns, int current) return false; } -bool skill_parse_row_improvisedb(char* split[], int columns, int current) +static bool skill_parse_row_improvisedb(char *split[], int columns, int current) { // SkillID,Rate uint16 skill_id; @@ -19844,7 +19871,7 @@ bool skill_parse_row_improvisedb(char* split[], int columns, int current) return true; } -bool skill_parse_row_magicmushroomdb(char* split[], int column, int current) +static bool skill_parse_row_magicmushroomdb(char *split[], int column, int current) { // SkillID uint16 skill_id; @@ -19865,7 +19892,7 @@ bool skill_parse_row_magicmushroomdb(char* split[], int column, int current) return true; } -bool skill_parse_row_abradb(char* split[], int columns, int current) +static bool skill_parse_row_abradb(char *split[], int columns, int current) { // skill_id,DummyName,RequiredHocusPocusLevel,Rate uint16 skill_id; @@ -19887,10 +19914,10 @@ bool skill_parse_row_abradb(char* split[], int columns, int current) return true; } -bool skill_parse_row_changematerialdb(char* split[], int columns, int current) +static bool skill_parse_row_changematerialdb(char *split[], int columns, int current) { // ProductID,BaseRate,MakeAmount1,MakeAmountRate1...,MakeAmount5,MakeAmountRate5 - uint16 skill_id; + int skill_id; short j; int x,y; @@ -19932,7 +19959,7 @@ bool skill_parse_row_changematerialdb(char* split[], int columns, int current) * @param *conf pointer to config setting. * @param *arr pointer to array to be set. */ -void skill_config_set_level(struct config_setting_t *conf, int *arr) +static void skill_config_set_level(struct config_setting_t *conf, int *arr) { int i=0; @@ -19961,7 +19988,7 @@ void skill_config_set_level(struct config_setting_t *conf, int *arr) * @param value value being set for the array. * @return (void) */ -void skill_level_set_value(int *arr, int value) +static void skill_level_set_value(int *arr, int value) { int i=0; @@ -19971,7 +19998,7 @@ void skill_level_set_value(int *arr, int value) } } -void skill_validate_hittype(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_hittype(struct config_setting_t *conf, struct s_skill_db *sk) { const char *type = NULL; @@ -19996,7 +20023,7 @@ void skill_validate_hittype(struct config_setting_t *conf, struct s_skill_db *sk * @param sk struct, pointer to s_skill_db * @return (void) */ -void skill_validate_skilltype(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_skilltype(struct config_setting_t *conf, struct s_skill_db *sk) { struct config_setting_t *t = NULL, *tt = NULL; @@ -20050,7 +20077,7 @@ void skill_validate_skilltype(struct config_setting_t *conf, struct s_skill_db * * @param sk struct, pointer to s_skill_db * @return (void) */ -void skill_validate_skillinfo(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_skillinfo(struct config_setting_t *conf, struct s_skill_db *sk) { struct config_setting_t *t = NULL, *tt = NULL; @@ -20188,7 +20215,7 @@ void skill_validate_skillinfo(struct config_setting_t *conf, struct s_skill_db * * @param sk struct, pointer to s_skill_db * @return (void) */ -void skill_validate_attacktype(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_attacktype(struct config_setting_t *conf, struct s_skill_db *sk) { const char *type = NULL; @@ -20213,7 +20240,7 @@ void skill_validate_attacktype(struct config_setting_t *conf, struct s_skill_db * @param sk struct, pointer to s_skill_db * @return (void) */ -void skill_validate_element(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_element(struct config_setting_t *conf, struct s_skill_db *sk) { const char *type = NULL; struct config_setting_t *t = NULL; @@ -20261,7 +20288,7 @@ void skill_validate_element(struct config_setting_t *conf, struct s_skill_db *sk * @param sk struct, pointer to s_skill_db * @return (void) */ -void skill_validate_damagetype(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_damagetype(struct config_setting_t *conf, struct s_skill_db *sk) { struct config_setting_t *t = NULL, *tt = NULL; @@ -20334,7 +20361,7 @@ void skill_validate_damagetype(struct config_setting_t *conf, struct s_skill_db * @param delay boolean, switch for cast/delay setting * @return (void) */ -void skill_validate_castnodex(struct config_setting_t *conf, struct s_skill_db *sk, bool delay) +static void skill_validate_castnodex(struct config_setting_t *conf, struct s_skill_db *sk, bool delay) { struct config_setting_t *t = NULL, *tt = NULL; @@ -20381,7 +20408,7 @@ void skill_validate_castnodex(struct config_setting_t *conf, struct s_skill_db * * @param *sk struct, pointer to s_skill_db * @return void */ -int skill_validate_weapontype_sub(const char *type, bool on, struct s_skill_db *sk) +static int skill_validate_weapontype_sub(const char *type, bool on, struct s_skill_db *sk) { nullpo_ret(sk); if (strcmpi(type, "NoWeapon") == 0) { @@ -20584,7 +20611,7 @@ int skill_validate_weapontype_sub(const char *type, bool on, struct s_skill_db * * @param sk struct, struct, pointer to s_skill_db * @return (void) */ -void skill_validate_weapontype(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_weapontype(struct config_setting_t *conf, struct s_skill_db *sk) { struct config_setting_t *tt = NULL; const char *type = NULL; @@ -20611,7 +20638,7 @@ void skill_validate_weapontype(struct config_setting_t *conf, struct s_skill_db * @param sk struct, pointer to s_skill_db * @return void */ -int skill_validate_ammotype_sub(const char *type, bool on, struct s_skill_db *sk) +static int skill_validate_ammotype_sub(const char *type, bool on, struct s_skill_db *sk) { nullpo_ret(sk); if (strcmpi(type, "A_ARROW") == 0) { @@ -20688,7 +20715,7 @@ int skill_validate_ammotype_sub(const char *type, bool on, struct s_skill_db *sk * @param sk struct, pointer to s_skill_db * @return void */ -void skill_validate_ammotype(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_ammotype(struct config_setting_t *conf, struct s_skill_db *sk) { struct config_setting_t *tt = NULL; const char *tstr = NULL; @@ -20714,7 +20741,7 @@ void skill_validate_ammotype(struct config_setting_t *conf, struct s_skill_db *s * @param sk struct, pointer to s_skill_db * @return void */ -void skill_validate_state(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_state(struct config_setting_t *conf, struct s_skill_db *sk) { const char *type = NULL; @@ -20755,7 +20782,7 @@ void skill_validate_state(struct config_setting_t *conf, struct s_skill_db *sk) * @param sk struct, pointer to s_skill_db * @return void */ -void skill_validate_item_requirements(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_item_requirements(struct config_setting_t *conf, struct s_skill_db *sk) { struct config_setting_t *tt = NULL; @@ -20792,7 +20819,7 @@ void skill_validate_item_requirements(struct config_setting_t *conf, struct s_sk * @param sk struct, pointer to s_skill_db * @return void */ -void skill_validate_unit_target(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_unit_target(struct config_setting_t *conf, struct s_skill_db *sk) { const char *type = NULL; @@ -20834,7 +20861,7 @@ void skill_validate_unit_target(struct config_setting_t *conf, struct s_skill_db * @param sk struct, pointer to s_skill_db. * @return (void) */ -int skill_validate_unit_flag_sub(const char *type, bool on, struct s_skill_db *sk) +static int skill_validate_unit_flag_sub(const char *type, bool on, struct s_skill_db *sk) { nullpo_ret(type); nullpo_ret(sk); @@ -20930,7 +20957,7 @@ int skill_validate_unit_flag_sub(const char *type, bool on, struct s_skill_db *s * @param sk struct, struct, pointer to s_skill_db * @return (void) */ -void skill_validate_unit_flag(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_unit_flag(struct config_setting_t *conf, struct s_skill_db *sk) { struct config_setting_t *t = NULL; @@ -20953,7 +20980,7 @@ void skill_validate_unit_flag(struct config_setting_t *conf, struct s_skill_db * * @param sk struct, struct, pointer to s_skill_db * @return (void) */ -void skill_validate_additional_fields(struct config_setting_t *conf, struct s_skill_db *sk) +static void skill_validate_additional_fields(struct config_setting_t *conf, struct s_skill_db *sk) { // Does nothing like a boss. *cough* plugins *cough* } @@ -20964,7 +20991,7 @@ void skill_validate_additional_fields(struct config_setting_t *conf, struct s_sk * @param *source filepath constant. * @return boolean true on success. */ -bool skill_validate_skilldb(struct s_skill_db *sk, const char *source) +static bool skill_validate_skilldb(struct s_skill_db *sk, const char *source) { int idx; @@ -20995,7 +21022,7 @@ bool skill_validate_skilldb(struct s_skill_db *sk, const char *source) * @param filename contains the file path and name. * @return boolean true on success */ -bool skill_read_skilldb(const char *filename) +static bool skill_read_skilldb(const char *filename) { struct config_t skilldb; struct config_setting_t *sk, *conf; @@ -21252,7 +21279,7 @@ bool skill_read_skilldb(const char *filename) * create_arrow_db.txt * abra_db.txt *------------------------------*/ -void skill_readdb(bool minimal) +static void skill_readdb(bool minimal) { // init skill db structures db_clear(skill->name2id_db); @@ -21291,7 +21318,7 @@ void skill_readdb(bool minimal) sv->readdb(map->db_path, "skill_changematerial_db.txt", ',', 4, 4+2*5, MAX_SKILL_PRODUCE_DB, skill->parse_row_changematerialdb); } -void skill_reload(void) +static void skill_reload(void) { struct s_mapiterator *iter; struct map_session_data *sd; @@ -21324,7 +21351,7 @@ void skill_reload(void) /*========================================== * *------------------------------------------*/ -int do_init_skill(bool minimal) +static int do_init_skill(bool minimal) { skill->name2id_db = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, MAX_SKILL_NAME_LENGTH); skill->read_db(minimal); @@ -21358,7 +21385,7 @@ int do_init_skill(bool minimal) return 0; } -int do_final_skill(void) +static int do_final_skill(void) { db_destroy(skill->name2id_db); db_destroy(skill->group_db); |