summaryrefslogtreecommitdiff
path: root/src/map/mob.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/mob.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/mob.c')
-rw-r--r--src/map/mob.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 286146e5c..32deef2bc 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1162,14 +1162,6 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
}
}
}
- if (md->state.aggressive && md->attacked_id == md->target_id)
- { //No longer aggressive, change to retaliate AI.
- md->state.aggressive = 0;
- if(md->state.skillstate== MSS_ANGRY)
- md->state.skillstate = MSS_BERSERK;
- if(md->state.skillstate== MSS_FOLLOW)
- md->state.skillstate = MSS_RUSH;
- }
//Clear it since it's been checked for already.
md->attacked_id = 0;
}
@@ -1582,8 +1574,18 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage)
{
int char_id = 0, flag = 0;
- if (damage > 0) //Store total damage...
+ if (damage > 0)
+ { //Store total damage...
md->tdmg+=damage;
+ if (md->state.aggressive)
+ { //No longer aggressive, change to retaliate AI.
+ md->state.aggressive = 0;
+ if(md->state.skillstate== MSS_ANGRY)
+ md->state.skillstate = MSS_BERSERK;
+ if(md->state.skillstate== MSS_FOLLOW)
+ md->state.skillstate = MSS_RUSH;
+ }
+ }
if(md->guardian_data && md->guardian_data->number < MAX_GUARDIANS) // guardian hp update [Valaris] (updated by [Skotlex])
md->guardian_data->castle->guardian[md->guardian_data->number].hp = md->status.hp;