diff options
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 87e869ec7..4bf110b23 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2017 Hercules Dev Team + * Copyright (C) 2012-2018 Hercules Dev Team * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify @@ -37,6 +37,7 @@ #include "map/log.h" #include "map/map.h" #include "map/mercenary.h" +#include "map/messages.h" #include "map/mob.h" #include "map/npc.h" #include "map/party.h" @@ -6304,7 +6305,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin break; case SA_SUMMONMONSTER: clif->skill_nodamage(src,bl,skill_id,skill_lv,1); - if (sd) mob->once_spawn(sd, src->m, src->x, src->y," --ja--", -1, 1, "", SZ_SMALL, AI_NONE); + if (sd != NULL) + mob->once_spawn(sd, src->m, src->x, src->y, DEFAULT_MOB_JNAME, -1, 1, "", SZ_SMALL, AI_NONE); break; case SA_LEVELUP: clif->skill_nodamage(src,bl,skill_id,skill_lv,1); @@ -11429,7 +11431,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); } else { int mob_id = skill_lv < 2 ? MOBID_BLACK_MUSHROOM + rnd()%2 : MOBID_RED_PLANT + rnd()%6; - struct mob_data *md = mob->once_spawn_sub(src, src->m, x, y, "--ja--", mob_id, "", SZ_SMALL, AI_NONE); + struct mob_data *md = mob->once_spawn_sub(src, src->m, x, y, DEFAULT_MOB_JNAME, mob_id, "", SZ_SMALL, AI_NONE); int i; if (md == NULL) break; @@ -18005,7 +18007,9 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, for( i = 0; i < MAX_INVENTORY; i++ ) { if( sd->status.inventory[i].nameid == nameid ) { if( sd->status.inventory[i].amount >= data->stack.amount ) { - clif->msgtable(sd, MSG_RUNE_STONE_MAX_AMOUNT); +#if PACKETVER >= 20090729 + clif->msgtable(sd, MSG_RUNESTONE_MAKEERROR_OVERCOUNT); +#endif return 0; } else { /** @@ -18464,8 +18468,10 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, } break; } - if( k ){ + if (k) { +#if PACKETVER >= 20091013 clif->msgtable_skill(sd, skill_id, MSG_SKILL_SUCCESS); +#endif return 1; } } else if (tmp_item.amount) { //Success @@ -18473,8 +18479,10 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, clif->additem(sd,0,0,flag); map->addflooritem(&sd->bl, &tmp_item, tmp_item.amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0, false); } - if( skill_id == GN_MIX_COOKING || skill_id == GN_MAKEBOMB || skill_id == GN_S_PHARMACY ) +#if PACKETVER >= 20091013 + if (skill_id == GN_MIX_COOKING || skill_id == GN_MAKEBOMB || skill_id == GN_S_PHARMACY) clif->msgtable_skill(sd, skill_id, MSG_SKILL_SUCCESS); +#endif return 1; } } @@ -18533,13 +18541,17 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, clif->additem(sd,0,0,flag); map->addflooritem(&sd->bl, &tmp_item, tmp_item.amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0, false); } - clif->msgtable_skill(sd, skill_id, MSG_SKILL_FAILURE); +#if PACKETVER >= 20091013 + clif->msgtable_skill(sd, skill_id, MSG_SKILL_FAIL); +#endif } break; case GN_MAKEBOMB: case GN_S_PHARMACY: case GN_CHANGEMATERIAL: - clif->msgtable_skill(sd, skill_id, MSG_SKILL_FAILURE); +#if PACKETVER >= 20091013 + clif->msgtable_skill(sd, skill_id, MSG_SKILL_FAIL); +#endif break; default: if( skill->dbs->produce_db[idx].itemlv > 10 && skill->dbs->produce_db[idx].itemlv <= 20 ) @@ -18875,7 +18887,9 @@ int skill_changematerial(struct map_session_data *sd, const struct itemlist *ite amount = entry->amount; nameid = sd->status.inventory[idx].nameid; if (nameid > 0 && sd->status.inventory[idx].identify == 0) { - clif->msgtable_skill(sd, GN_CHANGEMATERIAL, MSG_SKILL_ITEM_NEED_IDENTIFY); +#if PACKETVER >= 20091013 + clif->msgtable_skill(sd, GN_CHANGEMATERIAL, MSG_SKILL_FAIL_MATERIAL_IDENTITY); +#endif return 0; } if( nameid == skill->dbs->produce_db[i].mat_id[j] && (amount-p*skill->dbs->produce_db[i].mat_amount[j]) >= skill->dbs->produce_db[i].mat_amount[j] @@ -18895,10 +18909,10 @@ int skill_changematerial(struct map_session_data *sd, const struct itemlist *ite } } } - - if( p == 0) - clif->msgtable_skill(sd, GN_CHANGEMATERIAL, MSG_SKILL_ITEM_NOT_FOUND); - +#if PACKETVER >= 20091013 + if (p == 0) + clif->msgtable_skill(sd, GN_CHANGEMATERIAL, MSG_SKILL_RECIPE_NOTEXIST); +#endif return 0; } |