diff --git a/conf/battle/misc.conf b/conf/battle/misc.conf index 1a3b8bb7e0..5850705ef9 100644 --- a/conf/battle/misc.conf +++ b/conf/battle/misc.conf @@ -114,6 +114,9 @@ at_timeout: 0 // Makes player cannot be attacked when autotrade? (turns player's state.monster_ignore) (Note 1) at_monsterignore: no +// Should autotrade trigger OnPCLogout script events? (Note 1) +at_logout_event: yes + // Auction system, fee per hour. Default is 12000 auction_feeperhour: 12000 diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index a2a4cac2bd..81a8bc4690 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -6100,6 +6100,9 @@ ACMD_FUNC(autotrade) { status_change_start(NULL,&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, SCSTART_NONE); } + if (battle_config.at_logout_event) + npc_script_event(sd, NPCE_LOGOUT); //Logout Event + channel_pcquit(sd,0xF); //leave all chan clif_authfail_fd(sd->fd, 15); diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 59bba863e7..b897ba54cd 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -8996,6 +8996,7 @@ static const struct _battle_data { { "show_skill_scale", &battle_config.show_skill_scale, 1, 0, 1, }, { "achievement_mob_share", &battle_config.achievement_mob_share, 0, 0, 1, }, { "slave_stick_with_master", &battle_config.slave_stick_with_master, 0, 0, 1, }, + { "at_logout_event", &battle_config.at_logout_event, 1, 0, 1, }, #include "../custom/battle_config_init.inc" }; diff --git a/src/map/battle.hpp b/src/map/battle.hpp index 7dd451f468..363f119d50 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -684,6 +684,7 @@ struct Battle_Config int show_skill_scale; int achievement_mob_share; int slave_stick_with_master; + int at_logout_event; #include "../custom/battle_config_struct.inc" };