summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c69
1 files changed, 34 insertions, 35 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 0e1d11e35..ff78a8f3f 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3675,11 +3675,11 @@ int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tic
sc = status_get_sc(dst);
if(sc && sc->count) {
- if(type != 4 && dst->type == BL_PC && sc->data[SC_ENDURE].timer != -1 && !map_flag_gvg(dst->m))
+ if(type != 4 && dst->type == BL_PC && sc->data[SC_ENDURE] && !map_flag_gvg(dst->m))
type = 9;
- if(sc->data[SC_HALLUCINATION].timer != -1) {
- if(damage > 0) damage = damage*(5+sc->data[SC_HALLUCINATION].val1) + rand()%100;
- if(damage2 > 0) damage2 = damage2*(5+sc->data[SC_HALLUCINATION].val1) + rand()%100;
+ if(sc->data[SC_HALLUCINATION]) {
+ if(damage) damage = damage*(sc->data[SC_HALLUCINATION]->val2) + rand()%100;
+ if(damage2) damage2 = damage2*(sc->data[SC_HALLUCINATION]->val2) + rand()%100;
}
}
@@ -4246,10 +4246,10 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int
sc = status_get_sc(dst);
if(sc && sc->count) {
- if(type != 4 && dst->type == BL_PC && sc->data[SC_ENDURE].timer != -1 && !map_flag_gvg(dst->m))
+ if(type != 4 && dst->type == BL_PC && sc->data[SC_ENDURE] && !map_flag_gvg(dst->m))
type = 9;
- if(sc->data[SC_HALLUCINATION].timer != -1 && damage > 0)
- damage = damage*(5+sc->data[SC_HALLUCINATION].val1) + rand()%100;
+ if(sc->data[SC_HALLUCINATION] && damage)
+ damage = damage*(sc->data[SC_HALLUCINATION]->val2) + rand()%100;
}
#if PACKETVER < 3
@@ -4337,8 +4337,8 @@ int clif_skill_damage2(struct block_list *src,struct block_list *dst,unsigned in
sc = status_get_sc(dst);
if(sc && sc->count) {
- if(sc->data[SC_HALLUCINATION].timer != -1 && damage > 0)
- damage = damage*(5+sc->data[SC_HALLUCINATION].val1) + rand()%100;
+ if(sc->data[SC_HALLUCINATION] && damage)
+ damage = damage*(sc->data[SC_HALLUCINATION]->val2) + rand()%100;
}
WBUFW(buf,0)=0x115;
@@ -8084,7 +8084,7 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd)
else if (pc_cant_act(sd))
return;
- if(sd->sc.count && sd->sc.data[SC_RUN].timer != -1)
+ if(sd->sc.data[SC_RUN])
return;
pc_delinvincibletimer(sd);
@@ -8109,7 +8109,7 @@ void clif_parse_QuitGame(int fd, struct map_session_data *sd)
WFIFOW(fd,0) = 0x18b;
/* Rovert's prevent logout option fixed [Valaris] */
- if (sd->sc.data[SC_CLOAKING].timer==-1 && sd->sc.data[SC_HIDING].timer==-1 &&
+ if (!sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] &&
(!battle_config.prevent_logout || DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout)
) {
clif_setwaitclose(fd);
@@ -8176,7 +8176,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
if( is_atcommand(fd, sd, message) || is_charcommand(fd, sd, message) )
return;
- if( sd->sc.data[SC_BERSERK].timer != -1 || (sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT) )
+ if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
return;
if( battle_config.min_chat_delay )
@@ -8355,9 +8355,9 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
}
if (sd->sc.count &&
- (sd->sc.data[SC_TRICKDEAD].timer != -1 ||
- sd->sc.data[SC_AUTOCOUNTER].timer != -1 ||
- sd->sc.data[SC_BLADESTOP].timer != -1))
+ (sd->sc.data[SC_TRICKDEAD] ||
+ sd->sc.data[SC_AUTOCOUNTER] ||
+ sd->sc.data[SC_BLADESTOP]))
return;
pc_stop_walking(sd, 1);
@@ -8404,8 +8404,8 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
break;
if (sd->sc.count && (
- sd->sc.data[SC_DANCING].timer != -1 ||
- (sd->sc.data[SC_GRAVITATION].timer != -1 && sd->sc.data[SC_GRAVITATION].val3 == BCT_SELF)
+ sd->sc.data[SC_DANCING] ||
+ (sd->sc.data[SC_GRAVITATION] && sd->sc.data[SC_GRAVITATION]->val3 == BCT_SELF)
)) //No sitting during these states either.
break;
@@ -8487,7 +8487,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
if (is_atcommand(fd, sd, message) || is_charcommand(fd, sd, message) )
return;
- if (sd->sc.data[SC_BERSERK].timer!=-1 || (sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT))
+ if (sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT))
return;
if (battle_config.min_chat_delay)
@@ -8665,9 +8665,9 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd)
break;
if(sd->sc.count && (
- sd->sc.data[SC_TRICKDEAD].timer != -1 ||
- sd->sc.data[SC_BLADESTOP].timer != -1 ||
- (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOITEM))
+ sd->sc.data[SC_TRICKDEAD] ||
+ sd->sc.data[SC_BLADESTOP] ||
+ (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOITEM))
)
break;
@@ -8696,9 +8696,9 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd)
return;
if (sd->sc.count && (
- sd->sc.data[SC_AUTOCOUNTER].timer != -1 ||
- sd->sc.data[SC_BLADESTOP].timer != -1 ||
- (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOITEM)
+ sd->sc.data[SC_AUTOCOUNTER] ||
+ sd->sc.data[SC_BLADESTOP] ||
+ (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOITEM)
))
return;
@@ -8768,7 +8768,7 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd)
else if (pc_cant_act(sd))
return;
- if(sd->sc.data[SC_BLADESTOP].timer!=-1 || sd->sc.data[SC_BERSERK].timer!=-1 )
+ if(sd->sc.data[SC_BLADESTOP] || sd->sc.data[SC_BERSERK])
return;
if(!sd->status.inventory[index].identify) {
@@ -8916,7 +8916,7 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd)
char s_title[CHATROOM_TITLE_SIZE];
char s_password[CHATROOM_PASS_SIZE];
- if (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOROOM)
+ if (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM)
return;
if(battle_config.basic_skill_check && pc_checkskill(sd,NV_BASIC) < 4) {
clif_skill_fail(sd,1,0,3);
@@ -9241,10 +9241,10 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
sd->skillitem = sd->skillitemlv = 0;
if (skillnum == MO_EXTREMITYFIST) {
- if ((sd->sc.data[SC_COMBO].timer == -1 ||
- (sd->sc.data[SC_COMBO].val1 != MO_COMBOFINISH &&
- sd->sc.data[SC_COMBO].val1 != CH_TIGERFIST &&
- sd->sc.data[SC_COMBO].val1 != CH_CHAINCRUSH))) {
+ if ((!sd->sc.data[SC_COMBO] ||
+ (sd->sc.data[SC_COMBO]->val1 != MO_COMBOFINISH &&
+ sd->sc.data[SC_COMBO]->val1 != CH_TIGERFIST &&
+ sd->sc.data[SC_COMBO]->val1 != CH_CHAINCRUSH))) {
if (!sd->state.skill_flag ) {
sd->state.skill_flag = 1;
clif_skillinfo(sd, MO_EXTREMITYFIST, INF_ATTACK_SKILL, -1);
@@ -9256,8 +9256,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
}
}
if (skillnum == TK_JUMPKICK) {
- if (sd->sc.data[SC_COMBO].timer == -1 ||
- sd->sc.data[SC_COMBO].val1 != TK_JUMPKICK) {
+ if (!sd->sc.data[SC_COMBO] || sd->sc.data[SC_COMBO]->val1 != TK_JUMPKICK) {
if (!sd->state.skill_flag ) {
sd->state.skill_flag = 1;
clif_skillinfo(sd, TK_JUMPKICK, INF_ATTACK_SKILL, -1);
@@ -9893,7 +9892,7 @@ void clif_parse_PartyMessage(int fd, struct map_session_data* sd)
if( is_atcommand(fd, sd, message) || is_charcommand(fd, sd, message) )
return;
- if( sd->sc.data[SC_BERSERK].timer!=-1 || (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT) )
+ if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
return;
if( battle_config.min_chat_delay )
@@ -9950,7 +9949,7 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd)
bool flag = (bool)RFIFOB(fd,84);
const uint8* data = (uint8*)RFIFOP(fd,85);
- if( sd->sc.data[SC_NOCHAT].timer != -1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOROOM )
+ if( sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM )
return;
if( map[sd->bl.m].flag.novending || map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOVENDING) ) {
clif_displaymessage (sd->fd, msg_txt(276)); // "You can't open shop on this map"
@@ -10165,7 +10164,7 @@ void clif_parse_GuildMessage(int fd, struct map_session_data* sd)
if( is_atcommand(fd, sd, message) || is_charcommand(fd, sd, message) )
return;
- if( sd->sc.data[SC_BERSERK].timer!=-1 || (sd->sc.data[SC_NOCHAT].timer!=-1 && sd->sc.data[SC_NOCHAT].val1&MANNER_NOCHAT) )
+ if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
return;
if( battle_config.min_chat_delay )