diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 46 | ||||
-rw-r--r-- | src/map/clif.h | 92 | ||||
-rw-r--r-- | src/map/guild.c | 2 | ||||
-rw-r--r-- | src/map/pc.c | 6 | ||||
-rw-r--r-- | src/map/skill.c | 273 | ||||
-rw-r--r-- | src/map/unit.c | 10 | ||||
-rw-r--r-- | src/map/vending.c | 6 |
7 files changed, 262 insertions, 173 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; } diff --git a/src/map/clif.h b/src/map/clif.h index cf6578c5c..29e870185 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -215,6 +215,90 @@ enum map_type MAPTYPE_UNUSED = 29, }; +enum useskill_fail_cause +{// clif_skill_fail + USESKILL_FAIL_LEVEL = 0, + USESKILL_FAIL_SP_INSUFFICIENT = 1, + USESKILL_FAIL_HP_INSUFFICIENT = 2, + USESKILL_FAIL_STUFF_INSUFFICIENT = 3, + USESKILL_FAIL_SKILLINTERVAL = 4, + USESKILL_FAIL_MONEY = 5, + USESKILL_FAIL_THIS_WEAPON = 6, + USESKILL_FAIL_REDJAMSTONE = 7, + USESKILL_FAIL_BLUEJAMSTONE = 8, + USESKILL_FAIL_WEIGHTOVER = 9, + USESKILL_FAIL = 10, + USESKILL_FAIL_TOTARGET = 11, + USESKILL_FAIL_ANCILLA_NUMOVER = 12, + USESKILL_FAIL_HOLYWATER = 13, + USESKILL_FAIL_ANCILLA = 14, + USESKILL_FAIL_DUPLICATE_RANGEIN = 15, + USESKILL_FAIL_NEED_OTHER_SKILL = 16, + USESKILL_FAIL_NEED_HELPER = 17, + USESKILL_FAIL_INVALID_DIR = 18, + USESKILL_FAIL_SUMMON = 19, + USESKILL_FAIL_SUMMON_NONE = 20, + USESKILL_FAIL_IMITATION_SKILL_NONE = 21, + USESKILL_FAIL_DUPLICATE = 22, + USESKILL_FAIL_CONDITION = 23, + USESKILL_FAIL_PAINTBRUSH = 24, + //XXX_USESKILL_FAIL_II_SURFACE_PAINTS = 25, + USESKILL_FAIL_POS = 26, + USESKILL_FAIL_HELPER_SP_INSUFFICIENT = 27, + //XXX_USESKILL_FAIL_II_NECK_CANDY = 28, + //XXX_USESKILL_FAIL_II_MISERABLE_TEAR = 29, + //XXX_USESKILL_FAIL_II_PROTECT_NECK_CANDY = 30, + USESKILL_FAIL_GC_WEAPONBLOCKING = 31, + USESKILL_FAIL_GC_POISONINGWEAPON = 32, + USESKILL_FAIL_MADOGEAR = 33, + //XXX_USESKILL_FAIL_II_VULCANBULLET = 34, + //XXX_USESKILL_FAIL_II_FUELGAS = 35, + //XXX_USESKILL_FAIL_II_COLDSLOWERBULLET = 36, + USESKILL_FAIL_CANONBALL = 37, + //XXX_USESKILL_FAIL_II_MADOGEAR_ACCELERATION = 38, + //XXX_USESKILL_FAIL_II_MADOGEAR_HOVERING_BOOSTER = 39, + USESKILL_FAIL_MADOGEAR_HOVERING = 40, + //XXX_USESKILL_FAIL_II_MADOGEAR_SELFDESTRUCTION_DEVICE = 41, + //XXX_USESKILL_FAIL_II_MADOGEAR_SHAPESHIFTER = 42, + USESKILL_FAIL_GUILLONTINE_POISON = 43, + //XXX_USESKILL_FAIL_II_MADOGEAR_COOLING_DEVICE = 44, + //XXX_USESKILL_FAIL_II_MADOGEAR_MAGNETICFIELD_GENERATOR = 45, + //XXX_USESKILL_FAIL_II_MADOGEAR_BARRIER_GENERATOR = 46, + //XXX_USESKILL_FAIL_II_MADOGEAR_OPTICALCAMOUFLAGE_GENERATOR = 47, + //XXX_USESKILL_FAIL_II_MADOGEAR_REPAIRKIT = 48, + //XXX_USESKILL_FAIL_II_MONKEY_SPANNER = 49, + USESKILL_FAIL_MADOGEAR_RIDE = 50, + USESKILL_FAIL_SPELLBOOK = 51, + USESKILL_FAIL_SPELLBOOK_DIFFICULT_SLEEP = 52, + USESKILL_FAIL_SPELLBOOK_PRESERVATION_POINT = 53, + USESKILL_FAIL_SPELLBOOK_READING = 54, + //XXX_USESKILL_FAIL_II_FACE_PAINTS = 55, + //XXX_USESKILL_FAIL_II_MAKEUP_BRUSH = 56, + USESKILL_FAIL_CART = 57, + //XXX_USESKILL_FAIL_II_THORNS_SEED = 58, + //XXX_USESKILL_FAIL_II_BLOOD_SUCKER_SEED = 59, + USESKILL_FAIL_NO_MORE_SPELL = 60, + //XXX_USESKILL_FAIL_II_BOMB_MUSHROOM_SPORE = 61, + //XXX_USESKILL_FAIL_II_GASOLINE_BOOMB = 62, + //XXX_USESKILL_FAIL_II_OIL_BOTTLE = 63, + //XXX_USESKILL_FAIL_II_EXPLOSION_POWDER = 64, + //XXX_USESKILL_FAIL_II_SMOKE_POWDER = 65, + //XXX_USESKILL_FAIL_II_TEAR_GAS = 66, + //XXX_USESKILL_FAIL_II_HYDROCHLORIC_ACID_BOTTLE = 67, + //XXX_USESKILL_FAIL_II_HELLS_PLANT_BOTTLE = 68, + //XXX_USESKILL_FAIL_II_MANDRAGORA_FLOWERPOT = 69, + USESKILL_FAIL_MANUAL_NOTIFY = 70, + USESKILL_FAIL_NEED_ITEM = 71, + USESKILL_FAIL_NEED_EQUIPMENT = 72, + USESKILL_FAIL_COMBOSKILL = 73, + USESKILL_FAIL_SPIRITS = 74, + USESKILL_FAIL_EXPLOSIONSPIRITS = 75, + USESKILL_FAIL_HP_TOOMANY = 76, + USESKILL_FAIL_NEED_ROYAL_GUARD_BANDING = 77, + USESKILL_FAIL_NEED_EQUIPPED_WEAPON_CLASS = 78, + USESKILL_FAIL_EL_SUMMON = 79, +}; + int clif_setip(const char* ip); void clif_setbindip(const char* ip); void clif_setport(uint16 port); @@ -272,7 +356,7 @@ void clif_unequipitemack(struct map_session_data *sd,int n,int pos,int ok); // s void clif_misceffect(struct block_list* bl,int type); // area void clif_changeoption(struct block_list* bl); // area void clif_changeoption2(struct block_list* bl); // area -void clif_useitemack(struct map_session_data *sd,int index,int amount,int ok); // self +void clif_useitemack(struct map_session_data *sd,int index,int amount,bool ok); // self void clif_GlobalMessage(struct block_list* bl, const char* message); void clif_createchat(struct map_session_data* sd, int flag); // self void clif_dispchat(struct chat_data* cd, int fd); // area or fd @@ -327,12 +411,12 @@ void clif_class_change(struct block_list *bl,int class_,int type); void clif_skillinfoblock(struct map_session_data *sd); void clif_skillup(struct map_session_data *sd,int skill_num); void clif_skillinfo(struct map_session_data *sd,int skill, int inf); -void clif_addskill(struct map_session_data *sd, int skill); -void clif_deleteskill(struct map_session_data *sd, int skill); +void clif_addskill(struct map_session_data *sd, int id); +void clif_deleteskill(struct map_session_data *sd, int id); void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, int skill_num, int property, int casttime); void clif_skillcastcancel(struct block_list* bl); -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); void clif_skill_cooldown(struct map_session_data *sd, int skillid, unsigned int tick); int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int tick,int sdelay,int ddelay,int damage,int div,int skill_id,int skill_lv,int type); //int clif_skill_damage2(struct block_list *src,struct block_list *dst,unsigned int tick,int sdelay,int ddelay,int damage,int div,int skill_id,int skill_lv,int type); diff --git a/src/map/guild.c b/src/map/guild.c index 28d4c7062..335d77301 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -1049,7 +1049,7 @@ int guild_change_emblem(struct map_session_data *sd,int len,const char *data) if (battle_config.require_glory_guild && !((g = guild_search(sd->status.guild_id)) && guild_checkskill(g, GD_GLORYGUILD)>0)) { - clif_skill_fail(sd,GD_GLORYGUILD,0,0); + clif_skill_fail(sd,GD_GLORYGUILD,USESKILL_FAIL_LEVEL,0); return 0; } diff --git a/src/map/pc.c b/src/map/pc.c index 6f10e88a7..9978f711c 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3957,16 +3957,16 @@ int pc_useitem(struct map_session_data *sd,int n) script = sd->inventory_data[n]->script; //Check if the item is to be consumed immediately [Skotlex] if( sd->inventory_data[n]->flag.delay_consume ) - clif_useitemack(sd,n,amount,1); + clif_useitemack(sd,n,amount,true); else { if( sd->status.inventory[n].expire_time == 0 ) { - clif_useitemack(sd,n,amount-1,1); + clif_useitemack(sd,n,amount-1,true); pc_delitem(sd,n,1,1,0,LOG_TYPE_CONSUME); // Rental Usable Items are not deleted until expiration } else - clif_useitemack(sd,n,0,0); + clif_useitemack(sd,n,0,false); } if(sd->status.inventory[n].card[0]==CARD0_CREATE && pc_famerank(MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3]), MAPID_ALCHEMIST)) diff --git a/src/map/skill.c b/src/map/skill.c index de5b34f1e..0545c09c1 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -498,7 +498,7 @@ int skillnotok (int skillid, struct map_session_data *sd) case WZ_ICEWALL: // noicewall flag [Valaris] if (map[m].flag.noicewall) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); return 1; } break; @@ -514,7 +514,7 @@ int skillnotok (int skillid, struct map_session_data *sd) !(battle_config.emergency_call&(map[m].flag.gvg || map[m].flag.gvg_castle?8:4)) || (battle_config.emergency_call&16 && map[m].flag.nowarpto && !map[m].flag.gvg_castle) ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); return 1; } break; @@ -714,7 +714,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int if(pc_steal_item(sd,bl,pc_checkskill(sd,TF_STEAL))) clif_skill_nodamage(src,bl,TF_STEAL,skill,1); else - clif_skill_fail(sd,RG_SNATCHER,0,0); + clif_skill_fail(sd,RG_SNATCHER,USESKILL_FAIL_LEVEL,0); } // Chance to trigger Taekwon kicks [Dralnu] if(sc && !sc->data[SC_COMBO]) { @@ -777,7 +777,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int if(!sc_start(bl,SC_POISON,(4*skilllv+10),skilllv,skill_get_time2(skillid,skilllv)) && sd && skillid==TF_POISON ) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; case AS_SONICBLOW: @@ -2650,12 +2650,12 @@ static int skill_check_condition_mercenary(struct block_list *bl, int skill, int { if( hp > 0 && status->hp <= (unsigned int)hp ) { - clif_skill_fail(sd, skill, 2, 0); + clif_skill_fail(sd, skill, USESKILL_FAIL_HP_INSUFFICIENT, 0); return 0; } if( sp > 0 && status->sp <= (unsigned int)sp ) { - clif_skill_fail(sd, skill, 1, 0); + clif_skill_fail(sd, skill, USESKILL_FAIL_SP_INSUFFICIENT, 0); return 0; } } @@ -2666,7 +2666,7 @@ static int skill_check_condition_mercenary(struct block_list *bl, int skill, int case ST_MOVE_ENABLE: if( !unit_can_move(bl) ) { - clif_skill_fail(sd, skill, 0, 0); + clif_skill_fail(sd, skill, USESKILL_FAIL_LEVEL, 0); return 0; } break; @@ -2682,7 +2682,7 @@ static int skill_check_condition_mercenary(struct block_list *bl, int skill, int index[i] = pc_search_inventory(sd, itemid[i]); if( index[i] < 0 || sd->status.inventory[index[i]].amount < amount[i] ) { - clif_skill_fail(sd, skill, 0, 0); + clif_skill_fail(sd, skill, USESKILL_FAIL_LEVEL, 0); return 0; } } @@ -3225,7 +3225,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int unit_setdir(bl,dir); } else if (sd) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); } break; @@ -3582,7 +3582,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int case SL_STUN: if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) { status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,10); - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag); @@ -4105,7 +4105,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in switch (skillid) { case HLIF_HEAL: //[orn] if (bl->type != BL_HOM) { - if (sd) clif_skill_fail(sd,skillid,0,0) ; + if (sd) clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0) ; break ; } case AL_HEAL: @@ -4120,7 +4120,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if (sd && battle_check_undead(tstatus->race,tstatus->def_ele)) { if (battle_check_target(src, bl, BCT_ENEMY) < 1) { //Offensive heal does not works on non-enemies. [Skotlex] - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); return 0; } return skill_castend_damage_id (src, bl, skillid, skilllv, tick, flag); @@ -4199,7 +4199,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case PR_REDEMPTIO: if (sd && !(flag&1)) { if (sd->status.party_id == 0) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } skill_area_temp[0] = 0; @@ -4208,7 +4208,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in src,skillid,skilllv,tick, flag|BCT_PARTY|1, skill_castend_nodamage_id); if (skill_area_temp[0] == 0) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } skill_area_temp[0] = 5 - skill_area_temp[0]; // The actual penalty... @@ -4230,7 +4230,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case ALL_RESURRECTION: if(sd && (map_flag_gvg(bl->m) || map[bl->m].flag.battleground)) { //No reviving in WoE grounds! - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } if (!status_isdead(bl)) @@ -4396,7 +4396,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in int class_; if ( sd && dstmd->status.mode&MD_BOSS ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } class_ = skillid==SA_MONOCELL?1002:mob_get_random_id(2, 1, 0); @@ -4415,7 +4415,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case SA_DEATH: if ( sd && dstmd && dstmd->status.mode&MD_BOSS ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } clif_skill_nodamage(src,bl,skillid,skilllv,1); @@ -4441,7 +4441,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case CR_PROVIDENCE: if(sd && dstsd){ //Check they are not another crusader [Skotlex] if ((dstsd->class_&MAPID_UPPERMASK) == MAPID_CRUSADER) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 1; } @@ -4456,7 +4456,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if( sd && dstsd && (dstsd->class_&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,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 1; } @@ -4479,7 +4479,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in else { if( sd ) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 1; @@ -4509,7 +4509,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in dstsd->sc.data[SC_ENCPOISON] )) ) { - if (sd) clif_skill_fail(sd,skillid,0,0); + if (sd) clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); clif_skill_nodamage(src,bl,skillid,skilllv,0); break; } @@ -4517,7 +4517,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in // 100% success rate at lv4 & 5, but lasts longer at lv5 if(!clif_skill_nodamage(src,bl,skillid,skilllv, sc_start(bl,type,(60+skilllv*10),skilllv, skill_get_time(skillid,skilllv)))) { if (sd) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); if (skill_break_equip(bl, EQP_WEAPON, 10000, BCT_PARTY) && sd && sd != dstsd) clif_displaymessage(sd->fd,"You broke target's weapon"); } @@ -4683,7 +4683,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case HP_ASSUMPTIO: if( sd && dstmd ) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); else clif_skill_nodamage(src,bl,skillid,skilllv, sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv))); @@ -4741,7 +4741,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in // dstsd->sc.data[SC_ENCPOISON] //People say you should be able to recast to lengthen the timer. [Skotlex] ) { clif_skill_nodamage(src,bl,skillid,skilllv,0); - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } } @@ -4764,12 +4764,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in int id; if (sd->mission_mobid && (sd->mission_count || rand()%100)) { //Cannot change target when already have one clif_mission_info(sd, sd->mission_mobid, sd->mission_count); - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } id = mob_get_random_id(0,0xF, sd->status.base_level); if (!id) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } sd->mission_mobid = id; @@ -4804,7 +4804,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if( !i ) { if( sd ) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 0; } @@ -4833,7 +4833,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if( !dstsd || (!sd && !mer) ) { // Only players can be devoted if( sd ) - clif_skill_fail(sd, skillid, 0, 0); + clif_skill_fail(sd, skillid, USESKILL_FAIL_LEVEL, 0); break; } @@ -4846,7 +4846,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in (dstsd->sc.data[SC_HELLPOWER])) // Players affected by SC_HELLPOWERR cannot be devoted. { if( sd ) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 1; } @@ -4861,7 +4861,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in ARR_FIND(0, count, i, sd->devotion[i] == 0 ); if( i == count ) { // No free slots, skill Fail - clif_skill_fail(sd, skillid, 0, 0); + clif_skill_fail(sd, skillid, USESKILL_FAIL_LEVEL, 0); map_freeblock_unlock(); return 1; } @@ -5107,7 +5107,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in dstsd->status.char_id == sd->status.child )) { status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,8); - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } } @@ -5164,7 +5164,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if( i ) clif_skill_nodamage(src,bl,skillid,( skillid == LG_FORCEOFVANGUARD ) ? skilllv : -1,i); else if( sd ) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 0; } @@ -5172,7 +5172,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if( i ) clif_skill_nodamage(src,bl,skillid,( skillid == LG_FORCEOFVANGUARD ) ? skilllv : -1,i); else if( sd ) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; case BD_ADAPTATION: @@ -5213,7 +5213,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in else { clif_skill_nodamage(src,bl,skillid,skilllv,0); - if(sd) clif_skill_fail(sd,skillid,0,0); + if(sd) clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); } } break; @@ -5223,7 +5223,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if(pc_steal_item(sd,bl,skilllv)) clif_skill_nodamage(src,bl,skillid,skilllv,1); else - clif_skill_fail(sd,skillid,0x0a,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL,0); } break; @@ -5237,14 +5237,14 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in } else - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); } break; case MG_STONECURSE: { if (tstatus->mode&MD_BOSS) { - if (sd) clif_skill_fail(sd,skillid,0,0); + if (sd) clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } if(status_isimmune(bl) || !tsc) @@ -5252,7 +5252,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if (tsc->data[SC_STONE]) { status_change_end(bl, SC_STONE, INVALID_TIMER); - if (sd) clif_skill_fail(sd,skillid,0,0); + if (sd) clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } if (sc_start4(bl,SC_STONE,(skilllv*4+20), @@ -5260,7 +5260,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in skill_get_time2(skillid,skilllv))) clif_skill_nodamage(src,bl,skillid,skilllv,1); else if(sd) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); // Level 6-10 doesn't consume a red gem if it fails [celest] if (skilllv > 5) { // not to consume items @@ -5364,7 +5364,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; if( dstsd ) { // Fail on Players - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } if( dstmd && dstmd->class_ == MOBID_EMPERIUM ) @@ -5396,7 +5396,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if(sd) { //Prevent vending of GMs with unnecessary Level to trade/drop. [Skotlex] if ( !pc_can_give_items(pc_isGM(sd)) ) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); else { sd->state.prevend = 1; clif_openvendingreq(sd,2+skilllv); @@ -5444,7 +5444,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if (skill_produce_mix(sd, skillid, 523, 0, 0, 0, 1)) clif_skill_nodamage(src,bl,skillid,skilllv,1); else - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); } break; @@ -5528,7 +5528,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in //Nothing stripped. if( sd && !i ) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); } break; @@ -5547,13 +5547,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in i = pc_search_inventory(sd,skill_db[skillid].itemid[x]); if(i < 0 || skill_db[skillid].itemid[x] <= 0) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 1; } if(sd->inventory_data[i] == NULL || sd->status.inventory[i].amount < skill_db[skillid].amount[x]) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 1; } @@ -5561,7 +5561,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in { if( dstsd && dstsd->status.base_level < (unsigned int)sd->inventory_data[i]->elv ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 1; } @@ -5654,7 +5654,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in clif_skill_nodamage(src,bl,skillid,skilllv,1); //Prepare 200 White Potions. if (!skill_produce_mix(sd, skillid, 504, 0, 0, 0, 200)) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); } break; case AM_TWILIGHT2: @@ -5662,7 +5662,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in clif_skill_nodamage(src,bl,skillid,skilllv,1); //Prepare 200 Slim White Potions. if (!skill_produce_mix(sd, skillid, 547, 0, 0, 0, 200)) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); } break; case AM_TWILIGHT3: @@ -5672,7 +5672,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in || !skill_can_produce_mix(sd,7136,-1, 50) //50 Acid Bottle || !skill_can_produce_mix(sd,7135,-1, 50) //50 Flame Bottle ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } clif_skill_nodamage(src,bl,skillid,skilllv,1); @@ -5691,7 +5691,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in || ( tsc && tsc->option&OPTION_MADOGEAR ) )//Mado Gear is immune to dispell according to bug report 49 [Ind] { if (sd) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } if(status_isimmune(bl) || !tsc || !tsc->count) @@ -5818,7 +5818,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in { //Only 10% success chance against bosses. [Skotlex] if (rand()%100 < 90) { - if (sd) clif_skill_fail(sd,skillid,0,0); + if (sd) clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } } else if (!dstsd || map_flag_vs(bl->m)) //HP damage only on pvp-maps when against players. @@ -6092,7 +6092,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in struct map_session_data *m_sd = pc_get_mother(sd); // if neither was found if(!f_sd && !m_sd){ - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 0; } @@ -6108,7 +6108,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in hp = sstatus->max_hp/10; sp = hp * 10 * skilllv / 100; if (!status_charge(src,hp,0)) { - if (sd) clif_skill_fail(sd,skillid,0,0); + if (sd) clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } clif_skill_nodamage(src, bl, skillid, skilllv, 1); @@ -6204,7 +6204,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case AS_SPLASHER: if(tstatus->mode&MD_BOSS || tstatus-> hp > tstatus->max_hp*3/4) { - if (sd) clif_skill_fail(sd,skillid,0,0); + if (sd) clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 1; } @@ -6232,7 +6232,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if (!clif_skill_nodamage(src,bl,skillid,skilllv, sc_start(bl,type,55+5*skilllv,skilllv,skill_get_time(skillid,skilllv)))) { - if (sd) clif_skill_fail(sd,skillid,0,0); + if (sd) clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 0; } @@ -6256,7 +6256,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in unsigned int sp1 = 0, sp2 = 0; if (dstmd) { if (dstmd->state.soul_change_flag) { - if(sd) clif_skill_fail(sd,skillid,0,0); + if(sd) clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } dstmd->state.soul_change_flag = 1; @@ -6338,7 +6338,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if( rand() % 100 > skilllv * 8 || (dstmd && ((dstmd->guardian_data && dstmd->class_ == MOBID_EMPERIUM) || mob_is_battleground(dstmd))) ) { if( sd ) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 0; @@ -6441,7 +6441,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case SL_WIZARD: //NOTE: here, 'type' has the value of the associated MAPID, not of the SC_SPIRIT constant. if (sd && !(dstsd && (dstsd->class_&MAPID_UPPERMASK) == type)) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } if (skillid == SL_SUPERNOVICE && dstsd && dstsd->die_counter && !(rand()%100)) @@ -6457,7 +6457,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in break; case SL_HIGH: if (sd && !(dstsd && (dstsd->class_&JOBL_UPPER) && !(dstsd->class_&JOBL_2) && dstsd->status.base_level < 70)) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } clif_skill_nodamage(src,bl,skillid,skilllv, @@ -6473,7 +6473,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case SL_SKA: // [marquis007] case SL_SKE: if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,10); break; } @@ -6565,7 +6565,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if (sd) { clif_skill_nodamage(src,bl,skillid,skilllv,1); if (!pc_set_hate_mob(sd, skilllv-1, bl)) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); } break; @@ -6579,16 +6579,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in } break; - case GS_CRACKER: - i =65 -5*distance_bl(src,bl); //Base rate - if (i < 30) i = 30; - clif_skill_nodamage(src,bl,skillid,skilllv,1); - sc_start(bl,SC_STUN, i,skilllv,skill_get_time2(skillid,skilllv)); - break; + case GS_CRACKER: + if (!dstsd) // according to latest patch, should not work on players [Reddozen] + { + i =65 -5*distance_bl(src,bl); //Base rate + if (i < 30) i = 30; + clif_skill_nodamage(src,bl,skillid,skilllv,1); + sc_start(bl,SC_STUN, i,skilllv,skill_get_time2(skillid,skilllv)); + } + else if (sd) + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); + break; case AM_CALLHOMUN: //[orn] if (sd && !merc_call_homunculus(sd)) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; case AM_REST: @@ -6597,7 +6602,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if (merc_hom_vaporize(sd,1)) clif_skill_nodamage(src, bl, skillid, skilllv, 1); else - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); } break; @@ -6626,9 +6631,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in } // Failed else if (hd && hd->master) - clif_skill_fail(hd->master, skillid, 0, 0); + clif_skill_fail(hd->master, skillid, USESKILL_FAIL_LEVEL, 0); else if (sd) - clif_skill_fail(sd, skillid, 0, 0); + clif_skill_fail(sd, skillid, USESKILL_FAIL_LEVEL, 0); break; case HVAN_CHAOTIC: //[orn] { @@ -7667,7 +7672,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data) sc->data[SC_FOGWALL] && rand()%100 < 75) { //Fogwall makes all offensive-type targetted skills fail at 75% - if (sd) clif_skill_fail(sd,ud->skillid,0,0); + if (sd) clif_skill_fail(sd,ud->skillid,USESKILL_FAIL_LEVEL,0); break; } } @@ -7686,7 +7691,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data) !check_distance_bl(src, target, skill_get_range2(src,ud->skillid,ud->skilllv)+battle_config.skill_add_range)) { if (sd) { - clif_skill_fail(sd,ud->skillid,0,0); + clif_skill_fail(sd,ud->skillid,USESKILL_FAIL_LEVEL,0); if(battle_config.skill_out_range_consume) //Consume items anyway. [Skotlex] skill_consume_requirement(sd,ud->skillid,ud->skilllv,3); } @@ -7806,7 +7811,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data) clif_slide(src,src->x,src->y); clif_skill_damage(src,target,tick,sd->battle_status.amotion,0,0,1,ud->skillid, ud->skilllv, 5); } - clif_skill_fail(sd,ud->skillid,0,0); + clif_skill_fail(sd,ud->skillid,USESKILL_FAIL_LEVEL,0); } } @@ -7867,7 +7872,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data) skill_check_unit_range(src,ud->skillx,ud->skilly,ud->skillid,ud->skilllv) ) { - if (sd) clif_skill_fail(sd,ud->skillid,0,0); + if (sd) clif_skill_fail(sd,ud->skillid,USESKILL_FAIL_LEVEL,0); break; } if( src->type&battle_config.skill_nofootset && @@ -7875,7 +7880,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data) skill_check_unit_range2(src,ud->skillx,ud->skilly,ud->skillid,ud->skilllv) ) { - if (sd) clif_skill_fail(sd,ud->skillid,0,0); + if (sd) clif_skill_fail(sd,ud->skillid,USESKILL_FAIL_LEVEL,0); break; } if( src->type&battle_config.land_skill_limit && @@ -7888,7 +7893,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data) } if( maxcount == 0 ) { - if (sd) clif_skill_fail(sd,ud->skillid,0,0); + if (sd) clif_skill_fail(sd,ud->skillid,USESKILL_FAIL_LEVEL,0); break; } } @@ -8253,7 +8258,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk int j = pc_search_inventory(sd,skill_db[skillid].itemid[i]); if( j < 0 || skill_db[skillid].itemid[i] <= 0 || sd->inventory_data[j] == NULL || sd->status.inventory[j].amount < skill_db[skillid].amount[i] ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); return 1; } potion_flag = 1; @@ -8309,7 +8314,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk i = skill_get_splash(skillid, skilllv); map_foreachinarea(skill_cell_overlap, src->m, x-i, y-i, x+i, y+i, BL_SKILL, HW_GANBANTEIN, &dummy, src); } else { - if (sd) clif_skill_fail(sd,skillid,0,0); + if (sd) clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); return 1; } break; @@ -8326,12 +8331,12 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk int i; if( map_count_oncell(src->m,x,y,BL_CHAR) > 0 ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); return 1; } clif_skill_poseffect(src,skillid,skilllv,x,y,tick); if (rand()%100 < 50) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); } else { TBL_MOB* md = mob_once_spawn_sub(src, src->m, x, y, "--ja--",(skilllv < 2 ? 1084+rand()%2 : 1078+rand()%6),""); if (!md) break; @@ -8381,7 +8386,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk { if (!merc_resurrect_homunculus(sd, 20*skilllv, x, y)) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } } @@ -8626,7 +8631,7 @@ int skill_castend_map (struct map_session_data *sd, short skill_num, const char mapindex = mapindex_name2id((char*)map); if(!mapindex) { //Given map not found? - clif_skill_fail(sd,skill_num,0,0); + clif_skill_fail(sd,skill_num,USESKILL_FAIL_LEVEL,0); skill_failed(sd); return 0; } @@ -8641,7 +8646,7 @@ int skill_castend_map (struct map_session_data *sd, short skill_num, const char maxcount--; } if(!maxcount) { - clif_skill_fail(sd,skill_num,0,0); + clif_skill_fail(sd,skill_num,USESKILL_FAIL_LEVEL,0); skill_failed(sd); return 0; } @@ -10348,7 +10353,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh if( pc_is90overweight(sd) ) { - clif_skill_fail(sd,skill,9,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_WEIGHTOVER,0); return 0; } @@ -10375,7 +10380,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh { case SA_CASTCANCEL: if(sd->ud.skilltimer == INVALID_TIMER) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -10387,7 +10392,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh break; case MO_CALLSPIRITS: if(sd->spiritball >= lv) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -10438,7 +10443,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh } 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,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -10446,7 +10451,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh case TK_MISSION: if( (sd->class_&MAPID_UPPERMASK) != MAPID_TAEKWON ) {// Cannot be used by Non-Taekwon classes - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -10458,7 +10463,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh case TK_JUMPKICK: if( (sd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER ) {// Soul Linkers cannot use this skill - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -10491,7 +10496,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh int time; if(!(sc && sc->data[SC_DANCING])) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } time = 1000*(sc->data[SC_DANCING]->val3>>16); @@ -10500,7 +10505,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh (sc->data[SC_DANCING]->val1>>16)) //Dance Skill LV - time < skill_get_time2(skill,lv)) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } } @@ -10509,7 +10514,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh case PR_BENEDICTIO: if (skill_check_pc_partner(sd, skill, &lv, 1, 0) < 2) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -10527,7 +10532,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh case CG_HERMODE: if(!npc_check_areanpc(1,sd->bl.m,sd->bl.x,sd->bl.y,skill_get_splash(skill, lv))) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -10539,7 +10544,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh x = sd->bl.x+(i%size-range); y = sd->bl.y+(i/size-range); if (map_getcell(sd->bl.m,x,y,CELL_CHKWALL)) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } } @@ -10550,7 +10555,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh int exp; if( ((exp = pc_nextbaseexp(sd)) > 0 && get_percentage(sd->status.base_exp, exp) < 1) || ((exp = pc_nextjobexp(sd)) > 0 && get_percentage(sd->status.job_exp, exp) < 1)) { - clif_skill_fail(sd,skill,0,0); //Not enough exp. + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); //Not enough exp. return 0; } break; @@ -10559,7 +10564,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh case AM_TWILIGHT3: if (!party_skill_check(sd, sd->status.party_id, skill, lv)) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -10571,7 +10576,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh i = skill-SG_SUN_WARM; if (sd->bl.m == sd->feel_map[i].m) break; - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; break; case SG_SUN_COMFORT: @@ -10583,7 +10588,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh if (sd->bl.m == sd->feel_map[i].m && (battle_config.allow_skill_without_day || sg_info[i].day_func())) break; - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; case SG_FUSION: if (sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_STAR) @@ -10593,7 +10598,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh if( require.sp > 0 ) { if (status->sp < (unsigned int)require.sp) - clif_skill_fail(sd,skill,1,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_SP_INSUFFICIENT,0); else status_zap(&sd->bl, 0, require.sp); } @@ -10602,7 +10607,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh case GD_REGENERATION: case GD_RESTORE: if (!map_flag_gvg2(sd->bl.m)) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } case GD_EMERGENCYCALL: @@ -10613,26 +10618,26 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh case GS_GLITTERING: if(sd->spiritball >= 10) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case NJ_ISSEN: if (status->hp < 2) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } case NJ_BUNSINJYUTSU: if (!(sc && sc->data[SC_NEN])) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case NJ_ZENYNAGE: if(sd->status.zeny < require.zeny) { - clif_skill_fail(sd,skill,5,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_MONEY,0); return 0; } break; @@ -10642,14 +10647,14 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh 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,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case AM_REST: //Can't vapo homun if you don't have an active homunc or it's hp is < 80% if (!merc_is_hom_active(sd->hd) || sd->hd->battle_status.hp < (sd->hd->battle_status.max_hp*80/100)) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -10786,66 +10791,66 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh switch(require.state) { case ST_HIDING: if(!(sc && sc->option&OPTION_HIDE)) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case ST_CLOAKING: if(!pc_iscloaking(sd)) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case ST_HIDDEN: if(!pc_ishiding(sd)) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case ST_RIDING: if(!pc_isriding(sd)) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case ST_FALCON: if(!pc_isfalcon(sd)) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case ST_CARTBOOST: if(!(sc && sc->data[SC_CARTBOOST])) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } case ST_CART: if(!pc_iscarton(sd)) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case ST_SHIELD: if(sd->status.shield <= 0) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case ST_SIGHT: if(!(sc && sc->data[SC_SIGHT])) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case ST_EXPLOSIONSPIRITS: if(!(sc && sc->data[SC_EXPLOSIONSPIRITS])) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,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,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -10854,7 +10859,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh sd->ud.canmove_tick = 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,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -10863,7 +10868,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh break; if (map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKWATER)) break; - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; /** * Rune Knight @@ -10915,27 +10920,27 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh if(require.mhp > 0 && get_percentage(status->hp, status->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,2,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_HP_INSUFFICIENT,0); return 0; } if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) { - clif_skill_fail(sd,skill,6,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_THIS_WEAPON,0); return 0; } if( require.sp > 0 && status->sp < (unsigned int)require.sp) { - clif_skill_fail(sd,skill,1,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_SP_INSUFFICIENT,0); return 0; } if( require.zeny > 0 && sd->status.zeny < require.zeny ) { - clif_skill_fail(sd,skill,5,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_MONEY,0); return 0; } if( require.spiritball > 0 && sd->spiritball < require.spiritball) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } @@ -10980,7 +10985,7 @@ int skill_check_condition_castend(struct map_session_data* sd, short skill, shor if( pc_is90overweight(sd) ) { - clif_skill_fail(sd,skill,9,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_WEIGHTOVER,0); return 0; } @@ -11007,7 +11012,7 @@ int skill_check_condition_castend(struct map_session_data* sd, short skill, shor if(c >= maxcount || (skill==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,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } } @@ -11046,7 +11051,7 @@ int skill_check_condition_castend(struct map_session_data* sd, short skill, shor require = skill_get_requirement(sd,skill,lv); if( require.hp > 0 && status->hp <= (unsigned int)require.hp) { - clif_skill_fail(sd,skill,2,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_HP_INSUFFICIENT,0); return 0; } @@ -11062,7 +11067,7 @@ int skill_check_condition_castend(struct map_session_data* sd, short skill, shor { //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,6,0); + //clif_skill_fail(sd,skill,USESKILL_FAIL_THIS_WEAPON,0); return 0; } } @@ -11074,11 +11079,11 @@ int skill_check_condition_castend(struct map_session_data* sd, short skill, shor index[i] = pc_search_inventory(sd,require.itemid[i]); if( index[i] < 0 || sd->status.inventory[index[i]].amount < require.amount[i] ) { if( require.itemid[i] == ITEMID_RED_GEMSTONE ) - clif_skill_fail(sd,skill,7,0);// red gemstone required + clif_skill_fail(sd,skill,USESKILL_FAIL_REDJAMSTONE,0);// red gemstone required else if( require.itemid[i] == ITEMID_BLUE_GEMSTONE ) - clif_skill_fail(sd,skill,8,0);// blue gemstone required + clif_skill_fail(sd,skill,USESKILL_FAIL_BLUEJAMSTONE,0);// blue gemstone required else - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } } @@ -11711,7 +11716,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) < 0 ) { - clif_skill_fail(sd,sd->menuskill_id,0,0); + clif_skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0); return; } clif_skill_nodamage(&sd->bl,&target_sd->bl,sd->menuskill_id,1,1); @@ -11764,7 +11769,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) || ditem->flag.no_refine // if the item isn't refinable || (i = pc_search_inventory(sd, material [ditem->wlv])) < 0 ) { - clif_skill_fail(sd,sd->menuskill_id,0,0); + clif_skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0); return; } diff --git a/src/map/unit.c b/src/map/unit.c index 72e6fe2d6..05b8d2e39 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1058,7 +1058,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh return 0; target = (struct block_list*)map_charid2sd(sd->status.partner_id); if (!target) { - clif_skill_fail(sd,skill_num,0,0); + clif_skill_fail(sd,skill_num,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -1110,7 +1110,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh case BD_ENCORE: //Prevent using the dance skill if you no longer have the skill in your tree. if(!sd->skillid_dance || pc_checkskill(sd,sd->skillid_dance)<=0){ - clif_skill_fail(sd,skill_num,0,0); + clif_skill_fail(sd,skill_num,USESKILL_FAIL_LEVEL,0); return 0; } sd->skillid_old = skill_num; @@ -1126,7 +1126,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh case CG_MOONLIT: if (skill_check_pc_partner(sd, skill_num, &skill_lv, 1, 0) < 1) { - clif_skill_fail(sd,skill_num,0,0); + clif_skill_fail(sd,skill_num,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -1356,7 +1356,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, sh if( map_getcell(src->m, skill_x, skill_y, CELL_CHKWALL) ) {// can't cast ground targeted spells on wall cells - if (sd) clif_skill_fail(sd,skill_num,0,0); + if (sd) clif_skill_fail(sd,skill_num,USESKILL_FAIL_LEVEL,0); return 0; } @@ -1691,7 +1691,7 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t { // attacking when under cast delay has restrictions: if( tid == INVALID_TIMER ) { //requested attack. - if(sd) clif_skill_fail(sd,1,4,0); + if(sd) clif_skill_fail(sd,1,USESKILL_FAIL_SKILLINTERVAL,0); return 0; } //Otherwise, we are in a combo-attack, delay this until your canact time is over. [Skotlex] diff --git a/src/map/vending.c b/src/map/vending.c index 38c817139..0db4ee85b 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -254,14 +254,14 @@ void vending_openvending(struct map_session_data* sd, const char* message, bool // skill level and cart check if( !vending_skill_lvl || !pc_iscarton(sd) ) { - clif_skill_fail(sd, MC_VENDING, 0, 0); + clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); return; } // check number of items in shop if( count < 1 || count > MAX_VENDING || count > 2 + vending_skill_lvl ) { // invalid item count - clif_skill_fail(sd, MC_VENDING, 0, 0); + clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); return; } @@ -296,7 +296,7 @@ void vending_openvending(struct map_session_data* sd, const char* message, bool if( i == 0 ) { // no valid item found - clif_skill_fail(sd, MC_VENDING, 0, 0); // custom reply packet + clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); // custom reply packet return; } sd->state.prevend = 0; |