summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorHercules.ws <Hercules@efficiently.awesome>2014-10-25 18:15:42 +0200
committerHerculesWSAPI <Hercules@efficiently.awesome>2014-10-25 18:15:42 +0200
commit468e13d4d12dadc9b2a1666f6d2303e30cf93d82 (patch)
tree1efd44000ff556d861f1dd5d52f41e22cbf6415c /src/map/mob.c
parenta5c0636f74a2177839aec9153b542afd8c36850a (diff)
downloadhercules-468e13d4d12dadc9b2a1666f6d2303e30cf93d82.tar.gz
hercules-468e13d4d12dadc9b2a1666f6d2303e30cf93d82.tar.bz2
hercules-468e13d4d12dadc9b2a1666f6d2303e30cf93d82.tar.xz
hercules-468e13d4d12dadc9b2a1666f6d2303e30cf93d82.zip
HPM Hooks Update
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index eea1ff18e..eaf8c8468 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1603,7 +1603,7 @@ bool mob_ai_sub_hard(struct mob_data *md, int64 tick) {
//Attempt to attack.
//At this point we know the target is attackable, we just gotta check if the range matches.
- if (battle->check_range(&md->bl, tbl, md->status.rhw.range) && !(md->sc.option&OPTION_HIDE))
+ if (battle->check_range(&md->bl, tbl, md->status.rhw.range) && !(md->sc.option&OPTION_HIDE))
{ //Target within range and able to use normal attack, engage
if (md->ud.target != tbl->id || md->ud.attacktimer == INVALID_TIMER)
{ //Only attack if no more attack delay left
@@ -1624,17 +1624,17 @@ bool mob_ai_sub_hard(struct mob_data *md, int64 tick) {
return true;
}
- //Monsters in berserk state, unable to use normal attacks, will always attempt a skill
- if(md->ud.walktimer == INVALID_TIMER && (md->state.skillstate == MSS_BERSERK || md->state.skillstate == MSS_ANGRY)) {
- if (DIFF_TICK(md->ud.canmove_tick, tick) <= MIN_MOBTHINKTIME && DIFF_TICK(md->ud.canact_tick, tick) < -MIN_MOBTHINKTIME*IDLE_SKILL_INTERVAL)
- { //Only use skill if able to walk on next tick and not used a skill the last second
- mob->skill_use(md, tick, -1);
- }
- }
-
- //Target still in attack range, no need to chase the target
- if(battle->check_range(&md->bl, tbl, md->status.rhw.range))
- return true;
+ //Monsters in berserk state, unable to use normal attacks, will always attempt a skill
+ if(md->ud.walktimer == INVALID_TIMER && (md->state.skillstate == MSS_BERSERK || md->state.skillstate == MSS_ANGRY)) {
+ if (DIFF_TICK(md->ud.canmove_tick, tick) <= MIN_MOBTHINKTIME && DIFF_TICK(md->ud.canact_tick, tick) < -MIN_MOBTHINKTIME*IDLE_SKILL_INTERVAL)
+ { //Only use skill if able to walk on next tick and not used a skill the last second
+ mob->skill_use(md, tick, -1);
+ }
+ }
+
+ //Target still in attack range, no need to chase the target
+ if(battle->check_range(&md->bl, tbl, md->status.rhw.range))
+ return true;
//Out of range...