summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-12 21:38:34 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-12 21:38:34 +0000
commitd35733732b5594c7e5da8146157a5d59325f0909 (patch)
tree05921235267062bcc3f5139fd6d9474ee948e88f /src/map/battle.c
parent18bbc8b3983085d0b262422796cb7631f78df287 (diff)
downloadhercules-d35733732b5594c7e5da8146157a5d59325f0909.tar.gz
hercules-d35733732b5594c7e5da8146157a5d59325f0909.tar.bz2
hercules-d35733732b5594c7e5da8146157a5d59325f0909.tar.xz
hercules-d35733732b5594c7e5da8146157a5d59325f0909.zip
- Mobs now by default are "everyone's" enemy, so mobs are able to hit each another.
- Added monster_ai&0x400 to use the previous 'smart' criteria that prevents mobs from fighting each another. - Moved "unsetting" the angry mode from the mob_ai to the mob_damage function, where it'll work regardless of who hits the mob. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9481 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index e315142f9..f82153c37 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3254,11 +3254,23 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
case BL_MOB:
{
TBL_MOB *md = (TBL_MOB*)t_bl;
- if(md->state.killer) //Enable retaliation
- state |= BCT_ENEMY;
-
+
if (!agit_flag && md->guardian_data && md->guardian_data->guild_id)
return 0; //Disable guardians/emperiums owned by Guilds on non-woe times.
+ if(md->state.killer || !(battle_config.mob_ai&0x400))
+ state |= BCT_ENEMY; //By default everyone hates mobs.
+ else
+ { //Smart enemy criteria.
+ if (!md->special_state.ai) { //Normal mobs.
+ if (s_bl->type == BL_MOB && !((TBL_MOB*)s_bl)->special_state.ai)
+ state |= BCT_PARTY; //Normal mobs with no ai are friends.
+ else
+ state |= BCT_ENEMY; //However, all else are enemies.
+ } else {
+ if (s_bl->type == BL_MOB && !((TBL_MOB*)s_bl)->special_state.ai)
+ state |= BCT_ENEMY; //Natural enemy for AI mobs are normal mobs.
+ }
+ }
break;
}
}
@@ -3335,15 +3347,6 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
return 0; //Disable guardians/emperium owned by Guilds on non-woe times.
if(md->state.killer) // Is on a rampage too :D
state |= BCT_ENEMY;
- else if (!md->special_state.ai) { //Normal mobs.
- if (t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai)
- state |= BCT_PARTY; //Normal mobs with no ai are friends.
- else
- state |= BCT_ENEMY; //However, all else are enemies.
- } else {
- if (t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai)
- state |= BCT_ENEMY; //Natural enemy for AI mobs are normal mobs.
- }
break;
}
default: