|
@@ -46,12 +46,6 @@ using namespace rathena;
|
|
|
|
|
|
#define IDLE_SKILL_INTERVAL 10 //Active idle skills should be triggered every 1 second (1000/MIN_MOBTHINKTIME)
|
|
|
|
|
|
-// Probability for mobs far from players from doing their IDLE skill. (rate of 1000 minute)
|
|
|
-// in Aegis, this is 100% for mobs that have been activated by players and none otherwise.
|
|
|
-#define MOB_LAZYSKILLPERC(md) (mob_is_spotted(md)?1000:0)
|
|
|
-// Move probability for mobs away from players (rate of 1000 minute)
|
|
|
-// in Aegis, this is 100% for mobs that have been activated by players and none otherwise.
|
|
|
-#define MOB_LAZYMOVEPERC(md) (mob_is_spotted(md)?1000:0)
|
|
|
const t_tick MOB_MAX_DELAY = 24 * 3600 * 1000;
|
|
|
#define MAX_MINCHASE 30 //Max minimum chase value to use for mobs.
|
|
|
#define RUDE_ATTACKED_COUNT 1 //After how many rude-attacks should the skill be used?
|
|
@@ -2052,14 +2046,19 @@ static int mob_ai_sub_lazy(struct mob_data *md, va_list args)
|
|
|
|
|
|
if( DIFF_TICK(md->next_walktime,tick) < 0 && status_has_mode(&md->status,MD_CANMOVE) && unit_can_move(&md->bl) )
|
|
|
{
|
|
|
- if( rnd()%1000 < MOB_LAZYMOVEPERC(md) )
|
|
|
+ // 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 )
|
|
|
mob_randomwalk(md, tick);
|
|
|
}
|
|
|
else if( md->ud.walktimer == INVALID_TIMER )
|
|
|
{
|
|
|
//Because it is not unset when the mob finishes walking.
|
|
|
md->state.skillstate = MSS_IDLE;
|
|
|
- if( rnd()%1000 < MOB_LAZYSKILLPERC(md) ) //Chance to do a mob's idle skill.
|
|
|
+
|
|
|
+ // 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 )
|
|
|
mobskill_use(md, tick, -1);
|
|
|
}
|
|
|
|