Adjusted NPC casted skill cast times

* Fixes #2045.
* NPC's that cast skills through script commands unitskilluseid or unitskillusepos with a given cast time will no longer be instant cast.
This commit is contained in:
aleos89 2017-06-22 14:39:05 -04:00
parent 6fc2399df1
commit 2a6277a3dc
2 changed files with 2 additions and 8 deletions

View File

@ -16269,7 +16269,7 @@ int skill_castfix_sc(struct block_list *bl, double time, uint8 flag)
if (time < 0)
return 0;
if (bl->type == BL_MOB)
if (bl->type == BL_MOB || bl->type == BL_NPC)
return (int)time;
if (sc && sc->count) {
@ -16322,7 +16322,7 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16
if (time < 0)
return 0;
if (bl->type == BL_MOB)
if (bl->type == BL_MOB || bl->type == BL_NPC)
return (int)time;
if (fixed < 0 || !battle_config.default_fixed_castrate) // no fixed cast time

View File

@ -1819,9 +1819,6 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
casttime = skill_vfcastfix(src, casttime, skill_id, skill_lv);
#endif
if (src->type == BL_NPC) // NPC-objects do not have cast time
casttime = 0;
if(!ud->state.running) // Need TK_RUN or WUGDASH handler to be done before that, see bugreport:6026
unit_stop_walking(src, 1); // Even though this is not how official works but this will do the trick. bugreport:6829
@ -2034,9 +2031,6 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui
casttime = skill_vfcastfix(src, casttime, skill_id, skill_lv );
#endif
if (src->type == BL_NPC) // NPC-objects do not have cast time
casttime = 0;
ud->state.skillcastcancel = castcancel&&casttime>0?1:0;
if (!sd || sd->skillitem != skill_id || skill_get_cast(skill_id, skill_lv))
ud->canact_tick = tick + max(casttime, max(status_get_amotion(src), battle_config.min_skill_delay_limit)) + SECURITY_CASTTIME;