diff options
author | dastgir <dastgirpojee@rocketmail.com> | 2014-11-07 05:18:53 -0500 |
---|---|---|
committer | dastgir <dastgirpojee@rocketmail.com> | 2014-11-07 05:18:53 -0500 |
commit | ccfbe13b83f355ac6dbe399adad3bdc3b03a9be0 (patch) | |
tree | 802ec4db18914337aba411965066c70bf793e31b /src | |
parent | 182f11b52116bfca978368d372831594a806debc (diff) | |
parent | cf18e5578f85bc6c368a2ad4d7c746af8687c7f0 (diff) | |
download | hercules-ccfbe13b83f355ac6dbe399adad3bdc3b03a9be0.tar.gz hercules-ccfbe13b83f355ac6dbe399adad3bdc3b03a9be0.tar.bz2 hercules-ccfbe13b83f355ac6dbe399adad3bdc3b03a9be0.tar.xz hercules-ccfbe13b83f355ac6dbe399adad3bdc3b03a9be0.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src')
-rw-r--r-- | src/map/mob.c | 26 | ||||
-rw-r--r-- | src/map/status.h | 1 |
2 files changed, 6 insertions, 21 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 2605b414f..e2cf765ee 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1616,17 +1616,6 @@ bool mob_ai_sub_hard(struct mob_data *md, int64 tick) { { //Only attack if no more attack delay left if(tbl->type == BL_PC) mob->log_damage(md, tbl, 0); //Log interaction (counts as 'attacker' for the exp bonus) - - if( !(mode&MD_RANDOMTARGET) ) - unit->attack(&md->bl,tbl->id,1); - else { // Attack once and find a new random target - int search_size = (view_range < md->status.rhw.range) ? view_range : md->status.rhw.range; - unit->attack(&md->bl,tbl->id, 0); - if ((tbl = battle->get_enemy(&md->bl, DEFAULT_ENEMY_TYPE(md), search_size))) { - md->target_id = tbl->id; - md->min_chase = md->db->range3; - } - } } return true; } @@ -3082,7 +3071,6 @@ int mobskill_use(struct mob_data *md, int64 tick, int event) { struct block_list *bl; struct mob_data *fmd = NULL; int i,j,n; - short skill_target; nullpo_ret(md); nullpo_ret(ms = md->db->skill); @@ -3181,12 +3169,10 @@ int mobskill_use(struct mob_data *md, int64 tick, int event) { if (!flag) continue; //Skill requisite failed to be fulfilled. - //Execute skill - skill_target = (md->db->status.mode&MD_RANDOMTARGET)? MST_RANDOM : ms[i].target; if (skill->get_casttype(ms[i].skill_id) == CAST_GROUND) {//Ground skill. short x, y; - switch (skill_target) { + switch (ms[i].target) { case MST_RANDOM: //Pick a random enemy within skill range. bl = battle->get_enemy(&md->bl, DEFAULT_ENEMY_TYPE(md), skill->get_range2(&md->bl, ms[i].skill_id, ms[i].skill_lv)); @@ -3216,10 +3202,10 @@ int mobskill_use(struct mob_data *md, int64 tick, int event) { x = bl->x; y = bl->y; // Look for an area to cast the spell around... - if (skill_target >= MST_AROUND1 || skill_target >= MST_AROUND5) { - j = skill_target >= MST_AROUND1? - (skill_target-MST_AROUND1) +1: - (skill_target-MST_AROUND5) +1; + if (ms[i].target >= MST_AROUND1 || ms[i].target >= MST_AROUND5) { + j = ms[i].target >= MST_AROUND1? + (ms[i].target-MST_AROUND1) +1: + (ms[i].target-MST_AROUND5) +1; map->search_freecell(&md->bl, md->bl.m, &x, &y, j, j, 3); } md->skill_idx = i; @@ -3232,7 +3218,7 @@ int mobskill_use(struct mob_data *md, int64 tick, int event) { } } else { //Targeted skill - switch (skill_target) { + switch (ms[i].target) { case MST_RANDOM: //Pick a random enemy within skill range. bl = battle->get_enemy(&md->bl, DEFAULT_ENEMY_TYPE(md), skill->get_range2(&md->bl, ms[i].skill_id, ms[i].skill_lv)); diff --git a/src/map/status.h b/src/map/status.h index e96894e9f..aca26b1af 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1600,7 +1600,6 @@ enum e_mode MD_CHANGETARGET_MELEE = 0x1000, MD_CHANGETARGET_CHASE = 0x2000, MD_TARGETWEAK = 0x4000, - MD_RANDOMTARGET = 0x8000, MD_MASK = 0xFFFF, }; |