Added independent idle time and settings for homunculus share (#4761)

* Follow up to 921b3e2c3e
This commit is contained in:
Daegaladh
2020-04-27 20:21:22 +02:00
committed by GitHub
parent 286645d850
commit ca56c060cf
9 changed files with 75 additions and 6 deletions

View File

@@ -10242,6 +10242,8 @@ static bool clif_process_message(struct map_session_data* sd, bool whisperFormat
if (battle_config.idletime_option&IDLE_CHAT)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_CHAT)
sd->idletime_hom = last_tick;
return true;
}
@@ -11018,6 +11020,8 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd)
//Set last idle time... [Skotlex]
if (battle_config.idletime_option&IDLE_WALK)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_WALK)
sd->idletime_hom = last_tick;
unit_walktoxy(&sd->bl, x, y, 4);
}
@@ -11232,6 +11236,8 @@ void clif_parse_Emotion(int fd, struct map_session_data *sd)
if (battle_config.idletime_option&IDLE_EMOTION)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_EMOTION)
sd->idletime_hom = last_tick;
if (sd->state.block_action & PCBLOCK_EMOTION) {
clif_skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 1);
@@ -11316,6 +11322,8 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
pc_delinvincibletimer(sd);
if (battle_config.idletime_option&IDLE_ATTACK)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_ATTACK)
sd->idletime_hom = last_tick;
unit_attack(&sd->bl, target_id, action_type != 0);
break;
case 0x02: // sitdown
@@ -11346,6 +11354,8 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
if (battle_config.idletime_option&IDLE_SIT)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_SIT)
sd->idletime_hom = last_tick;
pc_setsit(sd);
skill_sit(sd, true);
@@ -11369,6 +11379,8 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
if (pc_setstand(sd, false)) {
if (battle_config.idletime_option&IDLE_SIT)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_SIT)
sd->idletime_hom = last_tick;
skill_sit(sd, false);
clif_standing(&sd->bl);
}
@@ -11626,6 +11638,8 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd){
if (battle_config.idletime_option&IDLE_DROPITEM)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_DROPITEM)
sd->idletime_hom = last_tick;
return;
}
@@ -11656,6 +11670,8 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd)
//Whether the item is used or not is irrelevant, the char ain't idle. [Skotlex]
if (battle_config.idletime_option&IDLE_USEITEM)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_USEITEM)
sd->idletime_hom = last_tick;
n = RFIFOW(fd,packet_db[RFIFOW(fd,0)].pos[0])-2;
if(n <0 || n >= MAX_INVENTORY)
@@ -11703,6 +11719,8 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd)
if (battle_config.idletime_option&IDLE_USEITEM)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_USEITEM)
sd->idletime_hom = last_tick;
//Client doesn't send the position for ammo.
if(sd->inventory_data[index]->type == IT_AMMO)
@@ -11742,6 +11760,8 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd)
if (battle_config.idletime_option&IDLE_USEITEM)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_USEITEM)
sd->idletime_hom = last_tick;
pc_unequipitem(sd,index,1);
}
@@ -12391,6 +12411,8 @@ void clif_parse_skill_toid( struct map_session_data* sd, uint16 skill_id, uint16
// This is done here, because homunculi and mercenaries can be triggered by AI and not by the player itself
if (battle_config.idletime_option&IDLE_USESKILLTOID)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_USESKILLTOID)
sd->idletime_hom = last_tick;
if( sd->npc_id ){
if( pc_hasprogress( sd, WIP_DISABLE_SKILLITEM ) || !sd->npc_item_flag || !( inf & INF_SELF_SKILL ) ){
@@ -12519,6 +12541,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]
if (battle_config.idletime_option&IDLE_USESKILLTOPOS)
sd->idletime = last_tick;
if (battle_config.hom_idle_no_share && sd->hd && battle_config.idletime_hom_option&IDLE_USESKILLTOPOS)
sd->idletime_hom = last_tick;
if( skill_isNotOk(skill_id, sd) )
return;