summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-06-09 18:05:53 -0300
committershennetsind <ind@henn.et>2013-06-09 18:05:53 -0300
commit9fe16cc556b151e6d60efe5faa759d7959a3fd24 (patch)
tree4002c97c54ff00eca7897a6bbcc1153473cf22c6 /src
parent3508292a2d76f8327da77532464cf00c32cc058a (diff)
downloadhercules-9fe16cc556b151e6d60efe5faa759d7959a3fd24.tar.gz
hercules-9fe16cc556b151e6d60efe5faa759d7959a3fd24.tar.bz2
hercules-9fe16cc556b151e6d60efe5faa759d7959a3fd24.tar.xz
hercules-9fe16cc556b151e6d60efe5faa759d7959a3fd24.zip
Fixed Bug #7334
Special Thanks to kyeme http://hercules.ws/board/tracker/issue-7334-mc-identify/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/map/skill.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index f7a943633..15c133dc1 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6006,8 +6006,15 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case MC_IDENTIFY:
- if(sd)
+ if(sd) {
clif->item_identify_list(sd);
+ if( sd->menuskill_id != MC_IDENTIFY ) {/* failed, dont consume anything, return */
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
+ iMap->freeblock_unlock();
+ return 1;
+ }
+ status_zap(src,0,skill_db[skill->get_index(skill_id)].sp[skill_lv]); // consume sp only if succeeded
+ }
break;
// Weapon Refining [Celest]
@@ -13361,18 +13368,26 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
// type&2: consume items (after skill was used)
// type&1: consume the others (before skill was used)
-int skill_consume_requirement( struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type)
-{
+int skill_consume_requirement( struct map_session_data *sd, uint16 skill_id, uint16 skill_lv, short type) {
struct skill_condition req;
nullpo_ret(sd);
req = skill->get_requirement(sd,skill_id,skill_lv);
- if( type&1 )
- {
- if( skill_id == CG_TAROTCARD || sd->state.autocast )
- req.sp = 0; // TarotCard will consume sp in skill_cast_nodamage_id [Inkfish]
+ if( type&1 ) {
+
+ switch( skill_id ) {
+ case CG_TAROTCARD: // TarotCard will consume sp in skill_cast_nodamage_id [Inkfish]
+ case MC_IDENTIFY:
+ req.sp = 0;
+ break;
+ default:
+ if( sd->state.autocast )
+ req.sp = 0;
+ break;
+ }
+
if(req.hp || req.sp)
status_zap(&sd->bl, req.hp, req.sp);