|
@@ -9708,9 +9708,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
|
|
|
// Notify everyone that this char logged in [Skotlex].
|
|
|
map_foreachpc(clif_friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 1);
|
|
|
|
|
|
- // Set the initial idle time
|
|
|
- sd->idletime = last_tick;
|
|
|
-
|
|
|
if (!sd->state.autotrade) { // Don't trigger NPC event or opening vending/buyingstore will be failed
|
|
|
//Login Event
|
|
|
npc_script_event(sd, NPCE_LOGIN);
|
|
@@ -10010,7 +10007,8 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd)
|
|
|
RFIFOPOS(fd, packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0], &x, &y, NULL);
|
|
|
|
|
|
//Set last idle time... [Skotlex]
|
|
|
- sd->idletime = last_tick;
|
|
|
+ if (battle_config.idletime_option&IDLE_WALK)
|
|
|
+ sd->idletime = last_tick;
|
|
|
|
|
|
unit_walktoxy(&sd->bl, x, y, 4);
|
|
|
}
|
|
@@ -10124,6 +10122,9 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
|
|
|
sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
|
|
|
}
|
|
|
|
|
|
+ if (battle_config.idletime_option&IDLE_CHAT)
|
|
|
+ sd->idletime = last_tick;
|
|
|
+
|
|
|
if( sd->gcbind ) {
|
|
|
channel_send(sd->gcbind,sd,message);
|
|
|
return;
|
|
@@ -10158,9 +10159,6 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
|
|
|
map_foreachinrange(npc_chat_sub, &sd->bl, AREA_SIZE, BL_NPC, text, textlen, &sd->bl);
|
|
|
#endif
|
|
|
|
|
|
- // Reset idle time when using normal chat.
|
|
|
- sd->idletime = last_tick;
|
|
|
-
|
|
|
// Chat logging type 'O' / Global Chat
|
|
|
log_chat(LOG_CHAT_GLOBAL, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message);
|
|
|
}
|
|
@@ -10256,6 +10254,9 @@ void clif_parse_Emotion(int fd, struct map_session_data *sd)
|
|
|
}
|
|
|
sd->emotionlasttime = time(NULL);
|
|
|
|
|
|
+ if (battle_config.idletime_option&IDLE_EMOTION)
|
|
|
+ sd->idletime = last_tick;
|
|
|
+
|
|
|
if(battle_config.client_reshuffle_dice && emoticon>=E_DICE1 && emoticon<=E_DICE6) {// re-roll dice
|
|
|
emoticon = rnd()%6+E_DICE1;
|
|
|
}
|
|
@@ -10332,7 +10333,8 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
|
|
|
}
|
|
|
|
|
|
pc_delinvincibletimer(sd);
|
|
|
- sd->idletime = last_tick;
|
|
|
+ if (battle_config.idletime_option&IDLE_ATTACK)
|
|
|
+ sd->idletime = last_tick;
|
|
|
unit_attack(&sd->bl, target_id, action_type != 0);
|
|
|
break;
|
|
|
case 0x02: // sitdown
|
|
@@ -10356,7 +10358,9 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
|
|
|
)) //No sitting during these states either.
|
|
|
break;
|
|
|
|
|
|
- sd->idletime = last_tick;
|
|
|
+ if (battle_config.idletime_option&IDLE_SIT)
|
|
|
+ sd->idletime = last_tick;
|
|
|
+
|
|
|
skill_sit(sd, 1);
|
|
|
pc_setsit(sd);
|
|
|
clif_sitting(&sd->bl);
|
|
@@ -10374,7 +10378,9 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- sd->idletime = last_tick;
|
|
|
+ if (battle_config.idletime_option&IDLE_SIT)
|
|
|
+ sd->idletime = last_tick;
|
|
|
+
|
|
|
pc_setstand(sd);
|
|
|
skill_sit(sd, 0);
|
|
|
clif_standing(&sd->bl);
|
|
@@ -10458,8 +10464,8 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
|
|
|
sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
|
|
|
}
|
|
|
|
|
|
- // Reset idle time when using whisper/main chat.
|
|
|
- sd->idletime = last_tick;
|
|
|
+ if (battle_config.idletime_option&IDLE_CHAT)
|
|
|
+ sd->idletime = last_tick;
|
|
|
|
|
|
// Chat logging type 'W' / Whisper
|
|
|
log_chat(LOG_CHAT_WHISPER, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, target, message);
|
|
@@ -10647,6 +10653,9 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd){
|
|
|
if (!pc_dropitem(sd, item_index, item_amount))
|
|
|
break;
|
|
|
|
|
|
+ if (battle_config.idletime_option&IDLE_DROPITEM)
|
|
|
+ sd->idletime = last_tick;
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -10672,7 +10681,8 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd)
|
|
|
return;
|
|
|
|
|
|
//Whether the item is used or not is irrelevant, the char ain't idle. [Skotlex]
|
|
|
- sd->idletime = last_tick;
|
|
|
+ if (battle_config.idletime_option&IDLE_USEITEM)
|
|
|
+ sd->idletime = last_tick;
|
|
|
n = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-2;
|
|
|
|
|
|
if(n <0 || n >= MAX_INVENTORY)
|
|
@@ -10718,6 +10728,9 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if (battle_config.idletime_option&IDLE_USEITEM)
|
|
|
+ sd->idletime = last_tick;
|
|
|
+
|
|
|
//Client doesn't send the position for ammo.
|
|
|
if(sd->inventory_data[index]->type == IT_AMMO)
|
|
|
pc_equipitem(sd,index,EQP_AMMO);
|
|
@@ -10754,6 +10767,9 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd)
|
|
|
|
|
|
index = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-2;
|
|
|
|
|
|
+ if (battle_config.idletime_option&IDLE_USEITEM)
|
|
|
+ sd->idletime = last_tick;
|
|
|
+
|
|
|
pc_unequipitem(sd,index,1);
|
|
|
}
|
|
|
|
|
@@ -11311,7 +11327,8 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
|
|
|
}
|
|
|
|
|
|
// Whether skill fails or not is irrelevant, the char ain't idle. [Skotlex]
|
|
|
- sd->idletime = last_tick;
|
|
|
+ if (battle_config.idletime_option&IDLE_USESKILLTOID)
|
|
|
+ sd->idletime = last_tick;
|
|
|
|
|
|
if( sd->npc_id ){
|
|
|
#ifdef RENEWAL
|
|
@@ -11411,7 +11428,8 @@ static void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uin
|
|
|
}
|
|
|
|
|
|
//Whether skill fails or not is irrelevant, the char ain't idle. [Skotlex]
|
|
|
- sd->idletime = last_tick;
|
|
|
+ if (battle_config.idletime_option&IDLE_USESKILLTOPOS)
|
|
|
+ sd->idletime = last_tick;
|
|
|
|
|
|
if( skill_isNotOk(skill_id, sd) )
|
|
|
return;
|
|
@@ -12191,8 +12209,8 @@ void clif_parse_PartyMessage(int fd, struct map_session_data* sd){
|
|
|
sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
|
|
|
}
|
|
|
|
|
|
- // Reset idle time when using party chat.
|
|
|
- sd->idletime = last_tick;
|
|
|
+ if (battle_config.idletime_option&IDLE_CHAT)
|
|
|
+ sd->idletime = last_tick;
|
|
|
|
|
|
party_send_message(sd, text, textlen);
|
|
|
}
|
|
@@ -12787,8 +12805,8 @@ void clif_parse_GuildMessage(int fd, struct map_session_data* sd){
|
|
|
sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
|
|
|
}
|
|
|
|
|
|
- // Reset idle time when using guild chat.
|
|
|
- sd->idletime = last_tick;
|
|
|
+ if (battle_config.idletime_option&IDLE_CHAT)
|
|
|
+ sd->idletime = last_tick;
|
|
|
|
|
|
if( sd->bg_id )
|
|
|
bg_send_message(sd, text, textlen);
|
|
@@ -15789,8 +15807,8 @@ void clif_parse_BattleChat(int fd, struct map_session_data* sd){
|
|
|
sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
|
|
|
}
|
|
|
|
|
|
- // Reset idle time when using battleground chat.
|
|
|
- sd->idletime = last_tick;
|
|
|
+ if (battle_config.idletime_option&IDLE_CHAT)
|
|
|
+ sd->idletime = last_tick;
|
|
|
|
|
|
bg_send_message(sd, text, textlen);
|
|
|
}
|