diff options
-rw-r--r-- | Changelog-Trunk.txt | 1 | ||||
-rw-r--r-- | src/map/mob.c | 14 | ||||
-rw-r--r-- | src/map/skill.c | 8 | ||||
-rw-r--r-- | src/map/unit.c | 1 |
4 files changed, 11 insertions, 13 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index dd723bf30..a9e82477b 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/05/04
+ * Some clean-ups in the mob_ai [Skotlex]
* Improved atcommand autoloot, now displays droprate in percents and notices
player if autoloot is already on or off. Also simplified the code [Harbin, Kain],
commited by erKURITA
diff --git a/src/map/mob.c b/src/map/mob.c index 9f52cbf7b..46129cd35 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -792,7 +792,7 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap) switch (bl->type)
{
case BL_PC:
- if (((struct map_session_data*)bl)->state.gangsterparadise &&
+ if (((TBL_PC*)bl)->state.gangsterparadise &&
!(status_get_mode(&md->bl)&MD_BOSS))
return 0; //Gangster paradise protection.
case BL_MOB:
@@ -1038,7 +1038,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) int dist;
int mode;
int search_size;
- int view_range, can_move, can_walk;
+ int view_range, can_move;
md = (struct mob_data*)bl;
tick = va_arg(ap, unsigned int);
@@ -1068,8 +1068,6 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) can_move = (mode&MD_CANMOVE)&&unit_can_move(&md->bl);
//Since can_move is false when you are casting or the damage-delay kicks in, some special considerations
- //must be taken to avoid unlocking the target or triggering rude-attacked skills in said cases. [Skotlex]
- can_walk = DIFF_TICK(tick, md->ud.canmove_tick) > 0;
if (md->target_id)
{ //Check validity of current target. [Skotlex]
@@ -1079,7 +1077,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) (md->ud.walktimer != -1 && !check_distance_bl(&md->bl, tbl, md->min_chase)) ||
(
tbl->type == BL_PC && !(mode&MD_BOSS) &&
- ((struct map_session_data*)tbl)->state.gangsterparadise
+ ((TBL_PC*)tbl)->state.gangsterparadise
)) { //Unlock current target.
if (battle_config.mob_ai&8) //Inmediately stop chasing.
mob_stop_walking(md,1);
@@ -1184,6 +1182,10 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) mob_unlocktarget(md,tick);
return 0;
}
+
+ if (!can_move) //Stuck. Wait before walking.
+ return 0;
+
md->state.skillstate = md->state.aggressive?MSS_FOLLOW:MSS_RUSH;
if (md->ud.walktimer != -1 && md->ud.target == tbl->id &&
(
@@ -1222,7 +1224,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) mob_unlocktarget(md,tick);
return 0;
}
- if (!can_move) // 動けない状態にある
+ if (!can_move) //Stuck. Wait before walking.
return 0;
md->state.skillstate = MSS_LOOT; // ルート時スキル使用
if (!unit_walktobl(&md->bl, tbl, 0, 1))
diff --git a/src/map/skill.c b/src/map/skill.c index edf39a2c9..ac9dbcea7 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4340,12 +4340,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in skill_get_time2(skillid, skilllv) * (100-(status_get_int(bl)+status_get_vit(bl))/2)/100,10);
}
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if(dstmd){
- dstmd->attacked_id=0;
- dstmd->target_id=0;
- dstmd->state.skillstate=MSS_IDLE;
- dstmd->next_walktime=tick+rand()%3000+3000;
- }
+ if(dstmd)
+ mob_unlocktarget(dstmd,tick);
break;
case WZ_ESTIMATION: /* モンスタ??報 */
diff --git a/src/map/unit.c b/src/map/unit.c index 227e2bd43..d7613cc02 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -562,7 +562,6 @@ int unit_stop_walking(struct block_list *bl,int type) unit_walktoxy_timer(-1, tick, bl->id, ud->walkpath.path_pos);
}
-// if(md) { md->state.skillstate = MSS_IDLE; }
if(type&0x01)
clif_fixpos(bl);
|