summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-29 18:29:37 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-29 18:29:37 +0000
commit928b5aba634a04f25299dcbd1e355fbc39e28b60 (patch)
tree5460485fc5ccf3109121592e96cbfdf691d20dd2 /src/map
parent54e34e48a57a5b6e056e3f15d78794940a0a05d7 (diff)
downloadhercules-928b5aba634a04f25299dcbd1e355fbc39e28b60.tar.gz
hercules-928b5aba634a04f25299dcbd1e355fbc39e28b60.tar.bz2
hercules-928b5aba634a04f25299dcbd1e355fbc39e28b60.tar.xz
hercules-928b5aba634a04f25299dcbd1e355fbc39e28b60.zip
- 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
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mob.c15
1 files changed, 8 insertions, 7 deletions
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;