summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authoreathenabot <eathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-17 05:33:14 +0000
committereathenabot <eathenabot@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-17 05:33:14 +0000
commite2a611d1ce53ccea06168d5d63707aff09bd0555 (patch)
tree31ec3e61639ad2ea0c1d73dcf1178716f657b8c4 /src/map/skill.c
parentf5ded9b1d612e0b21ca993303289cffa8aae9180 (diff)
downloadhercules-e2a611d1ce53ccea06168d5d63707aff09bd0555.tar.gz
hercules-e2a611d1ce53ccea06168d5d63707aff09bd0555.tar.bz2
hercules-e2a611d1ce53ccea06168d5d63707aff09bd0555.tar.xz
hercules-e2a611d1ce53ccea06168d5d63707aff09bd0555.zip
* Merged changes up to eAthena 15054. [ai4rei]
* clif cleanup: Changed argument types of some clif functions. - Added enumeration for skill failure codes and made clif_skill_fail use it. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15472 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c273
1 files changed, 139 insertions, 134 deletions
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;
}