conf/map/battle/monster.conf | 3 +++ src/map/battle.c | 1 + src/map/battle.h | 2 ++ src/map/mob.c | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/conf/map/battle/monster.conf b/conf/map/battle/monster.conf index 0f621cf..984ebaa 100644 --- a/conf/map/battle/monster.conf +++ b/conf/map/battle/monster.conf @@ -269,3 +269,6 @@ boss_icewall_walk_block: 1 // only have a range of 9. If you put a number higher than 0, their range will // be increased by that number. monster_eye_range_bonus: 0 + +// Will battleground guardians follow ally players when no targets nearby? +bg_monster_follow_player: true \ No newline at end of file diff --git a/src/map/battle.c b/src/map/battle.c index f257f3c..6276402 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7322,6 +7322,7 @@ static const struct battle_data { { "storage_use_item", &battle_config.storage_use_item, 0, 0, 1, }, { "features/enable_attendance_system", &battle_config.feature_enable_attendance_system,1, 0, 1, }, { "features/feature_attendance_endtime",&battle_config.feature_attendance_endtime, 1, 0, 99999999, }, + { "bg_monster_follow_player", &battle_config.bg_monster_follow_player, 1, 0, 1, }, }; bool battle_set_value_sub(int index, int value) diff --git a/src/map/battle.h b/src/map/battle.h index 998c0b0..d51d736 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -568,6 +568,8 @@ struct Battle_Config { int feature_enable_attendance_system; int feature_attendance_endtime; + + int bg_monster_follow_player; }; /* criteria for battle_config.idletime_critera */ diff --git a/src/map/mob.c b/src/map/mob.c index 070c0ea..4467805 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1639,7 +1639,7 @@ bool mob_ai_sub_hard(struct mob_data *md, int64 tick) { md->state.aggressive = 1; //Restore angry state when no targets are available. /* bg guardians follow allies when no targets nearby */ - if( md->bg_id && mode&MD_CANATTACK ) { + if (battle_config.bg_monster_follow_player && md->bg_id && (mode&MD_CANATTACK)) { if( md->ud.walktimer != INVALID_TIMER ) return true;/* we are already moving */ map->foreachinrange (mob->ai_sub_hard_bg_ally, &md->bl, view_range, BL_PC, md, &tbl, mode);