|
@@ -204,8 +204,9 @@ int unit_teleport_timer(int tid, unsigned int tick, int id, intptr_t data)
|
|
|
*/
|
|
|
int unit_check_start_teleport_timer(struct block_list *sbl)
|
|
|
{
|
|
|
- TBL_PC *msd=NULL;
|
|
|
+ TBL_PC *msd = NULL;
|
|
|
int max_dist = 0;
|
|
|
+
|
|
|
switch(sbl->type) {
|
|
|
case BL_HOM:
|
|
|
case BL_ELEM:
|
|
@@ -216,7 +217,7 @@ int unit_check_start_teleport_timer(struct block_list *sbl)
|
|
|
default:
|
|
|
return 0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
switch(sbl->type) {
|
|
|
case BL_HOM: max_dist = AREA_SIZE; break;
|
|
|
case BL_ELEM: max_dist = MAX_ELEDISTANCE; break;
|
|
@@ -319,17 +320,10 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
|
|
|
return 0;
|
|
|
} else
|
|
|
sd->areanpc_id=0;
|
|
|
- /* WIP disable [Lighta], currently unsuported
|
|
|
- * this was meant to start the timer if the player move but not his slave...
|
|
|
- if(sd->md) unit_check_start_teleport_timer(&sd->md->bl);
|
|
|
- if(sd->ed) unit_check_start_teleport_timer(&sd->ed->bl);
|
|
|
- if(sd->hd) unit_check_start_teleport_timer(&sd->hd->bl);
|
|
|
- if(sd->pd) unit_check_start_teleport_timer(&sd->pd->bl);
|
|
|
- */
|
|
|
pc_cell_basilica(sd);
|
|
|
}
|
|
|
break;
|
|
|
- case BL_MOB: {
|
|
|
+ case BL_MOB:
|
|
|
if( map_getcell(bl->m,x,y,CELL_CHKNPC) ) {
|
|
|
if( npc_touch_areanpc2(md) )
|
|
|
return 0; // Warped
|
|
@@ -349,13 +343,6 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
|
|
|
// Resend walk packet for proper Self Destruction display.
|
|
|
clif_move(ud);
|
|
|
}
|
|
|
- }
|
|
|
- break;
|
|
|
- case BL_HOM:
|
|
|
- case BL_ELEM:
|
|
|
- case BL_PET:
|
|
|
- case BL_MER:
|
|
|
- unit_check_start_teleport_timer(bl);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -469,12 +456,16 @@ int unit_walktoxy( struct block_list *bl, short x, short y, unsigned char flag)
|
|
|
struct unit_data* ud = NULL;
|
|
|
struct status_change* sc = NULL;
|
|
|
struct walkpath_data wpd;
|
|
|
+ TBL_PC *sd = NULL;
|
|
|
|
|
|
nullpo_ret(bl);
|
|
|
|
|
|
ud = unit_bl2ud(bl);
|
|
|
|
|
|
- if( ud == NULL) return 0;
|
|
|
+ if (ud == NULL) return 0;
|
|
|
+
|
|
|
+ if (bl->type == BL_PC)
|
|
|
+ sd = BL_CAST(BL_PC, bl);
|
|
|
|
|
|
path_search(&wpd, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS); // Count walk path cells
|
|
|
#ifdef OFFICIAL_WALKPATH
|
|
@@ -519,7 +510,13 @@ int unit_walktoxy( struct block_list *bl, short x, short y, unsigned char flag)
|
|
|
delete_timer( ud->attacktimer, unit_attack_timer );
|
|
|
ud->attacktimer = INVALID_TIMER;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ // Start timer to recall summon
|
|
|
+ if (sd && sd->md) unit_check_start_teleport_timer(&sd->md->bl);
|
|
|
+ if (sd && sd->ed) unit_check_start_teleport_timer(&sd->ed->bl);
|
|
|
+ if (sd && sd->hd) unit_check_start_teleport_timer(&sd->hd->bl);
|
|
|
+ if (sd && sd->pd) unit_check_start_teleport_timer(&sd->pd->bl);
|
|
|
+
|
|
|
return unit_walktoxy_sub(bl);
|
|
|
}
|
|
|
|
|
@@ -1544,31 +1541,28 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
|
|
|
unit_stop_walking(src,1);// Even though this is not how official works but this will do the trick. bugreport:6829
|
|
|
// In official this is triggered even if no cast time.
|
|
|
clif_skillcasting(src, src->id, target_id, 0,0, skill_id, skill_get_ele(skill_id, skill_lv), casttime);
|
|
|
- if( casttime > 0 || combo ) {
|
|
|
- if (sd && target->type == BL_MOB) {
|
|
|
- TBL_MOB *md = (TBL_MOB*)target;
|
|
|
- mobskill_event(md, src, tick, -1); // Cast targetted skill event.
|
|
|
- if (tstatus->mode&(MD_CASTSENSOR_IDLE|MD_CASTSENSOR_CHASE) &&
|
|
|
- battle_check_target(target, src, BCT_ENEMY) > 0)
|
|
|
- {
|
|
|
- switch (md->state.skillstate) {
|
|
|
- case MSS_RUSH:
|
|
|
- case MSS_FOLLOW:
|
|
|
- if (!(tstatus->mode&MD_CASTSENSOR_CHASE))
|
|
|
- break;
|
|
|
- md->target_id = src->id;
|
|
|
- md->state.aggressive = (tstatus->mode&MD_ANGRY)?1:0;
|
|
|
- md->min_chase = md->db->range3;
|
|
|
+ if (sd && target->type == BL_MOB) {
|
|
|
+ TBL_MOB *md = (TBL_MOB*)target;
|
|
|
+
|
|
|
+ mobskill_event(md, src, tick, -1); // Cast targetted skill event.
|
|
|
+ if (tstatus->mode&(MD_CASTSENSOR_IDLE|MD_CASTSENSOR_CHASE) && battle_check_target(target, src, BCT_ENEMY) > 0) {
|
|
|
+ switch (md->state.skillstate) {
|
|
|
+ case MSS_RUSH:
|
|
|
+ case MSS_FOLLOW:
|
|
|
+ if (!(tstatus->mode&MD_CASTSENSOR_CHASE))
|
|
|
break;
|
|
|
- case MSS_IDLE:
|
|
|
- case MSS_WALK:
|
|
|
- if (!(tstatus->mode&MD_CASTSENSOR_IDLE))
|
|
|
- break;
|
|
|
- md->target_id = src->id;
|
|
|
- md->state.aggressive = (tstatus->mode&MD_ANGRY)?1:0;
|
|
|
- md->min_chase = md->db->range3;
|
|
|
+ md->target_id = src->id;
|
|
|
+ md->state.aggressive = (tstatus->mode&MD_ANGRY)?1:0;
|
|
|
+ md->min_chase = md->db->range3;
|
|
|
+ break;
|
|
|
+ case MSS_IDLE:
|
|
|
+ case MSS_WALK:
|
|
|
+ if (!(tstatus->mode&MD_CASTSENSOR_IDLE))
|
|
|
break;
|
|
|
- }
|
|
|
+ md->target_id = src->id;
|
|
|
+ md->state.aggressive = (tstatus->mode&MD_ANGRY)?1:0;
|
|
|
+ md->min_chase = md->db->range3;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|