Corrects the behavior of Vacuum Extreme (#5832)

* Fixes #5798.
* Targets will now become affected by Vacuum Extreme when walking through an active area but won't be sucked to the center unless they were standing still upon placement of the skill.
Thanks to @Rayvakarian and @Balferian!
This commit is contained in:
Aleos 2021-04-07 07:04:36 -04:00 committed by GitHub
parent f6dd49e8b6
commit df0457c835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View File

@ -14876,8 +14876,8 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t_t
(tsc->data[SC_VACUUM_EXTREME_POSTDELAY] && tsc->data[SC_VACUUM_EXTREME_POSTDELAY]->val2 == sg->group_id))) // Ignore post delay from other vacuum (this will make stack effect enabled)
return 0;
if (unit_bl2ud(bl)->walktimer == INVALID_TIMER) // Apply effect and suck non-walking targets one-by-one each n seconds
sc_start4(ss, bl, type, 100, sg->skill_lv, sg->group_id, (sg->val1<<16)|(sg->val2), ++sg->val3*500, (sg->limit - DIFF_TICK(tick, sg->tick)));
// Apply effect and suck targets one-by-one each n seconds
sc_start4(ss, bl, type, 100, sg->skill_lv, sg->group_id, (sg->val1 << 16) | (sg->val2), ++sg->val3 * 500, (sg->limit - DIFF_TICK(tick, sg->tick)));
break;
case UNT_BANDING:

View File

@ -512,6 +512,7 @@ bool skill_get_nk_(uint16 skill_id, std::vector<e_skill_nk> nk);
bool skill_get_inf2_(uint16 skill_id, std::vector<e_skill_inf2> inf2);
#define skill_get_unit_flag(skill_id, unit) skill_get_unit_flag_(skill_id, { unit })
bool skill_get_unit_flag_(uint16 skill_id, std::vector<e_skill_unit_flag> unit);
int skill_get_unit_range(uint16 skill_id, uint16 skill_lv);
// Accessor for skill requirements
int skill_get_hp( uint16 skill_id ,uint16 skill_lv );
int skill_get_mhp( uint16 skill_id ,uint16 skill_lv );

View File

@ -14709,12 +14709,17 @@ TIMER_FUNC(status_change_timer){
}
break;
case SC_VACUUM_EXTREME:
if (sce->val4) {
if (unit_movepos(bl, sce->val3>>16, sce->val3&0xFFFF, 0, false)) {
clif_slide(bl, sce->val3>>16, sce->val3&0xFFFF);
clif_fixpos(bl);
if (sce->val4 >= 0) {
// Only slide targets to center if they are standing still
if (unit_bl2ud(bl)->walktimer == INVALID_TIMER) {
uint16 x = sce->val3 >> 16, y = sce->val3 & 0xFFFF;
if (distance_xy(x, y, bl->x, bl->y) <= skill_get_unit_range(status_sc2skill(type), sce->val1) && unit_movepos(bl, x, y, 0, false)) {
clif_slide(bl, x, y);
clif_fixpos(bl);
}
}
sc_timer_next(tick+sce->val4);
sc_timer_next(tick + sce->val4);
sce->val4 = 0;
}
break;