summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-14 18:15:24 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-14 18:15:24 +0000
commit8ff9db48cd5f38b532232b30c5ead723d09259cd (patch)
treedbf9c2230a7f5cef26959d36eec20f400e95b338 /src/map/status.c
parent85fa4fdffd67908a487b957bc10aaecb4cf7ed7a (diff)
downloadhercules-8ff9db48cd5f38b532232b30c5ead723d09259cd.tar.gz
hercules-8ff9db48cd5f38b532232b30c5ead723d09259cd.tar.bz2
hercules-8ff9db48cd5f38b532232b30c5ead723d09259cd.tar.xz
hercules-8ff9db48cd5f38b532232b30c5ead723d09259cd.zip
- Added function skill_strip to handle stripping code. The RG strip skills and GS_DISARM use it now.
- Modified the strip-related status changes so they handle removing the equipped item instead of leaving it up to the skill-code. They return 0 when nothing could be stripped. - Cleaned some the MD_DETECTOR code. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9499 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c72
1 files changed, 56 insertions, 16 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 81837bef1..ea78c57bf 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1106,8 +1106,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
return 0;
default:
//Check for chase-walk/hiding/cloaking opponents.
- if (tsc && tsc->option&hide_flag && !(status->mode&MD_BOSS) &&
- !(status->mode&MD_DETECTOR))
+ if (tsc && tsc->option&hide_flag && !(status->mode&(MD_BOSS|MD_DETECTOR)))
return 0;
}
return 1;
@@ -1136,19 +1135,17 @@ int status_check_visibility(struct block_list *src, struct block_list *target)
switch (target->type)
{ //Check for chase-walk/hiding/cloaking opponents.
case BL_PC:
- {
- if(tsc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) &&
- !(status->mode&MD_BOSS) &&
- (
- ((TBL_PC*)target)->special_state.perfect_hiding ||
- !(status->mode&MD_DETECTOR)
- ))
- return 0;
- }
+ if(tsc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) &&
+ !(status->mode&MD_BOSS) &&
+ (
+ ((TBL_PC*)target)->special_state.perfect_hiding ||
+ !(status->mode&MD_DETECTOR)
+ ))
+ return 0;
break;
default:
if (tsc && tsc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) &&
- !(status->mode&MD_BOSS) && !(status->mode&MD_DETECTOR))
+ !(status->mode&(MD_BOSS|MD_DETECTOR)))
return 0;
}
@@ -4646,6 +4643,10 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
case SC_COMA:
case SC_GRAVITATION:
case SC_SUITON:
+ case SC_STRIPWEAPON:
+ case SC_STRIPSHIELD:
+ case SC_STRIPARMOR:
+ case SC_STRIPHELM:
return 0;
}
}
@@ -4927,19 +4928,58 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
}
break;
case SC_STRIPWEAPON:
- if (bl->type != BL_PC) //Watk reduction
+ if (sd) {
+ int i;
+ if(sd->unstripable_equip&EQP_WEAPON)
+ return 0;
+ i = sd->equip_index[EQI_HAND_L];
+ if (i>=0 && sd->inventory_data[i] &&
+ sd->inventory_data[i]->type == IT_WEAPON)
+ pc_unequipitem(sd,i,3); //L-hand weapon
+
+ i = sd->equip_index[EQI_HAND_R];
+ if (i<0 || !sd->inventory_data[i] ||
+ sd->inventory_data[i]->type != IT_WEAPON)
+ return 0;
+ pc_unequipitem(sd,i,3);
+ } else //Watk reduction
val2 = 5*val1;
break;
case SC_STRIPSHIELD:
- if (bl->type != BL_PC) //Def reduction
+ if (sd) {
+ int i;
+ if(sd->unstripable_equip&EQP_SHIELD)
+ return 0;
+ i = sd->equip_index[EQI_HAND_L];
+ if (i<0 || !sd->inventory_data[i] ||
+ sd->inventory_data[i]->type != IT_ARMOR)
+ return 0;
+ pc_unequipitem(sd,i,3);
+ } else //Def reduction
val2 = 3*val1;
break;
case SC_STRIPARMOR:
- if (bl->type != BL_PC) //Vit reduction
+ if (sd) {
+ int i;
+ if(sd->unstripable_equip&EQP_ARMOR)
+ return 0;
+ i = sd->equip_index[EQI_ARMOR];
+ if (i<0 || !sd->inventory_data[i])
+ return 0;
+ pc_unequipitem(sd,i,3);
+ } else //Vit reduction
val2 = 8*val1;
break;
case SC_STRIPHELM:
- if (bl->type != BL_PC) //Int reduction
+ if (sd) {
+ int i;
+ if(sd->unstripable_equip&EQP_HELM)
+ return 0;
+ i = sd->equip_index[EQI_HEAD_TOP];
+ if (i<0 || !sd->inventory_data[i])
+ return 0;
+ pc_unequipitem(sd,i,3);
+ } else //Int reduction
val2 = 8*val1;
break;
case SC_AUTOSPELL: