-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes Abracadabra and Improvised Skill #2859
Conversation
The Autocast by abra was cleared before the actual casting, which resulted in failure of skill if not learned. Fixes HerculesWS#2823 Fixes HerculesWS#2824
@@ -1155,7 +1155,7 @@ static int unit_skilluse_id(struct block_list *src, int target_id, uint16 skill_ | |||
int ret = unit->skilluse_id2(src, target_id, skill_id, skill_lv, casttime, castcancel); | |||
struct map_session_data *sd = BL_CAST(BL_PC, src); | |||
|
|||
if (sd != NULL) | |||
if (sd != NULL && ret == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this mean after this change auto cast never cleaned if skill was used without errors?
i think this wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Nevermind... I misread your comment.)unit->skilluse_id2()
returns 0
on failure, so this is okay.
Maybe the
else if (sd != NULL && ret != 0 && skill_id != SA_ABRACADABRA && skill_id != WM_RANDOMIZESPELL)
skill->validate_autocast_data(sd, skill_id, skill_lv);
block I removed in #2699 (LINK) should be re-added, too.
I currently can't have a closer look at this, so this is just a suggestion...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@4144 the problem is, this function is triggered before actual casting of skill, so removing this check caused autocast struct to be emptied, and skill failed to cast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dastgirp This definitely needs to be adressed what 4144 mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just had a look at this and the condition should be changed to:
if (sd != NULL && (ret == 0 || (skill_id != SA_ABRACADABRA && skill_id != WM_RANDOMIZESPELL)))
This commit introduces various fixes to the Abracadabra / Improvise skill validation: - autocast code is moved to after homun/merc skill ranges so that when any of those are triggered, autocast data is not purged - abracadabra/improvise is no longer purged immediately after cast, by calling autocast_clear_current in the proper manner - the abracadabra/improvise skill requirement bypass that was removed in HerculesWS#2657 and related pull requests is re-implemented - the condition that would get the character stuck and unable to cast other skills until teleporting or relogging when rolling AL_WARP from abracadabra (i.e. because AL_WARP lands in clif_parse_UseSkillMap in 2 steps) is fixed, by not immediately clearing the data after the first one All credits for the fix go to Heka of Origins Related to HerculesWS#2859 Fixes HerculesWS#2823 Fixes HerculesWS#2824 Signed-off-by: Haru <[email protected]>
I'm closing this in favor of the more complete fix (extensively tested on a production server) from #2972 |
This commit introduces various fixes to the Abracadabra / Improvise skill validation: - abracadabra/improvise is no longer purged immediately after cast, by calling autocast_clear_current in the proper manner - the abracadabra/improvise skill requirement bypass that was removed in HerculesWS#2657 and related pull requests is re-implemented - the condition that would get the character stuck and unable to cast other skills until teleporting or relogging when rolling AL_WARP from abracadabra (i.e. because AL_WARP lands in clif_parse_UseSkillMap in 2 steps) is fixed, by not immediately clearing the data after the first one All credits for the fix go to Heka of Origins Related to HerculesWS#2859 Fixes HerculesWS#2823 Fixes HerculesWS#2824 Signed-off-by: Haru <[email protected]>
Pull Request Prelude
The Autocast by abra was cleared before the actual casting, which resulted in failure of skill if not learned.
Changes Proposed
Adding ret = 0 check while casting skill, to clear the autocast data
Issues addressed: