summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/mob.c7
-rw-r--r--src/map/status.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 598389b3f..1dbc29757 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -955,16 +955,21 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
{
struct mob_data *md;
struct block_list **target;
+ int mode;
int dist;
nullpo_retr(0, bl);
md=va_arg(ap,struct mob_data *);
target= va_arg(ap,struct block_list**);
+ mode= va_arg(ap,int);
//If can't seek yet, not an enemy, or you can't attack it, skip.
if ((*target) == bl || !status_check_skilluse(&md->bl, bl, 0, 0))
return 0;
+ if ((mode&MD_TARGETWEAK) && status_get_lv(bl) >= md->level+5)
+ return 0;
+
if(battle_check_target(&md->bl,bl,BCT_ENEMY)<=0)
return 0;
@@ -1414,7 +1419,7 @@ static bool mob_ai_sub_hard(struct mob_data *md, unsigned int tick)
if ((!tbl && mode&MD_AGGRESSIVE) || md->state.skillstate == MSS_FOLLOW)
{
- map_foreachinrange (mob_ai_sub_hard_activesearch, &md->bl, view_range, DEFAULT_ENEMY_TYPE(md), md, &tbl);
+ map_foreachinrange (mob_ai_sub_hard_activesearch, &md->bl, view_range, DEFAULT_ENEMY_TYPE(md), md, &tbl, mode);
}
else
if (mode&MD_CHANGECHASE && (md->state.skillstate == MSS_RUSH || md->state.skillstate == MSS_FOLLOW))
diff --git a/src/map/status.h b/src/map/status.h
index f79deca6f..389817a65 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -668,6 +668,7 @@ extern int percentrefinery[5][MAX_REFINE+1]; //The last slot always has a 0% suc
#define MD_ANGRY 0x0800
#define MD_CHANGETARGET_MELEE 0x1000
#define MD_CHANGETARGET_CHASE 0x2000
+#define MD_TARGETWEAK 0x4000
#define MD_MASK 0xFFFF
//Status change option definitions (options are what makes status changes visible to chars