diff --git a/conf/battle/monster.conf b/conf/battle/monster.conf index 78a4fb2d60..012bb622bd 100644 --- a/conf/battle/monster.conf +++ b/conf/battle/monster.conf @@ -269,8 +269,10 @@ monster_stuck_warning: no // On small-medium sized servers this can cause all monsters like eggs and Fabre/Pupa to metamorph. // To switch it off, set it to 0. mob_nopc_idleskill_rate: 100 +boss_nopc_idleskill_rate: 100 // Rate at which monsters move when there are no players nearby (Note 2) // On official servers monsters always move if they have been spotted once, even if there are no players nearby anymore. // To switch it off, set it to 0. mob_nopc_move_rate: 100 +boss_nopc_move_rate: 100 diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 03b44ca80b..f73495f53d 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -8557,8 +8557,10 @@ static const struct _battle_data { { "feature.equipswitch", &battle_config.feature_equipswitch, 1, 0, 1, }, { "pet_walk_speed", &battle_config.pet_walk_speed, 1, 1, 3, }, { "blacksmith_fame_refine_threshold", &battle_config.blacksmith_fame_refine_threshold,10, 1, MAX_REFINE, }, - { "mob_nopc_idleskill_rate", &battle_config.mob_nopc_idleskill_rate, 100, 0, 100, }, - { "mob_nopc_move_rate", &battle_config.mob_nopc_move_rate, 100, 0, 100, }, + { "mob_nopc_idleskill_rate", &battle_config.mob_nopc_idleskill_rate, 100, 0, 100, }, + { "mob_nopc_move_rate", &battle_config.mob_nopc_move_rate, 100, 0, 100, }, + { "boss_nopc_idleskill_rate", &battle_config.boss_nopc_idleskill_rate, 100, 0, 100, }, + { "boss_nopc_move_rate", &battle_config.boss_nopc_move_rate, 100, 0, 100, }, #include "../custom/battle_config_init.inc" }; diff --git a/src/map/battle.hpp b/src/map/battle.hpp index 3fd0b794ff..e53b07d2ff 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -661,6 +661,8 @@ struct Battle_Config int blacksmith_fame_refine_threshold; int mob_nopc_idleskill_rate; int mob_nopc_move_rate; + int boss_nopc_idleskill_rate; + int boss_nopc_move_rate; #include "../custom/battle_config_struct.inc" }; diff --git a/src/map/mob.cpp b/src/map/mob.cpp index b1258fb2c6..9120b17d83 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -2048,7 +2048,9 @@ static int mob_ai_sub_lazy(struct mob_data *md, va_list args) { // Move probability for mobs away from players // In Aegis, this is 100% for mobs that have been activated by players and none otherwise. - if( mob_is_spotted(md) && rnd()%100 < battle_config.mob_nopc_move_rate ) + if( mob_is_spotted(md) && + ((!status_has_mode(&md->status,MD_STATUS_IMMUNE) && rnd()%100 < battle_config.mob_nopc_move_rate) || + (status_has_mode(&md->status,MD_STATUS_IMMUNE) && rnd()%100 < battle_config.boss_nopc_move_rate))) mob_randomwalk(md, tick); } else if( md->ud.walktimer == INVALID_TIMER ) @@ -2058,7 +2060,9 @@ static int mob_ai_sub_lazy(struct mob_data *md, va_list args) // Probability for mobs far from players from doing their IDLE skill. // In Aegis, this is 100% for mobs that have been activated by players and none otherwise. - if( mob_is_spotted(md) && rnd()%100 < battle_config.mob_nopc_idleskill_rate ) + if( mob_is_spotted(md) && + ((!status_has_mode(&md->status,MD_STATUS_IMMUNE) && rnd()%100 < battle_config.mob_nopc_idleskill_rate) || + (status_has_mode(&md->status,MD_STATUS_IMMUNE) && rnd()%100 < battle_config.boss_nopc_idleskill_rate))) mobskill_use(md, tick, -1); }