From 928b5aba634a04f25299dcbd1e355fbc39e28b60 Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 29 Aug 2006 18:29:37 +0000 Subject: - Mobs will now always chase players using hard-path seeks. - monster_ai&1 now only signals whether mobs should update their target cell while chasing more frequently (rather than being state-driven like Aegis) - Changed the defaults of view_range_rate and chase_range_rate to 120 to aproximate better Aegis's view ranges (which are square areas and not circles) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8536 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/map') diff --git a/src/map/mob.c b/src/map/mob.c index e7232a0f9..d217dcf69 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -525,8 +525,8 @@ int mob_spawn_guardian(struct map_session_data *sd,char *mapname, * Reachability to a Specification ID existence place * state indicates type of 'seek' mob should do: * - MSS_LOOT: Looking for item, path must be easy. - * - MSS_RUSH: Chasing attacking player, path is determined by mob_ai&1 - * - MSS_FOLLOW: Initiative/support seek, path must be easy. + * - MSS_RUSH: Chasing attacking player, path is complex + * - MSS_FOLLOW: Initiative/support seek, path is complex *------------------------------------------ */ int mob_can_reach(struct mob_data *md,struct block_list *bl,int range, int state) @@ -537,10 +537,10 @@ int mob_can_reach(struct mob_data *md,struct block_list *bl,int range, int state nullpo_retr(0, bl); switch (state) { case MSS_RUSH: - easy = (battle_config.mob_ai&1?0:1); + case MSS_FOLLOW: + easy = 0; //(battle_config.mob_ai&1?0:1); break; case MSS_LOOT: - case MSS_FOLLOW: default: easy = 1; break; @@ -785,7 +785,8 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap) if (!(battle_config.mob_ai&128) && (*target) && (*target)->type == BL_HOM && bl->type != BL_HOM) return 0; //For some reason Homun targets are never overriden. - if((dist=distance_bl(&md->bl, bl)) < md->db->range2 && + dist = distance_bl(&md->bl, bl); + if(dist < md->db->range2 && ((*target) == NULL || !check_distance_bl(&md->bl, *target, dist)) && battle_check_range(&md->bl,bl,md->db->range2) ) { //Pick closest target? @@ -1215,14 +1216,14 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) md->state.skillstate = md->state.aggressive?MSS_FOLLOW:MSS_RUSH; if (md->ud.walktimer != -1 && md->ud.target == tbl->id && ( - !battle_config.mob_ai&1 || + !(battle_config.mob_ai&1) || check_distance_blxy(tbl, md->ud.to_x, md->ud.to_y, md->status.rhw.range) )) //Current target tile is still within attack range. return 0; //Follow up if (!mob_can_reach(md, tbl, md->min_chase, MSS_RUSH) || - !unit_walktobl(&md->bl, tbl, md->status.rhw.range, 2|(!battle_config.mob_ai&1))) + !unit_walktobl(&md->bl, tbl, md->status.rhw.range, 2)) //Give up. mob_unlocktarget(md,tick); return 0; -- cgit v1.2.3-70-g09d2