diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-20 21:41:06 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-20 21:41:06 +0000 |
commit | 918fe275279d2954f0b7a46e91826e4399fa85a0 (patch) | |
tree | 6c0b78bb00de75a699d79036bd167901970d4b71 /src/map | |
parent | 3f1dbbacb312efa167d4239f99e8ca3d06dd2632 (diff) | |
download | hercules-918fe275279d2954f0b7a46e91826e4399fa85a0.tar.gz hercules-918fe275279d2954f0b7a46e91826e4399fa85a0.tar.bz2 hercules-918fe275279d2954f0b7a46e91826e4399fa85a0.tar.xz hercules-918fe275279d2954f0b7a46e91826e4399fa85a0.zip |
- Added monster_ai&16 setting for executing the hard ai on ALL mobs in maps with players instead of just mobs in the vecinity of players.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5687 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/mob.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 23d29b7a1..959a71cf9 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1958,17 +1958,6 @@ static int mob_ai_sub_foreachclient(struct map_session_data *sd,va_list ap) }
/*==========================================
- * Serious processing for mob in PC field of view (interval timer function)
- *------------------------------------------
- */
-static int mob_ai_hard(int tid,unsigned int tick,int id,int data)
-{
- clif_foreachclient(mob_ai_sub_foreachclient,tick);
-
- return 0;
-}
-
-/*==========================================
* Negligent mode MOB AI (PC is not in near)
*------------------------------------------
*/
@@ -1986,6 +1975,10 @@ static int mob_ai_sub_lazy(DBKey key,void * data,va_list app) return 0;
ap = va_arg(app, va_list);
+
+ if (battle_config.mob_ai&32 && map[md->bl.m].users>0)
+ return mob_ai_sub_hard(&md->bl, ap);
+
tick=va_arg(ap,unsigned int);
if(DIFF_TICK(tick,md->last_thinktime)<MIN_MOBTHINKTIME*10)
@@ -2049,6 +2042,21 @@ static int mob_ai_lazy(int tid,unsigned int tick,int id,int data) }
/*==========================================
+ * Serious processing for mob in PC field of view (interval timer function)
+ *------------------------------------------
+ */
+static int mob_ai_hard(int tid,unsigned int tick,int id,int data)
+{
+
+ if (battle_config.mob_ai&32)
+ map_foreachiddb(mob_ai_sub_lazy,tick);
+ else
+ clif_foreachclient(mob_ai_sub_foreachclient,tick);
+
+ return 0;
+}
+
+/*==========================================
* The structure object for item drop with delay
* Since it is only two being able to pass [ int ] a timer function
* Data is put in and passed to this structure object.
|