summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorpanikon <panikon@zoho.com>2014-07-10 02:02:59 -0300
committerpanikon <panikon@zoho.com>2014-07-10 02:02:59 -0300
commit9dd6ee636b783f1cd57b1be3d02fcc9782ebe2c3 (patch)
treeb633ab7d298a279b21d1cc0fafe8884deccd30f8 /src/map/clif.c
parent222345170f781b0cc19dfb99e0820098097a1254 (diff)
downloadhercules-9dd6ee636b783f1cd57b1be3d02fcc9782ebe2c3.tar.gz
hercules-9dd6ee636b783f1cd57b1be3d02fcc9782ebe2c3.tar.bz2
hercules-9dd6ee636b783f1cd57b1be3d02fcc9782ebe2c3.tar.xz
hercules-9dd6ee636b783f1cd57b1be3d02fcc9782ebe2c3.zip
Corrected some SC behaviour, special thanks to Rytech
- Extracted some methods to check SC blocks - Fixed issue that when players couldn't attack they couldn't talk to NPCs with mob view id either Follow up to ec51176326c6028630835538db67826281d34ffe, fixed minor typo
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 8ddae3326..750689816 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9866,7 +9866,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
if( atcommand->exec(fd, sd, message, true) )
return;
- if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_DEEP_SLEEP] && sd->sc.data[SC_DEEP_SLEEP]->val2) || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) )
+ if( !pc->can_talk(sd) )
return;
if( battle_config.min_chat_delay ) { //[Skotlex]
@@ -10113,14 +10113,14 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
return;
}
- if (sd->sc.count &&
- (sd->sc.data[SC_TRICKDEAD] ||
- (sd->sc.data[SC_AUTOCOUNTER] && action_type != 0x07) ||
- sd->sc.data[SC_BLADESTOP] ||
- sd->sc.data[SC_DEEP_SLEEP] ||
- sd->sc.data[SC__MANHOLE] ||
- sd->sc.data[SC_CURSEDCIRCLE_ATKER] ||
- sd->sc.data[SC_CURSEDCIRCLE_TARGET] ))
+ // Statuses that don't let the player sit / attack / talk with NPCs(targeted)
+ // (not all are included in pc_can_attack)
+ if( sd->sc.count && (
+ sd->sc.data[SC_TRICKDEAD] ||
+ (sd->sc.data[SC_AUTOCOUNTER] && action_type != 0x07) ||
+ sd->sc.data[SC_BLADESTOP] ||
+ sd->sc.data[SC_DEEP_SLEEP] )
+ )
return;
pc_stop_walking(sd, 1);
@@ -10144,10 +10144,6 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
if( sd->sc.option&OPTION_COSTUME )
return;
- if( sd->sc.data[SC_BASILICA] || sd->sc.data[SC__SHADOWFORM] ||
- (sd->sc.data[SC_SIREN] && sd->sc.data[SC_SIREN]->val2 == target_id) )
- return;
-
if (!battle_config.sdelay_attack_enable && pc->checkskill(sd, SA_FREECAST) <= 0) {
if (DIFF_TICK(tick, sd->ud.canact_tick) < 0) {
clif->skill_fail(sd, 1, USESKILL_FAIL_SKILLINTERVAL, 0);
@@ -10379,7 +10375,8 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
if ( atcommand->exec(fd, sd, message, true) )
return;
- if (sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_DEEP_SLEEP] && sd->sc.data[SC_DEEP_SLEEP]->val2) || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT))
+ // Statuses that prevent the player from whispering
+ if( !pc->can_talk(sd) )
return;
if (battle_config.min_chat_delay) { //[Skotlex]