change weapon for ranged skills

Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
This commit is contained in:
Pavel Okhlopkov 2026-04-10 23:01:16 +03:00
parent fe1dc5e02b
commit 6ba0edc2fb
6 changed files with 176 additions and 4 deletions

View file

@ -1025,8 +1025,16 @@ void SpellHandler::handleSpellGo(network::Packet& packet) {
if (!owner_.isProfessionSpell(data.spellId))
playSpellCastSound(data.spellId);
// Instant melee abilities → trigger attack animation
// Ranged auto-attack spells (Auto Shot, Shoot, Throw) complete as timed
// casts and are NOT classified as instant melee abilities, so trigger the
// ranged shot animation explicitly here.
uint32_t sid = data.spellId;
if (sid == 75 || sid == 5019 || sid == 2764) {
if (owner_.meleeSwingCallbackRef()) owner_.meleeSwingCallbackRef()(sid);
owner_.suppressNextMeleeSwingAnim();
}
// Instant melee abilities → trigger attack animation
bool isMeleeAbility = false;
if (!owner_.isProfessionSpell(sid)) {
owner_.loadSpellNameCache();