diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index fc859497f..4224e3777 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -3200,7 +3200,7 @@ void clif_changeoption2(struct block_list* bl) /*========================================== * *------------------------------------------*/ -void clif_useitemack(struct map_session_data *sd,int index,int amount,int ok) +void clif_useitemack(struct map_session_data *sd,int index,int amount,bool ok) { nullpo_retv(sd); @@ -4489,7 +4489,7 @@ void clif_skillcastcancel(struct block_list* bl) /// if(success!=0) doesn't display any of the previous messages /// Note: when this packet is received an unknown flag is always set to 0, /// suggesting this is an ACK packet for the UseSkill packets and should be sent on success too [FlavioJS] -void clif_skill_fail(struct map_session_data *sd,int skill_id,int type,int btype) +void clif_skill_fail(struct map_session_data *sd,int skill_id,enum useskill_fail_cause cause,int btype) { int fd; @@ -4504,7 +4504,7 @@ void clif_skill_fail(struct map_session_data *sd,int skill_id,int type,int btype if(battle_config.display_skill_fail&1) return; //Disable all skill failed messages - if(type==0x4 && !sd->state.showdelay) + if(cause==USESKILL_FAIL_SKILLINTERVAL && !sd->state.showdelay) return; //Disable delay failed messages if(skill_id == RG_SNATCHER && battle_config.display_skill_fail&4) @@ -4518,7 +4518,7 @@ void clif_skill_fail(struct map_session_data *sd,int skill_id,int type,int btype WFIFOW(fd,2) = skill_id; WFIFOL(fd,4) = btype; WFIFOB(fd,8) = 0;// success - WFIFOB(fd,9) = type; + WFIFOB(fd,9) = cause; WFIFOSET(fd,packet_len(0x110)); } @@ -5472,7 +5472,7 @@ void clif_item_repair_list(struct map_session_data *sd,struct map_session_data * sd->menuskill_id = BS_REPAIRWEAPON; sd->menuskill_val = dstsd->bl.id; }else - clif_skill_fail(sd,sd->ud.skillid,0,0); + clif_skill_fail(sd,sd->ud.skillid,USESKILL_FAIL_LEVEL,0); } void clif_item_repaireffect(struct map_session_data *sd,int nameid,int flag) { @@ -9072,13 +9072,13 @@ void clif_parse_Emotion(int fd, struct map_session_data *sd) if (battle_config.basic_skill_check == 0 || pc_checkskill(sd, NV_BASIC) >= 2) { if (emoticon == E_MUTE) {// prevent use of the mute emote [Valaris] - clif_skill_fail(sd, 1, 0, 1); + clif_skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 1); return; } // fix flood of emotion icon (ro-proxy): flood only the hacker player if (sd->emotionlasttime >= time(NULL)) { sd->emotionlasttime = time(NULL) + 1; // not more than 1 per second (using /commands the client can spam it) - clif_skill_fail(sd, 1, 0, 1); + clif_skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 1); return; } sd->emotionlasttime = time(NULL) + 1; // not more than 1 per second (using /commands the client can spam it) @@ -9090,7 +9090,7 @@ void clif_parse_Emotion(int fd, struct map_session_data *sd) clif_emotion(&sd->bl, emoticon); } else - clif_skill_fail(sd, 1, 0, 1); + clif_skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 1); } /*========================================== @@ -9139,7 +9139,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, if (!battle_config.sdelay_attack_enable && pc_checkskill(sd, SA_FREECAST) <= 0) { if (DIFF_TICK(tick, sd->ud.canact_tick) < 0) { - clif_skill_fail(sd, 1, 4, 0); + clif_skill_fail(sd, 1, USESKILL_FAIL_SKILLINTERVAL, 0); return; } } @@ -9150,7 +9150,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, break; case 0x02: // sitdown if (battle_config.basic_skill_check && pc_checkskill(sd, NV_BASIC) < 3) { - clif_skill_fail(sd, 1, 0, 2); + clif_skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 2); break; } @@ -9674,7 +9674,7 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd) if (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM) return; if(battle_config.basic_skill_check && pc_checkskill(sd,NV_BASIC) < 4) { - clif_skill_fail(sd,1,0,3); + clif_skill_fail(sd,1,USESKILL_FAIL_LEVEL,3); return; } @@ -9786,7 +9786,7 @@ void clif_parse_TradeRequest(int fd,struct map_session_data *sd) if( battle_config.basic_skill_check && pc_checkskill(sd,NV_BASIC) < 1) { - clif_skill_fail(sd,1,0,0); + clif_skill_fail(sd,1,USESKILL_FAIL_LEVEL,0); return; } @@ -9974,7 +9974,7 @@ static void clif_parse_UseSkillToPos_mercenary(struct mercenary_data *md, struct return; if( DIFF_TICK(tick, md->ud.canact_tick) < 0 ) { - clif_skill_fail(md->master, skillnum, 4, 0); + clif_skill_fail(md->master, skillnum, USESKILL_FAIL_SKILLINTERVAL, 0); return; } @@ -10044,7 +10044,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) { if( sd->skillitem != skillnum ) { - clif_skill_fail(sd, skillnum, 4, 0); + clif_skill_fail(sd, skillnum, USESKILL_FAIL_SKILLINTERVAL, 0); return; } } @@ -10120,7 +10120,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, short skil { if( pc_issit(sd) ) { - clif_skill_fail(sd, skillnum, 0, 0); + clif_skill_fail(sd, skillnum, USESKILL_FAIL_LEVEL, 0); return; } //You can't use Graffiti/TalkieBox AND have a vending open, so this is safe. @@ -10134,7 +10134,7 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, short skil { if( sd->skillitem != skillnum ) { - clif_skill_fail(sd, skillnum, 4, 0); + clif_skill_fail(sd, skillnum, USESKILL_FAIL_SKILLINTERVAL, 0); return; } } @@ -10242,7 +10242,7 @@ void clif_parse_ProduceMix(int fd,struct map_session_data *sd) return; if (pc_istrading(sd)) { //Make it fail to avoid shop exploits where you sell something different than you see. - clif_skill_fail(sd,sd->ud.skillid,0,0); + clif_skill_fail(sd,sd->ud.skillid,USESKILL_FAIL_LEVEL,0); sd->menuskill_val = sd->menuskill_id = 0; return; } @@ -10264,7 +10264,7 @@ void clif_parse_Cooking(int fd,struct map_session_data *sd) if (pc_istrading(sd)) { //Make it fail to avoid shop exploits where you sell something different than you see. - clif_skill_fail(sd,sd->ud.skillid,0,0); + clif_skill_fail(sd,sd->ud.skillid,USESKILL_FAIL_LEVEL,0); sd->menuskill_val = sd->menuskill_id = 0; return; } @@ -10280,7 +10280,7 @@ void clif_parse_RepairItem(int fd, struct map_session_data *sd) return; if (pc_istrading(sd)) { //Make it fail to avoid shop exploits where you sell something different than you see. - clif_skill_fail(sd,sd->ud.skillid,0,0); + clif_skill_fail(sd,sd->ud.skillid,USESKILL_FAIL_LEVEL,0); sd->menuskill_val = sd->menuskill_id = 0; return; } @@ -10299,7 +10299,7 @@ void clif_parse_WeaponRefine(int fd, struct map_session_data *sd) return; if (pc_istrading(sd)) { //Make it fail to avoid shop exploits where you sell something different than you see. - clif_skill_fail(sd,sd->ud.skillid,0,0); + clif_skill_fail(sd,sd->ud.skillid,USESKILL_FAIL_LEVEL,0); sd->menuskill_val = sd->menuskill_id = 0; return; } @@ -10400,7 +10400,7 @@ void clif_parse_SelectArrow(int fd,struct map_session_data *sd) { if (pc_istrading(sd)) { //Make it fail to avoid shop exploits where you sell something different than you see. - clif_skill_fail(sd,sd->ud.skillid,0,0); + clif_skill_fail(sd,sd->ud.skillid,USESKILL_FAIL_LEVEL,0); sd->menuskill_val = sd->menuskill_id = 0; return; } @@ -10627,7 +10627,7 @@ void clif_parse_CreateParty(int fd, struct map_session_data *sd) } if( battle_config.basic_skill_check && pc_checkskill(sd,NV_BASIC) < 7 ) { - clif_skill_fail(sd,1,0,4); + clif_skill_fail(sd,1,USESKILL_FAIL_LEVEL,4); return; } @@ -10648,7 +10648,7 @@ void clif_parse_CreateParty2(int fd, struct map_session_data *sd) } if( battle_config.basic_skill_check && pc_checkskill(sd,NV_BASIC) < 7 ) { - clif_skill_fail(sd,1,0,4); + clif_skill_fail(sd,1,USESKILL_FAIL_LEVEL,4); return; } |