Fixes Advent of Star Emperor behavior (#5424)

* Fixes #5409.
* Adjusts the behavior of Advent of Star Emperor spheres to work like Millennium Shield.
* Fixes the spheres not visually being removed when the the status ends.
Thanks to @molavian053!
This commit is contained in:
Aleos 2020-11-27 18:47:50 -05:00 committed by GitHub
parent ae3c6ce38b
commit 103416ca40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 12 deletions

View File

@ -1101,22 +1101,16 @@ bool battle_status_block_damage(struct block_list *src, struct block_list *targe
if ((sce = sc->data[SC_DIMENSION1]) && damage > 0) {
sce->val2 -= static_cast<int>(cap_value(damage, INT_MIN, INT_MAX));
if (sce->val2 >= 0)
damage = 0;
else
damage = -sce->val2;
if (sce->val2 <= 0)
status_change_end(target, SC_DIMENSION1, INVALID_TIMER);
return false;
}
if ((sce = sc->data[SC_DIMENSION2]) && damage > 0) {
sce->val2 -= static_cast<int>(cap_value(damage, INT_MIN, INT_MAX));
if (sce->val2 >= 0)
damage = 0;
else
damage = -sce->val2;
if (sce->val2 <= 0)
status_change_end(target, SC_DIMENSION2, INVALID_TIMER);
return false;
}
if (damage == 0)

View File

@ -7511,10 +7511,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
if (sd) {
// Remove old shields if any exist.
pc_delspiritball(sd, sd->spiritball, 0);
for (i = 0; i < 2; i++) {
pc_addspiritball(sd, skill_get_time2(SJ_BOOKOFDIMENSION, 1), 2);
sc_start2(src, bl, static_cast<sc_type>(SC_DIMENSION1 + i), 100, skill_lv, status_get_max_sp(src), skill_get_time2(SJ_BOOKOFDIMENSION, 1));
}
sc_start2(src, bl, SC_DIMENSION1, 100, skill_lv, status_get_max_sp(src), skill_get_time2(SJ_BOOKOFDIMENSION, 1));
sc_start2(src, bl, SC_DIMENSION2, 100, skill_lv, status_get_max_sp(src), skill_get_time2(SJ_BOOKOFDIMENSION, 1));
}
status_change_end(src, SC_DIMENSION, INVALID_TIMER);
}

View File

@ -12084,6 +12084,11 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
val2 = 4 + 2 * val1; // ASPD Increase
tick = INFINITE_TICK;
break;
case SC_DIMENSION1:
case SC_DIMENSION2:
if (sd)
pc_addspiritball(sd, skill_get_time2(SJ_BOOKOFDIMENSION, 1), 2);
break;
case SC_UNIVERSESTANCE:
val2 = 2 + val1; // All Stats Increase
tick = INFINITE_TICK;
@ -13567,6 +13572,11 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
case SC_JUMPINGCLAN:
status_change_end(bl,SC_CLAN_INFO,INVALID_TIMER);
break;
case SC_DIMENSION1:
case SC_DIMENSION2:
if (sd)
pc_delspiritball(sd, 1, 0);
break;
case SC_SOULENERGY:
if (sd)
pc_delsoulball(sd, sd->soulball, false);