summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorMichieru <Michieru@users.noreply.github.com>2014-08-10 11:27:45 +0200
committerMichieru <Michieru@users.noreply.github.com>2014-08-10 11:27:45 +0200
commit3089a7d2d2dc655fb955b90ec152c0ba569bd4e2 (patch)
tree7a64696414a2664593965f893d7d4bb12a8687bb /src/map
parent607d77fa39b4b1797d8b074362939c8fbbfb2dd7 (diff)
downloadhercules-3089a7d2d2dc655fb955b90ec152c0ba569bd4e2.tar.gz
hercules-3089a7d2d2dc655fb955b90ec152c0ba569bd4e2.tar.bz2
hercules-3089a7d2d2dc655fb955b90ec152c0ba569bd4e2.tar.xz
hercules-3089a7d2d2dc655fb955b90ec152c0ba569bd4e2.zip
- Fix shield protection should not protect the left hand dagger same for full chimical protection (bug:7731)
Diffstat (limited to 'src/map')
-rw-r--r--src/map/skill.c79
1 files changed, 53 insertions, 26 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index d6faa782c..0e7f8f9a7 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6770,20 +6770,42 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
}
break;
case AM_CP_WEAPON:
- case AM_CP_SHIELD:
- case AM_CP_ARMOR:
- case AM_CP_HELM:
- {
- unsigned int equip[] = {EQP_WEAPON, EQP_SHIELD, EQP_ARMOR, EQP_HEAD_TOP};
-
- if( sd && ( bl->type != BL_PC || ( dstsd && pc->checkequip(dstsd,equip[skill_id - AM_CP_WEAPON]) < 0 ) ) ) {
+ if(dstsd && dstsd->inventory_data[dstsd->equip_index[EQI_HAND_R]])
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
+ sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ else {
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ return 0;
+ }
+ break;
+ case AM_CP_SHIELD: {
+ int i;
+ if(dstsd && (i=dstsd->equip_index[EQI_HAND_L])>=0 && dstsd->inventory_data[i] &&
+ dstsd->inventory_data[i]->type==IT_ARMOR)
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
+ sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ else {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- map->freeblock_unlock(); // Don't consume item requirements
return 0;
}
-
+ }
+ break;
+ case AM_CP_ARMOR:
+ if(dstsd && dstsd->inventory_data[dstsd->equip_index[EQI_ARMOR]])
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,
+ sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ else {
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ return 0;
+ }
+ break;
+ case AM_CP_HELM:
+ if(dstsd && dstsd->inventory_data[dstsd->equip_index[EQI_HEAD_TOP]])
clif->skill_nodamage(src,bl,skill_id,skill_lv,
sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ else {
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ return 0;
}
break;
case AM_TWILIGHT1:
@@ -7465,25 +7487,30 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
}
break;
// Full Chemical Protection
- case CR_FULLPROTECTION:
- {
- unsigned int equip[] = {EQP_WEAPON, EQP_SHIELD, EQP_ARMOR, EQP_HEAD_TOP};
- int i, s = 0, skilltime = skill->get_time(skill_id,skill_lv);
-
- for (i=0 ; i<4; i++) {
- if( bl->type != BL_PC || ( dstsd && pc->checkequip(dstsd,equip[i]) < 0 ) )
- continue;
- sc_start(src,bl,(sc_type)(SC_PROTECTWEAPON + i),100,skill_lv,skilltime);
- s++;
- }
- if( sd && !s ){
- clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- map->freeblock_unlock(); // Don't consume item requirements
- return 0;
- }
+ case CR_FULLPROTECTION: {
+ bool iused=false;
+ int i;
+ if(dstsd && dstsd->inventory_data[dstsd->equip_index[EQI_HAND_R]]) {
+ iused=true;
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(src,bl,SC_PROTECTWEAPON,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ } if(dstsd && (i=dstsd->equip_index[EQI_HAND_L])>=0 && dstsd->inventory_data[i] &&
+ dstsd->inventory_data[i]->type==IT_ARMOR) {
+ iused=true;
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(src,bl,SC_PROTECTSHIELD,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ } if(dstsd && dstsd->inventory_data[dstsd->equip_index[EQI_ARMOR]]) {
+ iused=true;
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(src,bl,SC_PROTECTARMOR,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ } if(dstsd && dstsd->inventory_data[dstsd->equip_index[EQI_HEAD_TOP]]) {
+ iused=true;
+ clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start(src,bl,SC_PROTECTHELM,100,skill_lv,skill->get_time(skill_id,skill_lv)));
+ } if(iused)
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
+ else {
+ clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ return 0;
}
- break;
+ }
+ break;
case RG_CLEANER: //AppleGirl
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);