Add click-to-cast target selection and the original casting flow - #420
Open
RahulDNair wants to merge 7 commits into
Open
Add click-to-cast target selection and the original casting flow#420RahulDNair wants to merge 7 commits into
RahulDNair wants to merge 7 commits into
Conversation
Clicking a skill in the hotbar now enters a target selection mode: the cursor changes to the target cursor from cursors.act, the next left click casts the skill at the entity or tile under the cursor, and right click or escape cancels the selection. Self cast skills are used immediately without target selection, and passive skills do nothing. Ground skills show the tile indicator on the hovered cell while selecting. Dragging skills between hotbar slots and the existing cast hotkeys are unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Picking up a skill from the skill tree was rejected whenever the skill could no longer be upgraded, which made every skill at its maximum level impossible to drag to the hotbar. The check now only rejects skills that have not been learned at all. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The skill damage packet was registered as a noop, so skills dealt damage without any visual feedback. It now emits the same damage event as auto attacks, showing damage numbers and playing the hit animation on the target. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The hotbar cast keys were J, L, and U for the first three slots and cast instantly at the hovered target. All ten slots are now mapped to F1 through F10 and behave like the original client: pressing a function key or clicking the slot uses the skill, which either casts a self cast skill immediately or starts the target selection mode. The hotbar click and function keys share one code path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The cursor render direction workaround only maps even numbered cursor states correctly when the direction is zero, since the action index wraps modulo the action count. The target cursor is action 10, so it rendered action 3 instead. It now uses direction zero like the other even numbered states. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
While selecting a skill target, scrolling now adjusts the level the skill will be cast at, clamped between one and the level the skill was placed in the hotbar with, and the chosen level is displayed next to the cursor, like in the original client. Casting a bolt at a lower level trades damage for cast speed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Casting a skill on a target that is out of range now walks the player towards the target and sends the cast request right away, like in the original client. rAthena remembers skill requests received while walking and executes them as soon as the target is in range, re-checking against the target's current position at every step, so the cast is not lost when the target moves. This works for entity targets and ground skills, using the cast range the server sends for the learned skill level. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
The complete skill-casting flow of the original client, reimplemented clean-room from observed behavior (no code was taken from other clients — behavior was studied via roBrowserLegacy's semantics and verified against rAthena's server implementation):
cursors.act. The next left click casts at the entity or tile under the cursor; right click or escape cancels. Self-cast skills fire immediately, passives do nothing.ud->stepaction) and executes them per walk step against the target's current position, so the cast follows moving targets and fires as early as possible. Ground skills included. This deliberately relies on the server's step-action machinery rather than a client-side buffer (which would double-cast).Fixes found along the way
upgradableflag was false, which is every maxed skill. It now only rejects unlearned skills.ZC_NOTIFY_SKILL2(0x01DE) was registered as a noop, so skill hits showed no damage numbers and no hit reaction. It now emits the same damage event as auto attacks.Tested
Live against a local rAthena (PACKETVER 20220406): bolt skills at both level extremes (visibly different cast time and damage), targeting cancel via escape/right-click, casting at moving targets while walking into range, ground skill placement, drag-and-drop and slot swapping unchanged.
Known follow-ups (out of scope here)
bSeperateLv); this PR allows it on any targeted skill, and the server clamps regardless.This builds on the same play-testing effort as #419 but is independent of it.
🤖 Generated with Claude Code