summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-08 18:35:26 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-08 18:35:26 +0000
commit7a914d6f49d6914143fcfdec3fb11b18c9ff7c47 (patch)
tree8807ddad9a061976152d726c81b44a23a37c8cda /src/map/mob.c
parent5ce123adf879f75d82669f50c5c477fd05020fc9 (diff)
downloadhercules-7a914d6f49d6914143fcfdec3fb11b18c9ff7c47.tar.gz
hercules-7a914d6f49d6914143fcfdec3fb11b18c9ff7c47.tar.bz2
hercules-7a914d6f49d6914143fcfdec3fb11b18c9ff7c47.tar.xz
hercules-7a914d6f49d6914143fcfdec3fb11b18c9ff7c47.zip
- Added mob mode 0x4000, MD_TARGETWEAK: It makes aggro monsters only chase characters whose level is no higher than the monster's +5.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13867 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c7
1 files changed, 6 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))