|
@@ -320,6 +320,7 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
|
|
|
{
|
|
|
int i;
|
|
|
int x,y,dx,dy;
|
|
|
+ unsigned char icewall_walk_block;
|
|
|
uint8 dir;
|
|
|
struct block_list *bl;
|
|
|
struct unit_data *ud;
|
|
@@ -366,19 +367,29 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
|
|
|
dx = dirx[(int)dir];
|
|
|
dy = diry[(int)dir];
|
|
|
|
|
|
+ //Get icewall walk block depending on boss mode (players can't be trapped)
|
|
|
+ if(md && md->status.mode&MD_BOSS)
|
|
|
+ icewall_walk_block = battle_config.boss_icewall_walk_block;
|
|
|
+ else if(md)
|
|
|
+ icewall_walk_block = battle_config.mob_icewall_walk_block;
|
|
|
+ else
|
|
|
+ icewall_walk_block = 0;
|
|
|
+
|
|
|
//Monsters will walk into an icewall from the west and south if they already started walking
|
|
|
if(map_getcell(bl->m,x+dx,y+dy,CELL_CHKNOPASS)
|
|
|
- && (battle_config.icewall_walk_block == 0 || !map_getcell(bl->m,x+dx,y+dy,CELL_CHKICEWALL) || dx < 0 || dy < 0))
|
|
|
+ && (icewall_walk_block == 0 || !map_getcell(bl->m,x+dx,y+dy,CELL_CHKICEWALL) || dx < 0 || dy < 0))
|
|
|
return unit_walktoxy_sub(bl);
|
|
|
|
|
|
//Monsters can only leave icewalls to the west and south
|
|
|
//But if movement fails more than icewall_walk_block times, they can ignore this rule
|
|
|
- if(md && md->walktoxy_fail_count < battle_config.icewall_walk_block && map_getcell(bl->m,x,y,CELL_CHKICEWALL) && (dx > 0 || dy > 0)) {
|
|
|
+ if(md && md->walktoxy_fail_count < icewall_walk_block && map_getcell(bl->m,x,y,CELL_CHKICEWALL) && (dx > 0 || dy > 0)) {
|
|
|
//Needs to be done here so that rudeattack skills are invoked
|
|
|
md->walktoxy_fail_count++;
|
|
|
clif_fixpos(bl);
|
|
|
+ //Monsters in this situation first use a chase skill, then unlock target and then use an idle skill
|
|
|
+ if (!(++ud->walk_count%WALK_SKILL_INTERVAL))
|
|
|
+ mobskill_use(md, tick, -1);
|
|
|
mob_unlocktarget(md, tick);
|
|
|
- //Use idle skill at this point
|
|
|
if (!(++ud->walk_count%WALK_SKILL_INTERVAL))
|
|
|
mobskill_use(md, tick, -1);
|
|
|
return 0;
|
|
@@ -1281,6 +1292,16 @@ int unit_can_move(struct block_list *bl) {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ // Icewall walk block special trapped monster mode
|
|
|
+ if(bl->type == BL_MOB) {
|
|
|
+ struct mob_data *md = BL_CAST(BL_MOB, bl);
|
|
|
+ if(md && ((md->status.mode&MD_BOSS && battle_config.boss_icewall_walk_block == 1 && map_getcell(bl->m,bl->x,bl->y,CELL_CHKICEWALL))
|
|
|
+ || (!(md->status.mode&MD_BOSS) && battle_config.mob_icewall_walk_block == 1 && map_getcell(bl->m,bl->x,bl->y,CELL_CHKICEWALL)))) {
|
|
|
+ md->walktoxy_fail_count = 1; //Make sure rudeattacked skills are invoked
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return 1;
|
|
|
}
|
|
|
|