|
@@ -1920,7 +1920,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
|
|
if (ud) {
|
|
if (ud) {
|
|
rate = skill_delayfix(src, skill, skill_lv);
|
|
rate = skill_delayfix(src, skill, skill_lv);
|
|
if (DIFF_TICK(ud->canact_tick, tick + rate) < 0){
|
|
if (DIFF_TICK(ud->canact_tick, tick + rate) < 0){
|
|
- ud->canact_tick = tick+rate;
|
|
|
|
|
|
+ ud->canact_tick = max(tick + rate, ud->canact_tick);
|
|
if ( battle_config.display_status_timers )
|
|
if ( battle_config.display_status_timers )
|
|
clif_status_change(src, SI_ACTIONDELAY, 1, rate, 0, 0, 0);
|
|
clif_status_change(src, SI_ACTIONDELAY, 1, rate, 0, 0, 0);
|
|
}
|
|
}
|
|
@@ -2014,7 +2014,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
|
|
if (ud) {
|
|
if (ud) {
|
|
rate = skill_delayfix(src, skill, autospl_skill_lv);
|
|
rate = skill_delayfix(src, skill, autospl_skill_lv);
|
|
if (DIFF_TICK(ud->canact_tick, tick + rate) < 0){
|
|
if (DIFF_TICK(ud->canact_tick, tick + rate) < 0){
|
|
- ud->canact_tick = tick+rate;
|
|
|
|
|
|
+ ud->canact_tick = max(tick + rate, ud->canact_tick);
|
|
if ( battle_config.display_status_timers && sd )
|
|
if ( battle_config.display_status_timers && sd )
|
|
clif_status_change(src, SI_ACTIONDELAY, 1, rate, 0, 0, 0);
|
|
clif_status_change(src, SI_ACTIONDELAY, 1, rate, 0, 0, 0);
|
|
}
|
|
}
|
|
@@ -2348,7 +2348,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
|
|
if (ud) {
|
|
if (ud) {
|
|
autospl_rate = skill_delayfix(bl, autospl_skill_id, autospl_skill_lv);
|
|
autospl_rate = skill_delayfix(bl, autospl_skill_id, autospl_skill_lv);
|
|
if (DIFF_TICK(ud->canact_tick, tick + autospl_rate) < 0){
|
|
if (DIFF_TICK(ud->canact_tick, tick + autospl_rate) < 0){
|
|
- ud->canact_tick = tick+autospl_rate;
|
|
|
|
|
|
+ ud->canact_tick = max(tick + autospl_rate, ud->canact_tick);
|
|
if ( battle_config.display_status_timers && dstsd )
|
|
if ( battle_config.display_status_timers && dstsd )
|
|
clif_status_change(bl, SI_ACTIONDELAY, 1, autospl_rate, 0, 0, 0);
|
|
clif_status_change(bl, SI_ACTIONDELAY, 1, autospl_rate, 0, 0, 0);
|
|
}
|
|
}
|
|
@@ -3930,7 +3930,7 @@ static int skill_timerskill(int tid, unsigned int tick, int id, intptr_t data)
|
|
// Official behaviour is to hit as long as there is a line of sight, regardless of distance
|
|
// Official behaviour is to hit as long as there is a line of sight, regardless of distance
|
|
if (skl->type > 0 && !status_isdead(target) && path_search_long(NULL,src->m,src->x,src->y,target->x,target->y,CELL_CHKWALL)) {
|
|
if (skl->type > 0 && !status_isdead(target) && path_search_long(NULL,src->m,src->x,src->y,target->x,target->y,CELL_CHKWALL)) {
|
|
// Apply canact delay here to prevent hacks (unlimited casting)
|
|
// Apply canact delay here to prevent hacks (unlimited casting)
|
|
- ud->canact_tick = tick + skill_delayfix(src, skl->skill_id, skl->skill_lv);
|
|
|
|
|
|
+ ud->canact_tick = max(tick + status_get_amotion(src), ud->canact_tick);
|
|
skill_attack(BF_MAGIC, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag);
|
|
skill_attack(BF_MAGIC, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag);
|
|
}
|
|
}
|
|
if (unit && !status_isdead(target) && !status_isdead(src)) {
|
|
if (unit && !status_isdead(target) && !status_isdead(src)) {
|
|
@@ -5231,7 +5231,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- sd->ud.canact_tick = tick + skill_delayfix(src, pres_skill_id, pres_skill_lv);
|
|
|
|
|
|
+ sd->ud.canact_tick = max(tick + skill_delayfix(src, pres_skill_id, pres_skill_lv), sd->ud.canact_tick);
|
|
clif_status_change(src, SI_ACTIONDELAY, 1, skill_delayfix(src, pres_skill_id, pres_skill_lv), 0, 0, 0);
|
|
clif_status_change(src, SI_ACTIONDELAY, 1, skill_delayfix(src, pres_skill_id, pres_skill_lv), 0, 0, 0);
|
|
|
|
|
|
cooldown = pc_get_skillcooldown(sd,pres_skill_id, pres_skill_lv);
|
|
cooldown = pc_get_skillcooldown(sd,pres_skill_id, pres_skill_lv);
|
|
@@ -5721,22 +5721,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
|
|
|
|
|
|
if( sd && !(flag&1) )
|
|
if( sd && !(flag&1) )
|
|
{// ensure that the skill last-cast tick is recorded
|
|
{// ensure that the skill last-cast tick is recorded
|
|
- tick = gettick();
|
|
|
|
- switch (skill_id) {
|
|
|
|
- //These skill don't call skill_attack right away and allow to cast a second spell before the first skill deals damage
|
|
|
|
- case WZ_JUPITEL:
|
|
|
|
- case WZ_WATERBALL:
|
|
|
|
- //Only allow the double-cast trick every 2000ms to prevent hacks
|
|
|
|
- if (DIFF_TICK(tick, sd->canskill_tick) > 2000) {
|
|
|
|
- sd->ud.canact_tick = tick;
|
|
|
|
- sd->canskill_tick = tick-2000+TIMERSKILL_INTERVAL;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- //Fall through
|
|
|
|
- default:
|
|
|
|
- sd->canskill_tick = tick;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ sd->canskill_tick = gettick();
|
|
|
|
|
|
if( sd->state.arrow_atk )
|
|
if( sd->state.arrow_atk )
|
|
{// consume arrow on last invocation to this skill.
|
|
{// consume arrow on last invocation to this skill.
|
|
@@ -10999,8 +10984,8 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
|
|
if (ud->walktimer != INVALID_TIMER && ud->skill_id != TK_RUN && ud->skill_id != RA_WUGDASH)
|
|
if (ud->walktimer != INVALID_TIMER && ud->skill_id != TK_RUN && ud->skill_id != RA_WUGDASH)
|
|
unit_stop_walking(src,1);
|
|
unit_stop_walking(src,1);
|
|
|
|
|
|
- if( !sd || sd->skillitem != ud->skill_id || skill_get_delay(ud->skill_id,ud->skill_lv) )
|
|
|
|
- ud->canact_tick = tick + skill_delayfix(src, ud->skill_id, ud->skill_lv); //Tests show wings don't overwrite the delay but skill scrolls do. [Inkfish]
|
|
|
|
|
|
+ if (!sd || sd->skillitem != ud->skill_id || skill_get_delay(ud->skill_id, ud->skill_lv))
|
|
|
|
+ ud->canact_tick = max(tick + skill_delayfix(src, ud->skill_id, ud->skill_lv), ud->canact_tick - SECURITY_CASTTIME);
|
|
if (sd) { //Cooldown application
|
|
if (sd) { //Cooldown application
|
|
int cooldown = pc_get_skillcooldown(sd,ud->skill_id, ud->skill_lv); // Increases/Decreases cooldown of a skill by item/card bonuses.
|
|
int cooldown = pc_get_skillcooldown(sd,ud->skill_id, ud->skill_lv); // Increases/Decreases cooldown of a skill by item/card bonuses.
|
|
if(cooldown) skill_blockpc_start(sd, ud->skill_id, cooldown);
|
|
if(cooldown) skill_blockpc_start(sd, ud->skill_id, cooldown);
|
|
@@ -11228,8 +11213,8 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data)
|
|
if (ud->walktimer != INVALID_TIMER)
|
|
if (ud->walktimer != INVALID_TIMER)
|
|
unit_stop_walking(src,1);
|
|
unit_stop_walking(src,1);
|
|
|
|
|
|
- if( !sd || sd->skillitem != ud->skill_id || skill_get_delay(ud->skill_id,ud->skill_lv) )
|
|
|
|
- ud->canact_tick = tick + skill_delayfix(src, ud->skill_id, ud->skill_lv);
|
|
|
|
|
|
+ if (!sd || sd->skillitem != ud->skill_id || skill_get_delay(ud->skill_id, ud->skill_lv))
|
|
|
|
+ ud->canact_tick = max(tick + skill_delayfix(src, ud->skill_id, ud->skill_lv), ud->canact_tick - SECURITY_CASTTIME);
|
|
if (sd) { //Cooldown application
|
|
if (sd) { //Cooldown application
|
|
int cooldown = pc_get_skillcooldown(sd,ud->skill_id, ud->skill_lv);
|
|
int cooldown = pc_get_skillcooldown(sd,ud->skill_id, ud->skill_lv);
|
|
if(cooldown) skill_blockpc_start(sd, ud->skill_id, cooldown);
|
|
if(cooldown) skill_blockpc_start(sd, ud->skill_id, cooldown);
|
|
@@ -16233,9 +16218,6 @@ int skill_delayfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
|
|
if (battle_config.delay_rate != 100)
|
|
if (battle_config.delay_rate != 100)
|
|
time = time * battle_config.delay_rate / 100;
|
|
time = time * battle_config.delay_rate / 100;
|
|
|
|
|
|
- //min delay
|
|
|
|
- time = max(time, status_get_amotion(bl)); // Delay can never be below amotion [Playtester]
|
|
|
|
- time = max(time, battle_config.min_skill_delay_limit);
|
|
|
|
//ShowInfo("Delay delayfix = %d\n",time);
|
|
//ShowInfo("Delay delayfix = %d\n",time);
|
|
|
|
|
|
return time;
|
|
return time;
|